load->model('Groups_model'); $this->load->model('Groups_permission_model'); if (!$this->ion_auth->in_group(array('admin'))) { redirect('home/permission'); } } public function index() { $this->load->view('home/dashboard'); // just the header file $this->load->view('groups'); $this->load->view('home/footer'); // just the header file } public function addNewView() { $this->load->view('home/dashboard'); // just the header file $this->load->view('add_new'); $this->load->view('home/footer'); // just the header file } public function addNew() { $id = $this->input->post('id'); $name = $this->input->post('name'); $description = $this->input->post('description'); $this->load->library('form_validation'); $this->form_validation->set_error_delimiters('
';
// print_r($data);
// echo '';
// die;
$this->load->view('home/dashboard'); // just the header file
$this->load->view('add_new_permission',$data);
$this->load->view('home/footer'); // just the header file
}
public function addNewPermission() {
$permission=$this->input->post('name');
$group_id=$this->input->post('id');
$this->Groups_permission_model->delete($group_id);
$data = array();
foreach ($permission as $p) {
$data = array(
'group_id' => $group_id,
'permission_id' => $p,
);
$this->Groups_permission_model->insertGroupPermission($data);
}
$this->session->set_flashdata('feedback', 'Added');
redirect('groups');
}
// function details() {
// $data = array();
// if ($this->ion_auth->in_group(array('Doctor'))) {
// $doctor_ion_id = $this->ion_auth->get_user_id();
// $id = $this->doctor_model->getDoctorByIonUserId($doctor_ion_id)->id;
// } else {
// redirect('home');
// }
// $data['doctor'] = $this->doctor_model->getDoctorById($id);
// $data['todays_appointments'] = $this->appointment_model->getAppointmentByDoctorByToday($id);
// $data['appointments'] = $this->appointment_model->getAppointmentByDoctor($id);
// $data['patients'] = $this->patient_model->getPatient();
// $data['appointment_patients'] = $this->patient->getPatientByAppointmentByDctorId($id);
// $data['doctors'] = $this->doctor_model->getDoctor();
// $data['prescriptions'] = $this->prescription_model->getPrescriptionByDoctorId($id);
// $data['holidays'] = $this->schedule_model->getHolidaysByDoctor($id);
// $data['schedules'] = $this->schedule_model->getScheduleByDoctor($id);
// $this->load->view('home/dashboard'); // just the header file
// $this->load->view('details', $data);
// $this->load->view('home/footer'); // just the footer file
// }
// function editDoctorByJason() {
// $id = $this->input->get('id');
// $data['doctor'] = $this->doctor_model->getDoctorById($id);
// echo json_encode($data);
// }
// public function getDoctorInfo() {
// // Search term
// $searchTerm = $this->input->post('searchTerm');
// // Get users
// $response = $this->doctor_model->getDoctorInfo($searchTerm);
// echo json_encode($response);
// }
// public function getDoctorWithAddNewOption() {
// // Search term
// $searchTerm = $this->input->post('searchTerm');
// // Get users
// $response = $this->doctor_model->getDoctorWithAddNewOption($searchTerm);
// echo json_encode($response);
// }
// }
}
/* End of file doctor.php */
/* Location: ./application/modules/doctor/controllers/doctor.php */