mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-23 00:13:21 +03:00
51 lines
1.5 KiB
PHP
51 lines
1.5 KiB
PHP
<?php defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
* Easy!Appointments - Open Source Web Scheduler
|
|
*
|
|
* @package EasyAppointments
|
|
* @author A.Tselegidis <alextselegidis@gmail.com>
|
|
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
|
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
|
* @link http://easyappointments.org
|
|
* @since v1.3.2
|
|
* ---------------------------------------------------------------------------- */
|
|
|
|
/**
|
|
* Class Consent
|
|
*
|
|
* Handles user consent related operations.
|
|
*/
|
|
class Consents extends CI_Controller {
|
|
/**
|
|
* Save the user's consent.
|
|
*/
|
|
public function ajax_save_consent()
|
|
{
|
|
try
|
|
{
|
|
$consent = $this->input->post('consent');
|
|
|
|
$this->load->model('consents_model');
|
|
|
|
$consent['ip'] = $this->input->ip_address();
|
|
|
|
$consent['id'] = $this->consents_model->add($consent);
|
|
|
|
$this->output
|
|
->set_content_type('application/json')
|
|
->set_output(json_encode([
|
|
'success' => TRUE,
|
|
'id' => $consent['id']
|
|
]));
|
|
}
|
|
catch (Exception $exc)
|
|
{
|
|
$this->output
|
|
->set_content_type('application/json')
|
|
->set_output(json_encode([
|
|
'exceptions' => [exceptionToJavaScript($exc)]
|
|
]));
|
|
}
|
|
}
|
|
}
|