Jump to content

iimarah

New Members
  • Posts

    2
  • Joined

  • Last visited

iimarah's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I do know db a bit, so here is what I did... $booking_check_avilability_table = $wpdb->prefix . 'booking_check_avilability'; $fetch_booking_schedule_sql = $wpdb->get_results("select sum(total_room) as total_room from $booking_check_avilability_table where room_type_id = '".$room_type."' and ((check_in_date between '".$_SESSION['side_check_in_date']."' and '".$_SESSION['side_check_out_date']."') or (check_out_date between '".$_SESSION['side_check_in_date']."' and '".$_SESSION['side_check_out_date']."') or (check_in_date <= '".$_SESSION['side_check_in_date']."' and check_out_date >= '".$_SESSION['side_check_in_date']."') or (check_in_date >= '".$_SESSION['side_check_out_date']."' and check_out_date <= '".$_SESSION['side_check_out_date']."'))"); if(count($fetch_booking_schedule_sql) > 0){ foreach($fetch_booking_schedule_sql as $fetch_booking_schedule_res){ $chk_room_cnt = $no_room - $fetch_booking_schedule_res->total_room; echo '<th>'.$check_in_date.'</th>'; echo '<td>'.$chk_room_cnt.'</td>'; } } This is the part which shows the availability for the current day which is working fine. $one_check_in_date = date('d',strtotime($_SESSION['side_check_in_date'])); $one_check_out_date = date('d',strtotime($_SESSION['side_check_out_date'])); $one_no_rooms = $_SESSION['side_no_rooms']; $onenext_check_in_date = $one_check_in_date + 1; $onenext_check_out_date = $one_check_out_date + 1; $onenext_check_in_date_out = date('Y-m-'.$onenext_check_in_date.'',strtotime($_SESSION['side_check_in_date'])); $onenext_check_out_date_out = date('Y-m-'.$onenext_check_out_date.'',strtotime($_SESSION['side_check_out_date'])); $one_no_room = get_post_meta($room_type,'no_rooms',true); if($one_no_room == 0){ echo '<th>'.$onenext_check_in_date_out.'</th>'; echo '<td>Not Available</td>'; } elseif ($one_no_room == $one_no_rooms || $one_no_room > $one_no_rooms) { $one_fetch_booking_schedule_sql = $wpdb->get_results("select sum(total_room) as total_room from $booking_check_avilability_table where room_type_id = '".$room_type."' and ((check_in_date between '".$onenext_check_in_date_out."' and '".$onenext_check_out_date_out."') or (check_out_date between '".$onenext_check_in_date_out."' and '".$onenext_check_out_date_out."') or (check_in_date <= '".$onenext_check_in_date_out."' and check_out_date >= '".$onenext_check_in_date_out."') or (check_in_date >= '".$onenext_check_out_date_out."' and check_out_date <= '".$onenext_check_out_date_out."'))"); if(count($one_fetch_booking_schedule_sql) > 0){ foreach($one_fetch_booking_schedule_sql as $one_fetch_booking_schedule_res){ $one_chk_room_cnt = $one_no_room - $fetch_booking_schedule_res->total_room; echo '<th>'.$onenext_check_in_date_out.'</th>'; echo '<td>'.$one_chk_room_cnt.'</td>'; } } } This shows of the next day which isn't working, it always shows 0 !
  2. Hello, I am using the templatic hotel booking theme to enable users to book rooms through our website. If there is no room available for the queried dates, it shows a message that there is no room available. However, I wish to display the availability of that room for the next 5 days to enable them to book hotels for the next check in date. The form is using dhtmlgoodies calender to gather the dates. Is there any ways to display the stuff that I want. I have included the booking result page here... http://pastebin.com/795hFwMh
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.