%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 Managevideo extends ADMIN_Controller { public function __construct() { parent::__construct(); $this->load->model('Common_model'); } public function index() { $this->login_check(); if (isset($_GET['delete'])) { $this->Common_model->deleteRecords($_GET['delete'],'id', 'su_videos'); $this->session->set_flashdata('result_delete', 'Video deleted successfully!'); redirect('admin/videos'); } $data = array(); $head = array(); $head['title'] = 'Administration - Manage Videos'; $head['description'] = '!'; $head['keywords'] = ''; //die(var_dump($_FILES)); // Validate the form $this->form_validation->set_rules('video_name', 'Video Name', 'trim|required'); $this->form_validation->set_rules('video_type', 'Video Type', 'trim|required'); $this->form_validation->set_rules('display_order', 'Display order', 'trim|required'); $this->form_validation->set_rules('status', 'Status', 'trim|required'); $video_file = $this->uploadImage(); 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']); $this->Common_model->setRecords($_POST, $tbl_name = 'su_videos'); $this->saveHistory('Create new video - ' . $_POST['video_name']); redirect('admin/managevideo'); } if(isset($_GET['edit'])) { $_POST = $this->Common_model->getRecords($_GET['edit'], 'su_videos'); } // Get All SU Videos $data['videos'] = $this->Common_model->getRecords(NULL, 'su_videos'); $this->load->view('_parts/header', $head); $this->load->view('managevideo/managevideo', $data); $this->load->view('_parts/footer'); $this->saveHistory('Go to Admin Users'); } /* * Function : Export data * Description: export the banner data in csv format */ Private function exportData($data) { header("Content-Disposition: attachment; filename=sharda-schools-".date('Y-m-d').".csv"); $banners = $data['banners']; $file = fopen('php://output', 'w'); $header = array("School Name","School Url","Display Order","Date"); fputcsv($file, $header); foreach ($banners as $banner){ $data=array($banner->banner_name, $banner->banner_type ,$banner->banner_image,$banner->banner_text,$banner->banner_status); fputcsv($file,$data); } fclose($file); exit; } /* * Function : uploadImage * Description : Upload the banner image */ private function uploadImage() { $config = array(); $video_data = array(); $config['upload_path'] = './attachments/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; } } }