<?php
$tpl_version = "1.2";
if (isset($_GET['ver'])) {
  echo $tpl_version;
  exit;
	// Date: 2014-12-25
}
?>
<div class="boxes">
	<div style="float: right; width: 185px; padding: 0px">
		<h4 style="text-align: right; margin: 10px -10px 10px -50px;"><small><?php echo $TT_units; ?></small></h4>
    <table style="margin: 0 auto;" summary="Measures units used">
			<col width="180" />
      <tr>
        <td><?php echo $tr_cloudbaseunit; ?></td>
        <td><?php echo $cloudbaseunit; ?></td>
      </tr><tr>
        <td><?php echo $Tr_pressunit; ?></td>
        <td><?php echo $pressunit; ?></td>
      </tr><tr>
        <td><?php echo $Tr_rainunit; ?></td>
        <td><?php echo $rainunit; ?></td>
      </tr><tr>
        <td><?php echo $Tr_tempunit; ?></td>
        <td><?php echo $tempunit; ?></td>
      </tr><tr>
        <td><?php echo $Tr_windunit; ?></td>
        <td><?php echo $windunit; ?></td>
      </tr><tr>
        <td><?php echo $Tr_windrununit; ?></td>
        <td><?php echo $windrununit ; ?></td>
      </tr>
    </table>
	</div>
	<p style="Float: right; margin: 15px 25px 0px 5px"><img src="style/station.gif" alt="" title=""  /></p>
	<h3 style="text-align: center; margin: 10px;"><?php echo $location; ?></h3>
	<h4><?php echo $Tr_infos; ?></h4>
	<?php
		if ($newrecord == "1") echo '<p style="margin:0; color:#F00"><strong>'.$TT_newrecord.'!</strong></p>';
		echo '<p>'.$Tr_update_last.'(ws): '.$LastDataReadT."\n<br />";
		echo $Tr_update_last.': '.$update.'</p>';
		if ($LatestError != "") {
			echo $Tr_LatestErrorDate.': '.$LatestErrorDate.' '.$LatestErrorTime."</p>\n";
		}
		// Outside only to garantee 1st box minimum height
		echo '<p><strong>&nbsp;'.$LatestError."</strong></p>\n";
	?>
</div>
<?php
if ($davis) {
?>
	<div class="boxes" style="height: 170px;">
	<!--  Davis station status  -->
	<h4><?php echo $TT_davis; ?></h4>
	<table border="0" cellpadding="0" cellspacing="0" summary="Davis station status">
		<col width="250px" />
		<col width="75px" />
		<col width="200px" />
		<tr class="td_data" valign="top">
			<td><strong><?php echo $Tr_DavisFirmwareVersion; ?></strong></td>
			<td><?php echo $DavisFirmwareVersion; ?></td>
			<td><strong><?php echo $Tr_DavisNumCRCerrors; ?></strong></td>
			<td><?php echo $DavisNumCRCerrors; ?></td>
		</tr><tr class="td_data" valign="top">
			<td><strong><?php echo $Tr_DavisTotalPacketsReceived; ?></strong></td>
			<td><?php echo $DavisTotalPacketsReceived; ?></td>
			<td><strong><?php echo $Tr_DavisTotalPacketsMissed; ?></strong></td>
			<td><?php echo $DavisTotalPacketsMissed; ?></td>
		</tr><tr class="td_data" valign="top">
			<td><strong><?php echo $Tr_DavisMaxInARow; ?></strong></td>
			<td><?php echo $DavisMaxInARow; ?></td>
			<td><strong><?php echo $Tr_DavisNumberOfResynchs; ?></strong></td>
			<td><?php echo $DavisNumberOfResynchs; ?></td>
		</tr><tr class="td_data">
			<td><strong><?php echo $Tr_battery;?></strong></td>
			<td colspan="3"><?php echo $battery. ' '.$txbattery; ?></td>
		</tr>
	</table>
	</div>
<?php
	}
