diff --git a/admin/themes/default/template/controllers/products/booking.tpl b/admin/themes/default/template/controllers/products/booking.tpl deleted file mode 100644 index 74c4516a3..000000000 --- a/admin/themes/default/template/controllers/products/booking.tpl +++ /dev/null @@ -1,321 +0,0 @@ -{if isset($product->id) && isset($htl_config)} -
- -

{l s='Booking Information'}

- -
-
- -
- - -
- - -
- -
- - - -
- -
-
-
-
-
-
-

{$date_from|date_format:"%d"}

- {$date_from|date_format:"%b"} -
-
-

-

-
-
-

{$date_to|date_format:"%d"}

- {$date_to|date_format:"%b"} -
-
-
-
- -
-
-
-
-
-

{l s='Total Rooms'}

-

{$booking_data['stats']['total_rooms']}

-
-
-
-
-
-
-
-

{l s='Partially Available'}

-

{$booking_data['stats']['num_part_avai']}

-
-
-
-
-
-
-
-
-
-

{l s='Available Rooms'}

-

{$booking_data['stats']['num_avail']}

-
-
-
-
-
-
-
-

{l s='Booked Rooms'}

-

{$booking_data['stats']['num_booked']}

-
-
-
-
-
-
-
-
-
-

{l s='Unavailable Rooms'}

-

{$booking_data['stats']['num_unavail']}

-
-
-
-
-
- -
-
-
- {l s='Available Rooms'} -
-
-
- {l s='Partially Available'} -
-
-
- {l s='Unavailable Rooms'} -
-
-
-
- - -
- -
-

{l s='LIST OF HOTEL ROOMS'}

