Converted the booking message to the booking message layout

This commit is contained in:
alextselegidis 2021-11-12 16:39:38 +01:00
parent b31b4c87bd
commit 9fdafa5497
4 changed files with 86 additions and 69 deletions

View file

@ -107,14 +107,14 @@ class Appointments extends EA_Controller {
if (empty($results))
{
// The requested appointment doesn't exist in the database. Display a message to the customer.
$variables = [
// The requested appointment was not found in the database.
$view = [
'message_title' => lang('appointment_not_found'),
'message_text' => lang('appointment_does_not_exist_in_db'),
'message_icon' => base_url('assets/img/error.png')
];
$this->load->view('appointments/message', $variables);
$this->load->layout('layouts/message/message_layout', 'pages/booking/booking_message_page', $view);
return;
}
@ -138,7 +138,7 @@ class Appointments extends EA_Controller {
'message_icon' => base_url('assets/img/error.png')
];
$this->load->view('appointments/message', $view);
$this->load->layout('layouts/message/message_layout', 'pages/booking/booking_message_page', $view);
return;
}
@ -166,7 +166,7 @@ class Appointments extends EA_Controller {
}
// Load the book appointment view.
$variables = [
$view = [
'available_services' => $available_services,
'available_providers' => $available_providers,
'company_name' => $company_name,
@ -192,10 +192,10 @@ class Appointments extends EA_Controller {
}
catch (Throwable $e)
{
$variables['exceptions'][] = $e;
$view['exceptions'][] = $e;
}
$this->load->layout('layouts/booking/booking_layout', 'pages/booking/booking_page', $variables);
$this->load->layout('layouts/booking/booking_layout', 'pages/booking/booking_page', $view);
}
/**
@ -256,7 +256,7 @@ class Appointments extends EA_Controller {
$view['exceptions'] = $exceptions;
}
$this->load->view('appointments/message', $view);
$this->load->layout('layouts/message/message_layout', 'pages/booking/booking_message_page', $view);
}
/**

View file

@ -1,61 +0,0 @@
<?php
/**
* @var string $message_title
* @var string $message_icon
* @var string $message_text
*/
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#35A768">
<title><?= $message_title ?> | Easy!Appointments</title>
<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/vendor/bootstrap/bootstrap.min.css') ?>">
<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/css/frontend.css') ?>">
<link rel="icon" type="image/x-icon" href="<?= asset_url('assets/img/favicon.ico') ?>">
<link rel="icon" sizes="192x192" href="<?= asset_url('assets/img/logo.png') ?>">
<script>
var EALang = <?= json_encode($this->lang->language) ?>;
</script>
<script src="<?= asset_url('assets/vendor/jquery/jquery.min.js') ?>"></script>
<script src="<?= asset_url('assets/vendor/@popperjs-core/popper.min.js') ?>"></script>
<script src="<?= asset_url('assets/vendor/bootstrap/bootstrap.min.js') ?>"></script>
<script src="<?= asset_url('assets/vendor/datejs/date.min.js') ?>"></script>
<script src="<?= asset_url('assets/js/general_functions.js') ?>"></script>
</head>
<body>
<div id="main" class="container">
<div class="row wrapper">
<div id="message-frame" class="col-12 border my-auto frame-container">
<div>
<img id="message-icon" src="<?= $message_icon ?>" alt="warning">
</div>
<div>
<h3><?= $message_title ?></h3>
<p><?= $message_text ?></p>
</div>
<div class="mt-2">
<small>
Powered by
<a href="https://easyappointments.org">Easy!Appointments</a>
</small>
</div>
</div>
</div>
</div>
<?php google_analytics_script() ?>
</body>
</html>

View file

@ -0,0 +1,59 @@
<?php
/**
* @var string $title
* @var array $styles
* @var string $template
* @var array $scripts
* @var array $global_variables
*/
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#35A768">
<link rel="icon" href="<?= asset_url('assets/img/favicon.ico') ?>">
<link rel="icon" href="<?= asset_url('assets/img/logo.png') ?>" sizes="192x192" type="image/png">
<title><?= $page_title ?> | Easy!Appointments</title>
<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/vendor/bootstrap/bootstrap.min.css') ?>">
<link rel="stylesheet" type="text/css" href="<?= asset_url('assets/css/frontend.css') ?>">
<?php foreach ($styles as $style): ?>
<link rel="stylesheet" type="text/css" href="<?= $style ?>">
<?php endforeach ?>
</head>
<body>
<div id="main" class="container">
<div class="row wrapper">
<div id="message-frame" class="col-12 border my-auto frame-container">
<?php require $page_path ?>
<div class="mt-2">
<small>
Powered by
<a href="https://easyappointments.org">Easy!Appointments</a>
</small>
</div>
</div>
</div>
</div>
<script>
var EALang = <?= json_encode($this->lang->language) ?>;
</script>
<script src="<?= asset_url('assets/vendor/jquery/jquery.min.js') ?>"></script>
<script src="<?= asset_url('assets/vendor/@popperjs-core/popper.min.js') ?>"></script>
<script src="<?= asset_url('assets/vendor/bootstrap/bootstrap.min.js') ?>"></script>
<script src="<?= asset_url('assets/js/general_functions.js') ?>"></script>
<?php foreach ($scripts as $script): ?>
<script src="<?= $script ?>"></script>
<?php endforeach ?>
<?php google_analytics_script() ?>
</body>
</html>

View file

@ -0,0 +1,19 @@
<?php
/**
* @var string $message_title
* @var string $message_icon
* @var string $message_text
*/
?>
<div>
<img id="message-icon" src="<?= $message_icon ?>" alt="warning">
</div>
<div>
<h3><?= $message_title ?></h3>
<p><?= $message_text ?></p>
</div>
<?php google_analytics_script() ?>