?>
<div class="boxes" style="height: 220px;">
	<div style="float: left; width: 50%">
   	<h4><?php echo $Tr_time.' '.$timehhmmss; ?></h4>
    <table border="0" cellpadding="0" cellspacing="0" summary="Weather server status">
    <col width="115" />
		<tr class="td_data" valign="top">
			<td><strong><?php echo $Tr_SystemUpTime; ?></strong></td>
			<td><?php echo $SystemUpTime; ?></td>
		</tr>
		<tr class="td_data" valign="top">
			<td><strong><?php echo $Tr_ProgramUpTime; ?></strong></td>
			<td><?php echo $ProgramUpTime; ?></td>
		</tr>
		<tr class="td_data" valign="top">
			<td><strong><?php echo $Tr_DiskFree; ?></strong></td>
			<td><?php echo $DiskFree.' '.$Tr_DiskSize.' '.$DiskSize; ?></td>
		</tr>
		<tr class="td_data" valign="top">
			<td><strong><?php echo $Tr_MemoryStatus; ?></strong></td>
			<td><?php echo $MemoryStatus; ?></td>
		</tr>
		<tr class="td_data">
			<td><strong><?php echo $Tr_AllocatedMemory; ?></strong></td>
			<td><?php echo $AllocatedMemory; ?></td>
		</tr>
    </table>
	</div>	
  <div style="float: right; width: 50%">
    <h4><?php echo $TT_Sys_Config; ?></h4>
		<table border="0" cellpadding="0" cellspacing="0" summary="État du serveur météo">
      <col width="105px" />
			<tr class="td_data" valign="top">
				<td><strong><?php echo $Tr_OsVersion; ?></strong></td>
				<td><?php echo $OsVersion; ?></td>
			</tr>
			<tr class="td_data">
				<td><strong><?php echo $Tr_OsLanguage; ?></strong></td>
				<td><?php echo $OsLanguage; ?></td>
			</tr>
			<tr class="td_data">
				<td><strong><?php echo $Tr_CpuName; ?></strong></td>
				<td><?php echo $CpuName; ?></td>
			</tr>
			<tr class="td_data">
				<td><strong><?php echo $Tr_CpuCount; ?></strong></td>
				<td><?php echo $CpuCount; ?></td>
			</tr>
			<tr class="td_data">
				<td><strong><?php echo $Tr_DisplayMode; ?></strong></td>
				<td><?php echo $DisplayMode; ?></td>
			</tr>
    </table>
  </div>
