2018-06-24 18:27:16 +03:00
|
|
|
<?php defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
* Easy!Appointments - Open Source Web Scheduler
|
|
|
|
*
|
|
|
|
* @package EasyAppointments
|
|
|
|
* @author A.Tselegidis <alextselegidis@gmail.com>
|
2020-03-11 12:10:59 +03:00
|
|
|
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
2018-06-24 18:27:16 +03:00
|
|
|
* @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)]
|
|
|
|
]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|