diff --git a/application/config/routes.php b/application/config/routes.php index 0ba6dc84..0cb3875a 100755 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -51,7 +51,7 @@ require_once __DIR__ . '/../helpers/routes_helper.php'; -$route['default_controller'] = 'booking'; +$route['default_controller'] = 'home'; $route['404_override'] = ''; diff --git a/application/controllers/Home.php b/application/controllers/Home.php new file mode 100755 index 00000000..b2961de9 --- /dev/null +++ b/application/controllers/Home.php @@ -0,0 +1,55 @@ + setting('future_booking_limit'), + 'default_language' => setting('default_language'), + ]); + + html_vars([ + 'theme' => $theme, + 'company_name' => $company_name, + 'company_logo' => $company_logo, + 'company_color' => $company_color === '#ffffff' ? '' : $company_color, + 'display_login_button' => $display_login_button, + 'google_analytics_code' => $google_analytics_code, + 'matomo_analytics_url' => $matomo_analytics_url, + 'matomo_analytics_site_id' => $matomo_analytics_site_id, + ]); + + $this->load->view('pages/home'); + } + +} diff --git a/application/controllers/Home_contact.php b/application/controllers/Home_contact.php new file mode 100755 index 00000000..8e73f52e --- /dev/null +++ b/application/controllers/Home_contact.php @@ -0,0 +1,55 @@ + setting('future_booking_limit'), + 'default_language' => setting('default_language'), + ]); + + html_vars([ + 'theme' => $theme, + 'company_name' => $company_name, + 'company_logo' => $company_logo, + 'company_color' => $company_color === '#ffffff' ? '' : $company_color, + 'display_login_button' => $display_login_button, + 'google_analytics_code' => $google_analytics_code, + 'matomo_analytics_url' => $matomo_analytics_url, + 'matomo_analytics_site_id' => $matomo_analytics_site_id, + ]); + + $this->load->view('pages/home_contact'); + } + +} diff --git a/application/controllers/Home_price.php b/application/controllers/Home_price.php new file mode 100755 index 00000000..97294b77 --- /dev/null +++ b/application/controllers/Home_price.php @@ -0,0 +1,55 @@ + setting('future_booking_limit'), + 'default_language' => setting('default_language'), + ]); + + html_vars([ + 'theme' => $theme, + 'company_name' => $company_name, + 'company_logo' => $company_logo, + 'company_color' => $company_color === '#ffffff' ? '' : $company_color, + 'display_login_button' => $display_login_button, + 'google_analytics_code' => $google_analytics_code, + 'matomo_analytics_url' => $matomo_analytics_url, + 'matomo_analytics_site_id' => $matomo_analytics_site_id, + ]); + + $this->load->view('pages/home_price'); + } + +} diff --git a/application/controllers/Home_search.php b/application/controllers/Home_search.php new file mode 100755 index 00000000..64fc12c3 --- /dev/null +++ b/application/controllers/Home_search.php @@ -0,0 +1,55 @@ + setting('future_booking_limit'), + 'default_language' => setting('default_language'), + ]); + + html_vars([ + 'theme' => $theme, + 'company_name' => $company_name, + 'company_logo' => $company_logo, + 'company_color' => $company_color === '#ffffff' ? '' : $company_color, + 'display_login_button' => $display_login_button, + 'google_analytics_code' => $google_analytics_code, + 'matomo_analytics_url' => $matomo_analytics_url, + 'matomo_analytics_site_id' => $matomo_analytics_site_id, + ]); + + $this->load->view('pages/home_search'); + } + +} diff --git a/application/language/Chinese(Simplified)/translations_lang.php b/application/language/Chinese(Simplified)/translations_lang.php index cdd4442c..13a42187 100755 --- a/application/language/Chinese(Simplified)/translations_lang.php +++ b/application/language/Chinese(Simplified)/translations_lang.php @@ -483,4 +483,12 @@ $lang['fields'] = '字段'; $lang['invalid_credentials_provided'] = '提供的凭证无效,请重试。'; $lang['calendar_url'] = '日历 URL'; $lang['please_select'] = '请选择'; + +//2024-08-07 +$lang['home_appointment_button'] = '马上预约'; +$lang['home_search_button'] = '预约查询'; +$lang['home_price_button'] = '价格表'; +$lang['home_contact_button'] = '联系我们'; +$lang['please_select_service'] = '请选择(必选)'; + // End diff --git a/application/language/Chinese(Traditional)/translations_lang.php b/application/language/Chinese(Traditional)/translations_lang.php index f149b068..90ffe992 100755 --- a/application/language/Chinese(Traditional)/translations_lang.php +++ b/application/language/Chinese(Traditional)/translations_lang.php @@ -483,4 +483,11 @@ $lang['fields'] = '字段'; $lang['invalid_credentials_provided'] = '提供的憑證無效,請重試。 '; $lang['calendar_url'] = '日曆 URL'; $lang['please_select'] = '請選擇'; + +//2024-08-07 +$lang['home_appointment_button'] = '馬上預約'; +$lang['home_search_button'] = '預約查詢'; +$lang['home_price_button'] = '價格表'; +$lang['home_contact_button'] = '聯絡我們'; +$lang['please_select_service'] = '請選擇(必填)'; // End diff --git a/application/language/English/translations_lang.php b/application/language/English/translations_lang.php index a12624d6..94e30bc4 100755 --- a/application/language/English/translations_lang.php +++ b/application/language/English/translations_lang.php @@ -483,4 +483,11 @@ $lang['fields'] = 'Fields'; $lang['invalid_credentials_provided'] = 'Invalid credentials provided, please try again.'; $lang['calendar_url'] = 'Calendar URL'; $lang['please_select'] = 'Please Select'; + +//2024-08-07 +$lang['home_appointment_button'] = 'Book Now'; +$lang['home_search_button'] = 'Enquiry'; +$lang['home_price_button'] = 'Price List'; +$lang['home_contact_button'] = 'Contact Us'; +$lang['please_select_service'] = 'Please Select(*)'; // End diff --git a/application/views/components/booking_header.php b/application/views/components/booking_header.php index e0501295..8f576461 100755 --- a/application/views/components/booking_header.php +++ b/application/views/components/booking_header.php @@ -8,7 +8,10 @@ diff --git a/application/views/components/home_contact_header.php b/application/views/components/home_contact_header.php new file mode 100755 index 00000000..2e1b8b44 --- /dev/null +++ b/application/views/components/home_contact_header.php @@ -0,0 +1,28 @@ + + + + diff --git a/application/views/components/home_header.php b/application/views/components/home_header.php new file mode 100755 index 00000000..7f342701 --- /dev/null +++ b/application/views/components/home_header.php @@ -0,0 +1,27 @@ + + + diff --git a/application/views/components/home_price_header.php b/application/views/components/home_price_header.php new file mode 100755 index 00000000..7f342701 --- /dev/null +++ b/application/views/components/home_price_header.php @@ -0,0 +1,27 @@ + + + diff --git a/application/views/components/home_search_header.php b/application/views/components/home_search_header.php new file mode 100755 index 00000000..2e1b8b44 --- /dev/null +++ b/application/views/components/home_search_header.php @@ -0,0 +1,28 @@ + + + + diff --git a/application/views/layouts/home_contact_layout.php b/application/views/layouts/home_contact_layout.php new file mode 100755 index 00000000..d18a9be0 --- /dev/null +++ b/application/views/layouts/home_contact_layout.php @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + <?= lang('page_title') . ' ' . vars('company_name') ?> | TFE Group + + + + + + + + + + + + vars('company_color')]); ?> + + + + + + + +
+
+
+ vars('company_name'), + 'company_logo' => vars('company_logo'), + ]); ?> + +
+

