mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-09 01:23:10 +03:00
Resolve the any-provider selection before processing provider information (#885).
This commit is contained in:
parent
3079c513a8
commit
ae1f951cf8
1 changed files with 8 additions and 6 deletions
|
@ -967,6 +967,14 @@ class Appointments extends CI_Controller {
|
||||||
$appointment = $post_data['appointment'];
|
$appointment = $post_data['appointment'];
|
||||||
$customer = $post_data['customer'];
|
$customer = $post_data['customer'];
|
||||||
|
|
||||||
|
// Check appointment availability before registering it to the database.
|
||||||
|
$appointment['id_users_provider'] = $this->check_datetime_availability();
|
||||||
|
|
||||||
|
if ( ! $appointment['id_users_provider'])
|
||||||
|
{
|
||||||
|
throw new Exception(lang('requested_hour_is_unavailable'));
|
||||||
|
}
|
||||||
|
|
||||||
$provider = $this->providers_model->get_row($appointment['id_users_provider']);
|
$provider = $this->providers_model->get_row($appointment['id_users_provider']);
|
||||||
$service = $this->services_model->get_row($appointment['id_services']);
|
$service = $this->services_model->get_row($appointment['id_services']);
|
||||||
|
|
||||||
|
@ -985,12 +993,6 @@ class Appointments extends CI_Controller {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check appointment availability before registering it to the database.
|
|
||||||
if ( ! $this->check_datetime_availability())
|
|
||||||
{
|
|
||||||
throw new Exception(lang('requested_hour_is_unavailable'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->customers_model->exists($customer))
|
if ($this->customers_model->exists($customer))
|
||||||
{
|
{
|
||||||
$customer['id'] = $this->customers_model->find_record_id($customer);
|
$customer['id'] = $this->customers_model->find_record_id($customer);
|
||||||
|
|
Loading…
Reference in a new issue