%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
<?php error_reporting(0); defined('BASEPATH') OR exit('No direct script access allowed'); class Doctor extends CI_Controller { function __construct() { parent::__construct(); if((!isset($_SESSION['is_logged']))||($_SESSION['is_logged']==false)) { $_SESSION['redirect'] = base_url()."admin/Doctor/view_doctors"; redirect(base_url().'admin/login'); } // redirect_admin_not_logged(); $this->load->model('doctor_model', 'doctor'); $this->load->model('designation_model', 'designation'); $this->load->model('department_model', 'department'); // $this->load->model('nationality_model', 'nationality'); // $this->load->model('language_model', 'languages'); $this->load->model('Common_Model'); } public function index() { $this->view_doctors(); // $this->load->view('admin/ViewDoctors'); } public function do_upload($field_name, $upload_path= '', $file_name= '') { $this->load->library('upload', $config); if($upload_path!=''){ $config['upload_path'] = $upload_path; } else{ $config['upload_path'] = './uploads'; } $config['allowed_types'] = '*'; //$config['max_size'] = '100'; //$config['max_width'] = '1024'; //$config['max_height'] = '768'; if($file_name!=''){ $config['file_name'] = $file_name; } $this->upload->initialize($config); if($field_name!=''){ if ( ! $this->upload->do_upload($field_name)) { $error = array('error' => $this->upload->display_errors()); print_r($error); //$this->load->view('upload_form', $error); //return 0; } else { $data = array('upload_data' => $this->upload->data()); return $this->upload->data('file_name'); } } } public function add_doctor($id=0) { $data = array(); $data['data_string'] = ''; $doctorID = $id; if($id){ $records = $this->doctor->get_doctor_by_id($id); if(!$records){ show_404(); } else{ $data = array( 'DoctorID' => $records['DoctorID'], 'DoctorTitle' => $records['DoctorTitle'], 'DoctorName' => $records['DoctorName'], 'DoctorEmail' => '', 'DoctorDesignation' => $records['DoctorDesignation'], 'DoctorGender' => $records['DoctorGender'], 'DoctorNationality' => $records['DoctorNationality'], 'DoctorLanguage' => explode(',', $records['DoctorLanguage']), 'DoctorDepartment' => explode(',', $records['DoctorDepartment']), 'DoctorBriefProfile' => $records['DoctorBriefProfile'], 'DoctorQualification' => $records['DoctorQualification'], 'DoctorWorkExperienceDetail' => $records['DoctorWorkExperienceDetail'], 'DoctorQualificationDetail' => $records['DoctorQualificationDetail'], 'DoctorSpecialization' => $records['DoctorSpecialization'], 'DoctorClinicalInterest' => $records['DoctorClinicalInterest'], 'DoctorMemberships' => $records['DoctorMemberships'], 'DoctorOPDSchedule' => '', 'DoctorWorkExperience' => $records['DoctorWorkExperience'], 'DoctorAcheivements' => $records['DoctorAcheivements'], 'DoctorResearchPublication' => $records['DoctorResearchPublication'], 'DoctorProfilePic' => $records['DoctorProfilePic'], 'DoctorResume' => $records['DoctorResume'], 'DoctorPriorityOrder' => $records['DoctorPriorityOrder'], 'leadership_status' => $records['leadership_status'], 'Status' => $records['Status'], 'rating' => $records['rating'], 'DoctorPageURL' => str_replace(" ", "-",strtolower($records['DoctorPageURL'])) ); } } $post=$this->input->post(); if($post){ $this->form_validation->set_rules('DoctorTitle', 'Doctor Title', 'required'); $this->form_validation->set_rules('DoctorDesignation', 'Designation', 'required'); //$this->form_validation->set_rules('DoctorNationality', 'Nationality', 'required'); //$this->form_validation->set_rules('language[]', 'Language', 'required'); //$this->form_validation->set_rules('DoctorBriefProfile', 'Brief Profile', 'required'); //$this->form_validation->set_rules('DoctorQualification', 'Qualification', 'required'); // $this->form_validation->set_rules('DoctorWorkExperience', 'Work Experience', 'required'); //$this->form_validation->set_rules('profile_pic', 'Profile Picture','required'); if ($this->form_validation->run() == FALSE) { echo '<script>console.log("Error in validating doctor")</script>'; //console.log("Error in validating doctor"); // $data=$post; $this->load->view('admin/AddDoctor'); } else { $profile_pic =''; $resume = ''; if($_FILES['profile_pic']['name']){ $profile_pic = $this->do_upload('profile_pic', './uploads/doctor', 'doc_'.$post['DoctorPageURL']); $data['error'] = array('error' => $this->upload->display_errors()); } if($_FILES['resume']['name']){ $resume = $this->do_upload('resume', './uploads/doctor', 'resume_'.$post['DoctorPageURL']); $data['error'] = array('error' => $this->upload->display_errors()); } if(($_FILES['profile_pic']['name'])&&(!$profile_pic)){ $this->load->view('admin/AddDoctor'); } else if(($_FILES['resume']['name'])&&(!$resume)){ $this->load->view('admin/AddDoctor'); } else{ $DoctorID = $post['DoctorID']; $insert_data = array( 'DoctorTitle' => $post['DoctorTitle'], 'DoctorName' => $post['DoctorName'], 'DoctorEmail' => '', 'DoctorDesignation' => $post['DoctorDesignation'], 'DoctorGender' => $post['DoctorGender'], 'DoctorNationality' => $post['DoctorNationality'], 'DoctorLanguage' => implode(',', $post['language']), 'DoctorDepartment' => implode(',', $post['department']), 'DoctorBriefProfile' => $post['DoctorBriefProfile'], 'DoctorQualification' => $post['DoctorQualification'], 'DoctorWorkExperienceDetail' => $post['DoctorWorkExperienceDetail'], 'DoctorQualificationDetail' => $post['DoctorQualificationDetail'], 'DoctorSpecialization' => $post['DoctorSpecialization'], 'DoctorClinicalInterest' => $post['DoctorClinicalInterest'], 'DoctorMemberships' => $post['DoctorMemberships'], 'DoctorOPDSchedule' => '', 'DoctorWorkExperience' => $post['DoctorWorkExperience'], 'DoctorAcheivements' => $post['DoctorAcheivements'], 'DoctorResearchPublication' => $post['DoctorResearchPublication'], 'DoctorPriorityOrder' => $post['DoctorPriorityOrder'], 'leadership_status' => $post['leadership_status'], 'Status' => $post['Status'], 'rating' => $post['rating'], 'DoctorPageURL' => str_replace(" ", "-",strtolower($post['DoctorPageURL'])) ); if($profile_pic!=''){ $insert_data['DoctorProfilePic'] = $profile_pic; } if($profile_pic!=''){ $insert_data['DoctorResume'] = $resume; } $success = ''; echo '<script>console.log("'.$DoctorID.'")</script>'; if($DoctorID){ $success = $this->doctor->update_doctor($insert_data,$DoctorID); } else{ $success = $this->doctor->insert_doctor($insert_data); } if($success){ //redirect(base_url()."admin/Doctor/view_doctors"); redirect(base_url()."admin/Doctor"); }; } } } $data['designations'] = $this->designation->get_designations(); //$data['nationalities'] = $this->nationality->get_nationalities(); $data['nationalities'] = $this->Common_Model->getCommonQuery('SH_Nationalities'); $data['languages'] = $this->Common_Model->getCommonQuery('SH_Languages'); //$data['languages'] = $this->languages->get_languages(); $data['departments'] = $this->department->get_departments('DepartmentID, DepartmentName', array('Sub-department','Speciality','COE')); $data['doctorID'] = $doctorID; $this->load->view('admin/AddDoctor',$data); } /*********** opd_schedule ********************/ public function getuser() { $data = array(); $opdid = $_GET['uid']; $post=$this->input->post(); $this->load->view('admin/getuser',$opdid); } public function opd_schedule() { $data = array(); $opdid = $getid; $post=$this->input->post(); if($post){ $upd_opdschld = array( 'day' => $post['day'], 'time_first' => $post['time_first'], 'time_end' => $post['time_end'], 'drid'=>$post['getid'] ); } if($post['getid']){ $success = $this->doctor->upd_schedule($upd_opdschld,$post['getid']); } redirect(base_url()."admin/Doctor"); } /**************** END ************/ public function view_doctor($id=0) { $data = array(); $data['data_string'] = ''; if($id){ $data = $this->doctor->get_doctors(); if(!$records){ show_404(); } else{ $data = array( 'DoctorTitle' => $records['DoctorTitle'], 'DoctorName' => $records['DoctorName'], 'DoctorEmail' => '', 'DoctorDesignation' => $records['DoctorDesignation'], 'DoctorGender' => $records['DoctorGender'], 'DoctorNationality' => $records['DoctorNationality'], 'DoctorLanguage' => explode(',', $records['DoctorLanguage']), 'DoctorDepartment' => explode(',', $records['DoctorDepartment']), 'DoctorBriefProfile' => $records['DoctorBriefProfile'], 'DoctorQualification' => $records['DoctorQualification'], 'DoctorWorkExperienceDetail' => $records['DoctorWorkExperienceDetail'], 'DoctorQualificationDetail' => $records['DoctorQualificationDetail'], 'DoctorSpecialization' => $records['DoctorSpecialization'], 'DoctorClinicalInterest' => $records['DoctorClinicalInterest'], 'DoctorMemberships' => $records['DoctorMemberships'], 'DoctorOPDSchedule' => '', 'DoctorWorkExperience' => $records['DoctorWorkExperience'], 'DoctorAcheivements' => $records['DoctorAcheivements'], 'DoctorResearchPublication' => $records['DoctorResearchPublication'], 'DoctorPriorityOrder' => $records['DoctorPriorityOrder'], 'Status' => $records['Status'], 'DoctorPageURL' => str_replace(" ", "-",strtolower($records['DoctorPageURL'])) ); } } $this->load->view('admin/ViewDoctor',$data); } public function update_doctor($id){ $this->add_doctor($id); } public function view_doctors() { $data = array(); $data['records'] = $this->doctor->get_doctors(); if(!$data){ show_404(); } $this->load->view('admin/ViewDoctors',$data); } public function remove_doctor($id) { $data = array(); if($this->doctor->delete_doctor($id)){ $data['msg'] = 'Doctor deleted succesfully'; } else{ $data['msg'] = 'Doctor could not be deleted'; } $data['records'] = $this->doctor->get_doctors(); if(!$data){ show_404(); } $this->load->view('admin/ViewDoctors',$data); } }