FI

VÝZKUM » Webový teploměr » Calendar

IncDir()."calendar.php"; // $RRA_Location = "/var/www/html/projects/thermometer/RRA/"; // This function pads a number to a fixed length by // adding leading zeroes. // e.g. "3" padded to length "2" returns "03" function pad($s, $n) { $r = $s; while (strlen($r) < $n) { $r = "0".$r; } return $r; } // Now define the Calendar class class WebCamCalendar extends Calendar { function getCalendarLink($month, $year) { global $data; //$_SITE_DEF, $s = $data->RootDir().$data->BaseFile()."?".$data->TplParam()."=".$data->Template().$data->UrlSeparator()."lang=".$data->get_lang().$data->UrlSeparator()."month=$month".$data->UrlSeparator()."year=$year"; return $s; } function getDateLink($day, $month, $year) { global $_SITE_DEF, $data; $filename = pad($year, 4) . pad($month, 2) . pad($day, 2); $dir = $_SITE_DEF["rra_dir"] . $filename . "." . "rrd"; $s = $data->RootDir().$data->BaseFile()."?".$data->TplParam()."=project1-temperature".$data->UrlSeparator()."lang=".$data->get_lang().$data->UrlSeparator()."rra=$filename"; if (file_exists($dir)) { return $s; } else { return ""; } } } if (empty($_GET["year"])) $year = date( "Y", time() ); else $year = $_GET["year"]; $month = ""; if (!empty($_GET["month"])) $month = $_GET["month"]; // echo "$year
"; // echo "$_GET[year]"; // Construct a calendar to show the current year $cal = new WebCamCalendar; echo $cal->getYearView($year); /* echo $cal->getYearView($year) or die ("Chybova hlaska!"); pouziti operatoru @ nak nefunguje ? */ ?>