盈啟中醫

+

地址: 荃灣荃豐中心商場1樓B83號鋪 (荃灣站B2出口, 天橋層)

+

電話: 5592-4328

+

+ WhatsApp QR Code +

+
+ + vars('display_login_button')]); ?> +
+
+
+ + + vars('cookie_notice_content')]); ?> + + + + vars('terms_and_conditions_content'), + ]); ?> + + + + vars('privacy_policy_content')]); ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + vars('google_analytics_code')]); ?> + vars('matomo_analytics_url'), + 'matomo_analytics_site_id' => vars('matomo_analytics_site_id'), +]); ?> + + + + + \ No newline at end of file diff --git a/application/views/layouts/home_layout.php b/application/views/layouts/home_layout.php new file mode 100755 index 00000000..cfaa1d47 --- /dev/null +++ b/application/views/layouts/home_layout.php @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + <?= lang('page_title') . ' ' . vars('company_name') ?> | TFE Group + + + + + + + + + + + + vars('company_color')]); ?> + + + + + + + +
+
+
+ vars('company_name'), + 'company_logo' => vars('company_logo'), + ]); ?> + + + + vars('display_login_button')]); ?> +
+
+
+ + + vars('cookie_notice_content')]); ?> + + + + vars('terms_and_conditions_content'), + ]); ?> + + + + vars('privacy_policy_content')]); ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + vars('google_analytics_code')]); ?> + vars('matomo_analytics_url'), + 'matomo_analytics_site_id' => vars('matomo_analytics_site_id'), +]); ?> + + + + + \ No newline at end of file diff --git a/application/views/layouts/home_price_layout.php b/application/views/layouts/home_price_layout.php new file mode 100755 index 00000000..2165f9d4 --- /dev/null +++ b/application/views/layouts/home_price_layout.php @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + <?= lang('page_title') . ' ' . vars('company_name') ?> | TFE Group + + + + + + + + + + + + vars('company_color')]); ?> + + + + + + + +
+
+
+ vars('company_name'), + 'company_logo' => vars('company_logo'), + ]); ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
藥物治療
診金$100
中藥濃縮顆粒$100/天
手法治療
針灸 (多+1個部位/專科針灸*)$360 (+$130/項)
*專科針灸:腫瘤科、分解黏連針法、火針丶溫針灸丶皮針、刺血療法
手法治療$130
肌筋膜療法手法 (多+1個部位)$360 (+$180)
運動拔罐 (多+1個部位)$360 (+$180)
正骨整脊 (多+1個部位)$360 (+$180)
專業推拿* (60分鐘)$420
*經註冊中醫師診斷後由專業推拿師執行, 其後以30分鐘計算
外敷治療
藥灸$100
跌打$360/部位
耳穴療法$120
其他治療
美顏針灸$680/項
減肥腹針$680/項
+ + vars('display_login_button')]); ?> +
+
+
+ + + vars('cookie_notice_content')]); ?> + + + + vars('terms_and_conditions_content'), + ]); ?> + + + + vars('privacy_policy_content')]); ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + vars('google_analytics_code')]); ?> + vars('matomo_analytics_url'), + 'matomo_analytics_site_id' => vars('matomo_analytics_site_id'), +]); ?> + + + + + \ No newline at end of file diff --git a/application/views/layouts/home_search_layout.php b/application/views/layouts/home_search_layout.php new file mode 100755 index 00000000..4015bedf --- /dev/null +++ b/application/views/layouts/home_search_layout.php @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + <?= lang('page_title') . ' ' . vars('company_name') ?> | TFE Group + + + + + + + + + + + + vars('company_color')]); ?> + + + + + + + +
+
+
+ vars('company_name'), + 'company_logo' => vars('company_logo'), + ]); ?> + +
+ 搜索结果为空! +
+ + vars('display_login_button')]); ?> +
+
+
+ + + vars('cookie_notice_content')]); ?> + + + + vars('terms_and_conditions_content'), + ]); ?> + + + + vars('privacy_policy_content')]); ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + vars('google_analytics_code')]); ?> + vars('matomo_analytics_url'), + 'matomo_analytics_site_id' => vars('matomo_analytics_site_id'), +]); ?> + + + + + \ No newline at end of file diff --git a/application/views/pages/home.php b/application/views/pages/home.php new file mode 100755 index 00000000..3b52a771 --- /dev/null +++ b/application/views/pages/home.php @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/application/views/pages/home_contact.php b/application/views/pages/home_contact.php new file mode 100755 index 00000000..c1ab3e95 --- /dev/null +++ b/application/views/pages/home_contact.php @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/application/views/pages/home_price.php b/application/views/pages/home_price.php new file mode 100755 index 00000000..d40ae9ef --- /dev/null +++ b/application/views/pages/home_price.php @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/application/views/pages/home_search.php b/application/views/pages/home_search.php new file mode 100755 index 00000000..eff3aa8c --- /dev/null +++ b/application/views/pages/home_search.php @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/assets/img/whatsapp-qr-code.png b/assets/img/whatsapp-qr-code.png new file mode 100644 index 00000000..ed3ac7e0 Binary files /dev/null and b/assets/img/whatsapp-qr-code.png differ diff --git a/assets/js/pages/booking.js b/assets/js/pages/booking.js index 998a66c4..ad72970b 100755 --- a/assets/js/pages/booking.js +++ b/assets/js/pages/booking.js @@ -358,7 +358,7 @@ App.Pages.Booking = (function () { $selectProvider.empty(); - $selectProvider.append(new Option(lang('please_select'), '')); + $selectProvider.append(new Option(lang('please_select_service'), '')); const isChinese = (text) => /[\u4e00-\u9fa5]/.test(text); diff --git a/assets/js/pages/booking.min.js b/assets/js/pages/booking.min.js index d721ed07..a7e19d56 100755 --- a/assets/js/pages/booking.min.js +++ b/assets/js/pages/booking.min.js @@ -1 +1 @@ -"use strict";App.Pages.Booking=function(){function detectDatepickerMonthChangeStep(previousDateTimeMoment,nextDateTimeMoment){return previousDateTimeMoment.isAfter(nextDateTimeMoment)?-1:1}function prefillFromQueryParam(field,param){var $target=$(field);$target.length&&$target.val(App.Utils.Url.queryParam(param))}function optimizeContactInfoDisplay(){var $firstCol=$("#wizard-frame-3 .field-col:first"),$firstColControls=$firstCol.find(".form-control"),$secondCol=$("#wizard-frame-3 .field-col:last"),$secondColControls=$secondCol.find(".form-control");1===$firstColControls.length&&1<$secondColControls.length&&$firstColControls.each(function(index,controlEl){$(controlEl).parent().insertBefore($secondColControls.first().parent())}),1===$secondColControls.length&&1<$firstColControls.length&&$secondColControls.each(function(index,controlEl){$(controlEl).parent().insertAfter($firstColControls.last().parent())});var $fieldCols=$(document).find("#wizard-frame-3 .field-col");$fieldCols.each(function(index,fieldColEl){var $fieldCol=$(fieldColEl);$fieldCol.find(".form-control").length||$fieldCol.hide()})}function addEventListeners(){$selectTimezone.on("change",function(){var date=App.Utils.UI.getDateTimePickerValue($selectDate);date&&(App.Http.Booking.getAvailableHours(moment(date).format("YYYY-MM-DD")),App.Pages.Booking.updateConfirmFrame())}),$selectProvider.on("change",function(event){var $target=$(event.target),todayDateTimeObject=new Date,todayDateTimeMoment=moment(todayDateTimeObject);App.Utils.UI.setDateTimePickerValue($selectDate,todayDateTimeObject),App.Http.Booking.getUnavailableDates($target.val(),$selectService.val(),todayDateTimeMoment.format("YYYY-MM-DD")),App.Pages.Booking.updateConfirmFrame()}),$selectService.on("change",function(event){var $target=$(event.target),serviceId=$selectService.val();$selectProvider.empty(),$selectProvider.append(new Option(lang("please_select"),"")),vars("available_providers").forEach(function(provider){var canServeService=0",{id:"select-hour-prompt",class:"text-danger mb-4",text:lang("appointment_hour_missing")}).prependTo("#available-hours"));if("3"===$target.attr("data-step_index")){if(!App.Pages.Booking.validateCustomerForm())return;App.Pages.Booking.updateConfirmFrame()}var nextTabIndex=parseInt($target.attr("data-step_index"))+1;$target.parents().eq(1).fadeOut(function(){$(".active-step").removeClass("active-step"),$("#step-"+nextTabIndex).addClass("active-step"),$("#wizard-frame-"+nextTabIndex).fadeIn()});var scrollingElement=document.scrollingElement||document.body;window.innerHeight",{class:"form-control",id:"cancellation-reason",rows:"3",css:{width:"100%"}}).appendTo("#message-modal .modal-body"),!1}),$deletePersonalInformation.on("click",function(){var buttons=[{text:lang("cancel"),click:function click(event,messageModal){messageModal.hide()}},{text:lang("delete"),click:function click(){App.Http.Booking.deletePersonalInformation(vars("customer_token"))}}];App.Utils.Message.show(lang("delete_personal_information"),lang("delete_personal_information_prompt"),buttons)})),$bookAppointmentSubmit.on("click",function(){var $acceptToTermsAndConditions=$("#accept-to-terms-and-conditions");if($acceptToTermsAndConditions.removeClass("is-invalid"),$acceptToTermsAndConditions.length&&!$acceptToTermsAndConditions.prop("checked"))return void $acceptToTermsAndConditions.addClass("is-invalid");var $acceptToPrivacyPolicy=$("#accept-to-privacy-policy");return $acceptToPrivacyPolicy.removeClass("is-invalid"),$acceptToPrivacyPolicy.length&&!$acceptToPrivacyPolicy.prop("checked")?void $acceptToPrivacyPolicy.addClass("is-invalid"):void App.Http.Booking.registerAppointment()}),$captchaTitle.on("click","button",function(){$(".captcha-image").attr("src",App.Utils.Url.siteUrl("captcha?"+Date.now()))}),$selectDate.on("mousedown",".ui-datepicker-calendar td",function(){setTimeout(function(){App.Http.Booking.applyPreviousUnavailableDates()},300)})}function updateConfirmFrame(){var serviceOptionText=$selectService.find("option:selected").text();$(".display-selected-service").text(serviceOptionText).removeClass("invisible");var providerOptionText=$selectProvider.find("option:selected").text();if($(".display-selected-provider").text(providerOptionText).removeClass("invisible"),!!$availableHours.find(".selected-hour").text()){var serviceId=$selectService.val(),service=vars("available_services").find(function(availableService){return+availableService.id===+serviceId});if(service){var formattedSelectedDate,selectedDateObject=App.Utils.UI.getDateTimePickerValue($selectDate),selectedDateMoment=moment(selectedDateObject),selectedDate=selectedDateMoment.format("YYYY-MM-DD"),selectedTime=$availableHours.find(".selected-hour").text(),selectedDateTime="".concat(selectedDate," ").concat(selectedTime);selectedDateObject&&(formattedSelectedDate=App.Utils.Date.format(selectedDateTime,vars("date_format"),vars("time_format"),!0));var timezoneOptionText=$selectTimezone.find("option:selected").text();$("#appointment-details").html("\n
\n
\n ".concat(serviceOptionText,"\n
\n
\n ").concat(providerOptionText,"\n
\n
\n \n ").concat(formattedSelectedDate,"\n
\n
\n \n ").concat(service.duration," ").concat(lang("minutes"),"\n
\n
\n \n ").concat(timezoneOptionText,"\n
\n
\n \n ").concat((+service.price).toFixed(2)," ").concat(service.currency,"\n
\n
\n "));var firstName=App.Utils.String.escapeHtml($firstName.val()),lastName=App.Utils.String.escapeHtml($lastName.val()),fullName="".concat(firstName," ").concat(lastName).trim(),email=App.Utils.String.escapeHtml($email.val()),phoneNumber=App.Utils.String.escapeHtml($phoneNumber.val()),address=App.Utils.String.escapeHtml($address.val()),city=App.Utils.String.escapeHtml($city.val()),zipCode=App.Utils.String.escapeHtml($zipCode.val()),addressParts=[];city&&addressParts.push(city),zipCode&&addressParts.push(zipCode),$("#customer-details").html("\n
\n
\n ".concat(lang("contact_info"),"\n
\n
\n ").concat(fullName,"\n
\n
\n ").concat(email,"\n
\n
\n ").concat(phoneNumber,"\n
\n
\n ").concat(address,"\n
\n
\n ").concat(addressParts.join(", "),"\n
\n
\n "));var data={};data.customer={last_name:$lastName.val(),first_name:$firstName.val(),email:$email.val(),phone_number:$phoneNumber.val(),address:$address.val(),city:$city.val(),zip_code:$zipCode.val(),timezone:$selectTimezone.val(),custom_field_1:$customField1.val(),custom_field_2:$customField2.val(),custom_field_3:$customField3.val(),custom_field_4:$customField4.val(),custom_field_5:$customField5.val()},data.appointment={start_datetime:moment(App.Utils.UI.getDateTimePickerValue($selectDate)).format("YYYY-MM-DD")+" "+moment($(".selected-hour").data("value"),"HH:mm").format("HH:mm")+":00",end_datetime:calculateEndDatetime(),notes:$notes.val(),is_unavailability:!1,id_users_provider:$selectProvider.val(),id_services:$selectService.val()},data.manage_mode=+manageMode,manageMode&&(data.appointment.id=vars("appointment_data").id,data.customer.id=vars("customer_data").id),$("input[name=\"post_data\"]").val(JSON.stringify(data))}}}function calculateEndDatetime(){var endMoment,serviceId=$selectService.val(),service=vars("available_services").find(function(availableService){return+availableService.id===+serviceId}),selectedDate=moment(App.Utils.UI.getDateTimePickerValue($selectDate)).format("YYYY-MM-DD"),selectedHour=$(".selected-hour").data("value"),startMoment=moment(selectedDate+" "+selectedHour);return endMoment=service.duration&&startMoment?startMoment.clone().add({minutes:parseInt(service.duration)}):moment(),endMoment.format("YYYY-MM-DD HH:mm:ss")}function applyAppointmentData(appointment,provider,customer){try{$selectService.val(appointment.id_services).trigger("change"),$selectProvider.val(appointment.id_users_provider);var startMoment=moment(appointment.start_datetime);App.Utils.UI.setDateTimePickerValue($selectDate,startMoment.toDate()),App.Http.Booking.getAvailableHours(startMoment.format("YYYY-MM-DD")),$lastName.val(customer.last_name),$firstName.val(customer.first_name),$email.val(customer.email),$phoneNumber.val(customer.phone_number),$address.val(customer.address),$city.val(customer.city),$zipCode.val(customer.zip_code),customer.timezone&&$selectTimezone.val(customer.timezone);var appointmentNotes=null===appointment.notes?"":appointment.notes;return $notes.val(appointmentNotes),$customField1.val(customer.custom_field_1),$customField2.val(customer.custom_field_2),$customField3.val(customer.custom_field_3),$customField4.val(customer.custom_field_4),$customField5.val(customer.custom_field_5),App.Pages.Booking.updateConfirmFrame(),!0}catch(exc){return!1}}var $selectDate=$("#select-date"),$selectService=$("#select-service"),$selectProvider=$("#select-provider"),$selectTimezone=$("#select-timezone"),$firstName=$("#first-name"),$lastName=$("#last-name"),$email=$("#email"),$phoneNumber=$("#phone-number"),$address=$("#address"),$city=$("#city"),$zipCode=$("#zip-code"),$notes=$("#notes"),$captchaTitle=$(".captcha-title"),$availableHours=$("#available-hours"),$bookAppointmentSubmit=$("#book-appointment-submit"),$deletePersonalInformation=$("#delete-personal-information"),$customField1=$("#custom-field-1"),$customField2=$("#custom-field-2"),$customField3=$("#custom-field-3"),$customField4=$("#custom-field-4"),$customField5=$("#custom-field-5"),tippy=window.tippy,moment=window.moment,manageMode=vars("manage_mode")||!1;return document.addEventListener("DOMContentLoaded",function initialize(){var _window;if(!!+vars("display_cookie_notice")&&null!==(_window=window)&&void 0!==_window&&_window.cookieconsent){cookieconsent.initialise({palette:{popup:{background:"#ffffffbd",text:"#666666"},button:{background:"#429a82",text:"#ffffff"}},content:{message:lang("website_using_cookies_to_ensure_best_experience"),dismiss:"OK"}});var $cookieNoticeLink=$(".cc-link");$cookieNoticeLink.replaceWith($("",{"data-bs-toggle":"modal","data-bs-target":"#cookie-notice-modal",href:"#",class:"cc-link",text:$cookieNoticeLink.text()}))}manageMode=vars("manage_mode"),tippy("[data-tippy-content]");var monthTimeout;App.Utils.UI.initializeDatePicker($selectDate,{inline:!0,minDate:moment().subtract(1,"day").set({hours:23,minutes:59,seconds:59}).toDate(),maxDate:moment().add(vars("future_booking_limit"),"days").toDate(),onChange:function onChange(selectedDates){App.Http.Booking.getAvailableHours(moment(selectedDates[0]).format("YYYY-MM-DD")),App.Pages.Booking.updateConfirmFrame()},onMonthChange:function onMonthChange(selectedDates,dateStr,instance){$selectDate.parent().fadeTo(400,.3),monthTimeout&&clearTimeout(monthTimeout),monthTimeout=setTimeout(function(){var previousMoment=moment(instance.selectedDates[0]),displayedMonthMoment=moment(instance.currentYearElement.value+"-"+(+instance.monthsDropdownContainer.value+1+"").padStart(2,"0")+"-01"),monthChangeStep=detectDatepickerMonthChangeStep(previousMoment,displayedMonthMoment);App.Http.Booking.getUnavailableDates($selectProvider.val(),$selectService.val(),displayedMonthMoment.format("YYYY-MM-DD"),monthChangeStep)},500)},onYearChange:function onYearChange(selectedDates,dateStr,instance){setTimeout(function(){var previousMoment=moment(instance.selectedDates[0]),displayedMonthMoment=moment(instance.currentYearElement.value+"-"+(+instance.monthsDropdownContainer.value+1)+"-01"),monthChangeStep=detectDatepickerMonthChangeStep(previousMoment,displayedMonthMoment);App.Http.Booking.getUnavailableDates($selectProvider.val(),$selectService.val(),displayedMonthMoment.format("YYYY-MM-DD"),monthChangeStep)},500)}}),App.Utils.UI.setDateTimePickerValue($selectDate,new Date);var browserTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone,isTimezoneSupported=0<$selectTimezone.find("option[value=\"".concat(browserTimezone,"\"]")).length;if($selectTimezone.val(isTimezoneSupported?browserTimezone:"UTC"),addEventListeners(),optimizeContactInfoDisplay(),manageMode)applyAppointmentData(vars("appointment_data"),vars("provider_data"),vars("customer_data")),$("#wizard-frame-1").css({visibility:"visible",display:"none"}).fadeIn();else{var selectedServiceId=App.Utils.Url.queryParam("service");selectedServiceId&&0<$selectService.find("option[value=\""+selectedServiceId+"\"]").length&&$selectService.val(selectedServiceId),$selectService.trigger("change");var selectedProviderId=App.Utils.Url.queryParam("provider");if(selectedProviderId&&0===$selectProvider.find("option[value=\""+selectedProviderId+"\"]").length)for(var index in vars("available_providers")){var provider=vars("available_providers")[index];provider.id===selectedProviderId&&0\n ".concat(additionalInfoParts.join(", "),"\n \n ")).appendTo($serviceDescription),null!==(_service$description=service.description)&&void 0!==_service$description&&_service$description.length){var escapedDescription=App.Utils.String.escapeHtml(service.description),multiLineDescription=escapedDescription.replaceAll("\n","
");$("\n
\n ".concat(multiLineDescription,"\n
\n ")).appendTo($serviceDescription)}}},validateCustomerForm:function validateCustomerForm(){$("#wizard-frame-3 .is-invalid").removeClass("is-invalid"),$("#wizard-frame-3 label.text-danger").removeClass("text-danger");var missingRequiredField=!1;if($(".required").each(function(index,requiredField){$(requiredField).val()||($(requiredField).addClass("is-invalid"),missingRequiredField=!0)}),missingRequiredField)return $("#form-message").text(lang("fields_are_required")),!1;if($email.val()&&!App.Utils.Validation.email($email.val()))return $email.addClass("is-invalid"),$("#form-message").text(lang("invalid_email")),!1;var phoneNumber=$phoneNumber.val();return!phoneNumber||App.Utils.Validation.phone(phoneNumber)||($phoneNumber.addClass("is-invalid"),$("#form-message").text(lang("invalid_phone")),!1)}}}(); \ No newline at end of file +"use strict";App.Pages.Booking=function(){function detectDatepickerMonthChangeStep(previousDateTimeMoment,nextDateTimeMoment){return previousDateTimeMoment.isAfter(nextDateTimeMoment)?-1:1}function prefillFromQueryParam(field,param){var $target=$(field);$target.length&&$target.val(App.Utils.Url.queryParam(param))}function optimizeContactInfoDisplay(){var $firstCol=$("#wizard-frame-3 .field-col:first"),$firstColControls=$firstCol.find(".form-control"),$secondCol=$("#wizard-frame-3 .field-col:last"),$secondColControls=$secondCol.find(".form-control");1===$firstColControls.length&&1<$secondColControls.length&&$firstColControls.each(function(index,controlEl){$(controlEl).parent().insertBefore($secondColControls.first().parent())}),1===$secondColControls.length&&1<$firstColControls.length&&$secondColControls.each(function(index,controlEl){$(controlEl).parent().insertAfter($firstColControls.last().parent())});var $fieldCols=$(document).find("#wizard-frame-3 .field-col");$fieldCols.each(function(index,fieldColEl){var $fieldCol=$(fieldColEl);$fieldCol.find(".form-control").length||$fieldCol.hide()})}function addEventListeners(){$selectTimezone.on("change",function(){var date=App.Utils.UI.getDateTimePickerValue($selectDate);date&&(App.Http.Booking.getAvailableHours(moment(date).format("YYYY-MM-DD")),App.Pages.Booking.updateConfirmFrame())}),$selectProvider.on("change",function(event){var $target=$(event.target),todayDateTimeObject=new Date,todayDateTimeMoment=moment(todayDateTimeObject);App.Utils.UI.setDateTimePickerValue($selectDate,todayDateTimeObject),App.Http.Booking.getUnavailableDates($target.val(),$selectService.val(),todayDateTimeMoment.format("YYYY-MM-DD")),App.Pages.Booking.updateConfirmFrame()}),$selectService.on("change",function(event){var $target=$(event.target),serviceId=$selectService.val();$selectProvider.empty(),$selectProvider.append(new Option(lang("please_select_service"),"")),vars("available_providers").forEach(function(provider){var canServeService=0",{id:"select-hour-prompt",class:"text-danger mb-4",text:lang("appointment_hour_missing")}).prependTo("#available-hours"));if("3"===$target.attr("data-step_index")){if(!App.Pages.Booking.validateCustomerForm())return;App.Pages.Booking.updateConfirmFrame()}var nextTabIndex=parseInt($target.attr("data-step_index"))+1;$target.parents().eq(1).fadeOut(function(){$(".active-step").removeClass("active-step"),$("#step-"+nextTabIndex).addClass("active-step"),$("#wizard-frame-"+nextTabIndex).fadeIn()});var scrollingElement=document.scrollingElement||document.body;window.innerHeight",{class:"form-control",id:"cancellation-reason",rows:"3",css:{width:"100%"}}).appendTo("#message-modal .modal-body"),!1}),$deletePersonalInformation.on("click",function(){var buttons=[{text:lang("cancel"),click:function click(event,messageModal){messageModal.hide()}},{text:lang("delete"),click:function click(){App.Http.Booking.deletePersonalInformation(vars("customer_token"))}}];App.Utils.Message.show(lang("delete_personal_information"),lang("delete_personal_information_prompt"),buttons)})),$bookAppointmentSubmit.on("click",function(){var $acceptToTermsAndConditions=$("#accept-to-terms-and-conditions");if($acceptToTermsAndConditions.removeClass("is-invalid"),$acceptToTermsAndConditions.length&&!$acceptToTermsAndConditions.prop("checked"))return void $acceptToTermsAndConditions.addClass("is-invalid");var $acceptToPrivacyPolicy=$("#accept-to-privacy-policy");return $acceptToPrivacyPolicy.removeClass("is-invalid"),$acceptToPrivacyPolicy.length&&!$acceptToPrivacyPolicy.prop("checked")?void $acceptToPrivacyPolicy.addClass("is-invalid"):void App.Http.Booking.registerAppointment()}),$captchaTitle.on("click","button",function(){$(".captcha-image").attr("src",App.Utils.Url.siteUrl("captcha?"+Date.now()))}),$selectDate.on("mousedown",".ui-datepicker-calendar td",function(){setTimeout(function(){App.Http.Booking.applyPreviousUnavailableDates()},300)})}function updateConfirmFrame(){var serviceOptionText=$selectService.find("option:selected").text();$(".display-selected-service").text(serviceOptionText).removeClass("invisible");var providerOptionText=$selectProvider.find("option:selected").text();if($(".display-selected-provider").text(providerOptionText).removeClass("invisible"),!!$availableHours.find(".selected-hour").text()){var serviceId=$selectService.val(),service=vars("available_services").find(function(availableService){return+availableService.id===+serviceId});if(service){var formattedSelectedDate,selectedDateObject=App.Utils.UI.getDateTimePickerValue($selectDate),selectedDateMoment=moment(selectedDateObject),selectedDate=selectedDateMoment.format("YYYY-MM-DD"),selectedTime=$availableHours.find(".selected-hour").text(),selectedDateTime="".concat(selectedDate," ").concat(selectedTime);selectedDateObject&&(formattedSelectedDate=App.Utils.Date.format(selectedDateTime,vars("date_format"),vars("time_format"),!0));var timezoneOptionText=$selectTimezone.find("option:selected").text();$("#appointment-details").html("\n
\n
\n ".concat(serviceOptionText,"\n
\n
\n ").concat(providerOptionText,"\n
\n
\n \n ").concat(formattedSelectedDate,"\n
\n
\n \n ").concat(service.duration," ").concat(lang("minutes"),"\n
\n
\n \n ").concat(timezoneOptionText,"\n
\n
\n \n ").concat((+service.price).toFixed(2)," ").concat(service.currency,"\n
\n
\n "));var firstName=App.Utils.String.escapeHtml($firstName.val()),lastName=App.Utils.String.escapeHtml($lastName.val()),fullName="".concat(firstName," ").concat(lastName).trim(),email=App.Utils.String.escapeHtml($email.val()),phoneNumber=App.Utils.String.escapeHtml($phoneNumber.val()),address=App.Utils.String.escapeHtml($address.val()),city=App.Utils.String.escapeHtml($city.val()),zipCode=App.Utils.String.escapeHtml($zipCode.val()),addressParts=[];city&&addressParts.push(city),zipCode&&addressParts.push(zipCode),$("#customer-details").html("\n
\n
\n ".concat(lang("contact_info"),"\n
\n
\n ").concat(fullName,"\n
\n
\n ").concat(email,"\n
\n
\n ").concat(phoneNumber,"\n
\n
\n ").concat(address,"\n
\n
\n ").concat(addressParts.join(", "),"\n
\n
\n "));var data={};data.customer={last_name:$lastName.val(),first_name:$firstName.val(),email:$email.val(),phone_number:$phoneNumber.val(),address:$address.val(),city:$city.val(),zip_code:$zipCode.val(),timezone:$selectTimezone.val(),custom_field_1:$customField1.val(),custom_field_2:$customField2.val(),custom_field_3:$customField3.val(),custom_field_4:$customField4.val(),custom_field_5:$customField5.val()},data.appointment={start_datetime:moment(App.Utils.UI.getDateTimePickerValue($selectDate)).format("YYYY-MM-DD")+" "+moment($(".selected-hour").data("value"),"HH:mm").format("HH:mm")+":00",end_datetime:calculateEndDatetime(),notes:$notes.val(),is_unavailability:!1,id_users_provider:$selectProvider.val(),id_services:$selectService.val()},data.manage_mode=+manageMode,manageMode&&(data.appointment.id=vars("appointment_data").id,data.customer.id=vars("customer_data").id),$("input[name=\"post_data\"]").val(JSON.stringify(data))}}}function calculateEndDatetime(){var endMoment,serviceId=$selectService.val(),service=vars("available_services").find(function(availableService){return+availableService.id===+serviceId}),selectedDate=moment(App.Utils.UI.getDateTimePickerValue($selectDate)).format("YYYY-MM-DD"),selectedHour=$(".selected-hour").data("value"),startMoment=moment(selectedDate+" "+selectedHour);return endMoment=service.duration&&startMoment?startMoment.clone().add({minutes:parseInt(service.duration)}):moment(),endMoment.format("YYYY-MM-DD HH:mm:ss")}function applyAppointmentData(appointment,provider,customer){try{$selectService.val(appointment.id_services).trigger("change"),$selectProvider.val(appointment.id_users_provider);var startMoment=moment(appointment.start_datetime);App.Utils.UI.setDateTimePickerValue($selectDate,startMoment.toDate()),App.Http.Booking.getAvailableHours(startMoment.format("YYYY-MM-DD")),$lastName.val(customer.last_name),$firstName.val(customer.first_name),$email.val(customer.email),$phoneNumber.val(customer.phone_number),$address.val(customer.address),$city.val(customer.city),$zipCode.val(customer.zip_code),customer.timezone&&$selectTimezone.val(customer.timezone);var appointmentNotes=null===appointment.notes?"":appointment.notes;return $notes.val(appointmentNotes),$customField1.val(customer.custom_field_1),$customField2.val(customer.custom_field_2),$customField3.val(customer.custom_field_3),$customField4.val(customer.custom_field_4),$customField5.val(customer.custom_field_5),App.Pages.Booking.updateConfirmFrame(),!0}catch(exc){return!1}}var $selectDate=$("#select-date"),$selectService=$("#select-service"),$selectProvider=$("#select-provider"),$selectTimezone=$("#select-timezone"),$firstName=$("#first-name"),$lastName=$("#last-name"),$email=$("#email"),$phoneNumber=$("#phone-number"),$address=$("#address"),$city=$("#city"),$zipCode=$("#zip-code"),$notes=$("#notes"),$captchaTitle=$(".captcha-title"),$availableHours=$("#available-hours"),$bookAppointmentSubmit=$("#book-appointment-submit"),$deletePersonalInformation=$("#delete-personal-information"),$customField1=$("#custom-field-1"),$customField2=$("#custom-field-2"),$customField3=$("#custom-field-3"),$customField4=$("#custom-field-4"),$customField5=$("#custom-field-5"),tippy=window.tippy,moment=window.moment,manageMode=vars("manage_mode")||!1;return document.addEventListener("DOMContentLoaded",function initialize(){var _window;if(!!+vars("display_cookie_notice")&&null!==(_window=window)&&void 0!==_window&&_window.cookieconsent){cookieconsent.initialise({palette:{popup:{background:"#ffffffbd",text:"#666666"},button:{background:"#429a82",text:"#ffffff"}},content:{message:lang("website_using_cookies_to_ensure_best_experience"),dismiss:"OK"}});var $cookieNoticeLink=$(".cc-link");$cookieNoticeLink.replaceWith($("
",{"data-bs-toggle":"modal","data-bs-target":"#cookie-notice-modal",href:"#",class:"cc-link",text:$cookieNoticeLink.text()}))}manageMode=vars("manage_mode"),tippy("[data-tippy-content]");var monthTimeout;App.Utils.UI.initializeDatePicker($selectDate,{inline:!0,minDate:moment().subtract(1,"day").set({hours:23,minutes:59,seconds:59}).toDate(),maxDate:moment().add(vars("future_booking_limit"),"days").toDate(),onChange:function onChange(selectedDates){App.Http.Booking.getAvailableHours(moment(selectedDates[0]).format("YYYY-MM-DD")),App.Pages.Booking.updateConfirmFrame()},onMonthChange:function onMonthChange(selectedDates,dateStr,instance){$selectDate.parent().fadeTo(400,.3),monthTimeout&&clearTimeout(monthTimeout),monthTimeout=setTimeout(function(){var previousMoment=moment(instance.selectedDates[0]),displayedMonthMoment=moment(instance.currentYearElement.value+"-"+(+instance.monthsDropdownContainer.value+1+"").padStart(2,"0")+"-01"),monthChangeStep=detectDatepickerMonthChangeStep(previousMoment,displayedMonthMoment);App.Http.Booking.getUnavailableDates($selectProvider.val(),$selectService.val(),displayedMonthMoment.format("YYYY-MM-DD"),monthChangeStep)},500)},onYearChange:function onYearChange(selectedDates,dateStr,instance){setTimeout(function(){var previousMoment=moment(instance.selectedDates[0]),displayedMonthMoment=moment(instance.currentYearElement.value+"-"+(+instance.monthsDropdownContainer.value+1)+"-01"),monthChangeStep=detectDatepickerMonthChangeStep(previousMoment,displayedMonthMoment);App.Http.Booking.getUnavailableDates($selectProvider.val(),$selectService.val(),displayedMonthMoment.format("YYYY-MM-DD"),monthChangeStep)},500)}}),App.Utils.UI.setDateTimePickerValue($selectDate,new Date);var browserTimezone=Intl.DateTimeFormat().resolvedOptions().timeZone,isTimezoneSupported=0<$selectTimezone.find("option[value=\"".concat(browserTimezone,"\"]")).length;if($selectTimezone.val(isTimezoneSupported?browserTimezone:"UTC"),addEventListeners(),optimizeContactInfoDisplay(),manageMode)applyAppointmentData(vars("appointment_data"),vars("provider_data"),vars("customer_data")),$("#wizard-frame-1").css({visibility:"visible",display:"none"}).fadeIn();else{var selectedServiceId=App.Utils.Url.queryParam("service");selectedServiceId&&0<$selectService.find("option[value=\""+selectedServiceId+"\"]").length&&$selectService.val(selectedServiceId),$selectService.trigger("change");var selectedProviderId=App.Utils.Url.queryParam("provider");if(selectedProviderId&&0===$selectProvider.find("option[value=\""+selectedProviderId+"\"]").length)for(var index in vars("available_providers")){var provider=vars("available_providers")[index];provider.id===selectedProviderId&&0\n ".concat(additionalInfoParts.join(", "),"\n \n ")).appendTo($serviceDescription),null!==(_service$description=service.description)&&void 0!==_service$description&&_service$description.length){var escapedDescription=App.Utils.String.escapeHtml(service.description),multiLineDescription=escapedDescription.replaceAll("\n","
");$("\n
\n ".concat(multiLineDescription,"\n
\n ")).appendTo($serviceDescription)}}},validateCustomerForm:function validateCustomerForm(){$("#wizard-frame-3 .is-invalid").removeClass("is-invalid"),$("#wizard-frame-3 label.text-danger").removeClass("text-danger");var missingRequiredField=!1;if($(".required").each(function(index,requiredField){$(requiredField).val()||($(requiredField).addClass("is-invalid"),missingRequiredField=!0)}),missingRequiredField)return $("#form-message").text(lang("fields_are_required")),!1;if($email.val()&&!App.Utils.Validation.email($email.val()))return $email.addClass("is-invalid"),$("#form-message").text(lang("invalid_email")),!1;var phoneNumber=$phoneNumber.val();return!phoneNumber||App.Utils.Validation.phone(phoneNumber)||($phoneNumber.addClass("is-invalid"),$("#form-message").text(lang("invalid_phone")),!1)}}}(); \ No newline at end of file