2021-11-10 10:32:46 +03:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @var array $available_providers
|
|
|
|
* @var array $available_services
|
|
|
|
* @var array $secretary_providers
|
|
|
|
* @var string $date_format
|
|
|
|
* @var string $time_format
|
|
|
|
* @var string $base_url
|
|
|
|
* @var array $customers
|
|
|
|
* @var string $timezones
|
|
|
|
* @var string $user_id
|
|
|
|
* @var string $user_email
|
|
|
|
* @var string $timezone
|
|
|
|
* @var string $role_slug
|
|
|
|
* @var array $privileges
|
2021-11-17 10:42:12 +03:00
|
|
|
* @var string $require_phone_number
|
2021-11-10 10:32:46 +03:00
|
|
|
*/
|
|
|
|
?>
|
2021-11-15 11:49:08 +03:00
|
|
|
|
|
|
|
<?php extend('layouts/backend/backend_layout') ?>
|
|
|
|
|
|
|
|
<?php section('content') ?>
|
|
|
|
|
2021-11-08 12:57:03 +03:00
|
|
|
<script src="<?= asset_url('assets/vendor/jquery-ui-timepicker-addon/jquery-ui-timepicker-addon.min.js') ?>"></script>
|
2017-11-14 16:01:49 +03:00
|
|
|
<script src="<?= asset_url('assets/js/backend_customers_helper.js') ?>"></script>
|
|
|
|
<script src="<?= asset_url('assets/js/backend_customers.js') ?>"></script>
|
2017-09-05 15:58:34 +03:00
|
|
|
<script>
|
2015-10-05 01:31:06 +03:00
|
|
|
var GlobalVariables = {
|
2020-09-07 13:34:52 +03:00
|
|
|
csrfToken: <?= json_encode($this->security->get_csrf_hash()) ?>,
|
|
|
|
availableProviders: <?= json_encode($available_providers) ?>,
|
|
|
|
availableServices: <?= json_encode($available_services) ?>,
|
|
|
|
secretaryProviders: <?= json_encode($secretary_providers) ?>,
|
|
|
|
dateFormat: <?= json_encode($date_format) ?>,
|
|
|
|
timeFormat: <?= json_encode($time_format) ?>,
|
|
|
|
baseUrl: <?= json_encode($base_url) ?>,
|
|
|
|
customers: <?= json_encode($customers) ?>,
|
|
|
|
timezones: <?= json_encode($timezones) ?>,
|
2020-12-09 15:17:45 +03:00
|
|
|
user: {
|
2020-09-07 13:34:52 +03:00
|
|
|
id: <?= $user_id ?>,
|
|
|
|
email: <?= json_encode($user_email) ?>,
|
|
|
|
timezone: <?= json_encode($timezone) ?>,
|
|
|
|
role_slug: <?= json_encode($role_slug) ?>,
|
|
|
|
privileges: <?= json_encode($privileges) ?>
|
2015-10-05 01:31:06 +03:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-12-09 15:17:45 +03:00
|
|
|
$(function () {
|
2015-10-05 01:31:06 +03:00
|
|
|
BackendCustomers.initialize(true);
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2020-09-03 14:35:58 +03:00
|
|
|
<div class="container-fluid backend-page" id="customers-page">
|
2020-12-08 14:23:37 +03:00
|
|
|
<div class="row" id="customers">
|
2020-08-31 17:02:54 +03:00
|
|
|
<div id="filter-customers" class="filter-records col col-12 col-md-5">
|
2020-05-05 20:35:33 +03:00
|
|
|
<form class="mb-4">
|
2017-10-31 13:52:25 +03:00
|
|
|
<div class="input-group">
|
|
|
|
<input type="text" class="key form-control">
|
2017-09-23 02:27:07 +03:00
|
|
|
|
2018-01-02 15:32:09 +03:00
|
|
|
<div class="input-group-addon">
|
2017-10-31 13:52:25 +03:00
|
|
|
<div>
|
2020-12-09 15:17:45 +03:00
|
|
|
<button class="filter btn btn-outline-secondary" type="submit"
|
|
|
|
data-tippy-content="<?= lang('filter') ?>">
|
2020-05-05 20:35:33 +03:00
|
|
|
<i class="fas fa-search"></i>
|
2017-10-31 13:52:25 +03:00
|
|
|
</button>
|
2020-12-09 15:17:45 +03:00
|
|
|
<button class="clear btn btn-outline-secondary" type="button"
|
|
|
|
data-tippy-content="<?= lang('clear') ?>">
|
|
|
|
<i class="fas fa-redo-alt"></i>
|
2017-10-31 13:52:25 +03:00
|
|
|
</button>
|
|
|
|
</div>
|
2018-01-02 15:32:09 +03:00
|
|
|
</div>
|
2015-11-28 12:19:44 +02:00
|
|
|
</div>
|
2020-05-05 20:35:33 +03:00
|
|
|
</form>
|
2015-10-05 01:31:06 +03:00
|
|
|
|
2017-09-14 16:18:20 +03:00
|
|
|
<h3><?= lang('customers') ?></h3>
|
2015-10-05 01:31:06 +03:00
|
|
|
<div class="results"></div>
|
2020-12-09 15:17:45 +03:00
|
|
|
</div>
|
2015-10-05 01:31:06 +03:00
|
|
|
|
2020-12-09 15:17:45 +03:00
|
|
|
<div class="record-details col-12 col-md-7">
|
2020-05-05 20:35:33 +03:00
|
|
|
<div class="btn-toolbar mb-4">
|
2015-10-05 01:31:06 +03:00
|
|
|
<div id="add-edit-delete-group" class="btn-group">
|
2017-09-23 02:27:07 +03:00
|
|
|
<?php if ($privileges[PRIV_CUSTOMERS]['add'] === TRUE): ?>
|
2020-12-09 15:17:45 +03:00
|
|
|
<button id="add-customer" class="btn btn-primary">
|
2021-11-23 10:41:37 +03:00
|
|
|
<i class="fas fa-plus-square me-2"></i>
|
2020-12-09 15:17:45 +03:00
|
|
|
<?= lang('add') ?>
|
|
|
|
</button>
|
2017-09-23 02:27:07 +03:00
|
|
|
<?php endif ?>
|
2015-10-05 01:31:06 +03:00
|
|
|
|
2017-09-23 02:27:07 +03:00
|
|
|
<?php if ($privileges[PRIV_CUSTOMERS]['edit'] === TRUE): ?>
|
2020-12-09 15:17:45 +03:00
|
|
|
<button id="edit-customer" class="btn btn-outline-secondary" disabled="disabled">
|
2021-11-23 10:41:37 +03:00
|
|
|
<i class="fas fa-edit me-2"></i>
|
2020-12-09 15:17:45 +03:00
|
|
|
<?= lang('edit') ?>
|
|
|
|
</button>
|
2017-09-23 02:27:07 +03:00
|
|
|
<?php endif ?>
|
2015-10-05 01:31:06 +03:00
|
|
|
|
2017-09-23 02:27:07 +03:00
|
|
|
<?php if ($privileges[PRIV_CUSTOMERS]['delete'] === TRUE): ?>
|
2020-12-09 15:17:45 +03:00
|
|
|
<button id="delete-customer" class="btn btn-outline-secondary" disabled="disabled">
|
2021-11-23 10:41:37 +03:00
|
|
|
<i class="fas fa-trash-alt me-2"></i>
|
2020-12-09 15:17:45 +03:00
|
|
|
<?= lang('delete') ?>
|
|
|
|
</button>
|
2017-09-23 02:27:07 +03:00
|
|
|
<?php endif ?>
|
2015-10-05 01:31:06 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="save-cancel-group" class="btn-group" style="display:none;">
|
2020-08-31 13:23:10 +03:00
|
|
|
<button id="save-customer" class="btn btn-primary">
|
2021-11-23 10:41:37 +03:00
|
|
|
<i class="fas fa-check-square me-2"></i>
|
2017-09-14 16:18:20 +03:00
|
|
|
<?= lang('save') ?>
|
2015-10-05 01:31:06 +03:00
|
|
|
</button>
|
2020-09-28 15:24:29 +03:00
|
|
|
<button id="cancel-customer" class="btn btn-outline-secondary">
|
2021-11-23 10:41:37 +03:00
|
|
|
<i class="fas fa-ban me-2"></i>
|
2017-09-14 16:18:20 +03:00
|
|
|
<?= lang('cancel') ?>
|
2015-10-05 01:31:06 +03:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-09-23 02:27:07 +03:00
|
|
|
<input id="customer-id" type="hidden">
|
2015-10-05 01:31:06 +03:00
|
|
|
|
2016-07-14 21:25:05 +03:00
|
|
|
<div class="row">
|
2020-08-31 17:02:54 +03:00
|
|
|
<div class="col-12 col-md-6" style="margin-left: 0;">
|
2017-09-14 16:18:20 +03:00
|
|
|
<h3><?= lang('details') ?></h3>
|
2017-09-23 02:27:07 +03:00
|
|
|
|
2016-07-14 21:25:05 +03:00
|
|
|
<div id="form-message" class="alert" style="display:none;"></div>
|
|
|
|
|
2021-11-23 11:53:10 +03:00
|
|
|
<div class="mb-3">
|
|
|
|
<label class="form-label" for="first-name">
|
2020-09-30 14:32:42 +03:00
|
|
|
<?= lang('first_name') ?>
|
|
|
|
<span class="text-danger">*</span>
|
|
|
|
</label>
|
2017-09-23 04:42:14 +03:00
|
|
|
<input id="first-name" class="form-control required">
|
2016-07-14 21:25:05 +03:00
|
|
|
</div>
|
|
|
|
|
2021-11-23 11:53:10 +03:00
|
|
|
<div class="mb-3">
|
|
|
|
<label class="form-label" for="last-name">
|
2020-09-30 14:32:42 +03:00
|
|
|
<?= lang('last_name') ?>
|
|
|
|
<span class="text-danger">*</span>
|
|
|
|
</label>
|
2017-09-23 04:42:14 +03:00
|
|
|
<input id="last-name" class="form-control required">
|
2016-07-14 21:25:05 +03:00
|
|
|
</div>
|
|
|
|
|
2021-11-23 11:53:10 +03:00
|
|
|
<div class="mb-3">
|
|
|
|
<label class="form-label" for="email">
|
2020-09-30 14:32:42 +03:00
|
|
|
<?= lang('email') ?>
|
|
|
|
<span class="text-danger">*</span>
|
|
|
|
</label>
|
2017-09-23 04:42:14 +03:00
|
|
|
<input id="email" class="form-control required">
|
2016-07-14 21:25:05 +03:00
|
|
|
</div>
|
|
|
|
|
2021-11-23 11:53:10 +03:00
|
|
|
<div class="mb-3">
|
|
|
|
<label class="form-label" for="phone-number">
|
2020-09-30 14:32:42 +03:00
|
|
|
<?= lang('phone_number') ?>
|
|
|
|
<?= $require_phone_number === '1' ? '<span class="text-danger">*</span>' : ''; ?></label>
|
2019-10-18 05:37:52 +03:00
|
|
|
<input id="phone-number" class="form-control
|
2020-08-31 13:32:58 +03:00
|
|
|
<?= $require_phone_number === '1' ? 'required' : '' ?>">
|
2016-07-14 21:25:05 +03:00
|
|
|
</div>
|
|
|
|
|
2021-11-23 11:53:10 +03:00
|
|
|
<div class="mb-3">
|
|
|
|
<label class="form-label" for="address">
|
2020-09-30 14:32:42 +03:00
|
|
|
<?= lang('address') ?>
|
|
|
|
</label>
|
2017-09-23 04:42:14 +03:00
|
|
|
<input id="address" class="form-control">
|
2016-07-14 21:25:05 +03:00
|
|
|
</div>
|
|
|
|
|
2021-11-23 11:53:10 +03:00
|
|
|
<div class="mb-3">
|
|
|
|
<label class="form-label" for="city">
|
2020-09-30 14:32:42 +03:00
|
|
|
<?= lang('city') ?>
|
|
|
|
|
|
|
|
</label>
|
2017-09-23 04:42:14 +03:00
|
|
|
<input id="city" class="form-control">
|
2016-07-14 21:25:05 +03:00
|
|
|
</div>
|
|
|
|
|
2021-11-23 11:53:10 +03:00
|
|
|
<div class="mb-3">
|
|
|
|
<label class="form-label" for="zip-code">
|
2020-09-30 14:32:42 +03:00
|
|
|
<?= lang('zip_code') ?>
|
|
|
|
</label>
|
2017-09-23 04:42:14 +03:00
|
|
|
<input id="zip-code" class="form-control">
|
2016-07-14 21:25:05 +03:00
|
|
|
</div>
|
|
|
|
|
2021-11-23 11:53:10 +03:00
|
|
|
<div class="mb-3">
|
|
|
|
<label class="form-label" for="language">
|
2020-09-30 14:32:42 +03:00
|
|
|
<?= lang('language') ?>
|
2020-12-14 21:40:10 +03:00
|
|
|
<span class="text-danger">*</span>
|
2020-09-30 14:32:42 +03:00
|
|
|
</label>
|
2020-12-14 21:40:10 +03:00
|
|
|
<select id="language" class="form-control required"></select>
|
2020-06-16 18:01:27 +03:00
|
|
|
</div>
|
|
|
|
|
2021-11-23 11:53:10 +03:00
|
|
|
<div class="mb-3">
|
|
|
|
<label class="form-label" for="timezone">
|
2020-09-30 14:32:42 +03:00
|
|
|
<?= lang('timezone') ?>
|
2020-12-14 21:40:10 +03:00
|
|
|
<span class="text-danger">*</span>
|
2020-09-30 14:32:42 +03:00
|
|
|
</label>
|
2021-11-17 10:42:12 +03:00
|
|
|
<?php component('timezone_dropdown', 'id="timezone" class="form-control required"') ?>
|
2020-03-29 15:10:49 +03:00
|
|
|
</div>
|
|
|
|
|
2021-11-23 11:53:10 +03:00
|
|
|
<div class="mb-3">
|
|
|
|
<label class="form-label" for="notes">
|
2020-09-30 14:32:42 +03:00
|
|
|
<?= lang('notes') ?>
|
|
|
|
</label>
|
2016-07-14 21:25:05 +03:00
|
|
|
<textarea id="notes" rows="4" class="form-control"></textarea>
|
|
|
|
</div>
|
2015-10-05 01:31:06 +03:00
|
|
|
</div>
|
|
|
|
|
2020-08-31 17:02:54 +03:00
|
|
|
<div class="col-12 col-md-6">
|
2017-09-14 16:18:20 +03:00
|
|
|
<h3><?= lang('appointments') ?></h3>
|
2020-09-08 10:42:58 +03:00
|
|
|
<div id="customer-appointments" class="card bg-light border-light"></div>
|
|
|
|
<div id="appointment-details" class="card bg-light border-light d-none"></div>
|
2015-10-05 01:31:06 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-12-09 15:17:45 +03:00
|
|
|
</div>
|
2015-10-05 01:31:06 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-11-15 11:49:08 +03:00
|
|
|
|
|
|
|
<?php section('content') ?>
|