PHP File Manager
Editing File: Search.php
<?php /* * Copyright (C) Wayne Purton-Smith - All Rights Reserved * Unauthorized copying of this file or removing this paragraph, via any medium is strictly prohibited * Proprietary and confidential * Written by Wayne Purton-Smith <waynepurtonsmith@hotmail.co.uk> February 2014 */ class Search extends CI_Controller { public function index() { $search_query = trim(htmlspecialchars_decode(rawurldecode($this->input->get('q')), ENT_QUOTES)); if(($order_number = is_order_number($search_query))) { if(($order_id = $this->orders->getOrderIdByNumber($order_number))) { redirect('/orders/view/' . $order_id); exit; } } $head_data['page_title'] = (strlen($search_query)) ? 'Search results for "' . $search_query . '"' : 'Intranet search'; $this->load->view('header', $head_data); $orders_search = $this->orders->get(NULL, NULL, array ( 'customer_details' => $search_query )); $customers_search = $this->customers->get(NULL, array ( 'customer_details' => $search_query )); $data['search_query'] = $search_query; $data['found_orders'] = $orders_search; $data['found_customers'] = $customers_search; $this->load->view('search_results', $data); $this->load->view('footer'); } }
Cancel