Пример #1
0
 /**
  * E-mails staff and receipt notice to user, and saves everything.
  *
  * @return tempcode	The result of execution.
  */
 function thanks()
 {
     $title = get_page_title('CREATE_BOOKING');
     // Finish join operation, if applicable
     if (is_guest()) {
         list($messages) = ocf_join_actual(true, false, false, true, false, false, false, true);
         if (!$messages->is_empty()) {
             return inform_screen($title, $messages);
         }
     }
     // Read request
     $request = get_booking_request_from_form();
     // Save
     $test = save_booking_form_to_db($request, array());
     if (is_null($test)) {
         warn_exit(do_lang_tempcode('BOOKING_ERROR'));
     }
     // Send emails
     send_booking_emails($request);
     // Show success
     return inform_screen($title, do_lang_tempcode('BOOKING_SUCCESS', escape_html($GLOBALS['FORUM_DRIVER']->get_username(get_member()))));
 }
Пример #2
0
/**
 * AJAX script to work out the price of a booking.
 */
function booking_price_ajax_script()
{
    header('Content-type: text/plain');
    $request = get_booking_request_from_form();
    echo float_format(find_booking_price($request), 2);
}
Пример #3
0
 /**
  * Standard aed_module edit actualiser.
  *
  * @param  ID_TEXT		The entry being edited
  */
 function edit_actualisation($_id)
 {
     list($member_id, $i) = array_map('intval', explode('_', $_id, 2));
     $old_request = get_member_booking_request($member_id);
     $ignore_bookings = array();
     foreach ($old_request[$i]['_rows'] as $row) {
         $ignore_bookings[] = $row['id'];
     }
     $request = get_booking_request_from_form();
     $test = check_booking_dates_available($request, $ignore_bookings);
     if (!is_null($test)) {
         warn_exit($test);
     }
     // Delete then re-add
     $this->delete_actualisation($_id);
     $this->new_id = $this->add_actualisation();
 }