CodeIgniter 3 app for dinbestehjelper.no. Excludes vendor/, local backup folders (new/, archive/, archived/) and DB dumps (*.sql) via .gitignore. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P16ttGUge8zj91dm6WrmEb
1458 lines
79 KiB
PHP
1458 lines
79 KiB
PHP
<style>
|
|
.page{
|
|
text-align: center;
|
|
}
|
|
|
|
.rd-navbar-classic.rd-navbar-static .rd-navbar-aside-outer, .rd-navbar-classic.rd-navbar-static .rd-navbar-main-outer {
|
|
background-color: #151517;
|
|
}
|
|
|
|
.bookingContainer{
|
|
background: rgba(0, 0, 0, 0.05);
|
|
}
|
|
|
|
.bookingButtonContainer {
|
|
position: relative;
|
|
}
|
|
|
|
.serviceTable {
|
|
margin-bottom: 45px;
|
|
}
|
|
|
|
.bookingButton {
|
|
right: 35px;
|
|
width: 90px;
|
|
}
|
|
|
|
.bookingResultsWrapper {
|
|
float: none;
|
|
width: 375px;
|
|
display: inline-block;
|
|
vertical-align: top;
|
|
}
|
|
|
|
.bookingCalendar {
|
|
float: none;
|
|
display: inline-block;
|
|
margin-bottom: 40px;
|
|
vertical-align: top;
|
|
}
|
|
|
|
.bookingSubmit{
|
|
right: 35px;
|
|
width: 90px;
|
|
}
|
|
|
|
|
|
|
|
.bookingName, .bookingEmail, .bookingPhone {
|
|
min-width: 250px;
|
|
width: 250px!important;
|
|
}
|
|
|
|
#totalPanel {
|
|
background-color: #e2e1e1;
|
|
border-top-left-radius: 10px;
|
|
border-bottom-left-radius: 10px;
|
|
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1);
|
|
border: 1px solid gray;
|
|
}
|
|
|
|
#totalPanelBtn {
|
|
background-color: gray;
|
|
}
|
|
|
|
</style>
|
|
<div class="bookingContainer">
|
|
<div class="bookingTitle">Bestillingsprosess</div>
|
|
<ul class="steps-indicator steps-3">
|
|
<li>
|
|
<div class="stepTitleContainer">
|
|
<div class="stepLine"></div>
|
|
<div class="stepCircle activeStep" id="stepCircle1"></div>
|
|
<div class="stepTitle">STEG 1</div>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<div class="stepTitleContainer">
|
|
<div class="stepLine"></div>
|
|
<div class="stepCircle" id="stepCircle2"></div>
|
|
<div class="stepTitle">STEG 2</div>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<div class="stepTitleContainer">
|
|
<div class="stepCircle" id="stepCircle3"></div>
|
|
<div class="stepTitle">STEG 3</div>
|
|
</div>
|
|
<li>
|
|
</ul>
|
|
<div class="totalPanelContainer">
|
|
<div id="totalPanel">
|
|
<div class="serviceBookingDateContainer">
|
|
<div id="serviceBookingDate"></div>
|
|
<div id="serviceBookingTime"></div>
|
|
</div>
|
|
<div class="serviceBookingWorkerContainer">
|
|
</div>
|
|
<div class="serviceContent">
|
|
</div>
|
|
<div class="totalSelectedTime"></div>
|
|
<div class="totalPrice"></div>
|
|
</div>
|
|
<div id="totalPanelBtnContainer">
|
|
<div id="totalPanelBtn"><i class="fas fa-caret-right"></i></div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<form method="post" action="<?php echo SITEURL;?>booking-process">
|
|
<div class="BookingStepContainer" id="bookingStep1">
|
|
<div class="bookingStartTitle">Klikk på en av hovedkategoriene.</div>
|
|
<div class="serviceIconsContainer">
|
|
<div class="serviceBtn" id="cleaningService"></div>
|
|
<div class="serviceBtn" id="carService"></div>
|
|
<div class="serviceBtn" id="helphandService"></div>
|
|
<div class="serviceBtn" id="gardenService"></div>
|
|
<div class="serviceBtn" id="houseService"></div>
|
|
<div class="serviceBtn" id="buildService"></div>
|
|
</div>
|
|
<div class="totalTime"><input type="time" id="servicelength" name="servicelength" value="00:00"></div>
|
|
<input type="hidden" id="totalPrice" name="totalPrice" value="0">
|
|
|
|
<div class="bookingTable">
|
|
<div class="panel panel-primary">
|
|
<div class="panel-heading">Priser</div>
|
|
<div class="proserSubTitle">NB: Våre priser inkluderer alle kostnader (MVA, utkjøringsgebyr osv.).<br />Betaling er mulig via terminal</div>
|
|
</div>
|
|
</div>
|
|
<div class="ServiceContainers">
|
|
<div class="serviceContainer" id="cleaningServiceContent">
|
|
|
|
<!-- ServiceListBlock -->
|
|
<div class="serviceTable">
|
|
<?php
|
|
$prevousCategory = '';
|
|
$prevousServiceCategory = '';
|
|
|
|
if(is_array($cleaningServices)){
|
|
foreach($cleaningServices as $serviceItem){
|
|
if($serviceItem->main_category != $prevousCategory){
|
|
?>
|
|
<div class="serviceRow">
|
|
<div class="serviceCol" style="width: 100%">
|
|
<div class="category-content-title"><h4><?php echo $serviceItem->main_category;?></h4>
|
|
<div class="proserSubTitleDescription"><?php echo $serviceItem->main_category_description;?></div>
|
|
</div>
|
|
<?php
|
|
if($serviceItem->service_category != $prevousServiceCategory){
|
|
?>
|
|
<div class="category-content-subtitle"><p><?php echo $serviceItem->service_category;?></p></div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
}
|
|
else{
|
|
if($serviceItem->service_category != $prevousServiceCategory){
|
|
?>
|
|
<div class="category-content-subtitle"><p><?php echo $serviceItem->service_category;?></p></div>
|
|
<?php
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
<div class="serviceRow">
|
|
<div class="serviceCol serviceNameCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>" id="serviceName_<?php echo $serviceItem->service_id;?>"><?php echo $serviceItem->service_name;?></div>
|
|
<?php
|
|
if($serviceItem->service_price == '0'){
|
|
?>
|
|
<div class="serviceCol serviceCheckCol">
|
|
<?php
|
|
if($serviceItem->is_enabled){
|
|
?>
|
|
<a href="<?php echo $serviceItem->target_url;?>" style="display: inline-block;position: absolute;right: 0px;top: -1px;width: 98px;color:#19AFCA">Be om tilbud</a>
|
|
<?php
|
|
}
|
|
else{
|
|
?>
|
|
<div class="inactiveService" style="display: inline-block;position: absolute;right: 0px;top: -1px;width: 98px;">Be om tilbud</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<?php
|
|
}
|
|
else{
|
|
?>
|
|
<div class="serviceCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>"><input type="time" class="serviceTime" id="time_<?php echo $serviceItem->service_id;?>" value="<?php echo $serviceItem->service_time;?>"/></div>
|
|
<input type="hidden" id="quantity_<?php echo $serviceItem->service_id;?>" name="quantity_<?php echo $serviceItem->service_id;?>" value="1"/>
|
|
<div class="serviceCol servicePriceCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>" id="servicePrice_<?php echo $serviceItem->service_id;?>"><?php echo $serviceItem->service_price;?></div>
|
|
<div class="serviceCol serviceInfoCol">
|
|
<div class="serviceInfoIcon">
|
|
<i class="fas fa-info-circle <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>"></i><div class="serviceInfoLabel"><?php echo $serviceItem->service_description;?></div>
|
|
</div>
|
|
</div>
|
|
<div class="serviceCol serviceCheckCol">
|
|
<input type="hidden" name="service_<?php echo $serviceItem->service_id;?>" value="0"/>
|
|
<input type="checkbox" class="service group_<?php echo $serviceItem->service_group;?> <?php
|
|
echo $serviceItem->is_extra?'extra_'.$serviceItem->service_group:'';
|
|
?> <?php
|
|
echo $serviceItem->is_extra?'extra':'main';
|
|
echo $serviceItem->is_service_available?'':' inactiveInput'
|
|
?>" id="<?php echo $serviceItem->service_id;?>" name="service_<?php echo $serviceItem->service_id;?>" value="1" <?php
|
|
if($serviceItem->is_service_available){
|
|
echo $serviceItem->is_extra ?'disabled':'';
|
|
}
|
|
else{
|
|
echo 'disabled';
|
|
}
|
|
?>/>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<?php
|
|
$prevousCategory = $serviceItem->main_category;
|
|
$prevousServiceCategory = $serviceItem->service_category;
|
|
}
|
|
}
|
|
?>
|
|
</div>
|
|
<!-- End serviceBlock -->
|
|
|
|
</div>
|
|
<div class="serviceContainer" id="carServiceContent">
|
|
|
|
<!-- ServiceListBlock -->
|
|
<div class="serviceTable">
|
|
<?php
|
|
$prevousCategory = '';
|
|
$prevousServiceCategory = '';
|
|
|
|
if(is_array($carServices)){
|
|
foreach($carServices as $serviceItem){
|
|
if($serviceItem->main_category != $prevousCategory){
|
|
?>
|
|
<div class="serviceRow">
|
|
<div class="serviceCol" style="width: 100%">
|
|
<div class="category-content-title"><h4><?php echo $serviceItem->main_category;?></h4>
|
|
<div class="proserSubTitleDescription" style="left:54px;"><?php echo $serviceItem->main_category_description;?></div>
|
|
</div>
|
|
<?php
|
|
if($serviceItem->service_category != $prevousServiceCategory){
|
|
?>
|
|
<div class="category-content-subtitle"><p><?php echo $serviceItem->service_category;?></p></div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
}
|
|
else{
|
|
if($serviceItem->service_category != $prevousServiceCategory){
|
|
?>
|
|
<div class="category-content-subtitle"><p><?php echo $serviceItem->service_category;?></p></div>
|
|
<?php
|
|
}
|
|
|
|
}
|
|
?>
|
|
<div class="serviceRow">
|
|
<div class="serviceCol serviceNameCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>" id="serviceName_<?php echo $serviceItem->service_id;?>"><?php echo $serviceItem->service_name;?></div>
|
|
<?php
|
|
if($serviceItem->service_price == '0'){
|
|
?>
|
|
<div class="serviceCol serviceCheckCol" style="position:relative;right:-108px;">
|
|
<?php
|
|
if($serviceItem->is_enabled){
|
|
?>
|
|
<a href="<?php echo $serviceItem->target_url;?>" style="display: inline-block;position: absolute;right: 0px;top: -1px;width: 98px;color:#19AFCA">Be om tilbud</a>
|
|
<?php
|
|
}
|
|
else{
|
|
?>
|
|
<div class="inactiveService" style="display: inline-block;position: absolute;right: 0px;top: -1px;width: 98px;">Be om tilbud</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<?php
|
|
}
|
|
else{
|
|
?>
|
|
<div class="serviceCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>"><input type="time" class="serviceTime" id="time_<?php echo $serviceItem->service_id;?>" value="<?php echo $serviceItem->service_time;?>"/></div>
|
|
<input type="hidden" id="quantity_<?php echo $serviceItem->service_id;?>" name="quantity_<?php echo $serviceItem->service_id;?>" value="1"/>
|
|
<div class="serviceCol servicePriceCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>" id="servicePrice_<?php echo $serviceItem->service_id;?>"><?php echo $serviceItem->service_price;?></div>
|
|
<div class="serviceCol serviceInfoCol">
|
|
<div class="serviceInfoIcon">
|
|
<i class="fas fa-info-circle <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>"></i><div class="serviceInfoLabel"><?php echo $serviceItem->service_description;?></div>
|
|
</div>
|
|
</div>
|
|
<div class="serviceCol serviceCheckCol">
|
|
<input type="hidden" name="service_<?php echo $serviceItem->service_id;?>" value="0"/>
|
|
<input type="checkbox" class="service group_<?php echo $serviceItem->service_group;?> <?php
|
|
echo $serviceItem->is_extra?'extra_'.$serviceItem->service_group:'';
|
|
?> <?php
|
|
echo $serviceItem->is_extra?'extra':'main';
|
|
echo $serviceItem->is_service_available?'':' inactiveInput';
|
|
echo $serviceItem->is_car?' car':'';
|
|
?>" id="<?php echo $serviceItem->service_id;?>" name="service_<?php echo $serviceItem->service_id;?>" value="1" <?php
|
|
if($serviceItem->is_service_available){
|
|
echo $serviceItem->is_extra ?'disabled':'';
|
|
}
|
|
else{
|
|
echo 'disabled';
|
|
}
|
|
?>/>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<?php
|
|
$prevousCategory = $serviceItem->main_category;
|
|
$prevousServiceCategory = $serviceItem->service_category;
|
|
}
|
|
}
|
|
?>
|
|
</div>
|
|
<!-- End serviceBlock -->
|
|
</div>
|
|
<div class="serviceContainer" id="helphandServiceContent">
|
|
<!-- ServiceListBlock -->
|
|
<div class="serviceTable">
|
|
<?php
|
|
$prevousCategory = '';
|
|
$prevousServiceCategory = '';
|
|
|
|
if(is_array($helphandServices)){
|
|
foreach($helphandServices as $serviceItem){
|
|
if($serviceItem->main_category != $prevousCategory){
|
|
?>
|
|
<div class="caption">
|
|
<div class="category-content-title"><h4><?php echo $serviceItem->main_category;?></h4>
|
|
<div class="proserSubTitleDescription"><?php echo $serviceItem->main_category_description;?></div>
|
|
</div>
|
|
<?php
|
|
if($serviceItem->service_category != $prevousServiceCategory){
|
|
?>
|
|
<div class="category-content-subtitle"><p><?php echo $serviceItem->service_category;?></p></div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<div class="tgroup">
|
|
<?php
|
|
}
|
|
else{
|
|
if($serviceItem->service_category != $prevousServiceCategory){
|
|
?>
|
|
<div class="category-content-subtitle"><p><?php echo $serviceItem->service_category;?></p></div>
|
|
<?php
|
|
}
|
|
|
|
}
|
|
?>
|
|
<div class="serviceRow">
|
|
<div class="serviceCol serviceNameCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>" id="serviceName_<?php echo $serviceItem->service_id;?>"><?php echo $serviceItem->service_name;?></div>
|
|
<?php
|
|
if($serviceItem->service_price == '0'){
|
|
?>
|
|
<div class="serviceCol serviceCheckCol">
|
|
<?php
|
|
if($serviceItem->is_enabled){
|
|
?>
|
|
<a href="<?php echo $serviceItem->target_url;?>" style="display: inline-block;position: absolute;right: 0px;top: -1px;width: 98px;color:#19AFCA">Be om tilbud</a>
|
|
<?php
|
|
}
|
|
else{
|
|
?>
|
|
<div class="inactiveService" style="display: inline-block;position: absolute;right: 0px;top: -1px;width: 98px;">Be om tilbud</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
|
|
<?php
|
|
}
|
|
else{
|
|
?>
|
|
<div class="serviceCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>"><input type="time" class="serviceTime" id="time_<?php echo $serviceItem->service_id;?>" value="<?php echo $serviceItem->service_time;?>"/></div>
|
|
<div class="serviceCol serviceQuantityCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>" id="serviceQuantity_<?php echo $serviceItem->service_id;?>">
|
|
<select class="quantity <?php echo $serviceItem->is_service_available?'':' inactiveInput';?>" id="quantity_<?php echo $serviceItem->service_id;?>" name="quantity_<?php echo $serviceItem->service_id;?>" style="margin-right:5px;">
|
|
<option value="1">1</option>
|
|
<option value="2">2</option>
|
|
<option value="3">3</option>
|
|
<option value="4">4</option>
|
|
<option value="5">5</option>
|
|
<option value="6">6</option>
|
|
<option value="7">7</option>
|
|
<option value="8">8</option>
|
|
<option value="9">9</option>
|
|
</select>
|
|
</div>
|
|
<div class="serviceCol servicePriceCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>" id="servicePrice_<?php echo $serviceItem->service_id;?>"><?php echo $serviceItem->service_price;?></div>
|
|
<div class="serviceCol serviceInfoCol">
|
|
<div class="serviceInfoIcon">
|
|
<i class="fas fa-info-circle <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>"></i><div class="serviceInfoLabel"><?php echo $serviceItem->service_description;?></div>
|
|
</div>
|
|
</div>
|
|
<div class="serviceCol serviceCheckCol">
|
|
<input type="hidden" name="service_<?php echo $serviceItem->service_id;?>" value="0"/>
|
|
<input type="checkbox" class="service group_<?php echo $serviceItem->service_group;?> <?php
|
|
echo $serviceItem->is_extra?'extra_'.$serviceItem->service_group:'';
|
|
?> <?php
|
|
echo $serviceItem->is_extra?'extra':'main';
|
|
echo $serviceItem->is_service_available?'':' inactiveInput';
|
|
?>" id="<?php echo $serviceItem->service_id;?>" name="service_<?php echo $serviceItem->service_id;?>" value="1" <?php
|
|
if($serviceItem->is_service_available){
|
|
echo $serviceItem->is_extra ?'disabled':'';
|
|
}
|
|
else{
|
|
echo 'disabled';
|
|
}
|
|
?>/>
|
|
</div>
|
|
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
$prevousCategory = $serviceItem->main_category;
|
|
$prevousServiceCategory = $serviceItem->service_category;
|
|
}
|
|
}
|
|
?>
|
|
|
|
</div>
|
|
<!-- End serviceBlock -->
|
|
</div>
|
|
<div class="serviceContainer" id="gardenServiceContent">
|
|
<!-- ServiceListBlock -->
|
|
<div class="serviceTable">
|
|
<?php
|
|
$prevousCategory = '';
|
|
$prevousServiceCategory = '';
|
|
|
|
if(is_array($gardenServices)){
|
|
foreach($gardenServices as $serviceItem){
|
|
if($serviceItem->main_category != $prevousCategory){
|
|
?>
|
|
<div class="caption">
|
|
<div class="category-content-title"><h4><?php echo $serviceItem->main_category;?></h4>
|
|
<div class="proserSubTitleDescription"><?php echo $serviceItem->main_category_description;?></div>
|
|
</div>
|
|
<?php
|
|
if($serviceItem->service_category != $prevousServiceCategory){
|
|
?>
|
|
<div class="category-content-subtitle"><p><?php echo $serviceItem->service_category;?></p></div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<div class="tgroup">
|
|
<?php
|
|
}
|
|
else{
|
|
if($serviceItem->service_category != $prevousServiceCategory){
|
|
?>
|
|
<div class="category-content-subtitle"><p><?php echo $serviceItem->service_category;?></p></div>
|
|
<?php
|
|
}
|
|
|
|
}
|
|
?>
|
|
<div class="serviceRow">
|
|
<div class="serviceCol serviceNameCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>" id="serviceName_<?php echo $serviceItem->service_id;?>"><?php echo $serviceItem->service_name;?></div>
|
|
<?php
|
|
if($serviceItem->service_price == '0'){
|
|
?>
|
|
<div class="serviceCol serviceCheckCol">
|
|
<?php
|
|
if($serviceItem->is_enabled){
|
|
?>
|
|
<a href="<?php echo $serviceItem->target_url;?>" style="display: inline-block;position: absolute;right: 0px;top: -1px;width: 98px;color:#19AFCA">Be om tilbud</a>
|
|
<?php
|
|
}
|
|
else{
|
|
?>
|
|
<div class="inactiveService" style="display: inline-block;position: absolute;right: 0px;top: -1px;width: 98px;">Be om tilbud</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<?php
|
|
}
|
|
else{
|
|
?>
|
|
<div class="serviceCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>"><input type="time" class="serviceTime" id="time_<?php echo $serviceItem->service_id;?>" value="<?php echo $serviceItem->service_time;?>"/></div>
|
|
<div class="serviceCol serviceQuantityCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>" id="serviceQuantity_<?php echo $serviceItem->service_id;?>">
|
|
<select class="quantity <?php echo $serviceItem->is_service_available?'':' inactiveInput';?>" id="quantity_<?php echo $serviceItem->service_id;?>" name="quantity_<?php echo $serviceItem->service_id;?>" style="margin-right:5px;">
|
|
<option value="1">1</option>
|
|
<option value="2">2</option>
|
|
<option value="3">3</option>
|
|
<option value="4">4</option>
|
|
<option value="5">5</option>
|
|
<option value="6">6</option>
|
|
<option value="7">7</option>
|
|
<option value="8">8</option>
|
|
<option value="9">9</option>
|
|
</select>
|
|
</div>
|
|
<div class="serviceCol servicePriceCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>" id="servicePrice_<?php echo $serviceItem->service_id;?>"><?php echo $serviceItem->service_price;?></div>
|
|
<div class="serviceCol serviceInfoCol">
|
|
<div class="serviceInfoIcon">
|
|
<i class="fas fa-info-circle <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>"></i><div class="serviceInfoLabel"><?php echo $serviceItem->service_description;?></div>
|
|
</div>
|
|
</div>
|
|
<div class="serviceCol serviceCheckCol">
|
|
<input type="hidden" name="service_<?php echo $serviceItem->service_id;?>" value="0"/>
|
|
<input type="checkbox" class="service group_<?php echo $serviceItem->service_group;?> <?php
|
|
echo $serviceItem->is_extra?'extra_'.$serviceItem->service_group:'';
|
|
?> <?php
|
|
echo $serviceItem->is_extra?'extra':'main';
|
|
echo $serviceItem->is_service_available?'':' inactiveInput';
|
|
?>" id="<?php echo $serviceItem->service_id;?>" name="service_<?php echo $serviceItem->service_id;?>" value="1" <?php
|
|
if($serviceItem->is_service_available){
|
|
echo $serviceItem->is_extra ?'disabled':'';
|
|
}
|
|
else{
|
|
echo 'disabled';
|
|
}
|
|
?>/>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
|
|
</div>
|
|
</div>
|
|
<?php
|
|
$prevousCategory = $serviceItem->main_category;
|
|
$prevousServiceCategory = $serviceItem->service_category;
|
|
}
|
|
}
|
|
?>
|
|
|
|
</div>
|
|
<!-- End serviceBlock -->
|
|
</div>
|
|
<div class="serviceContainer" id="houseServiceContent">
|
|
<!-- ServiceListBlock -->
|
|
<div class="serviceTable">
|
|
<?php
|
|
$prevousCategory = '';
|
|
$prevousServiceCategory = '';
|
|
|
|
if(is_array($houseServices)){
|
|
foreach($houseServices as $serviceItem){
|
|
if($serviceItem->main_category != $prevousCategory){
|
|
?>
|
|
<div class="caption">
|
|
<div class="category-content-title"><h4><?php echo $serviceItem->main_category;?></h4>
|
|
<div class="proserSubTitleDescription"><?php echo $serviceItem->main_category_description;?></div>
|
|
</div>
|
|
<?php
|
|
if($serviceItem->service_category != $prevousServiceCategory){
|
|
?>
|
|
<div class="category-content-subtitle"><p><?php echo $serviceItem->service_category;?></p></div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<div class="tgroup">
|
|
<?php
|
|
}
|
|
else{
|
|
if($serviceItem->service_category != $prevousServiceCategory){
|
|
?>
|
|
<div class="category-content-subtitle"><p><?php echo $serviceItem->service_category;?></p></div>
|
|
<?php
|
|
}
|
|
|
|
}
|
|
?>
|
|
</div>
|
|
|
|
<div class="serviceRow">
|
|
<div class="serviceCol serviceNameCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>" id="serviceName_<?php echo $serviceItem->service_id;?>"><?php echo $serviceItem->service_name;?></div>
|
|
<?php
|
|
if($serviceItem->service_price == '0'){
|
|
?>
|
|
<div class="serviceCol serviceCheckCol" style="padding-right: 100px;">
|
|
<?php
|
|
if($serviceItem->is_enabled){
|
|
?>
|
|
<a href="<?php echo $serviceItem->target_url;?>" style="display: inline-block;position: absolute;right: 0px;top: -1px;width: 98px;color:#19AFCA">Be om tilbud</a>
|
|
<?php
|
|
}
|
|
else{
|
|
?>
|
|
<div class="inactiveService" style="display: inline-block;position: absolute;right: 0px;top: -1px;width: 98px;">Be om tilbud</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<?php
|
|
}
|
|
else{
|
|
?>
|
|
<div class="serviceCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>"><input type="time" class="serviceTime" id="time_<?php echo $serviceItem->service_id;?>" value="<?php echo $serviceItem->service_time;?>"/></div>
|
|
<div class="serviceCol serviceQuantityCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>" id="serviceQuantity_<?php echo $serviceItem->service_id;?>">
|
|
<select class="quantity <?php echo $serviceItem->is_service_available?'':' inactiveInput';?>" id="quantity_<?php echo $serviceItem->service_id;?>" name="quantity_<?php echo $serviceItem->service_id;?>" style="margin-right:5px;" <?php echo $serviceItem->is_service_available?'':'disabled';?>>
|
|
<option value="1">1</option>
|
|
<option value="2">2</option>
|
|
<option value="3">3</option>
|
|
<option value="4">4</option>
|
|
<option value="5">5</option>
|
|
<option value="6">6</option>
|
|
<option value="7">7</option>
|
|
<option value="8">8</option>
|
|
<option value="9">9</option>
|
|
</select>
|
|
</div>
|
|
<div class="serviceCol servicePriceCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>" id="servicePrice_<?php echo $serviceItem->service_id;?>"><?php echo $serviceItem->service_price;?></div>
|
|
<div class="serviceCol serviceInfoCol">
|
|
<div class="serviceInfoIcon">
|
|
<i class="fas fa-info-circle <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>"></i><div class="serviceInfoLabel"><?php echo $serviceItem->service_description;?></div>
|
|
</div>
|
|
</div>
|
|
<div class="serviceCol serviceCheckCol">
|
|
<input type="hidden" name="service_<?php echo $serviceItem->service_id;?>" value="0"/>
|
|
<input type="checkbox" class="service group_<?php echo $serviceItem->service_group;?> <?php
|
|
echo $serviceItem->is_extra?'extra_'.$serviceItem->service_group:'';
|
|
?> <?php
|
|
echo $serviceItem->is_extra?'extra':'main';
|
|
echo $serviceItem->is_service_available?'':' inactiveInput';
|
|
?>" id="<?php echo $serviceItem->service_id;?>" name="service_<?php echo $serviceItem->service_id;?>" value="1" <?php
|
|
if($serviceItem->is_service_available){
|
|
echo $serviceItem->is_extra ?'disabled':'';
|
|
}
|
|
else{
|
|
echo 'disabled';
|
|
}
|
|
?>/>
|
|
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
$prevousCategory = $serviceItem->main_category;
|
|
$prevousServiceCategory = $serviceItem->service_category;
|
|
}
|
|
}
|
|
?>
|
|
|
|
</div>
|
|
<!-- End serviceBlock -->
|
|
</div>
|
|
<div class="serviceContainer" id="buildServiceContent">
|
|
<!-- ServiceListBlock -->
|
|
<div class="serviceTable">
|
|
<?php
|
|
$prevousCategory = '';
|
|
$prevousServiceCategory = '';
|
|
|
|
if(is_array($buildServices)){
|
|
foreach($buildServices as $serviceItem){
|
|
if($serviceItem->main_category != $prevousCategory){
|
|
?>
|
|
<div class="caption">
|
|
<div class="category-content-title"><h4><?php echo $serviceItem->main_category;?></h4>
|
|
<div class="proserSubTitleDescription"><?php echo $serviceItem->main_category_description;?></div>
|
|
</div>
|
|
<?php
|
|
if($serviceItem->service_category != $prevousServiceCategory){
|
|
?>
|
|
<div class="category-content-subtitle"><p><?php echo $serviceItem->service_category;?></p></div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<div class="tgroup">
|
|
<?php
|
|
}
|
|
else{
|
|
if($serviceItem->service_category != $prevousServiceCategory){
|
|
?>
|
|
<div class="category-content-subtitle"><p><?php echo $serviceItem->service_category;?></p></div>
|
|
<?php
|
|
}
|
|
|
|
}
|
|
?>
|
|
<div class="serviceRow">
|
|
<div class="serviceCol serviceNameCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>" id="serviceName_<?php echo $serviceItem->service_id;?>"><?php echo $serviceItem->service_name;?></div>
|
|
<?php
|
|
if($serviceItem->service_price == '0'){
|
|
?>
|
|
<div class="serviceCol serviceCheckCol" style="padding-right: 100px;">
|
|
<?php
|
|
if($serviceItem->is_service_available){
|
|
?>
|
|
<a href="<?php echo SITEURL.$serviceItem->target_url;?>" style="display: inline-block;position: absolute;right: 0px;top: -1px;width: 98px;color:#19AFCA">Be om tilbud</a>
|
|
<?php
|
|
}
|
|
else{
|
|
?>
|
|
<div class="inactiveService" style="display: inline-block;position: absolute;right: 0px;top: -1px;width: 98px;">Be om tilbud</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<?php
|
|
}
|
|
else{
|
|
?>
|
|
<div class="serviceCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>"><input type="time" class="serviceTime" id="time_<?php echo $serviceItem->service_id;?>" value="<?php echo $serviceItem->service_time;?>"/></div>
|
|
<div class="serviceCol serviceQuantityCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>" id="serviceQuantity_<?php echo $serviceItem->service_id;?>">
|
|
<select class="quantity <?php echo $serviceItem->is_service_available?'':' inactiveInput';?>" id="quantity_<?php echo $serviceItem->service_id;?>" name="quantity_<?php echo $serviceItem->service_id;?>" style="margin-right:5px;">
|
|
<option value="1">1</option>
|
|
<option value="2">2</option>
|
|
<option value="3">3</option>
|
|
<option value="4">4</option>
|
|
<option value="5">5</option>
|
|
<option value="6">6</option>
|
|
<option value="7">7</option>
|
|
<option value="8">8</option>
|
|
<option value="9">9</option>
|
|
</select>
|
|
</div>
|
|
<div class="serviceCol servicePriceCol <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>" id="servicePrice_<?php echo $serviceItem->service_id;?>"><?php echo $serviceItem->service_price;?></div>
|
|
<div class="serviceCol serviceInfoCol">
|
|
<div class="serviceInfoIcon">
|
|
<i class="fas fa-info-circle <?php echo $serviceItem->is_service_available?'activeService':'inactiveService';?>"></i><div class="serviceInfoLabel"><?php echo $serviceItem->service_description;?></div>
|
|
</div>
|
|
</div>
|
|
<div class="serviceCol serviceCheckCol">
|
|
<input type="hidden" name="service_<?php echo $serviceItem->service_id;?>" value="0"/>
|
|
<input type="checkbox" class="service group_<?php echo $serviceItem->service_group;?> <?php
|
|
echo $serviceItem->is_extra?'extra_'.$serviceItem->service_group:'';
|
|
?> <?php
|
|
echo $serviceItem->is_extra?'extra':'main';
|
|
echo $serviceItem->is_service_available?'':' inactive';
|
|
?>" id="<?php echo $serviceItem->service_id;?>" name="service_<?php echo $serviceItem->service_id;?>" value="1"
|
|
<?php
|
|
if($serviceItem->is_service_available){
|
|
echo $serviceItem->is_extra ?'disabled':'';
|
|
}
|
|
else{
|
|
echo 'disabled';
|
|
}
|
|
?>
|
|
/>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
|
|
<?php
|
|
$prevousCategory = $serviceItem->main_category;
|
|
$prevousServiceCategory = $serviceItem->service_category;
|
|
}
|
|
}
|
|
?>
|
|
</div>
|
|
<!-- End serviceBlock -->
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="bookingButtonContainer">
|
|
<input type="button" class="rightButton bookingButton" onclick="goToStep(2);" value="Neste"/>
|
|
</div>
|
|
<input type="hidden" name="group_id" id="group_id" value="">
|
|
</div>
|
|
|
|
<div class="BookingStepContainer" id="bookingStep2">
|
|
<div>
|
|
<div class="bookingCalendar">
|
|
<div id="datepicker"></div>
|
|
</div>
|
|
<div class="bookingResultsWrapper">
|
|
<div class="availableTimesContainerTitle"></div>
|
|
<div class="availableTimesContainer" style="padding:5px;">
|
|
<input type="hidden" name="booking_date" id="booking_date" value="<?php echo date('Y-m-d');?>">
|
|
<input type="hidden" name="booking_start_time" id="booking_time" value="">
|
|
|
|
<div class="availableTimes">
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="bookingButtonContainer">
|
|
<input type="button" class="leftButton bookingButton" onclick="goToStep(1);" value="Tilbake"/>
|
|
<input type="button" class="rightButton bookingButton" id="isTimeSelectedBtn" onclick="goToStep(3);" value="Neste" disabled/>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="BookingStepContainer" id="bookingStep3">
|
|
<div style="padding-bottom: 40px;">
|
|
<div class="formRow">
|
|
<label class="bookingEmailTitle">Navn:</label>
|
|
<input type="text" class="bookingName" name="guest_name" id="guest_name" value="" required>
|
|
</div>
|
|
<div class="formRow">
|
|
<label class="bookingEmailTitle">E-mail:</label>
|
|
<input type="text" class="bookingEmail" name="guest_email" id="guest_email" value="" required>
|
|
</div>
|
|
<div class="formRow">
|
|
<label class="bookingPhoneTitle">Telefon:</label>
|
|
<input type="text" class="bookingPhone" name="guest_phone" id="guest_phone" value="" required>
|
|
</div>
|
|
<div class="formRow">
|
|
<label class="bookingPhoneTitle">Adresse:</label>
|
|
<input type="text" class="bookingPhone" name="guest_addresse" id="guest_addresse" value="" required>
|
|
</div>
|
|
<div class="" id="car_block" style="display:none;">
|
|
<div class="formRow">
|
|
<label class="bookingPhoneTitle">Registreringsnummer:</label>
|
|
<input type="text" class="bookingPhone" name="guest_car_reg_number" id="guest_car_reg_number" value="" required>
|
|
</div>
|
|
<div class="formRow">
|
|
<label class="bookingPhoneTitle">Bilmerke:</label>
|
|
<input type="text" class="bookingPhone" name="guest_car_type" id="guest_car_type" value="" required>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="bookingButtonContainer">
|
|
<input type="button" class="leftButton bookingButton" onclick="goToStep(2);" value="Tilbake"/>
|
|
|
|
<div class="g-recaptcha" data-callback="recaptcha_callback" data-sitekey="6Ld_sS0pAAAAANQrY3ziDGPcsjMOdM9L9WIgAzxd"></div>
|
|
<input type="submit" id="sendBooking" class="rightButton bookingSubmit" for="bookingStepForm" name="sendBooking" value="Sende" disabled/>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit"
|
|
async defer>
|
|
</script>
|
|
|
|
<script>
|
|
$(document).ready(function(){
|
|
|
|
|
|
$('#cleaningService').addClass('activeServiceButton');
|
|
|
|
$('#booking_time').change(function(){
|
|
if($('#booking_time').val() != ''){
|
|
$('#isTimeSelectedBtn').prop('disabled', false);
|
|
}
|
|
});
|
|
|
|
$('.quantity').change(function(){
|
|
var id = $(this).attr('id');
|
|
selectedId = id.split("_");
|
|
$('#servicelength').val('00:00');
|
|
if($('#'+selectedId[1]).is(':checked')){
|
|
|
|
var totalPrice = 0;
|
|
|
|
var selectedServices = '<div class="selectedServiceTable">';
|
|
selectedServices += '<div class="totalServiceRow serviceHeader"><div class="selectedServiceCol totalSelectedServiceName">Service name</div><div class="selectedServiceCol totalSelectedServicePrice">Price</div><div class="selectedServiceCol serviceInfoCol"></div><div class="selectedServiceCol serviceCheckCol"></div></div>';
|
|
$('.service').each(function(i, obj) {
|
|
|
|
if($(this).is(':checked')){
|
|
var selected_id = $(this).attr('id');
|
|
|
|
var selectedTotalTime = $('#servicelength').val();
|
|
selectedPriceElement = document.getElementById('servicePrice_'+selected_id).innerHTML;
|
|
|
|
var tmpQuantity = $('#quantity_'+selected_id).val();
|
|
var lineSubtotal = parseInt(tmpQuantity) * parseInt(selectedPriceElement);
|
|
var linetime = new Date('<?php echo date('Y-m-d');?> ' + $('#time_'+selected_id).val());
|
|
var lineSubtotalHoursInMins = linetime.getHours()*60*+ $('#quantity_'+selected_id).val();
|
|
var lineSubtotalMins = linetime.getMinutes();
|
|
var lineSubtotalTimeInMins = lineSubtotalHoursInMins + lineSubtotalMins;
|
|
|
|
var lineSubtotalHours = Math.floor(lineSubtotalTimeInMins/60);
|
|
var lineSubtotalMins = lineSubtotalTimeInMins-(lineSubtotalHours*60);
|
|
var lineSubtotalString = lineSubtotalHours <=9 ? '0'+lineSubtotalHours:lineSubtotalHours;
|
|
lineSubtotalString = lineSubtotalMins <= 9 ? lineSubtotalString+':0'+lineSubtotalMins:lineSubtotalString+':'+lineSubtotalMins;
|
|
|
|
|
|
totalPrice = totalPrice + parseInt(lineSubtotal);
|
|
|
|
selectedSubServiceDatetime = new Date('<?php echo date('Y-m-d');?> ' + lineSubtotalString);
|
|
|
|
var selectedServiceDatetime = new Date('<?php echo date('Y-m-d');?> ' + selectedSubServiceDatetime);
|
|
var subTotalTimeHours = moment.utc(selectedTotalTime,'HH:mm').add(selectedSubServiceDatetime.getHours(),'hour').format('HH:mm');
|
|
var subTotalTimeMinutes = moment.utc(subTotalTimeHours,'HH:mm').add(selectedSubServiceDatetime.getMinutes(),'minutes').format('HH:mm');
|
|
|
|
selectedNameElement = document.getElementById('serviceName_'+selected_id).innerHTML;
|
|
selectedServices = selectedServices + '<div class="totalServiceRow"><div class="selectedServiceCol totalSelectedServiceName">'+selectedNameElement+'</div><div class="selectedServiceCol totalSelectedServicePrice">' + tmpQuantity + ' x '+selectedPriceElement+' kr</div></div>';
|
|
|
|
$('#servicelength').val(subTotalTimeMinutes);
|
|
}
|
|
|
|
});
|
|
|
|
$('#totalPrice').val(totalPrice);
|
|
$('.serviceContent').html(selectedServices);
|
|
$('.totalPrice').html('<span class="totalTitle">Total:</span> <span>' + totalPrice + '</span><span class="totalTitle"> kr</span>');
|
|
$('.totalSelectedTime').html('<span class="totalTitle">Total time:</span> <span>' + $('#servicelength').val() + '</span>');
|
|
|
|
|
|
|
|
}
|
|
});
|
|
|
|
$('.serviceBtn').click(function(){
|
|
var id = $(this).attr('id');
|
|
$('.serviceBtn').removeClass('activeServiceButton');
|
|
$('.serviceContainer').hide();
|
|
$('#'+id+'Content').show();
|
|
$('#'+id).addClass('activeServiceButton');
|
|
|
|
$('.group_1').attr("disabled", false);
|
|
$('.group_2').attr("disabled", false);
|
|
$('.group_3').attr("disabled", false);
|
|
$('.group_4').attr("disabled", false);
|
|
$('.group_5').attr("disabled", false);
|
|
$('.group_6').attr("disabled", false);
|
|
$('.group_7').attr("disabled", false);
|
|
$('.group_8').attr("disabled", false);
|
|
$('.group_9').attr("disabled", false);
|
|
|
|
$('.group_1').prop('checked', false);
|
|
$('.group_2').prop('checked', false);
|
|
$('.group_3').prop('checked', false);
|
|
$('.group_4').prop('checked', false);
|
|
$('.group_5').prop('checked', false);
|
|
$('.group_6').prop('checked', false);
|
|
$('.group_7').prop('checked', false);
|
|
$('.group_8').prop('checked', false);
|
|
$('.group_9').prop('checked', false);
|
|
$('#servicelength').val('00:00');
|
|
var totalPrice = 0;
|
|
|
|
$('.quantity option[value="1"]').attr("selected",true);
|
|
$('.quantity').val("1");
|
|
var selectedServices = '<div class="selectedServiceTable">';
|
|
selectedServices += '<div class="totalServiceRow serviceHeader"><div class="selectedServiceCol totalSelectedServiceName">Service name</div><div class="selectedServiceCol totalSelectedServicePrice">Price</div><div class="selectedServiceCol serviceInfoCol"></div><div class="selectedServiceCol serviceCheckCol"></div></div>';
|
|
|
|
$('.serviceContent').html(selectedServices);
|
|
$('.totalPrice').html('<span class="totalTitle">Total:</span> <span>' + totalPrice + '</span><span class="totalTitle"> kr</span>');
|
|
$('.totalSelectedTime').html('<span class="totalTitle">Total time:</span> <span>' + $('#servicelength').val() + '</span>');
|
|
$('.extra' ).attr("disabled", true);
|
|
|
|
if(id == 'carService'){
|
|
$('.extra' ).prop("checked", false);
|
|
$('.group_2').attr("disabled", false);
|
|
$('.group_3').attr("disabled", false);
|
|
$('.group_4').attr("disabled", false);
|
|
$('.extra').attr("disabled", true);
|
|
}
|
|
$('.inactiveInput').prop('disabled', true);
|
|
});
|
|
|
|
$('#totalPanelBtn').click(function(){
|
|
if($('#totalPanel').is(':visible')){
|
|
$('#totalPanelBtn').html('<i class="fas fa-caret-left"></i>');
|
|
$('#totalPanel').hide();
|
|
$('#totalPanelBtn').css('border-top-left-radius','5px');
|
|
$('#totalPanelBtn').css('border-bottom-left-radius','5px');
|
|
|
|
}
|
|
else{
|
|
$('#totalPanelBtn').html('<i class="fas fa-caret-right"></i>');
|
|
$('#totalPanel').show();
|
|
$('#totalPanelBtn').css('border-top-left-radius','0px');
|
|
$('#totalPanelBtn').css('border-bottom-left-radius','0px');
|
|
}
|
|
});
|
|
|
|
$('.service').click(function(){
|
|
var id = $(this).attr('id');
|
|
var selected_classes = $(this).attr('class');
|
|
var totalPrice = 0;
|
|
var selectedServices = '<div class="selectedServiceTable">';
|
|
selectedServices += '<div class="totalServiceRow serviceHeader"><div class="selectedServiceCol totalSelectedServiceName">Service name</div><div class="selectedServiceCol totalSelectedServicePrice">Price</div><div class="selectedServiceCol serviceInfoCol"></div><div class="selectedServiceCol serviceCheckCol"></div></div>';
|
|
var classIsChecked = 0;
|
|
|
|
$('#servicelength').val('00:00');
|
|
$('.service').each(function(i, obj) {
|
|
if($(this).is(':checked')){
|
|
classIsChecked = 1;
|
|
var selected_id = $(this).attr('id');
|
|
}
|
|
|
|
});
|
|
|
|
selectedServices +='</div></div></div>';
|
|
var selectedDate = $('#booking_date').val();
|
|
var selectedClassesArray = selected_classes.split(" ");
|
|
var isExtra = 0;
|
|
|
|
if(classIsChecked){
|
|
var selectedGroup = selectedClassesArray[1].split('_');
|
|
|
|
for(x=0;x<selectedClassesArray.length;x++){
|
|
if(selectedClassesArray[x] == 'extra'){
|
|
isExtra = 1;
|
|
}
|
|
}
|
|
$('#totalPanelBtn').show();
|
|
$('#totalPanel').show();
|
|
setGroup(selectedDate, selectedGroup[1], id, isExtra);
|
|
|
|
//$('.extra_' + service_category).attr("disabled", false);
|
|
}
|
|
else{
|
|
$('#totalPanelBtn').hide();
|
|
$('#totalPanel').hide();
|
|
$('.extra' ).attr("disabled", true);
|
|
$('.extra' ).prop("checked", false);
|
|
setGroup(selectedDate, 0, id, isExtra);
|
|
$('.extra').attr("disabled", true);
|
|
$('.main' ).attr("disabled", false);
|
|
}
|
|
|
|
|
|
var totalPrice = 0;
|
|
|
|
var selectedServices = '<div class="selectedServiceTable">';
|
|
selectedServices += '<div class="totalServiceRow serviceHeader"><div class="selectedServiceCol totalSelectedServiceName">Service name</div><div class="selectedServiceCol totalSelectedServicePrice">Price</div><div class="selectedServiceCol serviceInfoCol"></div><div class="selectedServiceCol serviceCheckCol"></div></div>';
|
|
$('.service').each(function(i, obj) {
|
|
|
|
if($(this).is(':checked')){
|
|
var selected_id = $(this).attr('id');
|
|
|
|
var selectedTotalTime = $('#servicelength').val();
|
|
selectedPriceElement = document.getElementById('servicePrice_'+selected_id).innerHTML;
|
|
|
|
var tmpQuantity = $('#quantity_'+selected_id).val();
|
|
var lineSubtotal = parseInt(tmpQuantity) * parseInt(selectedPriceElement);
|
|
var linetime = new Date('<?php echo date('Y-m-d');?> ' + $('#time_'+selected_id).val());
|
|
var lineSubtotalHoursInMins = linetime.getHours()*60*+ $('#quantity_'+selected_id).val();
|
|
var lineSubtotalMins = linetime.getMinutes();
|
|
var lineSubtotalTimeInMins = lineSubtotalHoursInMins + lineSubtotalMins;
|
|
|
|
var lineSubtotalHours = Math.floor(lineSubtotalTimeInMins/60);
|
|
var lineSubtotalMins = lineSubtotalTimeInMins-(lineSubtotalHours*60);
|
|
var lineSubtotalString = lineSubtotalHours <=9 ? '0'+lineSubtotalHours:lineSubtotalHours;
|
|
lineSubtotalString = lineSubtotalMins <= 9 ? lineSubtotalString+':0'+lineSubtotalMins:lineSubtotalString+':'+lineSubtotalMins;
|
|
|
|
|
|
totalPrice = totalPrice + parseInt(lineSubtotal);
|
|
|
|
selectedSubServiceDatetime = new Date('<?php echo date('Y-m-d');?> ' + lineSubtotalString);
|
|
|
|
var selectedServiceDatetime = new Date('<?php echo date('Y-m-d');?> ' + selectedSubServiceDatetime);
|
|
var subTotalTimeHours = moment.utc(selectedTotalTime,'HH:mm').add(selectedSubServiceDatetime.getHours(),'hour').format('HH:mm');
|
|
var subTotalTimeMinutes = moment.utc(subTotalTimeHours,'HH:mm').add(selectedSubServiceDatetime.getMinutes(),'minutes').format('HH:mm');
|
|
|
|
selectedNameElement = document.getElementById('serviceName_'+selected_id).innerHTML;
|
|
selectedServices = selectedServices + '<div class="totalServiceRow"><div class="selectedServiceCol totalSelectedServiceName">'+selectedNameElement+'</div><div class="selectedServiceCol totalSelectedServicePrice">' + tmpQuantity + ' x '+selectedPriceElement+' kr</div></div>';
|
|
|
|
$('#servicelength').val(subTotalTimeMinutes);
|
|
}
|
|
|
|
});
|
|
|
|
$('#totalPrice').val(totalPrice);
|
|
$('.serviceContent').html(selectedServices);
|
|
$('.totalPrice').html('<span class="totalTitle">Total:</span> <span>' + totalPrice + '</span><span class="totalTitle"> kr</span>');
|
|
$('.totalSelectedTime').html('<span class="totalTitle">Total time:</span> <span>' + $('#servicelength').val() + '</span>');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
$('.inactiveInput').prop('disabled', true);
|
|
});
|
|
|
|
|
|
|
|
function recaptcha_callback(){
|
|
|
|
selectedDate = $('#booking_date').val();
|
|
selectedTime = $('#booking_time').val();
|
|
var response = 0;
|
|
|
|
$.ajax({
|
|
url: '<?php echo base_url();?>ajax',
|
|
type: 'POST',
|
|
data: {
|
|
action:'isTimeAvailable',
|
|
group_id:$('#group_id').val(),
|
|
servicelength:$('#servicelength').val(),
|
|
selectedDate:selectedDate,
|
|
selectedTime:selectedTime
|
|
},
|
|
error: function() {
|
|
},
|
|
//dataType: 'json',
|
|
success: function(data) {
|
|
},
|
|
}).done(function(result){
|
|
if(result == '1'){
|
|
$('#sendBooking').prop("disabled", false);
|
|
}
|
|
else{
|
|
alert('Den valgte tiden er allerede booket, velg et annet tidspunkt!');
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
$(function(){
|
|
|
|
$("#datepicker").datepicker({
|
|
firstDay: 1,
|
|
defaultDate: new Date(),
|
|
dateFormat: 'yy-mm-dd',
|
|
onSelect: function(dateText) {
|
|
$('#booking_date').val(this.value);
|
|
getAvaliableTimesOfTheDay(this.value);
|
|
//console.log("Selected date: " + dateText + "; input's current value: " + this.value);
|
|
}
|
|
});
|
|
|
|
|
|
});
|
|
|
|
function getAvaliableTimesOfTheDay(selectedDate){
|
|
$('.bookingResultsWrapper').show();
|
|
$('#serviceBookingDate').html(selectedDate);
|
|
$('#serviceBookingDate').show();
|
|
//console.log(selectedDate);
|
|
|
|
$.ajax({
|
|
url: '<?php echo base_url();?>ajax',
|
|
type: 'POST',
|
|
data: {
|
|
action:'getAvailableTimes',
|
|
group_id:$('#group_id').val(),
|
|
servicelength:$('#servicelength').val(),
|
|
selectedDate:selectedDate
|
|
},
|
|
error: function() {
|
|
},
|
|
//dataType: 'json',
|
|
success: function(data) {
|
|
},
|
|
}).done(function(result){
|
|
if(result != 0){
|
|
$('.availableTimes').html(result);
|
|
}
|
|
else{
|
|
$('.availableTimes').html('There is not available time on this day!');
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function setSelectedTime(time, id){
|
|
$('#booking_time').val(time).trigger('change');
|
|
$('#serviceBookingTime').html(time);
|
|
$('#serviceBookingTime').show();
|
|
|
|
$('.availableBookingTime').each(function(i, obj) {
|
|
$(this).removeClass('selectedTime');
|
|
});
|
|
|
|
|
|
//$('#bookingStep4').show();
|
|
$('#bookingTime_'+id).addClass('selectedTime');
|
|
}
|
|
|
|
function goToStep(stepNumber){
|
|
|
|
if(canGotoNextStep(stepNumber)){
|
|
$('.stepCircle').each(function(i, obj) {
|
|
$(this).removeClass('activeStep');
|
|
});
|
|
|
|
//$('#stepCircle'+stepNumber).addClass('activeStep');
|
|
|
|
$('.BookingStepContainer').each(function(i, obj) {
|
|
$(this).hide();
|
|
});
|
|
|
|
$('#bookingStep'+stepNumber).show();
|
|
|
|
if(stepNumber == 3){
|
|
$('#stepCircle1').addClass('activeStep');
|
|
$('#stepCircle2').addClass('activeStep');
|
|
$('#stepCircle3').addClass('activeStep');
|
|
}
|
|
else if(stepNumber == 2){
|
|
|
|
if($("#datepicker").val() != ''){
|
|
getAvaliableTimesOfTheDay($("#datepicker").val());
|
|
}
|
|
|
|
$('.bookingSummaryContainer').show();
|
|
$('#stepCircle1').addClass('activeStep');
|
|
$('#stepCircle2').addClass('activeStep');
|
|
//$('#stepCircle3').addClass('activeStep');
|
|
}
|
|
else{
|
|
if(stepNumber == 1){
|
|
$('#stepCircle1').addClass('activeStep');
|
|
}
|
|
if(stepNumber == 2){
|
|
$('#stepCircle1').addClass('activeStep');
|
|
$('#stepCircle2').addClass('activeStep');
|
|
}
|
|
$('.bookingSummaryContainer').hide();
|
|
$('.bookingResultsWrapper').hide();
|
|
|
|
}
|
|
$('html').scrollTop(0);
|
|
}
|
|
else{
|
|
alert('Please fill the required fields!');
|
|
}
|
|
}
|
|
|
|
function canGotoNextStep(stepNumber){
|
|
|
|
$RequiredFieldSelected = 0;
|
|
if(stepNumber == 2){
|
|
$('.service').each(function(i, obj) {
|
|
if($(this).is(':checked')){
|
|
$RequiredFieldSelected = 1;
|
|
}
|
|
});
|
|
}
|
|
else if(stepNumber == 1){
|
|
$RequiredFieldSelected = 1;
|
|
}
|
|
else if(stepNumber == 3){
|
|
if($('#booking_date').val() != '' && $('#booking_time').val() != ''){
|
|
$RequiredFieldSelected = 1;
|
|
}
|
|
|
|
var carServiceSelected = 0;
|
|
$('.service').each(function(i, obj) {
|
|
var selected_classes = $(this).attr('class');
|
|
var selectedClassesArray = selected_classes.split(" ");
|
|
for(x=0;x<selectedClassesArray.length;x++){
|
|
if(selectedClassesArray[x] == 'car'){
|
|
if($(this).is(':checked')){
|
|
carServiceSelected = 1;
|
|
}
|
|
}
|
|
}
|
|
|
|
});
|
|
|
|
$('#guest_name').val('');
|
|
$('#guest_email').val('');
|
|
$('#guest_phone').val('');
|
|
$('#guest_addresse').val('');
|
|
$('#guest_car_reg_number').val('');
|
|
$('#guest_car_type').val('');
|
|
|
|
if(carServiceSelected){
|
|
$('#car_block').show();
|
|
$('#guest_car_reg_number').prop('required',true);
|
|
$('#guest_car_type').prop('required',true);
|
|
}
|
|
else{
|
|
$('#car_block').hide();
|
|
$('#guest_car_reg_number').prop('required',false);
|
|
$('#guest_car_type').prop('required',false);
|
|
}
|
|
}
|
|
|
|
|
|
return $RequiredFieldSelected;
|
|
}
|
|
|
|
function setGroup(booking_date, service_category, id, isExtra){
|
|
var serviceGroupArray = [<?php echo implode(',', $serviceGroups);?>];
|
|
|
|
//enable or disable categories
|
|
if(service_category != 0){
|
|
for(index = 0; index <= serviceGroupArray.length; index++){
|
|
$('.group_' + serviceGroupArray[index]).attr("disabled", true);
|
|
}
|
|
$('.group_' + service_category).attr("disabled", false);
|
|
|
|
}
|
|
else{
|
|
for(index = 0; index <= serviceGroupArray.length; index++){
|
|
$('.group_' + serviceGroupArray[index]).attr("disabled", false);
|
|
}
|
|
}
|
|
|
|
//set extra fields
|
|
switch(service_category){
|
|
case '1':
|
|
var isMainChecked = 0;
|
|
var isExtraChecked = 0;
|
|
$('.main').each(function(i, obj) {
|
|
if($(this).is(':checked')){
|
|
isMainChecked = 1;
|
|
}
|
|
});
|
|
|
|
$('.extra').each(function(i, obj) {
|
|
if(!isMainChecked){
|
|
$(this).prop('checked', false);
|
|
$('.extra').attr("disabled", true);
|
|
}
|
|
|
|
if($(this).is(':checked')){
|
|
isExtraChecked = 1;
|
|
}
|
|
});
|
|
|
|
|
|
/*if(isMainChecked && !isExtra){
|
|
$('.main').prop('checked', false);
|
|
$('#'+id).prop('checked', true);
|
|
}*/
|
|
|
|
if(!isMainChecked){
|
|
$('.main').prop('checked', false);
|
|
$('.main').attr("disabled", false);
|
|
$('.extra').attr("disabled", true);
|
|
$('#servicelength').val('00:00');
|
|
}
|
|
|
|
if(isExtra){
|
|
if(!$('.main').is(':checked')){
|
|
$('.extra').prop('checked', false);
|
|
$('.extra').attr("disabled", true);
|
|
}
|
|
}
|
|
|
|
|
|
if(isMainChecked && !isExtra){
|
|
$('.main').each(function(i, obj) {
|
|
if($(this).is(':checked')){
|
|
$(this).prop('checked', false);
|
|
$('#'+id).prop('checked', true);
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
case '2':
|
|
case '3':
|
|
case '4':
|
|
|
|
$('.group_5').attr("disabled", false);
|
|
$('.group_6').attr("disabled", false);
|
|
$('.group_7').attr("disabled", false);
|
|
|
|
$('.group_' + service_category).each(function(i, obj) {
|
|
if($('.group_' + service_category).is(':checked')){
|
|
$('.group_' + service_category).attr("disabled", false);
|
|
}
|
|
else{
|
|
$('.extra' ).prop("checked", false);
|
|
$('.group_2').attr("disabled", false);
|
|
$('.group_3').attr("disabled", false);
|
|
$('.group_4').attr("disabled", false);
|
|
$('.extra').attr("disabled", true);
|
|
}
|
|
});
|
|
$('.group_11').attr("disabled", false);
|
|
break;
|
|
case '5':
|
|
case '6':
|
|
$('.group_5').attr("disabled", false);
|
|
$('.group_6').attr("disabled", false);
|
|
$('.group_7').attr("disabled", false);
|
|
|
|
$('.group_2').each(function(i, obj) {
|
|
if($('.group_2').is(':checked')){
|
|
$('.group_2').attr("disabled", false);
|
|
}
|
|
});
|
|
|
|
$('.group_3').each(function(i, obj) {
|
|
if($('.group_3').is(':checked')){
|
|
$('.group_3').attr("disabled", false);
|
|
}
|
|
});
|
|
|
|
$('.group_4').each(function(i, obj) {
|
|
if($('.group_4').is(':checked')){
|
|
$('.group_4').attr("disabled", false);
|
|
}
|
|
});
|
|
$('.group_11').attr("disabled", false);
|
|
break;
|
|
case '7':
|
|
if($('.group_' + service_category).is(':checked')){
|
|
}
|
|
//console.log('checked 7');
|
|
break;
|
|
case '8':
|
|
case '9':
|
|
//console.log(id);
|
|
|
|
break;
|
|
case '10':
|
|
//console.log(id);
|
|
|
|
break;
|
|
case '11':
|
|
//console.log(id);
|
|
$('.extra').each(function(i, obj) {
|
|
if($('.extra').is(':checked')){
|
|
$('.extra').attr("disabled", false);
|
|
}
|
|
});
|
|
|
|
$('.main').attr("disabled", false);
|
|
|
|
|
|
|
|
break;
|
|
}
|
|
|
|
$.ajax({
|
|
url: '<?php echo base_url();?>ajax',
|
|
type: 'POST',
|
|
data: {
|
|
action:'getAvailableGroup',
|
|
service_category:service_category,
|
|
booking_date: booking_date
|
|
},
|
|
error: function() {
|
|
},
|
|
//dataType: 'json',
|
|
success: function(data) {
|
|
},
|
|
}).done(function(result){
|
|
$('#group_id').val(result);
|
|
});
|
|
}
|
|
|
|
|
|
</script>
|
|
|