2020-04-22 22:48:56 +03:00
|
|
|
|
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
2013-07-09 08:43:59 +03:00
|
|
|
|
|
2015-07-20 22:41:24 +03:00
|
|
|
|
/* ----------------------------------------------------------------------------
|
2024-01-01 01:14:38 +03:00
|
|
|
|
* MaketRandevu - MAKET Randevu Portalı
|
2015-11-05 22:38:13 +03:00
|
|
|
|
*
|
2015-07-20 22:41:24 +03:00
|
|
|
|
* @package EasyAppointments
|
|
|
|
|
* @author A.Tselegidis <alextselegidis@gmail.com>
|
2021-12-18 19:43:45 +03:00
|
|
|
|
* @copyright Copyright (c) Alex Tselegidis
|
2020-11-14 22:36:25 +03:00
|
|
|
|
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
|
|
|
|
* @link https://easyappointments.org
|
2015-07-20 22:41:24 +03:00
|
|
|
|
* @since v1.0.0
|
|
|
|
|
* ---------------------------------------------------------------------------- */
|
|
|
|
|
|
2022-01-18 14:05:07 +03:00
|
|
|
|
/*
|
|
|
|
|
|------------------------------------------------------------------------------
|
|
|
|
|
| Deprecation Notice
|
|
|
|
|
|------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
| This file is still in the project for backwards compatibility reasons and for
|
|
|
|
|
| providing additional information on how to migrate your code to the latest
|
|
|
|
|
| codebase state.
|
|
|
|
|
|
|
|
|
|
|
| Visit the Easy!Appointments Developers website for more information:
|
|
|
|
|
|
|
|
|
|
|
| https://developers.easyappointments.org
|
|
|
|
|
|
|
|
|
|
|
| Since v1.5, the methods of this controller were ported to standalone controller
|
|
|
|
|
| classes, that can both handle the page rendering and all asynchronous HTTP
|
|
|
|
|
| requests.
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
2013-07-09 08:43:59 +03:00
|
|
|
|
/**
|
2021-11-06 18:21:27 +03:00
|
|
|
|
* Backend API controller.
|
2015-07-08 01:33:33 +03:00
|
|
|
|
*
|
2021-10-28 15:01:17 +03:00
|
|
|
|
* Handles the backend API related operations.
|
2015-11-05 22:38:13 +03:00
|
|
|
|
*
|
2015-07-08 01:33:33 +03:00
|
|
|
|
* @package Controllers
|
2023-11-29 12:24:09 +03:00
|
|
|
|
*
|
2022-01-18 14:06:20 +03:00
|
|
|
|
* @deprecated Since 1.5
|
2013-07-09 08:43:59 +03:00
|
|
|
|
*/
|
2023-11-29 12:24:09 +03:00
|
|
|
|
class Backend_api extends EA_Controller
|
|
|
|
|
{
|
2016-07-17 19:51:46 +03:00
|
|
|
|
/**
|
2017-09-15 14:36:37 +03:00
|
|
|
|
* Get Calendar Events
|
2016-07-17 19:51:46 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_get_calendar_events()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('calendar/get_calendar_appointments_for_table_view');
|
2016-07-17 19:51:46 +03:00
|
|
|
|
}
|
|
|
|
|
|
2013-07-09 08:43:59 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Get the registered appointments for the given date period and record.
|
2013-07-09 08:43:59 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_get_calendar_appointments()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('calendar/get_calendar_appointments');
|
2013-07-09 08:43:59 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-07-09 08:43:59 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Save appointment changes that are made from the backend calendar page.
|
2013-07-09 08:43:59 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_save_appointment()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('calendar/save_appointment');
|
2013-07-09 08:43:59 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-07-09 08:43:59 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Delete appointment from the database.
|
2013-07-09 08:43:59 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_delete_appointment()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('calendar/delete_appointment');
|
2013-07-09 08:43:59 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-07-09 08:43:59 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Disable a providers sync setting.
|
2013-07-09 08:43:59 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_disable_provider_sync()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('google/disable_provider_sync');
|
2013-07-09 08:43:59 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-07-09 08:43:59 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Filter the customer records with the given key string.
|
2013-07-09 08:43:59 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_filter_customers()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('customers/search');
|
2013-07-09 08:43:59 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-07-09 17:46:48 +03:00
|
|
|
|
/**
|
2022-01-18 14:05:07 +03:00
|
|
|
|
* Insert or update an unavailability.
|
2013-07-09 17:46:48 +03:00
|
|
|
|
*/
|
2022-01-18 14:54:41 +03:00
|
|
|
|
public function ajax_save_unavailability()
|
2017-09-15 14:36:37 +03:00
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('calendar/save_unavailability');
|
2013-07-09 17:46:48 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-07-09 17:46:48 +03:00
|
|
|
|
/**
|
2022-01-18 14:54:41 +03:00
|
|
|
|
* Delete an unavailability time period from database.
|
2013-07-09 17:46:48 +03:00
|
|
|
|
*/
|
2022-01-18 14:54:41 +03:00
|
|
|
|
public function ajax_delete_unavailability()
|
2017-09-15 14:36:37 +03:00
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('calendar/delete_unavailability');
|
2013-07-15 17:27:19 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2018-04-12 16:03:46 +03:00
|
|
|
|
/**
|
2020-10-20 16:03:48 +03:00
|
|
|
|
* Insert of update working plan exceptions to database.
|
2018-04-12 16:03:46 +03:00
|
|
|
|
*/
|
2020-10-20 16:03:48 +03:00
|
|
|
|
public function ajax_save_working_plan_exception()
|
2018-04-12 16:03:46 +03:00
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('calendar/save_working_plan_exception');
|
2018-04-12 16:03:46 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-10-28 15:01:17 +03:00
|
|
|
|
* Delete a working plan exceptions time period to database.
|
2018-04-12 16:03:46 +03:00
|
|
|
|
*/
|
2020-10-20 16:03:48 +03:00
|
|
|
|
public function ajax_delete_working_plan_exception()
|
2018-04-12 16:03:46 +03:00
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('calendar/delete_working_plan_exception');
|
2020-04-22 22:48:56 +03:00
|
|
|
|
}
|
2018-04-12 16:03:46 +03:00
|
|
|
|
|
2013-07-15 17:27:19 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Save (insert or update) a customer record.
|
2013-07-15 17:27:19 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_save_customer()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('customers/create'); // or "customers/update"
|
2013-07-15 17:27:19 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-07-15 17:27:19 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Delete customer from database.
|
2013-07-15 17:27:19 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_delete_customer()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('customers/destroy');
|
2013-07-09 17:46:48 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-07-19 18:29:59 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Save (insert or update) service record.
|
2013-07-19 18:29:59 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_save_service()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('services/create'); // or "services/update"
|
2013-07-16 17:21:33 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-07-19 18:29:59 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Delete service record from database.
|
2013-07-19 18:29:59 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_delete_service()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('services/destroy');
|
2013-07-16 17:21:33 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-07-19 18:29:59 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Filter service records by given key string.
|
2013-07-19 18:29:59 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_filter_services()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('services/search');
|
2013-07-16 17:21:33 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-07-19 18:29:59 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Save (insert or update) category record.
|
2013-07-19 18:29:59 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_save_service_category()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('categories/create'); // or "categories/update"
|
2013-07-16 17:21:33 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-07-19 18:29:59 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Delete category record from database.
|
2013-07-19 18:29:59 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_delete_service_category()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('categories/destroy');
|
2013-07-16 17:21:33 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-07-19 18:29:59 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Filter services categories with key string.
|
2013-07-19 18:29:59 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_filter_service_categories()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('categories/search');
|
2013-09-03 21:58:56 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-09-03 21:58:56 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Filter admin records with string key.
|
2013-09-03 21:58:56 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_filter_admins()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('admins/search');
|
2013-09-03 21:58:56 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-09-03 21:58:56 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Save (insert or update) admin record into database.
|
2013-09-03 21:58:56 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_save_admin()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('admins/create'); // or "admins/update"
|
2013-09-03 21:58:56 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-09-03 21:58:56 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Delete an admin record from the database.
|
2013-09-03 21:58:56 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_delete_admin()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('admins/destroy');
|
2013-09-03 21:58:56 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-09-03 21:58:56 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Filter provider records with string key.
|
2013-09-03 21:58:56 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_filter_providers()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('providers/search');
|
2013-09-03 21:58:56 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-09-03 21:58:56 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Save (insert or update) a provider record into database.
|
2013-09-03 21:58:56 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_save_provider()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('providers/create'); // or "providers/update"
|
2013-09-03 21:58:56 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-09-03 21:58:56 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Delete a provider record from the database.
|
2013-09-03 21:58:56 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_delete_provider()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('providers/destroy');
|
2013-09-03 21:58:56 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-09-03 21:58:56 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Filter secretary records with string key.
|
2013-09-03 21:58:56 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_filter_secretaries()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('secretaries/search');
|
2013-09-03 21:58:56 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-09-03 21:58:56 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Save (insert or update) a secretary record into database.
|
2013-09-03 21:58:56 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_save_secretary()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('secretaries/create'); // or "secretaries/update"
|
2013-09-03 21:58:56 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-09-03 21:58:56 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Delete a secretary record from the database.
|
2013-09-03 21:58:56 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_delete_secretary()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('secretaries/destroy');
|
2013-07-16 17:21:33 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-09-14 19:10:59 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Save a setting or multiple settings in the database.
|
2013-09-14 19:10:59 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_save_settings()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('general_settings/save'); // or "business_settings/save", "booking_settings/save", "legal_settings/save"
|
2013-09-14 19:10:59 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-09-23 18:42:36 +03:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* This method checks whether the username already exists in the database.
|
2013-09-23 18:42:36 +03:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_validate_username()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('account/validate_username');
|
2013-09-23 18:42:36 +03:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-12-23 18:55:42 +02:00
|
|
|
|
/**
|
2020-04-22 22:48:56 +03:00
|
|
|
|
* Change system language for current user.
|
2013-12-23 18:55:42 +02:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_change_language()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('account/change_language');
|
2013-12-23 18:55:42 +02:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-12-25 03:22:37 +02:00
|
|
|
|
/**
|
2021-10-28 15:01:17 +03:00
|
|
|
|
* This method will return a list of the available Google Calendars.
|
2013-12-25 03:22:37 +02:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_get_google_calendars()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('google/get_google_calendars');
|
2013-12-25 03:22:37 +02:00
|
|
|
|
}
|
2015-11-05 22:38:13 +03:00
|
|
|
|
|
2013-12-26 02:57:59 +02:00
|
|
|
|
/**
|
2015-11-05 22:38:13 +03:00
|
|
|
|
* Select a specific google calendar for a provider.
|
2013-12-26 02:57:59 +02:00
|
|
|
|
*/
|
2017-09-15 14:36:37 +03:00
|
|
|
|
public function ajax_select_google_calendar()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('google/select_google_calendar');
|
2013-12-26 02:57:59 +02:00
|
|
|
|
}
|
2020-03-29 20:25:23 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Apply global working plan to all providers.
|
|
|
|
|
*/
|
|
|
|
|
public function ajax_apply_global_working_plan()
|
|
|
|
|
{
|
2022-01-18 14:05:07 +03:00
|
|
|
|
redirect('business_settings/apply_global_working_plan');
|
2020-03-29 20:25:23 +03:00
|
|
|
|
}
|
2013-07-09 08:43:59 +03:00
|
|
|
|
}
|