-
-
- - - - - - - - - - {foreach from=$booking_data['rm_data'][0]['data'] key=b_key item=b_val} - {if ($b_key == 'available') && !empty($b_val)} - {foreach from=$b_val key=data_k item=data_v} - - - - - - {/foreach} - {elseif ($b_key == 'unavailable') && !empty($b_val)} - {foreach from=$b_val key=data_k item=data_v} - - - - - - {/foreach} - {elseif ($b_key == 'booked') && !empty($b_val)} - {foreach from=$b_val key=data_k item=data_v} - - - - - - {/foreach} - {elseif ($b_key == 'partially_available') && !empty($b_val)} - {foreach from=$b_val key=data_k item=data_v} - - - - - - {/foreach} - {/if} - {/foreach} - -
{l s='Room No.'}{l s='Status'}{l s='Message'}
{$data_v['room_num']}{l s='Available'}{$data_v['room_comment']}
{$data_v['room_num']}{l s='Unavailable'}{$data_v['room_comment']}
{$data_v['room_num']} - {if $data_v['detail'][0]['booking_status'] == 1} - {l s='Alloted'} - {elseif $data_v['detail'][0]['booking_status'] == 2} - {l s='Checked-in'} - {elseif $data_v['detail'][0]['booking_status'] == 3} - {l s='Checked-out'} - {/if} - {$data_v['detail'][0]['comment']}
{$data_v['room_num']}{l s='Partially Available'}{if isset($data_v['comment'])}{$data_v['comment']}{/if}
-
-
-
-{/if} - - \ No newline at end of file diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index c59d1757f..103544b8f 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -112,7 +112,6 @@ class AdminProductsControllerCore extends AdminController 'Warehouses' => $this->l('Warehouses'), 'Configuration' => $this->l('Configuration'), 'Occupancy' => $this->l('Occupancy'), - 'Booking' => $this->l('Booking Information'), ); $this->available_tabs = array('Warehouses' => 14); @@ -133,7 +132,6 @@ class AdminProductsControllerCore extends AdminController //'Suppliers' => 13, 'Configuration' => 14, 'Occupancy' => 15, - 'Booking' => 16, )); } @@ -1620,10 +1618,7 @@ class AdminProductsControllerCore extends AdminController $this->addJS(_PS_JS_DIR_.'jquery/plugins/select2/select2_locale_'.$this->context->language->iso_code.'.js'); $this->addJS(_PS_JS_DIR_.'jquery/plugins/validate/localization/messages_'.$this->context->language->iso_code.'.js'); - $this->addCSS(array( - _PS_JS_DIR_.'jquery/plugins/timepicker/jquery-ui-timepicker-addon.css', - _PS_CSS_DIR_.'ps-hotel-reservation.css', - )); + $this->addCSS(_PS_JS_DIR_.'jquery/plugins/timepicker/jquery-ui-timepicker-addon.css'); } } @@ -2225,9 +2220,6 @@ class AdminProductsControllerCore extends AdminController if ($this->isTabSubmitted('Configuration')) { $this->processConfiguration(); } - if ($this->isTabSubmitted('Booking')) { - $this->processBooking(); - } $this->updatePackItems($object); // Disallow avanced stock management if the product become a pack @@ -3622,162 +3614,6 @@ class AdminProductsControllerCore extends AdminController die('0'); } - /** - * @param Product $obj - * - * @throws Exception - * @throws PrestaShopException - * @throws SmartyException - */ - public function initFormBooking($obj) - { - $data = $this->createTemplate($this->tpl_form); - if ($obj->id) { - if ($this->product_exists_in_shop) { - $data->assign(array('product' => $obj)); - - $date_from = Tools::getValue('date_from'); - $date_to = Tools::getValue('date_to'); - - $obj_rm_type = new HotelRoomType(); - $obj_booking_dtl = new HotelBookingDetail(); - - $rm_info = $obj_rm_type->getRoomTypeInfoByIdProduct($obj->id); - if ($rm_info) { - if ($date_from && $date_to) { - $search_flag = 1; - $start_date = $date_from; - $last_date = $date_to; - } else { - $date_from = date('Y-m-d'); - $date_to = date('Y-m-t'); - $start_date = date('Y-m-01'); // hard-coded '01' for first day - $last_date = date('Y-m-t'); - } - $bookingParams = array(); - $bookingParams['date_from'] = $date_from; - $bookingParams['date_to'] = $date_to; - $bookingParams['hotel_id'] = $rm_info['id_hotel']; - $bookingParams['room_type'] = $obj->id; - $bookingParams['adult'] = $rm_info['adult']; - $bookingParams['children'] = $rm_info['children']; - $bookingParams['num_rooms'] = 0; - - $bookingParams['only_active_roomtype'] = 0; - - $booking_data = $obj_booking_dtl->getBookingData($bookingParams); - - $bookingParams['for_calendar'] = 1; - while ($start_date <= $last_date) { - $cal_date_from = $start_date; - $cal_date_to = date('Y-m-d', strtotime('+1 day', strtotime($cal_date_from))); - $booking_calendar_data[$cal_date_from] = $obj_booking_dtl->getBookingData($bookingParams); - - // if product is inactive then booking_details will be false - if (!$booking_calendar_data[$cal_date_from]) { - $booking_calendar_data[$cal_date_from]['stats']['num_avail'] = 0; - $booking_calendar_data[$cal_date_from]['stats']['num_part_avai'] = 0; - $booking_calendar_data[$cal_date_from]['stats']['num_unavail'] = 0; - $booking_calendar_data[$cal_date_from]['stats']['num_booked'] = 0; - } - $start_date = date('Y-m-d', strtotime('+1 day', strtotime($start_date))); - } - if (isset($search_flag) && $search_flag) { - if ($booking_data['stats']['num_avail'] > 0) { - $check_css_condition_var = 'available'; - } elseif ($booking_data['stats']['num_part_avai'] > 0) { - $check_css_condition_var = 'part_available'; - } else { - $check_css_condition_var = 'unavailable'; - } - } else { - if ($booking_data['stats']['num_avail'] > 0) { - $check_css_condition_var = 'default_available'; - } elseif ($booking_data['stats']['num_part_avai'] > 0) { - $check_css_condition_var = 'default_part_available'; - } else { - $check_css_condition_var = 'default_unavailable'; - } - } - - $data->assign( - array( - 'rooms_info' => $rm_info, - 'check_calendar_var' => 1, - 'date_from' => $date_from, - 'date_to' => $date_to, - 'booking_data' => $booking_data, - 'booking_calendar_data' => $booking_calendar_data, - 'htl_config' => 1, - 'check_css_condition_var' => $check_css_condition_var, - ) - ); - } else { - $this->displayWarning($this->l('First you have to fill Room configuration.')); - } - } else { - $this->displayWarning($this->l('You must save the room type in this shop before managing hotel configuration.')); - } - } else { - $this->displayWarning($this->l('You must save this room type to see the booking information.')); - } - $this->tpl_form_vars['custom_form'] = $data->fetch(); - } - - public function processBooking() - { - if (Tools::isSubmit('submitAddproductAndStay')) { - $checkTabClick = Tools::getValue('checkTabClick'); - $date_from = Tools::getValue('from_date'); - $date_to = Tools::getValue('to_date'); - $num_rooms = Tools::getValue('num_rooms'); - $id_product = Tools::getValue('id_product'); - - $link = new Link(); - if ($checkTabClick) { - Tools::redirectAdmin($link->getAdminLink('AdminProducts').'&id_product='.$id_product.'&updateproduct&key_tab=Booking&date_from='.$date_from.'&date_to='.$date_to); - } - } - } - - public function ajaxProcessProductRoomsBookingDetailsOnMonthChange() - { - $month = Tools::getValue('month'); - $year = Tools::getValue('year'); - $query_date = $year.'-'.$month.'-04'; - $start_date = date('Y-m-01', strtotime($query_date)); // hard-coded '01' for first day - $last_day_this_month = date('Y-m-t', strtotime($query_date)); - $hotel_id = Tools::getValue('id_hotel'); - $room_type = Tools::getValue('id_product'); - $adult = Tools::getValue('num_adults'); - $children = Tools::getValue('num_children'); - $num_rooms = 1; - - $obj_booking_dtl = new HotelBookingDetail(); - $bookingParams = array(); - $bookingParams['hotel_id'] = $hotel_id; - $bookingParams['room_type'] = $room_type; - $bookingParams['adult'] = $adult; - $bookingParams['children'] = $children; - $bookingParams['num_rooms'] = $num_rooms; - $bookingParams['for_calendar'] = 1; - while ($start_date <= $last_day_this_month) { - $cal_date_from = $start_date; - $cal_date_to = date('Y-m-d', strtotime($cal_date_from) + 86400); - - $bookingParams['date_from'] = $cal_date_from; - $bookingParams['date_to'] = $cal_date_to; - $booking_calendar_data[$cal_date_from] = $obj_booking_dtl->getBookingData($bookingParams); - $start_date = date('Y-m-d', strtotime($start_date) + 86400); - } - - if ($booking_calendar_data) { - die(json_encode($booking_calendar_data)); - } else { - die(0); - } - } - /** * @param Product $obj * diff --git a/css/ps-hotel-reservation.css b/css/ps-hotel-reservation.css deleted file mode 100644 index a9f66fe5d..000000000 --- a/css/ps-hotel-reservation.css +++ /dev/null @@ -1,266 +0,0 @@ -/* ---- AdminProducts (Booking) by webkul---- */ - -.margin-leftrgt-0 -{ - margin-left: 0px !important; - margin-right: 0px !important; -} - -.no_border -{ - border: none !important; -} -.hr_style -{ - border-color: #c7d6db !important; - margin: 10px 0 !important; -} - -.padding-top-btm-30 -{ - padding-bottom: 30px; - padding-top: 30px; -} - -.bg-green -{ - background-color: #7EC77B; -} - -.bg-yellow -{ - background-color: #DCC635; -} - -.bg-red -{ - background-color: #CD5D5D; -} - -.bg-gray -{ - background-color: #C2C2C2; -} - -.htl_date_header -{ - background-color: #2EACCE; - color: #FFFFFF; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - padding-bottom: 15px; - padding-top: 15px; - margin-bottom: -2px; -} - -.htl_date_disp -{ - font-size: 105px; - color: #FFFFFF; - font-weight: 300; - font-family: inherit; - margin-bottom: 0px !important; - line-height: 100px; -} - -.htl_month_disp -{ - font-size: 18px; - color: #FFFFFF; - font-weight: 400; - font-family: inherit; - margin-left: 7px !important; -} - -.hotel_date .ui-datepicker -{ - border: 1px solid #c7d6db; - border-top-left-radius: 0; - border-top-right-radius: 0; - width: 100%; -} - -.hotel_date .ui-datepicker-header -{ - border: medium none; -} - -.hotel_date .ui-datepicker-next:hover, .hotel_date .ui-datepicker-next:focus, .hotel_date .ui-datepicker-next:active, .hotel_date .ui-datepicker-prev:hover, .hotel_date .ui-datepicker-prev:focus, .hotel_date .ui-datepicker-prev:active -{ - outline: none; -} - -.hotel_date .ui-datepicker-prev span -{ - background-position: -97px 0; -} - -.hotel_date .ui-datepicker-next span -{ - background-position: -33px 0; -} - -.htl_room_data_cont -{ - border: 1px solid #C7D6DB; - border-radius: 4px; - padding: 15px !important; -} - -.htl_room_cat_data -{ - border-right: 1px solid #C7D6DB; - text-align: center; - padding-bottom: 30px; - padding-top: 30px; -} - -.room_cat_header -{ - font-size: 15px; - color: #252525; - font-weight: 400; - text-transform: capitalize; -} - -.room_cat_data -{ - line-height: 85px; - font-size: 105px; - color: #252525; - font-weight: 300; -} - -.color_indicate -{ - width: 40px; - height: 40px; - border-radius: 50%; - float: left; -} - -.indi_label -{ - color: #252525; - display: block !important; - font-size: 14px; - font-weight: 400; - margin-left: 3px; - text-transform: capitalize; - transform: translate(4px, 6px) !important; -} - -.indi_cont -{ - margin: 20px 0px; -} -/* ---- AdminProducts (Booking) ---- */ - -/*booking Information*/ - -.hotel_date .margin-leftrgt-0 -{ - margin-left: 0px !important; - margin-right: 0px !important; -} - -.hotel_date .no_border -{ - border: none !important; -} -.hotel_date .ui-datepicker -{ - border: 1px solid #c7d6db; - border-top-left-radius: 0; - border-top-right-radius: 0; - width: 100%; -} - -/*.hotel_date .ui-state-active -{ - border-radius: 50%; -}*/ - -.hotel_date .ui-datepicker td -{ - padding: 14px!important; -} - -.hotel_date .ui-state-default -{ - border: none!important; - text-align: center!important; - padding: 10px!important; -} - -.hotel_date .ui-datepicker-header -{ - border: medium none; -} - -.hotel_date .ui-datepicker-next:hover, .hotel_date .ui-datepicker-next:focus, .hotel_date .ui-datepicker-next:active, .hotel_date .ui-datepicker-prev:hover, .hotel_date .ui-datepicker-prev:focus, .hotel_date .ui-datepicker-prev:active -{ - outline: none; -} - -.ui-datepicker-prev span -{ - background-position: -97px 0; -} - -.ui-datepicker-next span -{ - background-position: -33px 0; -} - -.default_available .ui-state-default -{ - background-color: #7ec77b!important; - color: #ffffff; - border-radius: 50%; -} - -.default_part_available .ui-state-default -{ - background-color: #dcc635!important; - border-radius: 50%; - color: #ffffff; -} - -.default_unavailable .ui-state-default -{ - background-color: #cd5d5d!important; - color: #ffffff; - border-radius: 50%; -} - -.ui-datepicker-today -{ - background-color:#008abd; -} - -.available .ui-state-default -{ - background-color: #7ec77b !important; - border-radius: 50%; - color: #ffffff; -} - -.part_available .ui-state-default -{ - background-color: #dcc635!important; - border-radius: 50%; - color: #ffffff; -} - -.unavailable .ui-state-default -{ - background-color: #cd5d5d !important; - border-radius: 50%; - color: #ffffff; -} - -/* ----- For Advanced Payment in price.tpl of AdminProductController.php ----- */ - - -/* ----- For Advanced Payment in price.tpl of AdminProductController.php ----- */ \ No newline at end of file