%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 Whats_new extends ADMIN_Controller { private $num_rows = 10; public function __construct() { parent::__construct(); $this->load->model(array('Whats_new_model', 'Languages_model')); } public function index($page = 0) { //die('test'); $this->login_check(); $data = array(); $head['title'] = 'Administration - Tests Categories'; $head = array(); $head['description'] = '!'; $head['keywords'] = ''; $data['tests_categories'] = $this->Whats_new_model->getDoctors($this->num_rows, $page); $data['languages'] = $this->Languages_model->getLanguages(); $rowscount = $this->Whats_new_model->categoriesCount(); $data['links_pagination'] = pagination('admin/whats_new', $rowscount, $this->num_rows, 3); if (isset($_GET['delete'])) { $this->saveHistory('Delete a News'); $this->Whats_new_model->deleteItem('whats_new',($_GET['delete'])); $this->session->set_flashdata('result_delete', 'News is deleted!'); redirect('admin/whats_new'); } if (isset($_POST['submit'])) { $_POST['image'] = $this->uploadImage(); unset($_POST['submit']); $this->Whats_new_model->addeditnews($_POST); $this->session->set_flashdata('result_add', 'News is added!'); redirect('admin/whats_new'); } if (isset($_POST['editSubId'])) { $result = $this->Whats_new_model->editShopCategorieSub($_POST); if ($result === true) { $this->session->set_flashdata('result_add', 'Subcategory changed!'); $this->saveHistory('Change subcategory for category id - ' . $_POST['editSubId']); } else { $this->session->set_flashdata('result_add', 'Problem with Shop category change!'); } redirect('admin/whats_new'); } $this->load->view('_parts/header', $head); $this->load->view('whats_new/whats_new', $data); $this->load->view('_parts/footer'); $this->saveHistory('Go to shop categories'); } private function uploadImage() { $config['upload_path'] = './attachments/whats_new/'; $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(); return $img['file_name']; } public function getProductInfo($id) { $this->login_check(); return $this->Feedback_model->getOneProduct($id); } /* * called from ajax */ public function productStatusChange() { $this->login_check(); $result = $this->Feedback_model->productStatusChange($_POST['id'], $_POST['to_status']); if ($result == true) { echo 1; } else { echo 0; } $this->saveHistory('Change product id ' . $_POST['id'] . ' to status ' . $_POST['to_status']); } }