%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: Sharda Tech Pvt. Ltd.
*/
if (!defined('BASEPATH')) {
exit('No direct script access allowed');
}
class Contact extends ADMIN_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('Contact_model');
}
public function index()
{
$this->login_check();
if (isset($_GET['delete'])) {
$this->Contact_model->deleteContact($_GET['delete']);
$this->session->set_flashdata('result_delete', 'Contact is deleted!');
redirect('admin/contact');
}
$data = array();
$head = array();
$head['title'] = 'Administration - Manage Contact';
$head['description'] = '!';
$head['keywords'] = '';
$this->form_validation->set_rules('address_title', 'Title Name', 'trim|required');
$this->form_validation->set_rules('full_address', 'Address ', 'trim|required');
$this->form_validation->set_rules('contact_number', 'Contact Numbers', 'trim|required');
$this->form_validation->set_rules('display_order', 'Display order', 'trim|required');
if ($this->form_validation->run($this)) {
$_POST['location_image'] = $this->uploadImage();
$this->Contact_model->setContactDetails($_POST);
$this->saveHistory('Create new contact - ' . $_POST['address_title']);
redirect('admin/contact');
}
if(isset($_GET['edit'])) {
$_POST = $this->Contact_model->getContact($_GET['edit']);
}
$data['su_contact'] = $this->Contact_model->getContact();
$this->load->view('_parts/header', $head);
$this->load->view('contact/index', $data);
$this->load->view('_parts/footer');
$this->saveHistory('Go to Admin Users');
}
/*
* Function : uploadImage
*/
private function uploadImage()
{
$config['upload_path'] = './attachments/location_images/';
$config['allowed_types'] = $this->allowed_img_types;
$this->load->library('upload', $config);
$this->upload->initialize($config);
if (!$this->upload->do_upload('location_image')) {
log_message('error', 'Image Upload Error: ' . $this->upload->display_errors());
}
$img = $this->upload->data();
return $img['file_name'];
}
/*
* Function : exportData
*/
private function exportData()
{
if (isset($_POST['export'])) {
//header("Content-Disposition: attachment; filename=sharda-schools-".date('Y-m-d').".csv");
$schools = $data['schools'];
$file = fopen('php://output', 'w');
$header = array("School Name","School Url","Display Order","Date");
fputcsv($file, $header);
foreach ($schools as $school){
$data=array($school->school_name, $school->school_url ,$school->display_name,$bookings->createdon);
fputcsv($file,$data);
}
fclose($file);
exit;
}
}
}