MaketRandevu/application/controllers/Booking_confirmation.php

69 lines
2 KiB
PHP
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php defined('BASEPATH') or exit('No direct script access allowed');
/* ----------------------------------------------------------------------------
* MaketRandevu - MAKET Randevu Portalı
*
* @package EasyAppointments
* @author A.Tselegidis <alextselegidis@gmail.com>
* @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_confirmation 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.
*
* @throws Exception
*/
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'),
'company_color' => setting('company_color'),
'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');
}
}