mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-22 14:42:23 +03:00
Merge branch 'chrispichardo-master'
This commit is contained in:
commit
6eb710801b
2 changed files with 38 additions and 12 deletions
46
src/application/controllers/appointments.php
Normal file → Executable file
46
src/application/controllers/appointments.php
Normal file → Executable file
|
@ -210,20 +210,11 @@ class Appointments extends CI_Controller {
|
|||
} catch(Exception $exc) {
|
||||
$view['exceptions'][] = $exc;
|
||||
}
|
||||
|
||||
// :: LOAD THE BOOK SUCCESS VIEW
|
||||
$view = array(
|
||||
'appointment_data' => $appointment,
|
||||
'provider_data' => $provider,
|
||||
'service_data' => $service,
|
||||
'company_name' => $company_settings['company_name']
|
||||
);
|
||||
|
||||
} catch(Exception $exc) {
|
||||
$view['exceptions'][] = $exc;
|
||||
}
|
||||
|
||||
$this->load->view('appointments/book_success', $view);
|
||||
$this->session->set_flashdata('book_exceptions', $view['exceptions']);
|
||||
redirect('appointments/book_success/'.$appointment['id']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -678,6 +669,39 @@ class Appointments extends CI_Controller {
|
|||
));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* GET an specific appointment book and redirect to the success screen.
|
||||
*
|
||||
* @param int $appointment_id Contains the id of the appointment to retrieve.
|
||||
*/
|
||||
public function book_success($appointment_id) {
|
||||
//if the appointment id doesn't exist or zero redirect to index
|
||||
if(!$appointment_id){
|
||||
redirect('appointments');
|
||||
}
|
||||
$this->load->model('appointments_model');
|
||||
$this->load->model('providers_model');
|
||||
$this->load->model('services_model');
|
||||
$this->load->model('settings_model');
|
||||
//retrieve the data needed in the view
|
||||
$appointment = $this->appointments_model->get_row($appointment_id);
|
||||
$provider = $this->providers_model->get_row($appointment['id_users_provider']);
|
||||
$service = $this->services_model->get_row($appointment['id_services']);
|
||||
$company_name = $this->settings_model->get_setting('company_name');
|
||||
//get the exceptions
|
||||
$exceptions = $this->session->flashdata('book_success');
|
||||
// :: LOAD THE BOOK SUCCESS VIEW
|
||||
$view = array(
|
||||
'appointment_data' => $appointment,
|
||||
'provider_data' => $provider,
|
||||
'service_data' => $service,
|
||||
'company_name' => $company_name,
|
||||
);
|
||||
if($exceptions){
|
||||
$view['exceptions'] = $exceptions;
|
||||
}
|
||||
$this->load->view('appointments/book_success', $view);
|
||||
}
|
||||
}
|
||||
|
||||
/* End of file appointments.php */
|
||||
|
|
4
src/application/views/appointments/book_success.php
Normal file → Executable file
4
src/application/views/appointments/book_success.php
Normal file → Executable file
|
@ -44,7 +44,9 @@
|
|||
<?php
|
||||
echo '<h3>' . $this->lang->line('appointment_registered') . '</h3>';
|
||||
echo '<p>' . $this->lang->line('appointment_details_was_sent_to_you') . '</p>';
|
||||
|
||||
echo '<a href="'.$this->config->item('base_url').'" class="btn btn-primary btn-large">
|
||||
<span class="glyphicon glyphicon-calendar"></span>'.$this->lang->line('go_to_booking_page').'</a>';
|
||||
|
||||
if ($this->config->item('ea_google_sync_feature')) {
|
||||
echo '
|
||||
<button id="add-to-google-calendar" class="btn btn-primary">
|
||||
|
|
Loading…
Reference in a new issue