Minor formatting changes

This commit is contained in:
Alex Tselegidis 2021-10-28 13:28:37 +02:00
parent 18e89e1ba4
commit 198db17100
2 changed files with 47 additions and 43 deletions

View file

@ -101,7 +101,7 @@
$has_category = FALSE; $has_category = FALSE;
foreach ($available_services as $service) foreach ($available_services as $service)
{ {
if ($service['category_id'] != NULL) if ( ! empty($service['category_id']))
{ {
$has_category = TRUE; $has_category = TRUE;
break; break;
@ -114,7 +114,7 @@
foreach ($available_services as $service) foreach ($available_services as $service)
{ {
if ($service['category_id'] != NULL) if ( ! empty($service['category_id']))
{ {
if ( ! isset($grouped_services[$service['category_name']])) if ( ! isset($grouped_services[$service['category_name']]))
{ {
@ -138,8 +138,9 @@
foreach ($grouped_services as $key => $group) foreach ($grouped_services as $key => $group)
{ {
$group_label = ($key != 'uncategorized') $group_label = $key !== 'uncategorized'
? $group[0]['category_name'] : 'Uncategorized'; ? $group[0]['category_name']
: 'Uncategorized';
if (count($group) > 0) if (count($group) > 0)
{ {
@ -258,49 +259,49 @@
<input type="text" id="email" class="required form-control" maxlength="120"/> <input type="text" id="email" class="required form-control" maxlength="120"/>
</div> </div>
<?php if ($show_field['phone-number']) : ?> <?php if ($show_field['phone-number']) : ?>
<div class="form-group"> <div class="form-group">
<label for="phone-number" class="control-label"> <label for="phone-number" class="control-label">
<?= lang('phone_number') ?> <?= lang('phone_number') ?>
<?= $require_phone_number === '1' ? '<span class="text-danger">*</span>' : '' ?> <?= $require_phone_number === '1' ? '<span class="text-danger">*</span>' : '' ?>
</label> </label>
<input type="text" id="phone-number" maxlength="60" <input type="text" id="phone-number" maxlength="60"
class="<?= $require_phone_number === '1' ? 'required' : '' ?> form-control"/> class="<?= $require_phone_number === '1' ? 'required' : '' ?> form-control"/>
</div> </div>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="col-12 col-md-6"> <div class="col-12 col-md-6">
<?php if ($show_field['address']) : ?> <?php if ($show_field['address']) : ?>
<div class="form-group"> <div class="form-group">
<label for="address" class="control-label"> <label for="address" class="control-label">
<?= lang('address') ?> <?= lang('address') ?>
</label> </label>
<input type="text" id="address" class="form-control" maxlength="120"/> <input type="text" id="address" class="form-control" maxlength="120"/>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php if ($show_field['city']):?> <?php if ($show_field['city']): ?>
<div class="form-group"> <div class="form-group">
<label for="city" class="control-label"> <label for="city" class="control-label">
<?= lang('city') ?> <?= lang('city') ?>
</label> </label>
<input type="text" id="city" class="form-control" maxlength="120"/> <input type="text" id="city" class="form-control" maxlength="120"/>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php if ($show_field['zip-code']) : ?> <?php if ($show_field['zip-code']) : ?>
<div class="form-group"> <div class="form-group">
<label for="zip-code" class="control-label"> <label for="zip-code" class="control-label">
<?= lang('zip_code') ?> <?= lang('zip_code') ?>
</label> </label>
<input type="text" id="zip-code" class="form-control" maxlength="120"/> <input type="text" id="zip-code" class="form-control" maxlength="120"/>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php if ($show_field['notes']) : ?> <?php if ($show_field['notes']) : ?>
<div class="form-group"> <div class="form-group">
<label for="notes" class="control-label"> <label for="notes" class="control-label">
<?= lang('notes') ?> <?= lang('notes') ?>
</label> </label>
<textarea id="notes" maxlength="500" class="form-control" rows="1"></textarea> <textarea id="notes" maxlength="500" class="form-control" rows="1"></textarea>
</div> </div>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
@ -357,7 +358,7 @@
<div id="appointment-details" class="col-12 col-md-6"></div> <div id="appointment-details" class="col-12 col-md-6"></div>
<div id="customer-details" class="col-12 col-md-6"></div> <div id="customer-details" class="col-12 col-md-6"></div>
</div> </div>
<?php if ($this->settings_model->get_setting('require_captcha') === '1'): ?> <?php if (setting('require_captcha')): ?>
<div class="row frame-content"> <div class="row frame-content">
<div class="col-12 col-md-6"> <div class="col-12 col-md-6">
<h4 class="captcha-title"> <h4 class="captcha-title">

View file

@ -149,7 +149,7 @@
$has_category = FALSE; $has_category = FALSE;
foreach ($available_services as $service) foreach ($available_services as $service)
{ {
if ($service['category_id'] != NULL) if ( ! empty($service['category_id']))
{ {
$has_category = TRUE; $has_category = TRUE;
break; break;
@ -162,7 +162,7 @@
foreach ($available_services as $service) foreach ($available_services as $service)
{ {
if ($service['category_id'] != NULL) if ( ! empty($service['category_id']))
{ {
if ( ! isset($grouped_services[$service['category_name']])) if ( ! isset($grouped_services[$service['category_name']]))
{ {
@ -186,17 +186,20 @@
foreach ($grouped_services as $key => $group) foreach ($grouped_services as $key => $group)
{ {
$group_label = ($key != 'uncategorized') $group_label = $key !== 'uncategorized'
? $group[0]['category_name'] : 'Uncategorized'; ? $group[0]['category_name']
: 'Uncategorized';
if (count($group) > 0) if (count($group) > 0)
{ {
echo '<optgroup label="' . $group_label . '">'; echo '<optgroup label="' . $group_label . '">';
foreach ($group as $service) foreach ($group as $service)
{ {
echo '<option value="' . $service['id'] . '">' echo '<option value="' . $service['id'] . '">'
. $service['name'] . '</option>'; . $service['name'] . '</option>';
} }
echo '</optgroup>'; echo '</optgroup>';
} }
} }