示例#1
0
             $_REQUEST['action'] = 'modify';
         } else {
             if (modify_event($event_username, $event['event_id'], $_POST['subject'], $_POST['desc'], $_POST['bookingOptions'])) {
                 $page_info_message = "Event details modified successfully!";
                 $event = get_event_details($_REQUEST['event_id']);
             } else {
                 $page_error_message = "Event details could not be modified. Please try again.";
                 $event['description'] = $_POST['desc'];
                 $event['subject'] = $_POST['subject'];
                 $_REQUEST['action'] = 'modify';
             }
         }
     }
 } else {
     if ($_REQUEST['action'] == 'submit_delete') {
         if (delete_event_slot($event_username, $event['event_id'], $_REQUEST['date_time'])) {
             $page_info_message = "Time slot deleted successfully!";
             $showEventDetails = false;
         } else {
             $page_error_message = "Event time slot could not be deleted. Please try again.";
         }
         $_REQUEST['action'] = 'delete';
     } else {
         if ($_REQUEST['action'] == 'delete_event') {
             //make sure the user is within the time limit for a cancellation
             list($year, $month, $day) = explode("-", $starting_date);
             list($hour, $min, $sec) = explode(":", $starting_time);
             $secsUntilSlotStart = mktime($hour, $min, $sec, $month, $day, $year) - time();
             $secsForMinimumAllowedCancellation = $_SESSION['ADVANCE_CANCEL_LIMIT'] * 3600;
             //60 sec  x  60 mins  =  secs in an hour
             //echo "times: " . $secsUntilSlotStart . ' > ' . $secsForMinimumAllowedCancellation ;
示例#2
0
         $event['subject'] = $_POST['subject'];
         $_REQUEST['action'] = 'modify';
     } else {
         if (modify_event($_SESSION['valid_user'], $event['event_id'], $_POST['subject'], $_POST['desc'])) {
             $page_info_message = "Event details modified successfully!";
             $event = get_event_details($_REQUEST['event_id']);
         } else {
             $page_error_message = "Event details could not be modified. Please try again.";
             $event['description'] = $_POST['desc'];
             $event['subject'] = $_POST['subject'];
             $_REQUEST['action'] = 'modify';
         }
     }
 } else {
     if ($_REQUEST['action'] == 'submit_delete') {
         if (delete_event_slot($_SESSION['valid_user'], $event['event_id'], $_REQUEST['date_time'])) {
             $page_info_message = "Time slot deleted successfully!";
         } else {
             $page_error_message = "Event time slot could not be deleted. Please try again.";
         }
         $_REQUEST['action'] = 'delete';
     } else {
         if ($_REQUEST['action'] == 'delete_event') {
             if (delete_event($_SESSION['valid_user'], $event['event_id'])) {
                 $page_info_message = "Event deleted successfully!";
                 $page_error_message = "No event to display.";
             } else {
                 $page_error_message = "Event time slot could not be deleted. Please try again.";
                 $_REQUEST['action'] = 'delete';
             }
         }