Ejemplo n.º 1
0
     $time_blocks = get_times_in_range($range_start_time, $range_end_time, BOOKING_TIME_INTERVAL, false);
     foreach ($time_blocks as $time_block) {
         //echo "---$time_block<br />";
         $scheduled_date_time_data[] = $date . ' ' . $time_block . ':00';
         // SQL
     }
     $display_dates_and_time_ranges[] = $date . ' ' . $time_range;
     // Display
     $day++;
 }
 // CHECK AVAILABILITY OF DATE TIME DATA
 $scheduled_slots = count($scheduled_date_time_data);
 //echo "Scheduled Slots: ".$scheduled_slots."<br />";
 $available_date_time_data = array();
 $unavailable_date_time_data = array();
 $availability_count = check_schedule_availability($scheduled_date_time_data, $location_db_name[stripslashes($_REQUEST['location'])]);
 //echo "Availability Count: ".$availability_count."<br />";
 // All slots not available condition check.
 if ($scheduled_slots > $availability_count) {
     $page_error_message = 'Availability Problem: Not all of the selected date and time slots ' . 'are available for booking.  Please check the conflicting date and time slots, ' . 'make the necessary changes to your booking form and try again.';
     $unavailable_date_time_data = find_schedule_unavailability($scheduled_date_time_data, $location_db_name[stripslashes($_REQUEST['location'])]);
     if (count($unavailable_date_time_data) > 0) {
         $available_date_time_data = array_minus_array($scheduled_date_time_data, $unavailable_date_time_data);
     }
 } else {
     if (!ignoreRules && $availability_count > $remaining_booking_slots_allowed && ($user_info['max_bookings'] == '' || $user_info['max_bookings'] != 0)) {
         //user is attempting to book more slots than they are allowed to (and they are not allowed unlimited bookings).
         //report error to user and do not allow the booking without ammendments
         $page_error_message = 'You are attempting to book ' . $availability_count . ' slot';
         if ($availability_count > 1) {
             $page_error_message .= 's';
Ejemplo n.º 2
0
         $time_blocks = get_times_in_range($range_start_time, $range_end_time, BOOKING_TIME_INTERVAL, false);
         foreach ($time_blocks as $time_block) {
             //echo "---$time_block<br />";
             $scheduled_date_time_data[] = $date . ' ' . $time_block . ':00';
             // SQL
         }
         $display_dates_and_time_ranges[] = $date . ' ' . $time_range;
         // Display
         $day++;
     }
     // CHECK AVAILABILITY OF DATE TIME DATA
     $scheduled_slots = count($scheduled_date_time_data);
     //echo "Scheduled Slots: ".$scheduled_slots."<br />";
     $available_date_time_data = array();
     $unavailable_date_time_data = array();
     $availability_count = check_schedule_availability($scheduled_date_time_data, $location_db_name[$_REQUEST['location']]);
     //echo "Availability Count: ".$availability_count."<br />";
     // All slots not available condition check.
     if ($scheduled_slots > $availability_count) {
         $page_error_message = 'Availability Problem: Not all of the selected date and time slots ' . 'are available for booking.  Please check the conflicting date and time slots, ' . 'make the necessary changes to your booking form and try again.';
         $unavailable_date_time_data = find_schedule_unavailability($scheduled_date_time_data, $location_db_name[$_REQUEST['location']]);
         if (count($unavailable_date_time_data) > 0) {
             $available_date_time_data = array_minus_array($scheduled_date_time_data, $unavailable_date_time_data);
         }
     } else {
         $available_date_time_data = $scheduled_date_time_data;
     }
 }
 // IF ALL IS WELL WITH THE SCHEDULE DATA AVAILABILITY - ADD EVENT DATA
 echo "valid user: "******"<br />user_id: " . get_user_id($_SESSION['valid_user']) . "<br />";
 if ($page_error_message == '' && !empty($_POST['add_event'])) {