Problem-
We want the ability to book a room more than 12 months into the future. The calendar only goes 12 months.
Thanks!
HOW TO reserve a room more than 12 months in the future
Moderator: alexandrleonenko
Re: Reserve a room more than 12 months in the future.
Hello
This can be easily remedied
Go to the room settings (Hotels Management » Hotels and Rooms » Rooms Settings)
And ispravte setting "Maximum Allowed Search Period"
Regards, Sergey
This can be easily remedied
Go to the room settings (Hotels Management » Hotels and Rooms » Rooms Settings)
And ispravte setting "Maximum Allowed Search Period"
Regards, Sergey
Re: Reserve a room more than 12 months in the future.
Thanks for the reply.
Unfortunately, I don't have that in my version ??

Unfortunately, I don't have that in my version ??

Re: Reserve a room more than 12 months in the future.
Hello
The last example for uHotelBooking if you use ApPHP Hotel Site, you will need to make the following changes:
The file "include/classes/Rooms.class.php"
Find the following code in the code (~ 2720 line):
And set the desired number of months:
And to make the correction in the file templates/default/js/calendar.js (if you are using the default theme). Find following line:
And set the desired number of months - 1:
The last example for uHotelBooking if you use ApPHP Hotel Site, you will need to make the following changes:
The file "include/classes/Rooms.class.php"
Find the following code in the code (~ 2720 line):
Code: Select all
$output1 .= '</select>
<select id="checkin_year_month" name="checkin_year_month" class="checkin_year_month" onchange="cCheckDateOrder(this,\'checkin_monthday\',\'checkin_year_month\',\'checkout_monthday\',\'checkout_year_month\');cUpdateDaySelect(this);">
<option class="month prompt" value="0">'._MONTH.'</option>';
$selected_year_month = isset($_POST['checkin_year_month']) ? prepare_input($_POST['checkin_year_month']) : date('Y-n');
// !!! Edit only need this line
for($i=0; $i<12; $i++){
$cur_time = mktime(0, 0, 0, date('m')+$i, '1', date('Y'));
$val = date('Y', $cur_time).'-'.(int)date('m', $cur_time);
$output1 .= '<option value="'.$val.'" '.(($selected_year_month == $val) ? 'selected="selected"' : '').'>'.get_month_local(date('n', $cur_time)).' \''.date('y', $cur_time).'</option>';
}
$output1 .= '</select>';
.....
$output2 .= '</select>
<select id="checkout_year_month" name="checkout_year_month" class="checkout_year_month" onchange="cCheckDateOrder(this,\'checkout_monthday\',\'checkout_year_month\');cUpdateDaySelect(this);">
<option class="month prompt" value="0">'._MONTH.'</option>';
$checkout_selected_year_month = isset($_POST['checkout_year_month']) ? prepare_input($_POST['checkout_year_month']) : date('Y-n');
// !!! Edit only need this line
for($i=0; $i<12; $i++){
$cur_time = mktime(0, 0, 0, date('m')+$i, '1', date('Y'));
$val = date('Y', $cur_time).'-'.(int)date('m', $cur_time);
$output2 .= '<option value="'.$val.'" '.(($checkout_selected_year_month == $val) ? 'selected="selected"' : '').'>'.get_month_local(date('n', $cur_time)).' \''.date('y', $cur_time).'</option>';
}
$output2 .= '</select>';
And set the desired number of months:
Code: Select all
...
// 2 year == 24 month
for($i=0; $i<24; $i++){
...
// 2 year == 24 month
for($i=0; $i<24; $i++){
...
And to make the correction in the file templates/default/js/calendar.js (if you are using the default theme). Find following line:
Code: Select all
function cBuildCal(K,E,J){var B=[31,0,31,30,31,30,31,31,30,31,30,31] .... // And a lot of different chars
And set the desired number of months - 1:
Code: Select all
// Edit only need this:
// ... for(n=0;n<=11;n++) ...
// 2 year == 24 month - 1
.... for(n=0;n<=23;n++) ....
Re: Reserve a room more than 12 months in the future.
Hey super thanks for the try.
The upper select worked, but the bottom one didn't..
I also noticed in the "pop up" calendar, the months did not populate correctly with the +24 ?



The upper select worked, but the bottom one didn't..
I also noticed in the "pop up" calendar, the months did not populate correctly with the +24 ?



Re: Reserve a room more than 12 months in the future.
Hello
1.
To pop-up window appear correct months, check whether there were changes in the file "templates/default/js/calendar.js"
Then make the same changes to the file "templates/admin/js/calendar.js"
After the update the cache to reload the files
2.
Locate the following code in the file "include/classes/Rooms.class.php" (it should be next to the code that you ruled earlier):
And set the number of months:
1.
To pop-up window appear correct months, check whether there were changes in the file "templates/default/js/calendar.js"
Then make the same changes to the file "templates/admin/js/calendar.js"
After the update the cache to reload the files
2.
Locate the following code in the file "include/classes/Rooms.class.php" (it should be next to the code that you ruled earlier):
Code: Select all
$output2 .= '</select>
<select id="checkout_year_month" name="checkout_year_month" class="checkout_year_month" onchange="cCheckDateOrder(this,\'checkout_monthday\',\'checkout_year_month\');cUpdateDaySelect(this);">
<option class="month prompt" value="0">'._MONTH.'</option>';
$checkout_selected_year_month = isset($_POST['checkout_year_month']) ? prepare_input($_POST['checkout_year_month']) : date('Y-n');
// !!! Edit only need this line
for($i=0; $i<12; $i++){
$cur_time = mktime(0, 0, 0, date('m')+$i, '1', date('Y'));
$val = date('Y', $cur_time).'-'.(int)date('m', $cur_time);
$output2 .= '<option value="'.$val.'" '.(($checkout_selected_year_month == $val) ? 'selected="selected"' : '').'>'.get_month_local(date('n', $cur_time)).' \''.date('y', $cur_time).'</option>';
}
$output2 .= '</select>';
And set the number of months:
Code: Select all
...
// 2 year == 24 month
for($i=0; $i<24; $i++){
...
Re: Reserve a room more than 12 months in the future.
That was it!! Brilliant!
Thanks so much!!
Thanks so much!!