iflrandevu/application/controllers/Booking_confirmation.php

68 lines
2 KiB
PHP
Raw Normal View History

<?php defined('BASEPATH') or exit('No direct script access allowed');
/* ----------------------------------------------------------------------------
2022-01-18 15:05:42 +03:00
* Easy!Appointments - Online Appointment Scheduler
*
* @package EasyAppointments
* @author A.Tselegidis <alextselegidis@gmail.com>
2021-12-18 19:43:45 +03:00
* @copyright Copyright (c) Alex Tselegidis
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
* @link https://easyappointments.org
* @since v1.5.0
* ---------------------------------------------------------------------------- */
/**
* Booking confirmation controller.
*
* Handles the booking confirmation related operations.
*
* @package Controllers
*/
class Booking_confirmation extends EA_Controller {
/**
* Booking constructor.
*/
public function __construct()
{
parent::__construct();
$this->load->model('appointments_model');
$this->load->model('providers_model');
$this->load->model('services_model');
$this->load->model('customers_model');
$this->load->library('google_sync');
}
/**
* Display the appointment registration success page.
*/
public function of()
{
$appointment_hash = $this->uri->segment(3);
$occurrences = $this->appointments_model->get(['hash' => $appointment_hash]);
if (empty($occurrences))
{
redirect('appointments'); // The appointment does not exist.
return;
}
$appointment = $occurrences[0];
$add_to_google_url = $this->google_sync->get_add_to_google_url($appointment['id']);
html_vars([
'page_title' => lang('success'),
'theme' => setting('theme', 'default'),
'google_analytics_code' => setting('google_analytics_code'),
'matomo_analytics_url' => setting('matomo_analytics_url'),
'add_to_google_url' => $add_to_google_url,
]);
$this->load->view('pages/booking_confirmation');
}
}