
<table width="99%" align="center">

	<tr>
		<td align="right" width="130px">
			<label>
				identifiant :&nbsp;
			</label>
		</td>
		<td align="left" width="300px" colspan="2">
			<input
			  type="email"
			  disabled 
			  id="TARGET_ADMIN_ID"
			  name="TARGET_ADMIN_ID"
			  class="txtField_A" 
			  style="width:290px;color:#777777;"
			  size="64"
			  maxlength="64"
			  placeholder="nom@exemple.com"
			  value="<?php echo($_SESSION['target_admin_id']); ?>" 
			  title="adresse mail valide" 
			 />
		</td>
	</tr>
	
	<tr>
		<td align="right" >
			<label>
				statut :&nbsp;
			</label>
		</td>
		<td align="left" colspan="2" >
			<select name="TARGET_ADMIN_STATUS" id="TARGET_ADMIN_STATUS" size="1" class="txtField_A"	style="width:75px;" >
				<option value="OFF" <?php if($_SESSION['target_admin_status']=="OFF") echo("selected") ?> >OFF</option>
				<option value="ON"  <?php if($_SESSION['target_admin_status']=="ON" ) echo("selected") ?> >ON</option>
			</select>
		</td>
	</tr>
	
	<tr>
		<td align="right">
			<label>
				niveau :&nbsp;
			</label>
		</td>
		<td align="left" colspan="2" >
			<input
				type="number"
				id="TARGET_ADMIN_LEVEL" 
				name="TARGET_ADMIN_LEVEL" 
				value="<?php echo($_SESSION['target_admin_level']); ?>" 
				min="90" 
				max="127" 
				class="txtField_M1" 
				inputMode="numeric" //Opens numeric keyboard on mobile
				style="
					width:75px;
					color:black;
					background-color:white;
				" 

				onInput="myFunction_2()"

			/>

			<label>
				&nbsp;&nbsp;&nbsp;90...127
			</label>

		</td>
	</tr>

	<tr>
		<td align="right">
			<label>
				Tmax :&nbsp;
			</label>
		</td>
		<td align="left" colspan="2">
			<input
			  class="txtField_A"
			  type="date"
			  id="start"
			  name="TARGET_ADMIN_T_MAX"
			  id="TARGET_ADMIN_T_MAX"
			  style="width:150px;"
			  value="<?php echo(date("Y-m-d", $_SESSION['target_admin_t_max'])); ?>"
			  min="2020-01-01"
			  max="2100-12-31" 
			  required />

		</td>
	</tr>

	<tr>
		<td align="right">
			<label>
				2FA phone :&nbsp;
			</label>
		</td>
		<td align="left" colspan="2">
			<input
			  class="txtField_A"
			  type="tel"
			  name="TARGET_ADMIN_2FA_PHONE"
			  id="TARGET_ADMIN_2FA_PHONE"
			  style="width:150px;"
			  value="<?php echo($_SESSION['target_admin_2fa_phone']); ?>" 
			  pattern="\+33|0)[1-9]\d{9}"
			  required 
			 />
		</td>

	</tr>

	<tr>
		<td align="right" >
			<label>
				2FA SMS :&nbsp;
			</label>
		</td>
		<td align="left" colspan="2" >
			<select name="TARGET_ADMIN_2FA_STATUS" id="TARGET_ADMIN_2FA_STATUS" size="1" class="txtField_A"	style="width:75px;" >
				<option value="OFF" <?php if($_SESSION['target_admin_2fa_status']=="OFF") echo("selected") ?> >OFF</option>
				<option value="ON"  <?php if($_SESSION['target_admin_2fa_status']=="ON" ) echo("selected") ?> >ON</option>
			</select>
		</td>
	</tr>

	<tr>
		<td align="right">
			<label>
				2FAS secret :&nbsp;
			</label>
		</td>
		<td align="left" width="235px" >
			<input id="TARGET_ADMIN_2FAS_SECRET" name="TARGET_ADMIN_2FAS_SECRET" type="text" value=<?php echo($TWO_FA_SECRET); ?> maxlength="32" size="30" class="txtField_A"  style="width:230px;" >
		</td>
		<td align="left" >
			<!--<a class="a_picto" href="./modify_admin_parameters_target.php?RENEW=1">-->
			<a class="a_picto" onclick="javascript:window.location='./modify_user_of_one_site_target.php?RENEW=1'" >
				<img id="TARGET_ADMIN_2FAS_SECRET_RENEW_IMG" src="../M0/update.jpg" class="a_picto"  />
			</a>	
		</td>
	</tr>
	
				
	
	<tr>
		<td align="right" >
			<label>
				2FAS TOTP :&nbsp;
			</label>
		</td>
		<td align="left" colspan="2" >
			<select name="TARGET_ADMIN_2FAS_STATUS" id="TARGET_ADMIN_2FAS_STATUS" size="1" class="txtField_A"	style="width:75px;" >
				<option value="OFF" <?php if($_SESSION['target_admin_2fas_status']=="OFF") echo("selected") ?> >OFF</option>
				<option value="ON"  <?php if($_SESSION['target_admin_2fas_status']=="ON" ) echo("selected") ?> >ON</option>
			</select>
		</td>
	</tr>

	<tr>
		<td align="center" colspan="3">
	
			<input 
				type="submit" 
				onclick="my_confirm_function()" 
				value="modifier l'administrateur sélectionné" 
				class="button_A" 
				style="margin-top:20px;margin-bottom:20px;" 
			>
				
		</td>
	</tr>
	

</table>

<script>
function myFunction_2() {
	var target = document.getElementById("TARGET_ADMIN_LEVEL");

	if (target.value.length > 3) {
		target.value = 127;
	}
	
	if (target.value > 127) {
		target.value = 127;
		target.style.color = "#000000";
		target.style.backgroundColor = "#ffffff";
	}
	else if (target.value < 90) {
		target.style.color = "#000000";
		target.style.backgroundColor = "salmon";
	}
	else {
		target.style.color = "#000000";
		target.style.backgroundColor = "#ffffff";
	}
}
</script>

