%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 /* * @Author: Chandni Gupta */ if (!defined('BASEPATH')) { exit('No direct script access allowed'); } ob_start(); class Call_center_enquiry extends VENDOR_Controller { private $num_rows = 10; public function __construct() { parent::__construct(); $this->load->library('session'); $this->load->library('pagination'); $this->load->model('Agent_model'); } public function index($page = 0) { if (isset($_GET['delete'])) { $this->Agent_model->deleteProduct($_GET['delete']); $this->session->set_flashdata('result_delete', 'product is deleted!'); $this->saveHistory('Delete product id - ' . $_GET['delete']); redirect('vendor/call_center_enquiry'); } $data = array(); $head = array(); $head['title'] = 'Calls'; $head['description'] = 'Calls'; $head['keywords'] = ''; $page = $_GET['per_page']; unset($_SESSION['filter']); $source = null; if ($this->input->get('source') !== NULL) { $source = $this->input->get('source'); $_SESSION['filter']['source '] = $source; } $from_date = null; if ($this->input->get('from_date') !== NULL) { $from_date = $this->input->get('from_date'); $_SESSION['filter']['from_date'] = $from_date; //$this->saveHistory('Search for product title - ' . $from_date); } $to_date = null; if ($this->input->get('to_date') !== NULL) { $to_date = $this->input->get('to_date'); $_SESSION['filter']['to_date'] = $to_date; //$this->saveHistory('Search for product title - ' . $to_date); } $search_title = null; if ($this->input->get('search_title') !== NULL) { $search_title = $this->input->get('search_title'); $_SESSION['filter']['search_title'] = $search_title; //$this->saveHistory('Search for product title - ' . $search_title); } $rowscount = $this->Agent_model->callsCount($source, $from_date, $to_date, $search_title, $this->vendor_id); $data['products'] = $this->Agent_model->getCalls($this->num_rows, $page, $source, $from_date, $to_date, $search_title,$this->vendor_id); //Export Report if (isset($_POST['export'])) { header("Content-Disposition: attachment; filename=Calls-".date('Y-m-d').".csv"); $all_students = $this->Agent_model->getCalls($this->num_rows, $page, $source, $from_date, $to_date, $search_title,$this->vendor_id); $file = fopen('php://output', 'w'); $header = array("UID","Name","Contact Number","Email id","Info Source","City","State","Agent","Call Duration","Call Date"); fputcsv($file, $header); foreach($all_students as $students){ $data=array($students->uid,$students->title.$students->full_name ,$students->phone,$students->email,$students->info_source,$students->city,$students->state,$students->agent_id,$students->duration,$students->created_on); fputcsv($file,$data); } fclose($file); exit; } ob_end_flush(); //pagination $config['base_url'] = base_url('vendor/call_center_enquiry'); $config['total_rows'] = $rowscount; $config['per_page'] = $this->num_rows; $this->pagination->initialize($config); $data['links_pagination'] = $this->pagination->create_links(); $this->load->view('_parts/header', $head); $this->load->view('call_canter_enquiry', $data); $this->load->view('_parts/footer'); } public function deleteProduct($id) { $this->Agent_model->deleteProduct($id, $this->vendor_id); $this->session->set_flashdata('result_delete', lang('vendor_product_deleted')); redirect(LANG_URL . '/vendor/call_center_enquiry'); } public function logout() { unset($_SESSION['logged_vendor']); delete_cookie('logged_vendor'); redirect(LANG_URL . '/vendor/call_center_enquiry'); } }