Exemplo n.º 1
0
</th>
        <th><?php 
echo get_vocab("start_date");
?>
</th>
      </tr>
    </thead>
    
    <tbody>
<?php 
for ($i = 0; $row = sql_row_keyed($result, $i); $i++) {
    echo "<tr>\n";
    echo "<td><a href=\"view_entry/id:" . $row['entry_id'] . "\">" . get_vocab("view") . "</a></td>\n";
    echo "<td>" . htmlspecialchars($row['create_by']) . "</td>\n";
    echo "<td>" . htmlspecialchars($row['name']) . "</td>\n";
    echo "<td>" . htmlspecialchars($row['description']) . "</td>\n";
    // generate a link to the day.php
    $link = getdate($row['start_time']);
    $url = formatURLFull($link[year], $link[mon], $link[mday], $row['area_id'], NULL);
    echo "<td><a href=\"day/{$url}\">";
    if (empty($row['enable_periods'])) {
        $link_str = time_date_string($row['start_time']);
    } else {
        list(, $link_str) = period_date_string($row['start_time']);
    }
    echo "{$link_str}</a></td>";
    echo "</tr>\n";
}
echo "</tbody>\n";
echo "</table>\n";
require_once "trailer.inc";
Exemplo n.º 2
0
function display_entry_row($row)
{
    echo "<tr>\n";
    echo "<td class=\"control\">&nbsp;</td>\n";
    // reservation name, with a link to the view_entry page
    echo "<td>";
    echo "<a href=\"view_entry/id:" . $row['id'] . "\">" . htmlspecialchars($row['name']) . "</a></td>\n";
    // create_by, area and room names
    echo "<td>" . htmlspecialchars($row['create_by']) . "</td>\n";
    echo "<td>" . htmlspecialchars($row['area_name']) . "</td>\n";
    echo "<td>" . htmlspecialchars($row['room_name']) . "</td>\n";
    // start date, with a link to the day.php
    $link = getdate($row['start_time']);
    echo "<td>";
    $url = formatURLFull($link[year], $link[mon], $link[mday], $row['area_id'], NULL);
    echo "<a href=\"day/{$url}\">";
    if (empty($row['enable_periods'])) {
        $link_str = time_date_string($row['start_time']);
    } else {
        list(, $link_str) = period_date_string($row['start_time']);
    }
    echo "{$link_str}</a></td>";
    // action buttons
    echo "<td>\n";
    display_buttons($row, FALSE);
    echo "</td>\n";
    echo "</tr>\n";
}
Exemplo n.º 3
0
 $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
 if (FALSE != $row_labels_both_sides) {
     draw_time_cell($t, $time_t, $time_t_stripped, $hilite_url);
Exemplo n.º 4
0
<?php

// $Id: admin.php 1779 2011-01-30 10:06:06Z cimorrison $
require_once "defaultincludes.inc";
require_once 'url.inc';
// Get non-standard form variables
$area_name = get_form_var('area_name', 'string');
$error = get_form_var('error', 'string');
// the image buttons:  need to specify edit_x rather than edit etc. because
// IE6 only returns _x and _y
$edit_x = get_form_var('edit_x', 'int');
$delete_x = get_form_var('delete_x', 'int');
// Check to see whether the Edit or Delete buttons have been pressed and redirect
// as appropriate
$std_query_string = formatURLFull($year, $month, $day, $area, NULL);
if (isset($edit_x)) {
    $location = $location = "edit_area_room/{$std_query_string}-change_area:1-phase:1";
    header("Location: {$location}");
    exit;
}
if (isset($delete_x)) {
    $location = "del/{$std_query_string}-type:area";
    header("Location: {$location}");
    exit;
}
// Check the user is authorised for this page
checkAuthorised();
// Also need to know whether they have admin rights
$user = getUserName();
$required_level = isset($max_level) ? $max_level : 2;
$is_admin = authGetUserLevel($user) >= $required_level;
// Need to tell all the links where to go back to after an edit or delete
if (!isset($returl)) {
    if (isset($HTTP_REFERER)) {
        $returl = $HTTP_REFERER;
    } else {
        switch ($default_view) {
            case "month":
                $returl = "month";
                break;
            case "week":
                $returl = "week";
                break;
            default:
                $returl = "day";
        }
        $returl .= formatURLFull($year, $month, $day, $area, NULL);
    }
}
$link_returl = $returl;
// for use in links
if (empty($series)) {
    $series = 0;
} else {
    $series = 1;
}
// Now that we know all the data we start drawing it
echo "<h3" . ($keep_private && $is_private_field['entry.name'] ? " class=\"private\"" : "") . ">\n";
echo $keep_private && $is_private_field['entry.name'] ? "[" . get_vocab("private") . "]" : htmlspecialchars($row['name']);
if (is_private_event($private) && $writeable) {
    echo ' (' . get_vocab("private") . ')';
}
Exemplo n.º 6
0
     // These days are to be hidden in the display (as they are hidden, just give the
     // day of the week in the header row
     echo "<td class=\"hidden_day\">\n";
     echo "<div class=\"cell_container\">\n";
     echo "<div class=\"cell_header\">\n";
     // first put in the day of the month
     echo "<span>{$cday}</span>\n";
     echo "</div>\n";
     echo "</div>\n";
     echo "</td>\n";
 } else {
     echo "<td class=\"valid\">\n";
     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";
Exemplo n.º 7
0
<?php

// $Id: index.php 1640 2010-11-24 17:50:28Z jberanek $
// Index is just a stub to redirect to the appropriate view
// as defined in config.inc.php using the variable $default_view
// If $default_room is defined in config.inc.php then this will
// be used to redirect to a particular room.
require_once "defaultincludes.inc";
require_once "mrbs_sql.inc";
require_once 'url.inc';
$url = formatURLFull($year, $month, $day, $area, $room);
switch ($default_view) {
    case "month":
        $redirect_str = "month/{$url}";
        break;
    case "week":
        $redirect_str = "week/{$url}";
        break;
    default:
        $redirect_str = "day/{$url}";
}
header("Location: {$redirect_str}");