</div>
<div class="boxes" style="height: 350px">
	<div style="float: left; width: 55%">
    <h4><?php echo $TT_sta_status; ?></h4>
    <!-- INFOS ON STATION  -->
    <table border="0" cellpadding="0" cellspacing="0" width="110%" summary="<?php echo $TT_sta_status; ?>">
      <col width="100" />
      <tr>
        <td><strong><?php echo $Tr_webname; ?></strong></td>
        <td><?php echo $location; ?></td>
      </tr><tr>
        <td><strong><?php echo $Tr_stationtype; ?></strong></td>
        <td><?php echo $stationtype; ?></td>
      </tr><tr>
        <td><strong><?php echo $Tr_online_since; ?></strong></td>
        <td><?php echo $recordsbegandate.' ('.$DaysSinceRecordsBegan.' '.$TT_day.')'; ?></td>
      </tr><tr class="td_data">
        <td colspan="2"><strong><?php echo $Tr_ErrorLight; ?></strong>
				<img src="style/light_red<?php echo $ErrorLight; ?>.png" style="float:right; padding-right: 100px" alt="O" title="indicator" /></td>
			<?php
				if ($SensorContactLost !=0) {
					echo '</tr><tr class="td_data">';
					echo '<td colspan="2"><strong>'.$Tr_SensorContactLost.'</strong><img src="style/light_red1.png" style="float:right; padding-right: 100px" alt="O" title="indicator"  /></td>';
				}
			?>
			<tr class="td_data">
				<td colspan="2"><strong><?php echo $Tr_DavisTotalPacketsMissed; ?></strong>
				<img src="style/light_red<?php echo $DataStopped; ?>.png" style="float:right; padding-right: 100px" alt="O" title="DataStopped"  /></td>
      </tr>
    </table>
		<h4 style="margin-top: 25px;"><?php echo $TT_noaa; ?></h4>
		<p><strong><?php echo $Tr_LatestNOAAMonthlyReport; ?></strong><br />
		&nbsp;<?php echo $LatestNOAAMonthlyReport; ?></p>
		<p><strong><?php echo $Tr_LatestNOAAYearlyReport; ?></strong><br />
		&nbsp;<?php echo $LatestNOAAYearlyReport; ?></p>
  </div>
	<div style="float: left; width: 45%">
	<!-- ALARMS  -->
    <h4><?php echo $TT_alarms; ?></h4>
		<table border="0" cellpadding="0" cellspacing="0" width="100%" summary="Indique si une alarme est allumée">
    <col width="235px" />
		<tr class="td_data">
			<td><?php echo $Tr_LowTempAlarm; ?></td>
			<td><img src="style/light_red<?php echo $LowTempAlarm; ?>.png" alt="O" title="indicator"  /></td>
		</tr>
		<tr class="td_data">
			<td><?php echo $Tr_HighTempAlarm; ?></td>
			<td><img src="style/light_red<?php echo $HighTempAlarm; ?>.png" alt="O" title="indicator"  /></td>
		</tr>
		<tr class="td_data">
			<td><?php echo $Tr_TempChangeUpAlarm; ?></td>
			<td><img src="style/light_red<?php echo $TempChangeUpAlarm; ?>.png" alt="O" title="indicator"  /></td>
		</tr>
		<tr class="td_data">
			<td><?php echo $Tr_TempChangeDownAlarm; ?></td>
			<td><img src="style/light_red<?php echo $TempChangeDownAlarm; ?>.png" alt="O" title="indicator"  /></td>
		</tr>
		<tr class="td_data">
			<td><?php echo $Tr_LowPressAlarm; ?></td>
			<td><img src="style/light_red<?php echo $LowPressAlarm; ?>.png" alt="O" title="indicator"  /></td>
		</tr>
		<tr class="td_data">
			<td><?php echo $Tr_HighPressAlarm; ?></td>
			<td><img src="style/light_red<?php echo $HighPressAlarm; ?>.png" alt="O" title="indicator"  /></td>
		</tr>
		<tr class="td_data">
			<td><?php echo $Tr_PressChangeUpAlarm; ?></td>
			<td><img src="style/light_red<?php echo $PressChangeUpAlarm; ?>.png" alt="O" title="indicator"  /></td>
		</tr>
		<tr class="td_data">
			<td><?php echo $Tr_PressChangeDownAlarm; ?></td>
			<td><img src="style/light_red<?php echo $PressChangeDownAlarm; ?>.png" alt="O" title="indicator"  /></td>
		</tr>
		<tr class="td_data">
			<td><?php echo $Tr_HighRainTodayAlarm; ?></td>
			<td><img src="style/light_red<?php echo $HighRainTodayAlarm; ?>.png" alt="O" title="indicator"  /></td>
		</tr>
		<tr class="td_data">
			<td><?php echo $Tr_HighRainRateAlarm; ?></td>
			<td><img src="style/light_red<?php echo $HighRainRateAlarm; ?>.png" alt="O" title="indicator"  /></td>
		</tr>
		<tr class="td_data">
			<td><?php echo $Tr_HighWindGustAlarm; ?></td>
			<td><img src="style/light_red<?php echo $HighWindGustAlarm; ?>.png" alt="O" title="indicator"  /></td>
		</tr>
		<tr class="td_data">
			<td><?php echo $Tr_HighWindSpeedAlarm; ?></td>
			<td><img src="style/light_red<?php echo $HighWindSpeedAlarm; ?>.png" alt="O" title="indicator"  /></td>
		</tr>
		</table>
  </div>
