Ejemplo n.º 1
0
 for ($t = mktime($morningstarts, $morningstarts_minutes, 0, $month, $day + $j, $year); $t <= mktime($eveningends, $eveningends_minutes, 0, $month, $day + $j, $year); $t += $resolution, $row_class = $row_class == "even_row" ? "odd_row" : "even_row") {
     // convert timestamps to HHMM format without leading zeros
     $time_t = date($format, $t);
     // and get a stripped version of the time for use with periods
     $time_t_stripped = preg_replace("/^0/", "", $time_t);
     // calculate hour and minute (needed for links)
     $hour = date("H", $t);
     $minute = date("i", $t);
     // Show the time linked to the URL for highlighting that time
     echo "<tr>";
     draw_time_cell($t, $time_t, $time_t_stripped, $hilite_url);
     // Loop through the list of rooms we have for this area
     while (list($key, $room_id) = each($rooms)) {
         // set up the query strings to be used for the link in the cell
         $query_strings = array();
         $query_strings['new_periods'] = formatURLPeriods($year, $month, $day, $area, $room_id, $time_t_stripped);
         $query_strings['new_times'] = formatURLTimes($year, $month, $day, $area, $room_id, $hour, $minute);
         $query_strings['booking'] = formatURLFull($year, $month, $day, $area, NULL);
         // and then draw the cell
         if (!isset($today[$room_id][$day][$time_t])) {
             $today[$room_id][$day][$time_t] = array();
             // to avoid an undefined index NOTICE error
         }
         if (isset($timetohighlight) && $time_t == $timetohighlight) {
             $cell_class = "row_highlight";
         } else {
             $cell_class = $row_class;
         }
         draw_cell($today[$room_id][$day][$time_t], $query_strings, $cell_class);
     }
     // next lines to display times on right side
Ejemplo n.º 2
0
 echo "<div class=\"cell_container\">\n";
 echo "<div class=\"cell_header\">\n";
 // first put in the day of the month
 $url = formatURLFull($year, $month, $cday, $area, NULL);
 echo "<a class=\"monthday\" href=\"day/{$url}\">{$cday}</a>\n";
 echo "</div>\n";
 // then the link to make a new booking
 if ($javascript_cursor) {
     echo "<script type=\"text/javascript\">\n";
     echo "//<![CDATA[\n";
     echo "BeginActiveCell();\n";
     echo "//]]>\n";
     echo "</script>\n";
 }
 if ($enable_periods) {
     $url = formatURLPeriods($year, $month, $cday, $area, $room, 0);
     echo "<a class=\"new_booking\" href=\"edit_entry/{$url}\">\n";
     echo "<img src=\"images/new.gif\" alt=\"New\" width=\"10\" height=\"10\">\n";
     echo "</a>\n";
 } else {
     $url = formatURLTimes($year, $month, $cday, $area, $room, $morningstarts, 0);
     echo "<a class=\"new_booking\" href=\"edit_entry/{$url}\">\n";
     echo "<img src=\"images/new.gif\" alt=\"New\" width=\"10\" height=\"10\">\n";
     echo "</a>\n";
 }
 if ($javascript_cursor) {
     echo "<script type=\"text/javascript\">\n";
     echo "//<![CDATA[\n";
     echo "EndActiveCell();\n";
     echo "//]]>\n";
     echo "</script>\n";