You are here

function rooms_booking_manager_override_confirmation_page in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

Constructs the booking override confirmation page

Parameters

DateTime $start_date: Start date for the search.

DateTime $end_date: End date for the search.

int $booking_units: In how many units are we to accommodate them.

Return value

string The themed page string.

1 string reference to 'rooms_booking_manager_override_confirmation_page'
rooms_booking_manager_menu in modules/rooms_booking_manager/rooms_booking_manager.module
Implements hook_menu().

File

modules/rooms_booking_manager/rooms_booking_manager.confirmation_override.inc, line 21
Override confirmation page logic.

Code

function rooms_booking_manager_override_confirmation_page(DateTime $start_date, DateTime $end_date, $booking_units = 1, $single_day_bookings = FALSE) {
  $booking_parameters = array(
    'unit_id' => $_GET['unit_id'],
    'group_size' => $_GET['group_size'],
  );
  if (isset($_GET['options'])) {
    $booking_parameters['options'] = $_GET['options'];
  }
  $type = '';
  if (isset($_GET['type'])) {
    $type = check_plain($_GET['type']);
    if ($type == '' || rooms_unit_type_load($type) === FALSE) {
      $type = '';
    }
  }
  $content['change_search'] = drupal_get_form('rooms_booking_manager_change_search_form', $start_date, $end_date, $booking_parameters, $booking_units, $type);
  $current_path = array(
    'path' => 'booking/' . $start_date
      ->format('Y-m-d') . '/' . $end_date
      ->format('Y-m-d') . '/' . $booking_units,
    'query' => array(
      'rooms_group_size1' => $booking_parameters['group_size'],
    ),
  );
  $content['confirm_form'] = drupal_get_form('rooms_booking_manager_override_confirmation_form', $start_date, $end_date, $booking_parameters, t('You have a previous booking request in your cart, continuing will replace it.'), $current_path, '', t('Continue'), t('Go Back To Search'));
  return theme('rooms_booking_override_confirmation_page', $content);
}