%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 Surveyreport extends CI_Controller { function __construct(){ parent::__construct(); $this->load->model(array('Common_Model','Survey_Model')); if(! $this->session->userdata('adid')) { redirect('admin/login'); } } /* * Function : index * Desc : listing all records */ public function index() { $data = array(); $header = array(); $data['recordsArray'] = $this->Common_Model->getCommonQuery('survey_set'); $this->load->view('admin/_parts/header'); $this->load->view('admin/surveyreport/index',$data); $this->load->view('admin/_parts/footer'); setHistory('Go to manage surveyreport'); } /* * Function : viewsurvey * Desc : For particular Record */ public function viewreport($id='') { // School Array $data = array(); $record_num = end($this->uri->segment_array()); $survey_id = base64_decode($record_num); $data['recordsArray'] = $data['qry'] = $this->Survey_Model->getAllRecords('survey_set',' * ', array('id'=>$survey_id)); $data['taken'] = $this->Survey_Model->customCountRow($survey_id); $data['answers'] = $this->Survey_Model->customQueryRecords($survey_id); $data['sd'] = $this->Survey_Model->getSingleRecord('survey_set',' * ', array('id'=>$survey_id)); $data['questionArray'] = $this->Survey_Model->getAllRecords('survey_questions',' * ', array('survey_id'=>$survey_id,'status'=>'1')); $data['recordsTotalArray'] = $this->Survey_Model->getRecordsByGroup('survey_answers','count(id) as total, survey_id ', array('survey_id'=>$survey_id), 'survey_id'); $this->load->view('admin/_parts/header'); $this->load->view('admin/surveyreport/viewreport',$data); $this->load->view('admin/_parts/footer'); setHistory('Go to Add/Edit managesurvey'); } /* * Function : addquestion * Desc : For particular Record */ public function addquestion($id='') { // School Array $data = array(); if($_POST){ $this->form_validation->set_rules('question','Question Title','required'); $this->form_validation->set_rules('type','Question Type','required'); if($this->form_validation->run()) { if($this->input->post('id')){ //frm_textarea_opt_value $_POST['frm_textarea_opt'] = $_POST['frm_textarea_opt_value']; unset($_POST['frm_textarea_opt_value']); unset($_POST['addrecord']); $this->Survey_Model->save_question($_POST); setHistory('Survey Info Updated successfully'); } else { $data['createdon']=date('y-m-d H:i:s'); $this->Survey_Model->save_question($_POST); setHistory('Survey Info Added successfully'); } redirect('admin/managesurvey/viewsurvey/'.$_POST['sid']); } else { $this->load->view('admin/managesurvey/addquestion?sid='.$_POST['sid']); setHistory('Error! Add/Edit managesurvey'); } } else { $data['sd'] = $this->Survey_Model->getSingleRecord('survey_questions',' * ', array('id'=>$id)); $this->load->view('admin/_parts/header'); $this->load->view('admin/managesurvey/addquestion',$data); $this->load->view('admin/_parts/footer'); setHistory('Go to Add/Edit managesurvey view survey'); } } /* * Function : addrecord * Desc : For particular Record */ public function addrecord($id='') { // School Array $data = array(); if($_POST){ $this->form_validation->set_rules('title','Survey Title','required'); $this->form_validation->set_rules('start_date','Start Date','required'); $this->form_validation->set_rules('end_date','End Date','required'); if($this->form_validation->run()) { if($this->input->post('id')){ $this->Survey_Model->savesurvey($_POST); setHistory('Survey Info Updated successfully'); } else { $data['createdon']=date('y-m-d H:i:s'); $this->Survey_Model->savesurvey($_POST); setHistory('Survey Info Added successfully'); } redirect('admin/managesurvey'); } else { $this->load->view('admin/managesurvey/addrecord'); setHistory('Error! Add/Edit managesurvey'); } } else { $data['sd'] = $this->Survey_Model->getSingleRecord('survey_set',' * ', array('id'=>$id)); $this->load->view('admin/_parts/header'); $this->load->view('admin/managesurvey/addrecord',$data); $this->load->view('admin/_parts/footer'); setHistory('Go to Add/Edit managesurvey'); } } /* * Function : deleterecord * Desc : For records deletion */ public function deleterecord($uid) { $this->Survey_Model->deleterecords('tbl_subchecklist_master',$uid); $this->session->set_flashdata('success', 'Data deleted'); setHistory('managesurvey record deleted successfully'); redirect('admin/managesurvey'); } /* * Function : deletequestion * Desc : For records deletion */ public function deletequestion($uid) { $this->Survey_Model->deleterecords('survey_questions',$uid); $this->session->set_flashdata('success', 'Data deleted'); setHistory('Question record deleted successfully'); redirect('admin/managesurvey/viewsurvey/'.$_GET['sid']); } }