<?php

	//-------------------------------------------------------------------------
	// prolongation de session
	include("../M0/session_start.php") ;
					   
	//-------------------------------------------------------------------------
	$Flag_debug = 1;
	$Flag_debug = 0;

	//-------------------------------------------------------------------------
	if ( ! empty( $_POST['aqcm_SONDE_PARAMS'] ) ) {
		
		$p_aqcm_SONDE_PARAMS = $_POST['aqcm_SONDE_PARAMS'] ;
		
		$p_aqcm_SONDE_PARAMS_strings = explode(',', $p_aqcm_SONDE_PARAMS) ;
		
		$_SESSION['aqcm_ONE_SONDE_NB']		= 1 ;
		$_SESSION['aqcm_ONE_SONDE_MAC']		= $p_aqcm_SONDE_PARAMS_strings[0] ;
		$_SESSION['aqcm_ONE_SONDE_NAME']		= $p_aqcm_SONDE_PARAMS_strings[1] ;
		$_SESSION['aqcm_ONE_SONDE_SITE_ID']	= $p_aqcm_SONDE_PARAMS_strings[2] ;
		$_SESSION['aqcm_ONE_SONDE_MESURES']	= $p_aqcm_SONDE_PARAMS_strings[3] ;

	}

	$NB_sondes		= $_SESSION['aqcm_ONE_SONDE_NB'] ;
	$aqcm_MAC			= $_SESSION['aqcm_ONE_SONDE_MAC'] ;
	$aqcm_NAME		= $_SESSION['aqcm_ONE_SONDE_NAME'] ;
	$aqcm_SITE_ID		= $_SESSION['aqcm_ONE_SONDE_SITE_ID'] ;
	$aqcm_MESURES		= $_SESSION['aqcm_ONE_SONDE_MESURES'] ;

	//-------------------------------------------------------------------------------------------------
	include("../M0/get_parameters.php");
	include("./AQCM_get_parameters_live.php");
	include("./Gauges_get_emoticons.php"); 
	include("./Gauges_communs.js");

?>
	
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
	<head>
		<title>AQCM05</title>
		<meta name="Description" content="">
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<meta http-equiv="refresh" content="5" />
		
		<script type="text/javascript" src="../M0/jquery.min.js"></script>
		<script type="text/javascript" src="../Highcharts-7.1.2/code/highcharts.js"></script>
		<script type="text/javascript" src="../Highcharts-7.1.2/code/highcharts-more.js"></script>
		<script type="text/javascript" src="../Highcharts-7.1.2/code/modules/solid-gauge.js"></script>

		<link rel="stylesheet" type="text/css" href="../styles/AQCM05.css" />

		<style type="text/css">
			.outer {
				width: 320px;
				height: 200px;
				margin: 0 auto;
			}
			.outer .chart-container {
				width: 320px;
				float: center;
				height: 200px;
			}
			
			.highcharts-yaxis-grid .highcharts-grid-line {
				display: none;
			}

			@media (max-width: 600px) {
				.outer {
					width: 100%;
					height: 400px;
				}
				.outer .chart-container {
					width: 300px;
					float: none;
					margin: 0 auto;
				}
				
			}
		</style>
		
	</head>

<body bgcolor="#000033" text="#CCCCCC" link="#00CCFF" vlink="#9966FF" alink="#CC0000">

<table align="center" border="2" cellspacing="2" cellpadding="2" bordercolor="#999999" bgcolor="#000033">

	<tr align="center" valign="middle" bordercolor="#666666">
		<td>
			<font size="4" color="cyan" face="Arial, Helvetica, sans-serif">
				<div id="dateNowServer"> <?php echo($date_sonde); ?> </div>
			</font>
		</td>
		<td >
			<font size="6" color="white" face="Arial, Helvetica, sans-serif">
				<?php 
					echo( $aqcm_NAME ); 
				?>
			</font>						
		</td>
		<td>
			<font size="4" color="cyan" face="Arial, Helvetica, sans-serif">
				<div id="timeNowServer"> <?php echo($time_sonde); ?> </div>
			</font>
		</td>
	</tr>
	
	<tr align="center" valign="middle" bordercolor="#666666">
	
		<td width="320">
			<?php
				if ( $aqcm_MESURES[0] == "Y" ) {
					echo ( '<div class="outer" id="container-TEMP" class="chart-container"></div>' ) ;
					include("Gauges_TEMP.js"); 
				}
				else {
					echo ( '<img src="TEMP.jpg" width="320" />' ) ;
				}
			?>
		</td>
		
		<td width="320" style="border-right: 0px ; "> 
			<?php
				if ( $aqcm_MESURES[2] == "Y" ) {
					echo ( '<div class="outer" id="container-CO2" class="chart-container"></div>' ) ;
					include("Gauges_CO2.js"); 
				}
				else {
					echo ( '<img src="CO2.jpg" width="320" />' ) ;
				}
			?>
		</td>

		<td width="320" style="border-left: 0px ;" >
			<?php
				if ( $aqcm_MESURES[5] == "Y" ) {
					echo ( '<div class="outer" id="container-PM25" class="chart-container"></div>' ) ;
					include("Gauges_PM25.js"); 
				}
				else {
					echo ( '<img src="PM25.jpg" width="320" />' ) ;
				}
			?>
		</td>
		

	</tr>
	
	<tr align="center" valign="middle" bordercolor="#666666">
	
		<td>
			<?php
				if ( $aqcm_MESURES[1] == "Y" ) {
					echo ( '<div class="outer" id="container-HR" class="chart-container"></div>' ) ;
					include("Gauges_HR.js"); 
				}
				else {
					echo ( '<img src="HR.jpg" width="320" />' ) ;
				}
			?>
		</td>
		
		<td style="border-right: 0px ; "> 
			<?php
				if ( $aqcm_MESURES[4] == "Y" ) {
					echo ( '<div class="outer" id="container-IAQ" class="chart-container"></div>' ) ;
					include("Gauges_IAQ.js"); 
				}
				else {
					echo ( '<img src="COV.jpg" width="320" />' ) ;
				}
			?>
		</td>
		
		<td style="border-left: 0px ;" >
			<?php
				if ( $aqcm_MESURES[6] == "Y" ) {
					echo ( '<div class="outer" id="container-HCHO" class="chart-container"></div>' ) ;
					include("Gauges_HCHO.js"); 
				}
				else {
					echo ( '<img src="HCHO.jpg" width="320" />' ) ;
				}
			?>
		</td>

	</tr>
	
	<tr align="center" valign="top" bordercolor="#666666">
	
		<td>
			<?php
				if ( $aqcm_MESURES[3] == "Y" ) {
					echo ( '<div class="outer" id="container-P" class="chart-container"></div>' ) ;
					include("Gauges_P.js"); 
				}
				else {
					echo ( '<img src="P1.jpg" width="320" />' ) ;
				}
			?>
		</td>
		
		<td>
			<?php
				if ( $aqcm_MESURES[7] == "Y" ) {
					echo ( '<div class="outer" id="container-LUX" class="chart-container"></div>' ) ;
					include("Gauges_LUX.js"); 
				}
				else {
					echo ( '<img src="LUX.jpg" width="320" />' ) ;
				}
			?>
		
		</td>

		<td >
			<?php
				if ( $aqcm_MESURES[8] == "Y" ) {
					echo ( '<div class="outer" id="container-SPL" class="chart-container"></div>' ) ;
					include("Gauges_SPL.js"); 
				}
				else {
					echo ( '<img src="SPL.jpg" width="320" />' ) ;
				}
			?>
		</td>
		
	</tr>
	
</table>
			
</body>
</html>

