<?php

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

	//---------------------------------------------------------------------------------------------
	// utilisateurs autorisés : "super_users" et "users" avec niveau > 8
	//---------------------------------------------------------------------------------------------
	/*
	*/
	if ( !( ( $_SESSION['user_type'] == "super_user" ) or ( $_SESSION['level'] >= 8 ) ) ) {
		
		header('Location: ' . $root_dir . '/M1/index_2.php');
		exit();
		
	}
	
	include("../M0/communs_en_tete_HTML.html") ;
	
	$back_link = "../M2/gestion_users.php";
	include('../M0/communs_en_tete_home_back.html');

	$return_path = "./modify_user_of_one_site_target.php" ;
	include('../M0/display_admin_site_user_without_prefixe.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>
		<td>
		
			<table width="100%" >
				<tr>
					<td align="center">
					
						<div><label style="display: block;font-size:24px; color:lightblue;padding-top:10px;margin-bottom:15px;" >
						<u>- modification d'un utilisateur -</u>
						</label></div>
						
					</td>
				</tr>
					
				<tr align="center">
					<td colspan="2">

						<?php 
							
							//-------------------------------------------------------------
							// pas d'auto-modification possible !
							//-------------------------------------------------------------
							if ( $get_users_of_one_site_erreur == 0 ) {
								
								if (	(   $_SESSION['user_type'] == "super_user"   ) or 
										(	( $_SESSION['target_user_id'] != $_SESSION['login'] ) and 
											( $_SESSION['level'] > $_SESSION['target_user_level'] ) ) 
									)	{
									
									if ( $_SESSION['target_user_id'] == "none" ) {
										echo( '<label>' ) ;
										echo( "<font color='Salmon'>") ;
										echo( 'sélectionnez un utilisateur !!!</br></br>' ) ;
										echo( "</font>") ;
										echo( '</label>' ) ;
									}
									else {
										//include("./modify_user_of_one_site_target_1.php");
										include("./modify_user_of_one_site_target_a.php") ;
									}

								}
								else {
									include("./modify_user_of_one_site_target_b.php");
								}

							}
							else {
								
								include("./modify_user_of_one_site_target_c.php");
								
							}
						
						?> 

						<font size="1" face="Arial, Helvetica, sans-serif">&nbsp;</font>
						
					</td>
				</tr>
			</table>
			
		</td>
	</tr>
</table>

</form>

<script>

function my_confirm_function() {
	
	var   x = document.getElementById("modify_on_all_sites");
	var msg = "attention : voulez-vous vraiment modifier l'utilisateur sélectionné ?";
	var txt;
	var r = confirm(msg);
	
	if ( r == true ) {
		if ( x.checked ) {
			txt = "./modify_all_sites_of_target_user_execute.php";
		} else {
			txt = "./modify_user_of_one_site_target_execute.php";
		}
	} else {
		txt = "./modify_user_of_one_site_target.php";
	}
	document.getElementById("form2").action = txt;

}

</script>

 </body>
</html>