| Current Path : /home/balossw/www/temp/content/pages/ |
| Current File : /home/balossw/www/temp/content/pages/ajax.php |
<?php
/*---------------------------------------------------------------------------
File name ............ content/pages/ajax.php
Author ............... Antoine Lemoine
Creation date ........ 03.12.2010
Modification date .... 03.12.2010
---------------------------------------------------------------------------*/
$what = isset($_GET['what']) ? $_GET['what'] : '';
switch ($what) {
case 'weather':
header('Content-Type: text/html; charset=ISO-8859-1');
include_once $global->path('content/includes/weather.inc.php');
$weather = new Weather('Morteau');
if (!$weather->loaded()) $weather->load();
if ($weather->loaded()) {
$output = "<div class=\"weather\"><strong>".$weather->getCity()."</strong><div class=\"weather-content\"><div class=\"day current-day\"><div class=\"day-of-week\">".__("aujourd'hui")."</div>"
."<img src=\"".$weather->getIcon(-1,true)."\" alt=\"".$weather->getCondition()."\" />"
."<strong>".$weather->getTemperature()."°C</strong><br/>"
.$weather->getWind()."<br/>"
."<div style=\"clear:left;margin-left:15px;\">".$weather->getCondition()."</div>"
."</div><div class=\"other-days\">"
;
for ($i=1; $i<4; $i++) {
$output .= "<div class=\"day-i\"><div class=\"day-of-week\">".$weather->getDayOfWeek($i)."</div>"
."<img src=\"".$weather->getIcon($i,true)."\" alt=\"".$weather->getCondition($i)."\" />"
."<br/><strong>".$weather->getLow($i)."/".$weather->getHigh($i)."°C</strong>"
."</div>";
}
$output .= "</div><div class=\"clear\"></div></div></div>";
} else {
$output = "<div class=\"weather\">".__("Service temporairement indisponible")."</div>";
}
echo $output;
exit;
break;
}
echo 123;
exit;
?>