$just_check = $ajax && function_exists('json_encode') && !$commit; $this_id = isset($id) ? $id : NULL; $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'])) {
<?php // $Id: day.php 2374 2012-08-12 19:11:43Z cimorrison $ 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 = day_table_innerhtml($day, $month, $year, $room, $area, $timetohighlight); if ($ajax) { echo $inner_html; exit; } // Form the room parameter for use in query strings. We want to preserve room information // if possible when switching between views $room_param = empty($room) ? "" : "&room={$room}"; $timestamp = mktime(12, 0, 0, $month, $day, $year); // print the page header print_header($day, $month, $year, $area, isset($room) ? $room : ""); echo "<div id=\"dwm_header\" class=\"screenonly\">\n"; // Show all available areas echo make_area_select_html('day.php', $area, $year, $month, $day); // Draw the three month calendars if (!$display_calendar_bottom) { minicals($year, $month, $day, $area, $room, 'day'); } echo "</div>\n"; //y? are year, month and day of yesterday