Beispiel #1
0
$result = mrbsMakeBookings($bookings, $this_id, $just_check, $skip, $original_room_id, $need_to_send_mail, $edit_type);
// If we weren't just checking and this was a succesful booking and
// we were editing an existing booking, then delete the old booking
if (!$just_check && $result['valid_booking'] && isset($id)) {
    mrbsDelEntry($user, $id, $edit_type == "series", 1);
}
// If this is an Ajax request, output the result and finish
if ($ajax && function_exists('json_encode')) {
    // If this was a successful commit generate the new HTML
    if ($result['valid_booking'] && $commit) {
        // Generate the new HTML
        require_once "functions_table.inc";
        if ($page == 'day') {
            $result['table_innerhtml'] = day_table_innerhtml($day, $month, $year, $room, $area, $timetohighlight);
        } else {
            $result['table_innerhtml'] = week_table_innerhtml($day, $month, $year, $room, $area, $timetohighlight);
        }
    }
    echo json_encode($result);
    exit;
}
// Everything was OK.   Go back to where we came from
if ($result['valid_booking']) {
    header("Location: {$returl}");
    exit;
} else {
    print_header($day, $month, $year, $area, isset($room) ? $room : "");
    echo "<h2>" . get_vocab("sched_conflict") . "</h2>\n";
    if (!empty($result['rules_broken'])) {
        echo "<p>\n";
        echo get_vocab("rules_broken") . ":\n";
Beispiel #2
0
    }
    $result->free();
    $result2->free();
} else {
    $timetohighlight = get_form_var('timetohighlight', 'int');
    $this_user_name = get_area_name($user);
    echo "<div id=\"dwm\">\n";
    echo "<h2>" . htmlspecialchars("{$this_user_name}") . "</h2>\n";
    echo "</div>\n";
    $i = mktime(12, 0, 0, $month, $day - 7, $year);
    $yy = date("Y", $i);
    $ym = date("m", $i);
    $yd = date("d", $i);
    $i = mktime(12, 0, 0, $month, $day + 7, $year);
    $ty = date("Y", $i);
    $tm = date("m", $i);
    $td = date("d", $i);
    // Show Go to week before and after links
    $before_after_links_html = "\n<div class=\"screenonly\">\n  <div class=\"date_nav\">\n    <div class=\"date_before\">\n      <a href=\"temp.php?year={$yy}&amp;month={$ym}&amp;day={$yd}&amp;user={$user}\">\n          &lt;&lt;&nbsp;" . get_vocab("weekbefore") . "\n      </a>\n    </div>\n    <div class=\"date_now\">\n      <a href=\"temp.php?user={$user}\">\n          " . get_vocab("gotothisweek") . "\n      </a>\n    </div>\n    <div class=\"date_after\">\n      <a href=\"temp.php?year={$ty}&amp;month={$tm}&amp;day={$td}&amp;user={$user}\">\n          " . get_vocab("weekafter") . "&nbsp;&gt;&gt;\n      </a>\n    </div>\n  </div>\n</div>\n";
    print $before_after_links_html;
    $inner_html = week_table_innerhtml($day, $month, $year, $user, $timetohighlight);
    echo "<table class=\"dwm_main\" id=\"week_main\" data-resolution=\"{$resolution}\">";
    echo $inner_html;
    echo "</table>\n";
    print $before_after_links_html;
    // Draw the three month calendars
    if ($display_calendar_bottom) {
        minicals($year, $month, $day, $area, $room, 'temp', $user);
    }
    output_trailer();
}
Beispiel #3
0
<?php

// $Id: week.php 2374 2012-08-12 19:11:43Z cimorrison $
// mrbs/week.php - Week-at-a-time view
require "defaultincludes.inc";
require_once "mincals.inc";
require_once "functions_table.inc";
// Get non-standard form variables
$timetohighlight = get_form_var('timetohighlight', 'int');
$ajax = get_form_var('ajax', 'int');
// Check the user is authorised for this page
checkAuthorised();
$inner_html = week_table_innerhtml($day, $month, $year, $room, $area, $timetohighlight);
if ($ajax) {
    echo $inner_html;
    exit;
}
// print the page header
print_header($day, $month, $year, $area, isset($room) ? $room : "");
// Section with areas, rooms, minicals.
echo "<div id=\"dwm_header\" class=\"screenonly\">\n";
// Show all available areas
echo make_area_select_html('week.php', $area, $year, $month, $day);
// Show all available rooms in the current area:
echo make_room_select_html('week.php', $area, $room, $year, $month, $day);
// Draw the three month calendars
if (!$display_calendar_bottom) {
    minicals($year, $month, $day, $area, $room, 'week');
}
echo "</div>\n";
// Show area and room: