MaketRandevu/application/views/pages/customers/customers_page.php

196 lines
8.2 KiB
PHP
Raw Normal View History

<?php
/**
* @var string $timezones
* @var array $privileges
*/
?>
<?php extend('layouts/backend/backend_layout') ?>
<?php section('content') ?>
<script src="<?= asset_url('assets/vendor/jquery-ui-timepicker-addon/jquery-ui-timepicker-addon.min.js') ?>"></script>
<script src="<?= asset_url('assets/js/pages/customers/backend_customers_helper.js') ?>"></script>
<script src="<?= asset_url('assets/js/pages/customers/backend_customers.js') ?>"></script>
2017-09-05 15:58:34 +03:00
<script>
2015-10-05 01:31:06 +03:00
var GlobalVariables = {
csrfToken: <?= json_encode($this->security->get_csrf_hash()) ?>,
2021-11-25 10:46:01 +03:00
baseUrl: <?= json_encode(config('base_url')) ?>,
dateFormat: <?= json_encode(setting('date_format')) ?>,
timeFormat: <?= json_encode(setting('time_format')) ?>,
timezones: <?= json_encode($timezones) ?>,
2020-12-09 15:17:45 +03:00
user: {
2021-11-25 11:08:30 +03:00
id: <?= session('user_id') ?>,
2021-11-25 10:46:01 +03:00
email: <?= json_encode(session('user_email')) ?>,
timezone: <?= json_encode(session('timezone')) ?>,
role_slug: <?= json_encode(session('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>
<div class="container-fluid backend-page" id="customers-page">
<div class="row" id="customers">
<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">
<div class="input-group">
<input type="text" class="key form-control">
2018-01-02 15:32:09 +03:00
<div class="input-group-addon">
<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>
</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>
</button>
</div>
2018-01-02 15:32:09 +03:00
</div>
</div>
2020-05-05 20:35:33 +03:00
</form>
2015-10-05 01:31:06 +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">
<?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>
<?php endif ?>
2015-10-05 01:31:06 +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>
<?php endif ?>
2015-10-05 01:31:06 +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>
<?php endif ?>
2015-10-05 01:31:06 +03:00
</div>
<div id="save-cancel-group" class="btn-group" style="display:none;">
<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>
<?= lang('save') ?>
2015-10-05 01:31:06 +03:00
</button>
<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>
<?= lang('cancel') ?>
2015-10-05 01:31:06 +03:00
</button>
</div>
</div>
<input id="customer-id" type="hidden">
2015-10-05 01:31:06 +03:00
<div class="row">
<div class="col-12 col-md-6" style="margin-left: 0;">
<h3><?= lang('details') ?></h3>
<div id="form-message" class="alert" style="display:none;"></div>
<div class="mb-3">
<label class="form-label" for="first-name">
<?= lang('first_name') ?>
<span class="text-danger">*</span>
</label>
<input id="first-name" class="form-control required">
</div>
<div class="mb-3">
<label class="form-label" for="last-name">
<?= lang('last_name') ?>
<span class="text-danger">*</span>
</label>
<input id="last-name" class="form-control required">
</div>
<div class="mb-3">
<label class="form-label" for="email">
<?= lang('email') ?>
<span class="text-danger">*</span>
</label>
<input id="email" class="form-control required">
</div>
<div class="mb-3">
<label class="form-label" for="phone-number">
<?= lang('phone_number') ?>
2021-11-25 10:46:01 +03:00
<?= setting('require_phone_number') === '1' ? '<span class="text-danger">*</span>' : '' ?></label>
<input id="phone-number" class="form-control
2021-11-25 10:46:01 +03:00
<?= setting('require_phone_number') === '1' ? 'required' : '' ?>">
</div>
<div class="mb-3">
<label class="form-label" for="address">
<?= lang('address') ?>
</label>
<input id="address" class="form-control">
</div>
<div class="mb-3">
<label class="form-label" for="city">
<?= lang('city') ?>
</label>
<input id="city" class="form-control">
</div>
<div class="mb-3">
<label class="form-label" for="zip-code">
<?= lang('zip_code') ?>
</label>
<input id="zip-code" class="form-control">
</div>
<div class="mb-3">
<label class="form-label" for="language">
<?= lang('language') ?>
<span class="text-danger">*</span>
</label>
<select id="language" class="form-control required"></select>
2020-06-16 18:01:27 +03:00
</div>
<div class="mb-3">
<label class="form-label" for="timezone">
<?= lang('timezone') ?>
<span class="text-danger">*</span>
</label>
<?php component('timezone_dropdown', 'id="timezone" class="form-control required"') ?>
</div>
<div class="mb-3">
<label class="form-label" for="notes">
<?= lang('notes') ?>
</label>
<textarea id="notes" rows="4" class="form-control"></textarea>
</div>
2015-10-05 01:31:06 +03:00
</div>
<div class="col-12 col-md-6">
<h3><?= lang('appointments') ?></h3>
<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>
<?php section('content') ?>