2021-12-16 10:37:55 +03:00
|
|
|
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
2022-01-18 15:05:42 +03:00
|
|
|
* Easy!Appointments - Online Appointment Scheduler
|
2021-12-16 10:37:55 +03:00
|
|
|
*
|
|
|
|
* @package EasyAppointments
|
|
|
|
* @author A.Tselegidis <alextselegidis@gmail.com>
|
2021-12-18 19:43:45 +03:00
|
|
|
* @copyright Copyright (c) Alex Tselegidis
|
2021-12-16 10:37:55 +03:00
|
|
|
* @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');
|
2022-03-28 09:18:00 +03:00
|
|
|
|
|
|
|
$this->load->library('google_sync');
|
2021-12-16 10:37:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Display the appointment registration success page.
|
|
|
|
*/
|
2021-12-18 19:22:40 +03:00
|
|
|
public function of()
|
2021-12-16 10:37:55 +03:00
|
|
|
{
|
2022-01-13 13:33:46 +03:00
|
|
|
$appointment_hash = $this->uri->segment(3);
|
2021-12-18 19:22:40 +03:00
|
|
|
|
2021-12-16 10:37:55 +03:00
|
|
|
$occurrences = $this->appointments_model->get(['hash' => $appointment_hash]);
|
|
|
|
|
|
|
|
if (empty($occurrences))
|
|
|
|
{
|
|
|
|
redirect('appointments'); // The appointment does not exist.
|
2021-12-18 19:22:40 +03:00
|
|
|
|
2021-12-16 10:37:55 +03:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
$appointment = $occurrences[0];
|
|
|
|
|
2022-03-28 09:18:00 +03:00
|
|
|
$add_to_google_url = $this->google_sync->get_add_to_google_url($appointment['id']);
|
2022-01-13 13:33:46 +03:00
|
|
|
|
|
|
|
html_vars([
|
|
|
|
'page_title' => lang('success'),
|
2022-05-22 15:39:19 +03:00
|
|
|
'theme' => setting('theme', 'default'),
|
2022-01-19 12:18:00 +03:00
|
|
|
'google_analytics_code' => setting('google_analytics_code'),
|
|
|
|
'matomo_analytics_url' => setting('matomo_analytics_url'),
|
2022-03-28 09:18:00 +03:00
|
|
|
'add_to_google_url' => $add_to_google_url,
|
2021-12-16 10:37:55 +03:00
|
|
|
]);
|
2022-01-13 13:33:46 +03:00
|
|
|
|
2022-01-19 12:21:05 +03:00
|
|
|
$this->load->view('pages/booking_confirmation');
|
2021-12-16 10:37:55 +03:00
|
|
|
}
|
|
|
|
}
|