%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 defined('BASEPATH') OR exit('No direct script access allowed'); Class Patientstory extends CI_Controller { function __construct(){ parent::__construct(); if((!isset($_SESSION['is_logged']))||($_SESSION['is_logged']==false)) { $_SESSION['redirect'] = base_url()."admin/patientstory"; redirect(base_url().'admin/login'); } $this->load->model(array('ManageUsers_Model','Common_Model')); $this->load->model('patient_story_model', 'patient_story'); $this->load->model('department_model', 'department'); $this->load->model('health_library_model', 'condition'); } public function index(){ // $this->module(); $data = array(); $data['records'] = $recordsArray = $this->Common_Model->getCommonQuery('SH_PatientStories'); // print_r($data['records']); $this->load->view('admin/patientstory',$data); } /* * Function : addmodule * For particular Record */ public function uploadThumb() { $config['upload_path'] = './uploads/patient_stories/'; $config['allowed_types'] = "*"; $this->load->library('upload', $config); $this->upload->initialize($config); if (!$this->upload->do_upload('thumbnail')) { log_message('error', 'Image Upload Error: ' . $this->upload->display_errors()); } $img = $this->upload->data(); // if(!empty($img['file_name'])) { // resizeImage($img['file_name'],'300','300','attachments/awards_images'); // } return $img['file_name']; } public function uploadImage() { $config['upload_path'] = './uploads/patient_stories/'; $config['allowed_types'] = "*"; $this->load->library('upload', $config); $this->upload->initialize($config); if (!$this->upload->do_upload('image')) { log_message('error', 'Image Upload Error: ' . $this->upload->display_errors()); } $img = $this->upload->data(); // if(!empty($img['file_name'])) { // resizeImage($img['file_name'],'300','300','attachments/awards_images'); // } return $img['file_name']; } public function add_story($uid = '') { $data['nationalities'] = $this->Common_Model->getCommonQuery('SH_Nationalities'); $data['conditions'] = $this->condition->get_health_conditions(); $data['departments'] = $this->department->get_departments('DepartmentID, DepartmentName', array('Sub-department','Speciality')); if($_POST){ $this->form_validation->set_rules('title','Title','required'); $this->form_validation->set_rules('status','Status','required'); if($this->form_validation->run()) { // $fileTempPath = $_FILES['award_image']['tmp_name']; // $filename = $_FILES['award_image']['name']; // $filesize = $_FILES['award_image']['size']; // $fileType = $_FILES['award_image']['type']; // $fileNameCmps= explode('.') $formArray = array( 'PatientStoryTitle'=>$this->input->post('title'), 'PatientStoryDepartment'=>$this->input->post('department'), 'PatientStoryContent'=>$this->input->post('content'), 'PatientStoryCondition'=>$this->input->post('condition'), 'PatientStoryTestimonial'=>$this->input->post('testimonial'), 'PatientStoryNationality'=>$this->input->post('nationality'), 'PatientStoryState'=>$this->input->post('state'), 'PatientStoryDate'=>$this->input->post('date'), 'PatientStoryPriorityOrder'=>$this->input->post('order'), 'PatientStoryPageURL'=>$this->input->post('slug'), //'award_image'=>$this->input->post('award_image'), 'Status'=>$this->input->post('status'), 'CreationDate'=>date('y-m-d H:i:s'), 'UpdationDate'=>date('y-m-d H:i:s') ); $formArray['PatientStoryThumbnail'] = $this->uploadThumb(); $formArray['PatientStoryBanner'] = $this->uploadImage(); if($_POST['old_image']!='' && $formArray['PatientStoryBanner']==''){ $formArray['PatientStoryBanner'] = $_POST['old_image']; } unset($_POST['old_image']); if($_POST['old_thumb']!='' && $formArray['PatientStoryThumbnail']==''){ $formArray['PatientStoryThumbnail'] = $_POST['old_thumb']; } unset($_POST['old_thumb']); // print_r($data); die; if($this->input->post('id')){ $id = $this->input->post('id'); $this->Common_Model->updateinfo($tbl_name='SH_PatientStories',$formArray,'PatientStoryID',$id); } else { $this->Common_Model->saveinfo($tbl_name='SH_PatientStories',$formArray); } // setHistory('Module added Successfully'); redirect('admin/patientstory'); } else { $this->load->view('admin/addpatientstory',$data); // setHistory('Validation error on Add/Edit module page'); } } else { $data['sd'] = $sd = $this->Common_Model->getSingleRecord('SH_PatientStories',' * ', array('PatientStoryID'=>$uid)); $this->load->view('admin/addpatientstory',$data); // setHistory('Go to Add/Edit module page'); } } /* * Function : deletemodule * */ public function deletestory($uid){ $this->Common_Model->removeAllItems("SH_PatientStories",$uid,'PatientStoryID'); $this->session->set_flashdata('success', 'Data deleted'); redirect('admin/patientstory'); // setHistory('advance setting record deleted successfully'); } }