%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 if (!defined('BASEPATH')) { exit('No direct script access allowed'); } class Manageservice extends ADMIN_Controller { public function __construct() { parent::__construct(); $this->load->model('Service_model'); } public function index() { $this->login_check(); $data = array(); $head = array(); $head['title'] = 'Administration - Manage Services'; $head['description'] = 'Administration - Manage Services'; $head['keywords'] = 'Administration - Manage Services'; // Delete Service if (isset($_GET['delete'])) { $this->Service_model->deleteRecords($_GET['delete']); $this->session->set_flashdata('success', 'Service is deleted!'); $this->saveHistory('Delete Service id - ' . $_GET['delete']); redirect('admin/manageservice'); } // Get happenings $data['services'] = $this->Service_model->getServices(NULL, NULL); // Get Sections //$data['categoryArray'] = $this->Business_model->getcategoryList('tbl_business_category'); $this->load->view('_parts/header', $head); $this->load->view('manageservice/manageservice', $data); $this->load->view('_parts/footer'); $this->saveHistory('Go to Manage Services'); } public function addservice() { $this->login_check(); $data = array(); $head = array(); $head['title'] = 'Administration - Add Services'; $head['description'] = 'Administration - Add Services'; $head['keywords'] = 'Administration - Add Services'; if (isset($_POST['submit'])) { //$this->form_validation->set_rules('title', 'Title', 'trim|required'); $this->form_validation->set_rules('description', 'Description', 'trim|required'); $this->form_validation->set_rules('status', 'Status', 'trim|required'); //$video_file = $this->uploadvideo(); // if($video_file==false) { // $this->form_validation->set_message('video_file','Invalid Video Size. Maximum 5 MB video allowed!'); // } if ($this->form_validation->run($this)) { //$_POST['video_url'] = seo_friendly_url(str_replace(' ','-',strtolower($_POST['video_url']))); //$_POST['video_name'] = seo_friendly_url($_POST['video_name']); // $_POST['video_text'] = seo_friendly_url($_POST['video_text']); $_POST['service_image'] = $this->uploadImage('service_image'); //$_POST['site_logo'] = $this->uploadImage('site_logo'); //if($_POST['old_logo']!='' && $_POST['site_logo']==''){ $_POST['site_logo'] = $_POST['old_logo']; } unset($_POST['old_logo']); //$_POST['title'] = seo_friendly_url($_POST['title']); $_POST['description'] = seo_friendly_url_desc($_POST['description']); $_POST['slug'] = str_replace(array(" ","'","&",";",":","`"),"-",valid_seo_friendly_url(strtolower($_POST['slug']))); $this->Service_model->setServices($_POST); $this->session->set_flashdata('success', 'Service Added Successfully'); if ($id == 0) { $this->saveHistory('Service Added Successfully'); } else { $this->saveHistory('Service Updated Successfully'); } redirect('admin/manageservice'); } } // Get Service List if(isset($_GET['edit'])){ $_POST = $this->Service_model->getServices($_GET['edit']); } // Set Sections //$data['categoryArray'] = $this->Service_model->getcategory('tbl_service_category'); $this->load->view('_parts/header', $head); $this->load->view('manageservice/addservice', $data); $this->load->view('_parts/footer'); $this->saveHistory('Go to Add New Service'); } /* * Function : uploadImage */ private function uploadImage($image) { $config['upload_path'] = './attachments/service_images/'; $config['allowed_types'] = $this->allowed_img_types; $this->load->library('upload', $config); $this->upload->initialize($config); if (!$this->upload->do_upload($image)) { //log_message('error', 'Image Upload Error: ' . $this->upload->display_errors()); } $img = $this->upload->data(); // Resize Image if(!empty($img['file_name'])) { //resizeImage($img['file_name'],'250','250','attachments/happening_images'); } return $img['file_name']; } // /* // * Function : sections // */ // public function managecategory() // { // $this->login_check(); // $data = array(); // $head = array(); // $head['title'] = 'Administration - Manage Category'; // $head['description'] = 'Administration - Manage Category'; // $head['keywords'] = 'Administration - Manage Category'; // // Delete Sections // if (isset($_GET['delete'])) { // $this->Business_model->delete_records('tbl_business_category',$_GET['delete']); // $this->session->set_flashdata('success', 'Category is deleted!'); // $this->saveHistory('Delete Catgeory id - ' . $_GET['delete']); // redirect('admin/managebusiness/managecategory'); // } // // Set category // $data['categoryArray'] = $this->Business_model->getAllcategories('tbl_business_category'); // $this->load->view('_parts/header', $head); // $this->load->view('managebusiness/managecategory', $data); // $this->load->view('_parts/footer'); // $this->saveHistory('Go to Manage Category'); // } // public function addcategory() // { // $this->login_check(); // $data = array(); // $head = array(); // $head['title'] = 'Administration - Add Category'; // $head['description'] = 'Administration - Add Category'; // $head['keywords'] = 'Administration - Add Category'; // if (isset($_POST['submit'])) { // $this->form_validation->set_rules('category_name', 'Category Name', 'trim|required'); // $this->form_validation->set_rules('status', 'Status', 'trim|required'); // if ($this->form_validation->run($this)) { // $this->Business_model->setCategory($_POST); // $this->session->set_flashdata('success', 'Category Added Successfully'); // if ($id == 0) { // $this->saveHistory('Category Added Successfully'); // } else { // $this->saveHistory('Category Updated Successfully'); // } // redirect('admin/managebusiness/managecategory'); // } // } // if(isset($_GET['edit'])) // { // $_POST = $this->Business_model->getcategory('tbl_business_category', $_GET['edit']); // } // $this->load->view('_parts/header', $head); // $this->load->view('managebusiness/addcategory', $data); // $this->load->view('_parts/footer'); // $this->saveHistory('Go to Add New Category'); // } // private function uploadvideo() // { // $config = array(); // $video_data = array(); // $config['upload_path'] = './attachments/business_video_files/'; // $config['allowed_types'] = $this->allowed_video_types; // $config['encrypt_name'] = FALSE; // $is_file_error = FALSE; // $this->load->library('upload', $config); // $this->upload->initialize($config); // if($_FILES['video_file']['size']<=$this->allowed_video_size){ // if (!$this->upload->do_upload('video_file')) { // log_message('error', 'Image Upload Error: ' . $this->upload->display_errors()); // } // $img = $this->upload->data(); // return $img['file_name']; // } else { // return $is_file_error; // } // } }