iflrandevu/application/views/appointments/book.php

416 lines
22 KiB
PHP
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
2017-09-05 15:58:34 +03:00
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#35A768">
<title><?= lang('page_title') . ' ' . $company_name ?></title>
2017-09-05 15:58:34 +03:00
<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/ext/bootstrap/css/bootstrap.min.css') ?>">
<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/ext/jquery-ui/jquery-ui.min.css') ?>">
<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/ext/jquery-qtip/jquery.qtip.min.css') ?>">
<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/ext/cookieconsent/cookieconsent.min.css') ?>">
<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/css/frontend.css') ?>">
<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/css/general.css') ?>">
2020-05-05 20:35:33 +03:00
<script src="https://kit.fontawesome.com/bdcbd8a000.js" crossorigin="anonymous"></script>
<link rel="icon" type="image/x-icon" href="<?= asset_url('assets/img/favicon.ico') ?>">
<link rel="icon" sizes="192x192" href="<?= asset_url('assets/img/logo.png') ?>">
</head>
<body>
<div id="main" class="container">
2020-05-05 20:35:33 +03:00
<div class="wrapper row d-md-flex align-items-center justify-content-center">
<div id="book-appointment-wizard" class="col-xs-12 col-md-10 col-lg-8">
2017-09-05 15:58:34 +03:00
<!-- FRAME TOP BAR -->
<div id="header">
<span id="company-name"><?= $company_name ?></span>
<div id="steps">
<div id="step-1" class="book-step active-step" title="<?= lang('step_one_title') ?>">
<strong>1</strong>
</div>
<div id="step-2" class="book-step" title="<?= lang('step_two_title') ?>">
<strong>2</strong>
</div>
<div id="step-3" class="book-step" title="<?= lang('step_three_title') ?>">
<strong>3</strong>
</div>
<div id="step-4" class="book-step" title="<?= lang('step_four_title') ?>">
<strong>4</strong>
</div>
</div>
</div>
<?php if ($manage_mode): ?>
<div id="cancel-appointment-frame" class="booking-header-bar row">
2020-05-05 20:35:33 +03:00
<div class="col-xs-12 col-md-10">
<p><?= lang('cancel_appointment_hint') ?></p>
</div>
2020-05-05 20:35:33 +03:00
<div class="col-xs-12 col-md-2">
<form id="cancel-appointment-form" method="post"
action="<?= site_url('appointments/cancel/' . $appointment_data['hash']) ?>">
<input type="hidden" name="csrfToken" value="<?= $this->security->get_csrf_hash() ?>" />
<textarea name="cancel_reason" style="display:none"></textarea>
2020-05-05 20:35:33 +03:00
<button id="cancel-appointment" class="btn btn-light btn-sm"><?= lang('cancel') ?></button>
</form>
</div>
</div>
<div class="booking-header-bar row">
2020-05-05 20:35:33 +03:00
<div class="col-xs-12 col-md-10">
<p><?= lang('delete_personal_information_hint') ?></p>
</div>
2020-05-05 20:35:33 +03:00
<div class="col-xs-12 col-md-2">
<button id="delete-personal-information" class="btn btn-danger btn-sm"><?= lang('delete') ?></button>
</div>
</div>
<?php endif; ?>
<?php
if (isset($exceptions)) {
echo '<div style="margin: 10px">';
echo '<h4>' . lang('unexpected_issues') . '</h4>';
foreach($exceptions as $exception) {
echo exceptionToHtml($exception);
}
echo '</div>';
}
?>
2017-09-05 15:58:34 +03:00
<!-- SELECT SERVICE AND PROVIDER -->
<div id="wizard-frame-1" class="wizard-frame">
<div class="frame-container">
<h3 class="frame-title"><?= lang('step_one_title') ?></h3>
<div class="frame-content">
<div class="form-group">
<label for="select-service">
<strong><?= lang('select_service') ?></strong>
</label>
2020-05-05 20:35:33 +03:00
<select id="select-service" class="form-control">
<?php
// Group services by category, only if there is at least one service with a parent category.
$has_category = FALSE;
foreach($available_services as $service) {
if ($service['category_id'] != NULL) {
$has_category = TRUE;
break;
}
}
if ($has_category) {
$grouped_services = array();
foreach($available_services as $service) {
if ($service['category_id'] != NULL) {
if (!isset($grouped_services[$service['category_name']])) {
$grouped_services[$service['category_name']] = array();
}
$grouped_services[$service['category_name']][] = $service;
}
}
// We need the uncategorized services at the end of the list so
// we will use another iteration only for the uncategorized services.
$grouped_services['uncategorized'] = array();
foreach($available_services as $service) {
if ($service['category_id'] == NULL) {
$grouped_services['uncategorized'][] = $service;
}
}
foreach($grouped_services as $key => $group) {
$group_label = ($key != 'uncategorized')
? $group[0]['category_name'] : 'Uncategorized';
if (count($group) > 0) {
echo '<optgroup label="' . $group_label . '">';
foreach($group as $service) {
echo '<option value="' . $service['id'] . '">'
. $service['name'] . '</option>';
}
echo '</optgroup>';
}
}
} else {
foreach($available_services as $service) {
echo '<option value="' . $service['id'] . '">' . $service['name'] . '</option>';
}
}
?>
</select>
</div>
<div class="form-group">
<label for="select-provider">
<strong><?= lang('select_provider') ?></strong>
</label>
2020-05-05 20:35:33 +03:00
<select id="select-provider" class="form-control"></select>
</div>
<div id="service-description" style="display:none;"></div>
</div>
</div>
<div class="command-buttons">
2020-05-05 20:35:33 +03:00
<button type="button" id="button-next-1" class="btn button-next btn-info"
data-step_index="1">
<?= lang('next') ?>
2020-05-05 20:35:33 +03:00
<i class="fas fa-long-arrow-alt-right"></i>
</button>
</div>
</div>
2017-09-05 15:58:34 +03:00
<!-- SELECT APPOINTMENT DATE -->
<div id="wizard-frame-2" class="wizard-frame" style="display:none;">
<div class="frame-container">
<h3 class="frame-title"><?= lang('step_two_title') ?></h3>
<div class="frame-content row">
<div class="col-xs-12 col-md-7 pl-0 pr-0 pr-md-3 mb-4 mb-md-0 d-flex">
<div id="select-date"></div>
</div>
2020-05-05 20:35:33 +03:00
<div class="col-xs-12 col-sm-5 px-0">
2020-03-29 17:20:30 +03:00
<label for="select-timezone"><?= lang('timezone') ?></label>
<?= render_timezone_dropdown('id="select-timezone" class="form-control" value="UTC"'); ?>
<div id="available-hours"></div>
</div>
</div>
</div>
<div class="command-buttons">
2020-05-05 20:35:33 +03:00
<button type="button" id="button-back-2" class="btn button-back btn-light"
data-step_index="2">
2020-05-05 20:35:33 +03:00
<i class="fas fa-long-arrow-alt-left"></i>
<?= lang('back') ?>
</button>
2020-05-05 20:35:33 +03:00
<button type="button" id="button-next-2" class="btn button-next btn-info"
data-step_index="2">
<?= lang('next') ?>
2020-05-05 20:35:33 +03:00
<i class="fas fa-long-arrow-alt-right"></i>
</button>
</div>
</div>
2017-09-05 15:58:34 +03:00
<!-- ENTER CUSTOMER DATA -->
<div id="wizard-frame-3" class="wizard-frame" style="display:none;">
<div class="frame-container">
<h3 class="frame-title"><?= lang('step_three_title') ?></h3>
<div class="frame-content row">
2020-05-05 20:35:33 +03:00
<div class="col-xs-12 col-md-6">
<div class="form-group">
<label for="first-name" class="control-label"><?= lang('first_name') ?> *</label>
<input type="text" id="first-name" class="required form-control" maxlength="100" />
</div>
<div class="form-group">
<label for="last-name" class="control-label"><?= lang('last_name') ?> *</label>
<input type="text" id="last-name" class="required form-control" maxlength="120" />
</div>
<div class="form-group">
<label for="email" class="control-label"><?= lang('email') ?> *</label>
<input type="text" id="email" class="required form-control" maxlength="120" />
</div>
<div class="form-group">
<label for="phone-number" class="control-label"><?= lang('phone_number') ?>
<?php echo ('1' === $require_phone_number) ? '*' : ''; ?></label>
<input type="text" id="phone-number" class="<?php echo ('1' === $require_phone_number) ? 'required' : ''; ?>
form-control" maxlength="60" />
</div>
</div>
2020-05-05 20:35:33 +03:00
<div class="col-xs-12 col-md-6">
<div class="form-group">
<label for="address" class="control-label"><?= lang('address') ?></label>
<input type="text" id="address" class="form-control" maxlength="120" />
</div>
<div class="form-group">
<label for="city" class="control-label"><?= lang('city') ?></label>
<input type="text" id="city" class="form-control" maxlength="120" />
</div>
<div class="form-group">
<label for="zip-code" class="control-label"><?= lang('zip_code') ?></label>
<input type="text" id="zip-code" class="form-control" maxlength="120" />
</div>
<div class="form-group">
<label for="notes" class="control-label"><?= lang('notes') ?></label>
<textarea id="notes" maxlength="500" class="form-control" rows="3"></textarea>
</div>
</div>
2020-06-19 18:17:31 +03:00
</div>
</div>
2020-06-19 18:17:31 +03:00
<?php if ($display_terms_and_conditions): ?>
<div class="form-check mb-3">
<input type="checkbox" class="required form-check-input" id="accept-to-terms-and-conditions">
<label class="form-check-label" for="accept-to-terms-and-conditions">
<?= strtr(lang('read_and_agree_to_terms_and_conditions'),
[
'{$link}' => '<a href="#" data-toggle="modal" data-target="#terms-and-conditions-modal">',
'{/$link}' => '</a>'
])
?>
</label>
</div>
2020-06-19 18:17:31 +03:00
<?php endif ?>
<?php if ($display_privacy_policy): ?>
<div class="form-check mb-3">
2020-06-19 18:17:31 +03:00
<input type="checkbox" class="required form-check-input" id="accept-to-privacy-policy">
<label class="form-check-label" for="accept-to-privacy-policy">
<?= strtr(lang('read_and_agree_to_privacy_policy'),
[
'{$link}' => '<a href="#" data-toggle="modal" data-target="#privacy-policy-modal">',
'{/$link}' => '</a>'
])
?>
</label>
</div>
2020-06-19 18:17:31 +03:00
<?php endif ?>
<span id="form-message" class="text-danger d-block"><?= lang('fields_are_required') ?></span>
<div class="command-buttons">
2020-05-05 20:35:33 +03:00
<button type="button" id="button-back-3" class="btn button-back btn-light"
data-step_index="3"><i class="fas fa-long-arrow-alt-left"></i>
<?= lang('back') ?>
</button>
2020-05-05 20:35:33 +03:00
<button type="button" id="button-next-3" class="btn button-next btn-info"
data-step_index="3">
<?= lang('next') ?>
2020-05-05 20:35:33 +03:00
<i class="fas fa-long-arrow-alt-right"></i>
</button>
</div>
</div>
2017-09-05 15:58:34 +03:00
<!-- APPOINTMENT DATA CONFIRMATION -->
<div id="wizard-frame-4" class="wizard-frame" style="display:none;">
<div class="frame-container">
<h3 class="frame-title"><?= lang('step_four_title') ?></h3>
<div class="frame-content row">
2020-05-05 20:35:33 +03:00
<div id="appointment-details" class="col-xs-12 col-md-6"></div>
<div id="customer-details" class="col-xs-12 col-md-6"></div>
</div>
<?php if ($this->settings_model->get_setting('require_captcha') === '1'): ?>
<div class="frame-content row">
2020-05-05 20:35:33 +03:00
<div class="col-xs-12 col-md-6">
<h4 class="captcha-title">
CAPTCHA
2020-05-05 20:35:33 +03:00
<small class="fas fa-sync-alt"></small>
</h4>
<img class="captcha-image" src="<?= site_url('captcha') ?>">
<input class="captcha-text" type="text" value="" />
<span id="captcha-hint" class="help-block" style="opacity:0">&nbsp;</span>
</div>
</div>
<?php endif; ?>
</div>
<div class="command-buttons">
2020-05-05 20:35:33 +03:00
<button type="button" id="button-back-4" class="btn button-back btn-light"
data-step_index="4">
2020-05-05 20:35:33 +03:00
<i class="fas fa-long-arrow-alt-left"></i>
<?= lang('back') ?>
</button>
<form id="book-appointment-form" style="display:inline-block" method="post">
<button id="book-appointment-submit" type="button" class="btn btn-success">
2020-05-05 20:35:33 +03:00
<i class="far fa-check-circle"></i>
<?= !$manage_mode ? lang('confirm') : lang('update') ?>
</button>
<input type="hidden" name="csrfToken" />
<input type="hidden" name="post_data" />
</form>
</div>
</div>
2017-09-05 15:58:34 +03:00
<!-- FRAME FOOTER -->
<div id="frame-footer">
Powered By
<a href="https://easyappointments.org" target="_blank">Easy!Appointments</a>
|
2020-06-19 13:48:18 +03:00
<span id="select-language" class="badge badge-success">
<?= ucfirst(config('language')) ?>
</span>
|
<a href="<?= site_url('backend'); ?>">
<?= $this->session->user_id ? lang('backend_section') : lang('login') ?>
</a>
</div>
</div>
</div>
</div>
<?php if ($display_cookie_notice === '1'): ?>
<?php require 'cookie_notice_modal.php' ?>
<?php endif ?>
<?php if ($display_terms_and_conditions === '1'): ?>
<?php require 'terms_and_conditions_modal.php' ?>
<?php endif ?>
<?php if ($display_privacy_policy === '1'): ?>
<?php require 'privacy_policy_modal.php' ?>
<?php endif ?>
2017-09-05 15:58:34 +03:00
<script>
var GlobalVariables = {
availableServices : <?= json_encode($available_services) ?>,
availableProviders : <?= json_encode($available_providers) ?>,
baseUrl : <?= json_encode(config('base_url')) ?>,
manageMode : <?= $manage_mode ? 'true' : 'false' ?>,
customerToken : <?= json_encode($customer_token) ?>,
dateFormat : <?= json_encode($date_format) ?>,
2018-03-06 14:20:47 +03:00
timeFormat : <?= json_encode($time_format) ?>,
firstWeekday : <?= json_encode($first_weekday) ?>,
displayCookieNotice : <?= json_encode($display_cookie_notice === '1') ?>,
appointmentData : <?= json_encode($appointment_data) ?>,
providerData : <?= json_encode($provider_data) ?>,
customerData : <?= json_encode($customer_data) ?>,
displayAnyProvider : <?= json_encode($display_any_provider) ?>,
csrfToken : <?= json_encode($this->security->get_csrf_hash()) ?>
};
var EALang = <?= json_encode($this->lang->language) ?>;
var availableLanguages = <?= json_encode(config('available_languages')) ?>;
</script>
<script src="<?= asset_url('assets/js/general_functions.js') ?>"></script>
<script src="<?= asset_url('assets/ext/jquery/jquery.min.js') ?>"></script>
<script src="<?= asset_url('assets/ext/jquery-ui/jquery-ui.min.js') ?>"></script>
<script src="<?= asset_url('assets/ext/jquery-qtip/jquery.qtip.min.js') ?>"></script>
<script src="<?= asset_url('assets/ext/cookieconsent/cookieconsent.min.js') ?>"></script>
2020-05-05 20:35:33 +03:00
<script src="<?= asset_url('assets/ext/bootstrap/js/bootstrap.bundle.min.js') ?>"></script>
<script src="<?= asset_url('assets/ext/datejs/date.min.js') ?>"></script>
2020-03-29 17:20:30 +03:00
<script src="<?= asset_url('assets/ext/moment/moment.min.js') ?>"></script>
<script src="<?= asset_url('assets/ext/moment/moment-timezone-with-data.min.js') ?>"></script>
<script src="<?= asset_url('assets/js/frontend_book_api.js') ?>"></script>
<script src="<?= asset_url('assets/js/frontend_book.js') ?>"></script>
2017-09-05 15:58:34 +03:00
<script>
$(document).ready(function() {
FrontendBook.initialize(true, GlobalVariables.manageMode);
GeneralFunctions.enableLanguageSelection($('#select-language'));
});
</script>
<?php google_analytics_script(); ?>
</body>
</html>