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

	<?php
	
		if ( $_SESSION['CONNECTED_USER_LEVEL'] == 127 ) {
			include("./modify_admin_parameters_target_b.php");
		}
	
	?>

	<tr>
		<td align="right" width="120px">
			<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['CONNECTED_USER_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['CONNECTED_USER_2FA_STATUS']=="OFF") echo("selected") ?> >OFF</option>
				<option value="ON"  <?php if($_SESSION['CONNECTED_USER_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 type="text" id="TARGET_ADMIN_2FAS_SECRET" name="TARGET_ADMIN_2FAS_SECRET" 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_admin_parameters_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['CONNECTED_USER_2FAS_STATUS']=="OFF") echo("selected") ?> >OFF</option>
				<option value="ON"  <?php if($_SESSION['CONNECTED_USER_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 les paramètres" 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>

