%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 Feedbackpmchecklist extends CI_Controller { function __construct(){ parent::__construct(); $this->load->model('Common_Model'); if(! $this->session->userdata('adid')) { redirect('admin/login'); } } /* * Function : index * Desc : listing all records */ public function index() { $data = array(); $header = array(); $data['acategoryArray'] = $this->Common_Model->getCommonIdArray('tbl_asset_category'); $data['bumasterArray'] = $this->Common_Model->getCommonIdArray('tbl_bu_master'); $data['assetcArray'] = $this->Common_Model->getCommonIdArray('tbl_assetcategory_master'); $data['departmentArray'] = $this->Common_Model->getCommonIdArray('tbl_departments'); $data['recordsArray'] = $recordsArray = $this->Common_Model->getCommonQuery('tbl_pmplan_feedback'); $this->load->view('admin/_parts/header'); $this->load->view('admin/feedbackpmchecklist/index',$data); $this->load->view('admin/_parts/footer'); setHistory('Go to Change Password'); } /* * Function : addrecord * Desc : For particular Record */ public function addrecord($id='') { // School Array $data = array(); $data['acategoryArray'] = $this->Common_Model->getCommonIdArray('tbl_asset_category'); $data['bumasterArray'] = $this->Common_Model->getCommonIdArray('tbl_bu_master'); $data['assetcArray'] = $this->Common_Model->getCommonIdArray('tbl_assetcategory_master'); $data['departmentArray'] = $this->Common_Model->getCommonIdArray('tbl_departments'); if($_POST){ $this->form_validation->set_rules('equipment_type','Equipment Type','required'); $this->form_validation->set_rules('department','Department','required'); $this->form_validation->set_rules('location','Location','required'); $this->form_validation->set_rules('manufacture','Manufacture','required'); $this->form_validation->set_rules('sno','SNo','required'); $this->form_validation->set_rules('asset_tag','Asset Tag','required'); $this->form_validation->set_rules('model','Model','required'); $this->form_validation->set_rules('waranty_expiry','Waranty Expiry','required'); $this->form_validation->set_rules('custodian','Custodian','required'); $this->form_validation->set_rules('last_pmdate','Last PM Date','required'); $this->form_validation->set_rules('status','Status','required'); if($this->form_validation->run()) { $equipment_type = $this->input->post('equipment_type'); $department = $this->input->post('department'); $location = $this->input->post('location'); $manufacture = $this->input->post('manufacture'); $sno = $this->input->post('sno'); $asset_tag = $this->input->post('asset_tag'); $model = $this->input->post('model'); $custodian = $this->input->post('custodian'); $last_pmdate = $this->input->post('last_pmdate'); $waranty_expiry = $this->input->post('waranty_expiry'); $category = $this->input->post('category'); $business_unit = $this->input->post('business_unit'); $floor = $this->input->post('floor'); $room_no = $this->input->post('room_no'); $custodian_emp_code = $this->input->post('custodian_emp_code'); $custodian_email_id = $this->input->post('custodian_email_id'); $status = $this->input->post('status'); $data = array( 'category'=>$category, 'business_unit'=>$business_unit, 'floor'=>$floor, 'room_no'=>$room_no, 'custodian_emp_code'=>$custodian_emp_code, 'custodian_email_id'=>$custodian_email_id, 'equipment_type'=>$equipment_type, 'custodian'=>$custodian, 'last_pmdate'=>date('Y-m-d',strtotime($last_pmdate)), 'department'=>$department, 'location'=>$location, 'manufacture'=>$manufacture, 'sno'=>$sno, 'asset_tag'=>$asset_tag, 'waranty_expiry'=>$waranty_expiry, 'model'=>$model, 'custom_slug'=>str_replace(' ','-',strtolower($asset_tag)), 'status'=>$status, 'is_deleted'=>'0', 'createdon'=>date('y-m-d H:i:s') ); $records = $this->Common_Model->getSingleRecord('tbl_custompage',' * ', array('asset_tag'=>$asset_tag)); if(!empty($records)){ $id = $records['id']; $this->Common_Model->updateinfo($tbl_name='tbl_custompage',$data,'id',$id); setHistory('Info Auto Updated successfully'); } else { if($this->input->post('id')){ $id = $this->input->post('id'); $this->Common_Model->updateinfo($tbl_name='tbl_custompage',$data,'id',$id); setHistory('Info Updated successfully'); } else { $this->Common_Model->saveinfo($tbl_name='tbl_custompage',$data); setHistory('Info Added successfully'); } } redirect('admin/feedbackpmchecklist'); } else { $this->load->view('admin/feedbackpmchecklist/addrecord'); setHistory('Error! Add/Edit Custom page'); } } else { $data['sd'] = $this->Common_Model->getSingleRecord('tbl_custompage',' * ', array('id'=>$id)); $this->load->view('admin/_parts/header'); $this->load->view('admin/feedbackpmchecklist/addrecord',$data); $this->load->view('admin/_parts/footer'); if($id>0){ setHistory('Go to Edit custom page'); } else { setHistory('Go to Add custom page'); } } } /* * Function : viewrecord * Desc : For particular Record */ public function viewrecord($id='') { // School Array $data = array(); $data['acategoryArray'] = $this->Common_Model->getCommonIdArray('tbl_asset_category'); $data['bumasterArray'] = $this->Common_Model->getCommonIdArray('tbl_bu_master'); $data['assetcArray'] = $this->Common_Model->getCommonIdArray('tbl_assetcategory_master'); $data['departmentArray'] = $this->Common_Model->getCommonIdArray('tbl_departments'); $data['sd'] = $sd = $this->Common_Model->getSingleRecord('tbl_pmplan_feedback',' * ', array('id'=>$id)); // Get All Questions $data['allrecords'] = $this->Common_Model->getAllRecords('tbl_pmplan_feedback_records',' * ', array('pmplan_id'=>$sd['id'])); $questionArray = $this->Common_Model->getAllRecords('tbl_questions_master',' * ', array('status'=>'1')); $qDataArray = array(); foreach($questionArray as $question) { $qDataArray[$question['id']] = $question['title']; } $data['qmasterArray'] = $qDataArray; $this->load->view('admin/_parts/header'); $this->load->view('admin/feedbackpmchecklist/viewrecord',$data); $this->load->view('admin/_parts/footer'); setHistory('Go to view feedback records page'); } /* * Function : deleterecord * Desc : For records deletion */ public function deleterecord($uid) { $this->Common_Model->deleterecords('tbl_custompage',$uid); $this->session->set_flashdata('success', 'Data deleted'); setHistory('Current record deleted successfully'); redirect('admin/feedbackpmchecklist'); } /* * Function : downloadreport */ private function downloadreport($data) { //print_r($data); die; header("Content-Disposition: attachment; filename=programme-po-pso-statement-".time().".csv"); $file = fopen('php://output', 'w'); $header = array("Sr. No.","Programme","Statement Type", "Title","Statement","Status"); fputcsv($file, $header); $i=1; $recordsArray = $data['recordsArray']; $programArray = $data['programmedetails']; foreach ($recordsArray as $row){ $programme_name = $programArray[$row['programme_id']]['program_name'].' ('.$programArray[$row['programme_id']]['program_code'].')'; $status = $row['status']=='1' ? 'Active' : 'Inactive'; $statement_type = $row['statement_type']=='1' ? "PO Statement": "PSO Statement"; $title = strip_tags($row['title']); $statement = strip_tags($row['statement']); $data=array($i,$programme_name,$statement_type, $title,$statement,$status); fputcsv($file,$data); $i++; } fclose($file); exit; } /* * function : bulkupload */ public function bulkupload() { $data = array(); $head = array(); $uid = $this->session->userdata('adid'); if(isset($_POST["submit"])) { $file = $_FILES['program_file']['tmp_name']; $handle = fopen($file, "r"); $c = 0; $postArray = array(); while(($filesop = fgetcsv($handle, 1000, ",")) !== false) { $category = $filesop[0]; $business_unit = $filesop[1]; $equipment_type = $filesop[2]; $department = $filesop[3]; $floor = $filesop[4]; $room_no = $filesop[5]; $location = $filesop[6]; $manufacture = $filesop[7]; $sno = $filesop[8]; $asset_tag = $filesop[9]; $model = $filesop[10]; $waranty_expiry = $filesop[11]; $custodian = $filesop[12]; $custodian_emp_code = $filesop[13]; $custodian_email_id = $filesop[14]; $last_pmdate = $filesop[15]; $custom_one = $filesop[16]; $custom_two = $filesop[17]; $custom_three = $filesop[18]; $user_id = $uid->id; // Get All details if($c<>0){ /* SKIP THE FIRST ROW */ // Get Course Details $singleRow = $this->Common_Model->getSingleRecord('tbl_custompage','id', array('status'=>'1', 'is_deleted'=>'0','asset_tag'=>$asset_tag)); if($singleRow['id']>0) { $postArray['equipment_type'] = $equipment_type; $postArray['department'] = $department; $postArray['location'] = $location; $postArray['manufacture'] = $manufacture; $postArray['sno'] = $sno; $postArray['asset_tag'] = $asset_tag; $postArray['model'] = $model; $postArray['waranty_expiry'] = $waranty_expiry; $postArray['custodian'] = $custodian; $postArray['last_pmdate'] = date('Y-m-d',strtotime($last_pmdate)); $postArray['user_id'] = $user_id; $postArray['custom_slug'] = strtolower($asset_tag); $postArray['modifiedon'] = date('Y-m-d H:i:s'); $postArray['category'] = $category; $postArray['business_unit'] = $business_unit; $postArray['floor'] = $floor; $postArray['room_no'] = $room_no; $postArray['custodian_emp_code'] = $custodian_emp_code; $postArray['custodian_email_id'] = $custodian_email_id; $postArray['custom_one'] = $custom_one; $postArray['custom_two'] = $custom_two; $postArray['custom_three'] = $custom_three; $id = $singleRow['id']; // Set All records //print_r($postArray); die; $this->Common_Model->updateinfo('tbl_custompage',$postArray,'id',$id); } else { $postArray['equipment_type'] = $equipment_type; $postArray['department'] = $department; $postArray['location'] = $location; $postArray['manufacture'] = $manufacture; $postArray['sno'] = $sno; $postArray['asset_tag'] = $asset_tag; $postArray['model'] = $model; $postArray['waranty_expiry'] = $waranty_expiry; $postArray['custodian'] = $custodian; $postArray['last_pmdate'] = date('Y-m-d',strtotime($last_pmdate)); $postArray['user_id'] = $user_id; $postArray['custom_slug'] = strtolower($asset_tag); $postArray['modifiedon'] = date('Y-m-d H:i:s'); $postArray['category'] = $category; $postArray['business_unit'] = $business_unit; $postArray['floor'] = $floor; $postArray['room_no'] = $room_no; $postArray['custodian_emp_code'] = $custodian_emp_code; $postArray['custodian_email_id'] = $custodian_email_id; $postArray['custom_one'] = $custom_one; $postArray['custom_two'] = $custom_two; $postArray['custom_three'] = $custom_three; $postArray['createdon'] = date('Y-m-d H:i:s'); //print_r($postArray); die; // Save All records $this->Common_Model->saveinfo('tbl_custompage',$postArray); //die; } } $c = $c + 1; } $this->session->set_flashdata('success', '<span class="alert alert-success">All record added successfully</span>'); redirect('admin/feedbackpmchecklist'); } } }