You are here

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

Submit callback for rooms_filter_month_form form.

See also

rooms_filter_month_form()

File

./rooms.module, line 1245
Provides basic underlying functionality and configuration options used by all Rooms modules

Code

function rooms_filter_month_form_submit(&$form, &$form_state) {
  $year = $form_state['values']['year'] + date('Y', time()) - 2;
  $month = $form_state['values']['month'];
  $type = $form_state['values']['type'];
  $address = 'admin/rooms/units/' . arg(3) . '/' . $year . '/' . $month;
  if ($type != 'all') {
    $address .= '/' . $type;
  }
  if (arg(7) != '') {
    $address .= $type == 'all' ? '/all/' . arg(7) : $type . arg(7);
  }
  $form_state['redirect'] = $address;
}