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)
{ {
@ -278,7 +279,7 @@
<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') ?>
@ -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>';
} }
} }