3 * Description: a complete year with numeric week numbers
5 function getmicrotime(){
6 list($usec, $sec) = explode(" ",microtime());
7 return ((float)$usec + (float)$sec);
9 $start = getmicrotime();
11 if (!@include 'Calendar/Calendar.php') {
12 define('CALENDAR_ROOT', '../../');
15 require_once CALENDAR_ROOT.'Year.php';
16 require_once CALENDAR_ROOT.'Month/Weeks.php';
18 define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKS);
20 if (!isset($_GET['year'])) $_GET['year'] = date('Y');
27 if (!isset($_GET['week_type']) || !in_array($_GET['week_type'],$week_types) ) {
28 $_GET['week_type'] = 'n_in_year';
31 $Year = new Calendar_Year($_GET['year']);
35 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
38 <title> <?php echo $Year->thisYear(); ?> </title>
39 <style type="text/css">
41 font-family: Georgia, serif;
53 border: thin groove #800080
75 background-color: #e5e5f5;
82 <caption class="year">
83 <?php echo $Year->thisYear(); ?>
85 <a href="?year=<?php echo $Year->nextYear(); ?>&week_type=<?php echo $_GET['week_type']; ?>">>></a>
88 <a href="?year=<?php echo $Year->prevYear(); ?>&week_type=<?php echo $_GET['week_type']; ?>"><<</a>
91 <a href="?year=<?php echo $Year->thisYear(); ?>&week_type=n_in_year">Weeks by Year</a> :
92 <a href="?year=<?php echo $Year->thisYear(); ?>&week_type=n_in_month">Weeks by Month</a>
97 while ($Month = $Year->fetch()) {
106 echo "</tr>\n<tr>\n";
113 echo "<td>\n<table class=\"month\">\n";
114 echo '<caption class="month">'.date('F', $Month->thisMonth(TRUE)).'</caption>';
115 echo '<colgroup><col class="weekNumbers"><col span="7"></colgroup>'."\n";
116 echo "<tr>\n<th>Week</th><th>M</th><th>T</th><th>W</th><th>T</th><th>F</th><th>S</th><th>S</th>\n</tr>";
118 while ($Week = $Month->fetch()) {
120 echo '<td>'.$Week->thisWeek($_GET['week_type'])."</td>\n";
123 while ($Day = $Week->fetch()) {
124 if ($Day->isEmpty()) {
125 echo "<td> </td>\n";
127 echo "<td>".$Day->thisDay()."</td>\n";
131 echo "</table>\n</td>\n";
137 <p>Took: <?php echo ((getmicrotime()-$start)); ?></p>