Adjusted required customer fields based on booking to the appointments modal

This commit is contained in:
Alex Tselegidis 2022-01-05 08:31:51 +01:00
parent d4005bd378
commit 4e9ed6bf52
2 changed files with 59 additions and 13 deletions

View file

@ -97,6 +97,14 @@ class Calendar extends EA_Controller {
'available_services' => $this->services_model->get_available_services(), 'available_services' => $this->services_model->get_available_services(),
'secretary_providers' => $secretary_providers, 'secretary_providers' => $secretary_providers,
'edit_appointment' => $edit_appointment, 'edit_appointment' => $edit_appointment,
'require_first_name' => setting('require_first_name'),
'require_last_name' => setting('require_last_name'),
'require_email' => setting('require_email'),
'require_phone_number' => setting('require_phone_number'),
'require_address' => setting('require_address'),
'require_city' => setting('require_city'),
'require_zip_code' => setting('require_zip_code'),
'require_notes' => setting('require_notes'),
]); ]);
$this->load->view('pages/calendar', html_vars()); $this->load->view('pages/calendar', html_vars());

View file

@ -2,6 +2,13 @@
/** /**
* @var array $available_services * @var array $available_services
* @var array $timezones * @var array $timezones
* @var array $require_first_name
* @var array $require_last_name
* @var array $require_email
* @var array $require_phone_number
* @var array $require_address
* @var array $require_city
* @var array $require_zip_code
*/ */
?> ?>
<div id="manage-appointment" class="modal fade"> <div id="manage-appointment" class="modal fade">
@ -187,65 +194,96 @@
<div class="mb-3"> <div class="mb-3">
<label for="first-name" class="form-label"> <label for="first-name" class="form-label">
<?= lang('first_name') ?> <?= lang('first_name') ?>
<?php if ($require_first_name): ?>
<span class="text-danger">*</span> <span class="text-danger">*</span>
<?php endif ?>
</label> </label>
<input id="first-name" class="required form-control"> <input type="text" id="first-name"
class="<?= $require_first_name ? 'required' : '' ?> form-control"
maxlength="100"/>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="last-name" class="form-label"> <label for="last-name" class="form-label">
<?= lang('last_name') ?> <?= lang('last_name') ?>
<?php if ($require_last_name): ?>
<span class="text-danger">*</span> <span class="text-danger">*</span>
<?php endif ?>
</label> </label>
<input id="last-name" class="required form-control"> <input type="text" id="last-name"
class="<?= $require_last_name ? 'required' : '' ?> form-control"
maxlength="120"/>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="email" class="form-label"> <label for="email" class="form-label">
<?= lang('email') ?> <?= lang('email') ?>
<?php if ($require_email): ?>
<span class="text-danger">*</span> <span class="text-danger">*</span>
<?php endif ?>
</label> </label>
<input id="email" class="required form-control"> <input type="text" id="email"
class="<?= $require_email ? 'required' : '' ?> form-control"
maxlength="120"/>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="phone-number" class="form-label"> <label for="phone-number" class="form-label">
<?= lang('phone_number') ?> <?= lang('phone_number') ?>
<?php if (setting('require_phone_number') === '1'): ?> <?php if ($require_phone_number): ?>
<span class="text-danger">*</span> <span class="text-danger">*</span>
<?php endif ?> <?php endif ?>
</label> </label>
<input id="phone-number" <input type="text" id="phone-number" maxlength="60"
class="form-control <?= setting('require_phone_number') === '1' ? 'required' : '' ?>"> class="<?= $require_phone_number ? 'required' : '' ?> form-control"/>
</div> </div>
</div> </div>
<div class="col-12 col-sm-6"> <div class="col-12 col-sm-6">
<div class="mb-3"> <div class="mb-3">
<label for="address" class="form-label"> <label for="address" class="form-label">
<?= lang('address') ?> <?= lang('address') ?>
<?php if ($require_address): ?>
<span class="text-danger">*</span>
<?php endif ?>
</label> </label>
<input id="address" class="form-control"> <input type="text" id="address"
class="<?= $require_address ? 'required' : '' ?> form-control"
maxlength="120"/>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="city" class="form-label"> <label for="city" class="form-label">
<?= lang('city') ?> <?= lang('city') ?>
<?php if ($require_city): ?>
<span class="text-danger">*</span>
<?php endif ?>
</label> </label>
<input id="city" class="form-control"> <input type="text" id="city"
class="<?= $require_city ? 'required' : '' ?> form-control"
maxlength="120"/>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="zip-code" class="form-label"> <label for="zip-code" class="form-label">
<?= lang('zip_code') ?> <?= lang('zip_code') ?>
<?php if ($require_zip_code): ?>
<span class="text-danger">*</span>
<?php endif ?>
</label> </label>
<input id="zip-code" class="form-control"> <input type="text" id="zip-code"
class="<?= $require_zip_code ? 'required' : '' ?> form-control"
maxlength="120"/>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="customer-notes" class="form-label"> <label for="customer-notes" class="form-label">
<?= lang('notes') ?> <?= lang('notes') ?>
<?php if ($require_zip_code): ?>
<span class="text-danger">*</span>
<?php endif ?>
</label> </label>
<textarea id="customer-notes" rows="2" class="form-control"></textarea> <textarea id="customer-notes" rows="2"
class="<?= $require_zip_code ? 'required' : '' ?> form-control"></textarea>
</div> </div>
</div> </div>
</div> </div>