%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 Managegallery extends ADMIN_Controller { public function __construct() { parent::__construct(); $this->load->model('Gallery_model'); } public function index() { $this->login_check(); $data = array(); $head = array(); $head['title'] = 'Administration - Manage Gallery'; $head['description'] = 'Administration - Manage Gallery'; $head['keywords'] = 'Administration - Manage Gallery'; // Delete Gallery if (isset($_GET['delete'])) { $this->Gallery_model->deleteRecords($_GET['delete']); $this->session->set_flashdata('success', 'Gallery is deleted!'); $this->saveHistory('Delete Gallery id - ' . $_GET['delete']); redirect('admin/managegallery'); } // Get happenings $data['gallery'] = $this->Gallery_model->getGallery(NULL, NULL); // Get Sections $data['categoryArray'] = $this->Gallery_model->getcategoryList('tbl_gallery_category'); $this->load->view('_parts/header', $head); $this->load->view('managegallery/managegallery', $data); $this->load->view('_parts/footer'); $this->saveHistory('Go to Manage Gallery'); } public function addgallery() { $this->login_check(); $data = array(); $head = array(); $head['title'] = 'Administration - Add Gallery'; $head['description'] = 'Administration - Add Gallery'; $head['keywords'] = 'Administration - Add Gallery'; 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['gallery_image'] = $this->uploadImage('gallery_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->Gallery_model->setGallery($_POST); $this->session->set_flashdata('success', 'Gallery Added Successfully'); if ($id == 0) { $this->saveHistory('Gallery Added Successfully'); } else { $this->saveHistory('Gallery Updated Successfully'); } redirect('admin/managegallery'); } } // Get Gallery List if(isset($_GET['edit'])){ $_POST = $this->Gallery_model->getGallery($_GET['edit']); } // Set Sections $data['categoryArray'] = $this->Gallery_model->getcategory('tbl_gallery_category'); $this->load->view('_parts/header', $head); $this->load->view('managegallery/addgallery', $data); $this->load->view('_parts/footer'); $this->saveHistory('Go to Add New Gallery'); } /* * 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->Gallery_model->delete_records('tbl_gallery_category',$_GET['delete']); $this->session->set_flashdata('success', 'Category is deleted!'); $this->saveHistory('Delete Catgeory id - ' . $_GET['delete']); redirect('admin/managegallery/managecategory'); } // Set category $data['categoryArray'] = $this->Gallery_model->getAllcategories('tbl_gallery_category'); $this->load->view('_parts/header', $head); $this->load->view('managegallery/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->Gallery_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/managegallery/managecategory'); } } if(isset($_GET['edit'])) { $_POST = $this->Gallery_model->getcategory('tbl_gallery_category', $_GET['edit']); } $this->load->view('_parts/header', $head); $this->load->view('managegallery/addcategory', $data); $this->load->view('_parts/footer'); $this->saveHistory('Go to Add New Category'); } /* * Function : uploadImage */ private function uploadImage($image) { $config['upload_path'] = './attachments/gallery_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']; } private function uploadvideo() { $config = array(); $video_data = array(); $config['upload_path'] = './attachments/gallery_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; } } }