</div>
<div class="boxes" style="height: 350px;">
	<div style="float: left; width: 55%">
    <h4><img src="style/light_yellow<?php echo $TempRecordSet; ?>.png" alt="O" title="indicator"  /> <?php echo $Tr_TempRecordSet; ?></h4>
    <table border="0" cellpadding="0" cellspacing="0" width="100%" summary="Indique si un témoin record est allumé">
    <col width="235px" />
    <tr class="td_data">
      <td><?php echo $Tr_tempH; ?></td>
      <td><img src="style/light_green<?php echo $HighTempRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr>
    <tr class="td_data">
      <td><?php echo $Tr_tempL; ?></td>
      <td><img src="style/light_green<?php echo $LowTempRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr>
    <tr class="td_data">
      <td><?php echo $Tr_mintempH; ?></td>
      <td><img src="style/light_green<?php echo $HighMinTempRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr>
    <tr class="td_data">
      <td><?php echo $Tr_maxtempL; ?></td>
      <td><img src="style/light_green<?php echo $LowMaxTempRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr>
    <tr class="td_data">
      <td><?php echo $Tr_apptempH; ?></td>
      <td><img src="style/light_green<?php echo $HighAppTempRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr>
    <tr class="td_data">
      <td><?php echo $Tr_apptempL; ?></td>
      <td><img src="style/light_green<?php echo $LowAppTempRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr>
    <tr class="td_data">
      <td><?php echo $Tr_heatindexH; ?></td>
      <td><img src="style/light_green<?php echo $HighHeatIndexRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr>
    <tr class="td_data">
      <td><?php echo $Tr_dewpointH; ?></td>
      <td><img src="style/light_green<?php echo $HighDewPointRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr>
    <tr class="td_data">
      <td><?php echo $Tr_dewpointL; ?></td>
      <td><img src="style/light_green<?php echo $LowDewPointRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr>
    <tr class="td_data">
      <td><?php echo $Tr_wchillH; ?></td>
      <td><img src="style/light_green<?php echo $LowWindChillRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr>
    <tr class="td_data">
      <td><?php echo $Tr_HighDailyTempRange; ?></td>
      <td><img src="style/light_green<?php echo $HighTempRangeRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr>
    <tr class="td_data">
      <td><?php echo $Tr_LowDailyTempRange; ?></td>
      <td><img src="style/light_green<?php echo $LowTempRangeRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr>
    </table>
  </div>
	<div style="float: left; width: 45%">
    <h4>Other records</h4>
    <table border="0" cellpadding="0" cellspacing="0" width="100%" summary="Indique si un témoin record est allumé">
    <col width="235px" />
    <tr class="td_data">
      <td><?php echo $Tr_pressH; ?></td>
      <td><img src="style/light_green<?php echo $HighPressureRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr><tr class="td_data">
      <td><?php echo $Tr_pressL; ?></td>
      <td><img src="style/light_green<?php echo $LowPressureRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr><tr class="td_data">
      <td><?php echo $Tr_gustM; ?></td>
      <td><img src="style/light_green<?php echo $HighWindGustRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr><tr class="td_data">
      <td><?php echo $Tr_wspeedH; ?></td>
      <td><img src="style/light_green<?php echo $HighWindSpeedRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr><tr class="td_data">
      <td><?php echo $Tr_MonthWindRunH; ?></td>
      <td><img src="style/light_green<?php echo $HighWindrunRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr><tr class="td_data">
      <td><?php echo $Tr_humH; ?></td>
      <td><img src="style/light_green<?php echo $HighHumidityRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr><tr class="td_data">
      <td><?php echo $Tr_humL; ?></td>
      <td><img src="style/light_green<?php echo $LowHumidityRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr><tr class="td_data">
      <td><?php echo $Tr_rrateM; ?></td>
      <td><img src="style/light_green<?php echo $HighRainRateRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr><tr class="td_data">
      <td><?php echo $Tr_rfallhH; ?></td>
      <td><img src="style/light_green<?php echo $HighHourlyRainRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr><tr class="td_data">
      <td><?php echo $Tr_rfallH; ?></td>
      <td><img src="style/light_green<?php echo $HighDailyRainRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr><tr class="td_data">
      <td><?php echo $Tr_rfallmH; ?></td>
      <td><img src="style/light_green<?php echo $HighMonthlyRainRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr><tr class="td_data">
      <td><?php echo $Tr_LongestWetPeriod; ?></td>
      <td><img src="style/light_green<?php echo $LongestWetPeriodRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr><tr class="td_data">
      <td><?php echo $Tr_LongestDryPeriod; ?></td>
      <td><img src="style/light_green<?php echo $LongestDryPeriodRecordSet; ?>.png" alt="O" title="indicator"  /></td>
    </tr>
    </table>
  </div>
</div>
<!-- content ends --> 
<p class="credits" style="margin:10px 25px 0px 0px; text-align:right">
  <?php echo $Tr_update.': '.$update.'<br />'.$Tr_version; ?>
  <a href="http://sandaysoft.com/products/cumulus">Cumulus</a> <?php echo $version.' ('.$build.')'; ?>
</p>
