1: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2:
3: class Backend extends CI_Controller {
4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
15: public function index($appointment_hash = '') {
16:
17:
18: $this->load->model('appointments_model');
19: $this->load->model('providers_model');
20: $this->load->model('services_model');
21: $this->load->model('customers_model');
22: $this->load->model('settings_model');
23:
24: $view['base_url'] = $this->config->item('base_url');
25: $view['book_advance_timeout'] = $this->settings_model->get_setting('book_advance_timeout');
26: $view['company_name'] = $this->settings_model->get_setting('company_name');
27: $view['available_providers'] = $this->providers_model->get_available_providers();
28: $view['available_services'] = $this->services_model->get_available_services();
29:
30: if ($appointment_hash != '') {
31: $results = $this->appointments_model->get_batch(array('hash' => $appointment_hash));
32: $appointment = $results[0];
33: $appointment['customer'] = $this->customers_model->get_row($appointment['id_users_customer']);
34: $view['edit_appointment'] = $appointment;
35: } else {
36: $view['edit_appointment'] = NULL;
37: }
38:
39: $this->load->view('backend/header', $view);
40: $this->load->view('backend/calendar', $view);
41: $this->load->view('backend/footer', $view);
42: }
43:
44: 45: 46: 47: 48:
49: public function customers() {
50:
51:
52: $this->load->model('providers_model');
53: $this->load->model('customers_model');
54: $this->load->model('services_model');
55: $this->load->model('settings_model');
56:
57: $view['base_url'] = $this->config->item('base_url');
58: $view['company_name'] = $this->settings_model->get_setting('company_name');
59: $view['customers'] = $this->customers_model->get_batch();
60: $view['available_providers'] = $this->providers_model->get_available_providers();
61: $view['available_services'] = $this->services_model->get_available_services();
62:
63: $this->load->view('backend/header', $view);
64: $this->load->view('backend/customers', $view);
65: $this->load->view('backend/footer', $view);
66: }
67:
68: 69: 70: 71: 72: 73: 74: 75: 76:
77: public function services() {
78:
79:
80: $this->load->model('customers_model');
81: $this->load->model('services_model');
82: $this->load->model('settings_model');
83:
84: $view['base_url'] = $this->config->item('base_url');
85: $view['company_name'] = $this->settings_model->get_setting('company_name');
86: $view['services'] = $this->services_model->get_batch();
87: $view['categories'] = $this->services_model->get_all_categories();
88:
89: $this->load->view('backend/header', $view);
90: $this->load->view('backend/services', $view);
91: $this->load->view('backend/footer', $view);
92: }
93:
94: 95: 96: 97: 98: 99: 100:
101: public function users() {
102:
103:
104: $this->load->model('providers_model');
105: $this->load->model('secretaries_model');
106: $this->load->model('admins_model');
107: $this->load->model('services_model');
108: $this->load->model('settings_model');
109:
110: $view['base_url'] = $this->config->item('base_url');
111: $view['company_name'] = $this->settings_model->get_setting('company_name');
112: $view['admins'] = $this->admins_model->get_batch();
113: $view['providers'] = $this->providers_model->get_batch();
114: $view['secretaries'] = $this->secretaries_model->get_batch();
115: $view['services'] = $this->services_model->get_batch();
116:
117: $this->load->view('backend/header', $view);
118: $this->load->view('backend/users', $view);
119: $this->load->view('backend/footer', $view);
120: }
121:
122: 123: 124: 125: 126: 127: 128:
129: public function settings() {
130: echo '<h1>Not implemented yet.</h1>';
131: }
132: }
133:
134:
135: