2011-06-17 12:52:00 +00:00
|
|
|
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
|
|
|
|
class Search extends CI_Controller {
|
|
|
|
|
2019-09-04 22:12:45 +00:00
|
|
|
|
|
|
|
function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
|
|
|
|
$this->load->helper(array('form', 'url'));
|
|
|
|
|
|
|
|
$this->load->model('user_model');
|
|
|
|
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
|
|
|
}
|
|
|
|
|
2011-06-17 12:52:00 +00:00
|
|
|
public function index()
|
|
|
|
{
|
2016-02-12 16:31:29 +00:00
|
|
|
// Auth check
|
|
|
|
$this->load->model('user_model');
|
|
|
|
if(!$this->user_model->authorize($this->config->item('auth_mode'))) {
|
|
|
|
if($this->user_model->validate_session()) {
|
|
|
|
$this->user_model->clear_session();
|
|
|
|
show_error('Access denied<p>Click <a href="'.site_url('user/login').'">here</a> to log in as another user', 403);
|
|
|
|
} else {
|
|
|
|
redirect('user/login');
|
|
|
|
}
|
|
|
|
}
|
2011-08-19 17:24:56 +00:00
|
|
|
|
2011-11-04 17:32:03 +00:00
|
|
|
$data['page_title'] = "Search";
|
|
|
|
|
2019-05-14 10:52:11 +00:00
|
|
|
$this->load->view('interface_assets/header', $data);
|
2011-06-17 12:52:00 +00:00
|
|
|
$this->load->view('search/main');
|
2019-05-14 10:52:11 +00:00
|
|
|
$this->load->view('interface_assets/footer');
|
2011-06-17 12:52:00 +00:00
|
|
|
}
|
2019-09-04 22:12:45 +00:00
|
|
|
|
|
|
|
// Filter is for advanced searching and filtering of the logbook
|
|
|
|
public function filter() {
|
|
|
|
$data['page_title'] = "Search & Filter Logbook";
|
|
|
|
|
|
|
|
$this->load->library('form_validation');
|
|
|
|
|
2019-09-04 22:42:11 +00:00
|
|
|
$this->load->model('Search_filter');
|
|
|
|
|
|
|
|
$data['get_table_names'] = $this->Search_filter->get_table_columns();
|
|
|
|
|
|
|
|
//print_r($this->Search_filter->get_table_columns());
|
|
|
|
|
2019-09-04 22:12:45 +00:00
|
|
|
if ($this->form_validation->run() == FALSE)
|
|
|
|
{
|
|
|
|
$this->load->view('interface_assets/header', $data);
|
|
|
|
$this->load->view('search/filter');
|
|
|
|
$this->load->view('interface_assets/footer');
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$this->load->view('interface_assets/header', $data);
|
|
|
|
$this->load->view('search/filter');
|
|
|
|
$this->load->view('interface_assets/footer');
|
|
|
|
}
|
|
|
|
}
|
2011-08-19 17:24:56 +00:00
|
|
|
}
|