
<form name="myform_icone_site" id="myform_icone_site" method="post" action="./index_site.php">

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

		<tr>
		<td width="100%">

			<table align="left" width="100%">

			<tr>
				<td align="center" colspan="2" style="padding-top:10px;padding-bottom:15px;" >
					<label>
						<font size="5" color="lightblue" face="Arial, Helvetica, sans-serif">
							<u>- mise à jour des bilans -</u>
						</font>
					</label>
				</td>
			</tr>
				
			<tr>
				<td align="right">
				jour&nbsp;:&nbsp;
				</td>
				<td align="left">
				
					<?php
						$debut_periode  = mktime(0, 0, 0, $_SESSION['aqcm_MOIS']  , $_SESSION['aqcm_JOUR'], $_SESSION['aqcm_ANNEE']);
						$annee_debut_periode = date("Y", $debut_periode);
						$mois_debut_periode = date("m", $debut_periode);
						$jour_debut_periode = date("d", $debut_periode);
					
						$date_debut_periode		= date_create($annee_debut_periode."-".$mois_debut_periode."-".$jour_debut_periode);
						$is_bissextile			= ( date_format($date_debut_periode, 'L') == "1" ) ? true : false ;
					
						$lundis_string = [];
						$lundis_value = [];
						$timestamp_first_monday = strtotime('first monday of ' . $_SESSION['aqcm_ANNEE'] . '-' . $_SESSION['aqcm_MOIS'] ) ;
						$timestamp_last_monday  = strtotime('last monday of '  . $_SESSION['aqcm_ANNEE'] . '-' . $_SESSION['aqcm_MOIS'] ) ;
						$last_lundi_value = intval( date("d", $timestamp_last_monday) ) ;
						
						$i = 0 ;
						$lundis_value[$i]  = intval( date("d", $timestamp_first_monday) ) ;
						$lundis_string[$i] = str_pad($lundis_value[$i] , 2 , "0" , STR_PAD_LEFT);
						
						while ( ( $lundis_value[$i] + 7 ) <= $last_lundi_value ) {
							$lundis_value[$i+1] = $lundis_value[$i] + 7 ;
							$lundis_string[$i+1] = str_pad($lundis_value[$i+1] , 2 , "0" , STR_PAD_LEFT);
							$i++;
						}
						
						echo('<select name="aqcm_JOUR" id="aqcm_JOUR" size="1" class="txtField_A" >');
						for ($i = 0; $i < sizeof($lundis_string); $i++) {
							echo( '<option ' ) ;
							if ( $_SESSION['aqcm_JOUR'] == $lundis_string[$i] ) echo( "selected " ) ;
							echo( '>' ) ;
							echo( $lundis_string[$i] ) ;
							echo( '</option>' ) ;
						}
						echo('</select>');

						echo('<select id="aqcm_MOIS" name="aqcm_MOIS" size="1" onchange="one_site_icone_change()" class="txtField_A" >');
						include ("../M0/selection_mois_0.php");
						echo('</select>');
						
						echo('<select id="aqcm_ANNEE" name="aqcm_ANNEE" size="1" onchange="one_site_icone_change()" class="txtField_A" >');
						include ("../M0/selection_annee_0.php");
						echo('</select>');

					?>

				</td>
			</tr>

			<tr>
				<td align="right" width="120px" >
					durée&nbsp;:&nbsp;
				</td>
				<td align="left">
					<?php
						echo('<select name="aqcm_NB_WEEKS" id="aqcm_NB_WEEKS" size="1" class="txtField_A">');
						include ("../M0/selection_NB_WEEKS.php");
						echo('</select>');
					?>
					
					semaine(s)
				</td>
			</tr>
				
			<tr>
				<td align="right">
					<br>
					<input id="UPDATE_CO2_BIQUO"  name="UPDATE_CO2_BIQUO" type="checkbox" onclick="myFunction()" >
					&nbsp;:&nbsp;
					<br><br>
				</td>
				<td align="left" colspan="3">
					<label for="UPDATE_CO2_BIQUO"  class="txtField_C" >
					<br>forcer la mise à jour des présences<br>
					</label>
				</td>
			</tr>
				
			<tr>
				<td align="center" colspan="4">
					<input type="submit" formaction="./scheduler_execute_site_wait.php" value="mettre à jour les bilans pour ce site" class="button_A" style="width:400px;" >

				</td>
			</tr>

				<?php
					include ("./get_sondes.php");
				?>

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

	</table>

</form>
