<?php
	include("../M0/session_start.php") ;

	include("../M0/communs_en_tete_HTML.html") ;
	$back_link = "../M4/wireguard_gestion.php";
	include('../M0/communs_en_tete_home_back.html');

	$return_path = "./configure_peers_target.php" ;
	include('../M0/display_user_site_with_option.php'); 

?>

<form name="form2" id="form2" method="post" action="">

<table align="center" width="<?php echo $tables_width ; ?>"  border="2" cellspacing="2" cellpadding="2" bordercolor="#ffffff" bgcolor="#000033">	

	<tr align="center">
		<td colspan="2">
		
			<table width="98%">
			
				<tr align="center">
					<td align="center" colspan="2">
					
						<font size="4" color="white" face="Arial, Helvetica, sans-serif">
								enable / disable / delete &nbsp;&nbsp;&nbsp;&nbsp;« wireguard peers »
						</font>	
						
					</td>
				</tr>

			</table>
			
		</td>
	</tr>
			
	<tr align="center">
		<td colspan="2">
		
			<table width="98%" align="center">
			
				<font size="1" face="Arial, Helvetica, sans-serif">&nbsp;</font>
				
				<tr>
				
					<td align="center">
					
						<?php

							include('./wireguard_list_peers_execute_1.php');
							
							if ( $code_erreur == 0 ) {
								
								if ( sizeof($aqcm_WG_NAME) >= 1 ) {
									
									echo( '<select name="select_sonde_name[]" id="select_sonde_name" size="7" style="width: 75%"  class="txtField_A" multiple >' ) ;
									for ($i = 0; $i < sizeof($aqcm_WG_NAME); $i++) {
										
										echo( '<option value="' . $aqcm_WG_NAME[$i] . '"' ) ;
										echo( '>' ) ;
										echo( $aqcm_WG_NAME[$i] . ' - ' . $aqcm_WG_STATUS[$i] . '' ) ;
										echo( '</option>' ) ;

									}
									echo( '</select>' ) ;
									
								}
								else {
								echo( '<label>' ) ;
								echo( 'la liset des « peers wireguard » est vide !!!' ) ;
								echo( '</label>' ) ;
								}
								
							}
							else {
								echo( '<label>' ) ;
								echo( 'erreur (' . strval( $code_erreur ) . ') !!!' ) ;
								echo( '</label>' ) ;
							}


						?>
						
						
						
					</td>
					
				</tr>
				
				<tr>
					<td align="center" colspan="2">
						<font size="1" face="Arial, Helvetica, sans-serif">&nbsp;</font>
					</td>
				</tr>

				<tr>
					<td align="center" colspan="2">
					
						<input type="radio" id="WG_ENABLE" name="WG_EN" value="ON">
						<label for="WG_ENABLE">ON</label>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<input type="radio" id="WG_DISABLE" name="WG_EN" value="OFF">
						<label for="WG_DISABLE">OFF</label>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<input type="radio" id="WG_DELETE" name="WG_EN" value="DEL">
						<label for="WG_DELETE">DELETE</label>
						
					</td>
				</tr>
				
				<tr>
					<td align="center" colspan="2">
						<font size="1" face="Arial, Helvetica, sans-serif">&nbsp;</font>
					</td>
				</tr>

				
				<tr>
					<td align="center" colspan="2">
					
						<?php

							if ( $code_erreur == 0 ) {
								echo( '<input type="submit" onclick="my_confirm_function()" value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;appliquer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" class="button_A" >' ) ;
							}
						?>
							
					</td>
				</tr>
				
			</table>
			
			<font size="1" face="Arial, Helvetica, sans-serif">&nbsp;</font>
			
		</td>
	</tr>
	
</table>

</form>

<script>

function my_confirm_function() {
	var msg="attention : voulez-vous vraiment mettre à jour les sondes sélectionnées ?";
	var txt;
	var r = confirm(msg);
	if (r == true) {
		txt = "./configure_peers_target_execute.php";
	} else {
		txt = "./configure_peers_target.php";
	}
	document.getElementById("form2").action = txt;

}

</script>


 </body>
</html>