/** * 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())))); }
/** * Standard aed_module add actualiser. * * @return ID_TEXT The ID of the entry added */ function add_actualisation() { $username = post_param('username'); $member_id = $GLOBALS['FORUM_DRIVER']->get_member_from_username($username); if (is_null($member_id)) { require_code('ocf_member_action'); $member_id = ocf_make_member($username, uniqid('', true), '', array(), NULL, NULL, NULL, array(), NULL, NULL, 1, NULL, NULL, '', NULL, '', 0, 0, 1, '', '', '', 1, 1, NULL, 1, 1, '', NULL, '', false); } $request = get_booking_request_from_form(); $request = save_booking_form_to_db($request, array(), $member_id); // Find $i by loading all member requests and finding which one this is contained in $request = get_member_booking_request($member_id); foreach ($request as $i => $r) { foreach ($r['_rows'] as $row) { if ($row['id'] == $request[0]['_rows'][0]['id']) { break 2; } } } return strval($member_id) . '_' . strval($i); }