<form id="myform" method="post" action="<?php echo($return_path); ?>">

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

		<td>
			
				<table width="100%" >
				
					<tr>
						<td align="right" width="95px">
							<label>
								<?php
									if ( $_SESSION['user_type'] == "super_user" ) {
										echo("admin");
									}
									elseif ( $_SESSION['user_type'] == "normal_user" ) {
										echo("user");
									}
									else {
										echo("?????");
									}
								?>
								:&nbsp;
							</label>
						</td>
						<td align="left" colspan="3">
							<input disabled name="aqcm_USER" id="aqcm_USER" type="text" value="<?php echo($_SESSION['login_level']);?>" size="32" class="txtField_A" style="width:350px;" >
						</td>
					</tr>


				<tr>
				
					<td align="right">
						<label>
							site :&nbsp;
						</label>
					</td>
					
					<td align="left">

						<input disabled name="aqcm_SITE_ID" id="aqcm_SITE_ID" type="text" value="<?php echo($_SESSION['SITE_ID']);?>" size="10" class="txtField_A" style="width:125px;" >

					</td>
					
					<td align="left" width="70px">

						<?php
							if ( $_SESSION['user_type'] == "super_user" ) {
								echo("<label>");
									echo("préfixe :&nbsp;");
								echo("</label>");
							} else {
								echo("&nbsp;");
							}
						?>

					</td>
					
					<td align="left">
					
						<?php
							if ( $_SESSION['user_type'] == "super_user" ) {
								echo('<select name="aqcm_PREFIXE" id="aqcm_PREFIXE" size="1" onchange="My_change()" class="txtField_A" style="width:100px;">');
								include ("../M0/selection_prefixe.php");
								echo('</select>');
							} else {
								$_SESSION['aqcm_PREFIXE'] = "00" ;
								echo("&nbsp;");
							}
						?>
						
					</td>
				</tr>
				

					
<!--
					<tr>
						<td align="right">
							<label>
								site :&nbsp;
							</label>
						</td>
						<td align="left">
						
						
							<select name="select_site_id" id="select_site_id" size="1" onchange="change()" class="txtField_A" style="width:120px;">

								<?php

									$FLAG_NOT_SELECTED 		= true ;
									$INDEX_SITE_SELECTED 	= 0 ;
									$FLAG_FIRST_SITE 		= false ;
									$INDEX_FIRST_SITE 		= 0 ;
									
									for ($i = 0; $i < sizeof($_SESSION['list_sites']); $i++) {
										
										if ( $_SESSION['aqcm_PREFIXE'] == "00" ) {
											
											if ( $FLAG_NOT_SELECTED ) {
												if ( $_SESSION['SITE_ID'] == $_SESSION['list_sites'][$i] ) {
													$FLAG_NOT_SELECTED = false ;
													$INDEX_SITE_SELECTED = $i ;
												}
											}

										}
										else {
											
											if ( substr( $_SESSION['list_sites'][$i], 0, 2) == $_SESSION['aqcm_PREFIXE'] ) {
												
												if ( ! $FLAG_FIRST_SITE ) {
													$FLAG_FIRST_SITE		= true ;
													$INDEX_FIRST_SITE	= $i ;
												}
												
												if ( $FLAG_NOT_SELECTED ) {
													if ( $_SESSION['SITE_ID'] == $_SESSION['list_sites'][$i] ) {
														$FLAG_NOT_SELECTED = false ;
														$INDEX_SITE_SELECTED = $i ;
													}
												}
												
											}
											
										}
										
									}
									
									if ( $FLAG_NOT_SELECTED ) {
										$_SESSION['SITE_ID'] = $_SESSION['list_sites'][$INDEX_FIRST_SITE] ;
									}
										
									for ($i = 0; $i < sizeof($_SESSION['list_sites']); $i++) {
										
										if ( $_SESSION['aqcm_PREFIXE'] == "00" ) {
											
											echo( '<option' ) ;
											if ( $_SESSION['SITE_ID'] == $_SESSION['list_sites'][$i] ) {
												echo( ' ' ) ;
												echo('selected');
											}
											echo( '>' ) ;
											echo( $_SESSION['list_sites'][$i] ) ; 
											echo( '</option>' ) ;
										}
										else {
											
											if ( substr( $_SESSION['list_sites'][$i], 0, 2) == $_SESSION['aqcm_PREFIXE'] ) {
												
												echo( '<option' ) ;
												if ( $_SESSION['SITE_ID'] == $_SESSION['list_sites'][$i] ) {
													echo( ' ' ) ;
													echo('selected');
												}
												echo( '>' ) ;
												echo( $_SESSION['list_sites'][$i] ) ; 
												echo( '</option>' ) ;
												
											}
											
										}

									}
									
								?>
								
							
							</select>
							
						</td>
						
						<td align="left" width="70px">

							<?php
								if ( $_SESSION['user_type'] == "super_user" ) {
									echo("<label>");
										echo("préfixe :&nbsp;");
									echo("</label>");
								} else {
									echo("&nbsp;");
								}
							?>

						</td>
						
						<td align="left">
						
							<?php
								if ( $_SESSION['user_type'] == "super_user" ) {
									include ("../M0/selection_prefixe.php");
								} else {
									$_SESSION['aqcm_PREFIXE'] = "00" ;
									echo("&nbsp;");
								}
							?>
							
						</td>
					</tr>

-->

					<tr>
					
						<td align="right">
							<label>
								user :&nbsp;
							</label>
						</td>
						
						<td align="left" colspan="3">
						
							<select name="aqcm_target_user_id" id="aqcm_target_user_id" size="1" onchange="change()"  class="txtField_A" style="width:350px;" >

							<?php

								echo( "<option value='pas_de_choix' selected >choisir l'utilisateur cible</option>" ) ;

								for ($i = 0; $i < sizeof($_SESSION['list_users_of_1_site_id']); $i++) {
									
									//if ( $_SESSION['login'] != $_SESSION['list_users_of_1_site_id'][$i] ) {
									if ( true ) {
										
										echo( '<option' ) ;
										
										if ( $_SESSION['target_user_id'] == $_SESSION['list_users_of_1_site_id'][$i] ) {
											echo( ' ' ) ;
											echo('selected');
										}
										/*
										*/
										
										echo( '>' ) ;
										echo( $_SESSION['list_users_of_1_site_id'][$i] ) ;
										echo( '</option>' ) ;
										
									}

								}

							?>
							
							</select>
							
							
						</td>
						
					</tr>
					
				</table>

		</td>
		
	</tr>
	
</table>

</form>

<script>
function change(){
    document.getElementById("myform").requestSubmit();
}
</script>
