%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 Empanelments extends CI_Controller { function __construct(){ parent::__construct(); if((!isset($_SESSION['is_logged']))||($_SESSION['is_logged']==false)) { $_SESSION['redirect'] = base_url()."admin/empanelments."; redirect(base_url().'admin/login'); } $this->load->model(array('ManageUsers_Model','Common_Model')); } public function index(){ // $this->module(); $data = array(); $data['categories'] = $recordsArray = $this->Common_Model->getCommonQuery('sh_empanelment_type'); $data['records'] = $recordsArray = $this->Common_Model->getCommonQuery('sh_empanelments'); // print_r($data['records']); $this->load->view('admin/empanelments',$data); } /* * Function : addmodule * For particular Record */ public function uploadImage() { $config['upload_path'] = './uploads/empanelments/'; $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 add_empanelments($uid = '') { if($_POST){ $this->form_validation->set_rules('title','Title','required'); $this->form_validation->set_rules('description','Description','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('.') $data=array( 'empanelment_type_id'=>$this->input->post('empanelment_type_id'), 'title'=>$this->input->post('title'), 'description'=>$this->input->post('description'), //'award_image'=>$this->input->post('award_image'), 'status'=>$this->input->post('status'), 'created_at'=>date('y-m-d H:i:s'), 'updated_at'=>date('y-m-d H:i:s') ); //$data['thumbnail'] = $this->uploadImage(); //if($_POST['old_thumbnail']!='' && $data['thumbnail']==''){ $data['thumbnail'] = $_POST['old_thumbnail']; } unset($_POST['old_thumbnail']); // print_r($data); die; if($this->input->post('id')){ $id = $this->input->post('id'); $this->Common_Model->updateinfo($tbl_name='sh_empanelments',$data,'id',$id); } else { $this->Common_Model->saveinfo($tbl_name='sh_empanelments',$data); } // setHistory('Module added Successfully'); redirect('admin/empanelments'); } else { $this->load->view('admin/addempanelments'); // setHistory('Validation error on Add/Edit module page'); } } else { $data['empanelment_type'] = $recordsArray = $this->Common_Model->getCommonQuery('sh_empanelment_type'); $data['sd'] = $sd = $this->Common_Model->getSingleRecord('sh_empanelments',' * ', array('id'=>$uid)); $this->load->view('admin/addempanelments',$data); // setHistory('Go to Add/Edit module page'); } } /* * Function : deletemodule * */ public function delete_empanelments($uid){ $this->Common_Model->removeAllItems("sh_empanelments",$uid,'id'); $this->session->set_flashdata('success', 'Data deleted'); redirect('admin/empanelments'); // setHistory('advance setting record deleted successfully'); } }