38 lines
861 B
PHP
38 lines
861 B
PHP
<?php defined('BASEPATH') || exit('No direct script access allowed');
|
|
|
|
/**
|
|
* Search projects and experiments.
|
|
*
|
|
* @author Eike Foken <kontakt@eikefoken.de>
|
|
*/
|
|
class Search extends CI_Controller {
|
|
|
|
/**
|
|
* Calls the parent constructor.
|
|
*/
|
|
public function __construct() {
|
|
parent::__construct();
|
|
$this->load->model('experiment');
|
|
$this->load->helper('typography');
|
|
}
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public function index() {
|
|
if ($this->input->get('query') != '') {
|
|
$query = explode(" ", $this->input->get('query'));
|
|
|
|
$data['projects'] = $this->project->search($this->input->get('query'));
|
|
$data['experiments'] = $this->experiment->search($this->input->get('query'));
|
|
|
|
$this->load->view('search/results', $data);
|
|
} else {
|
|
$this->load->view('search/new');
|
|
}
|
|
}
|
|
}
|
|
|
|
/* End of file search.php */
|
|
/* Location: ./application/controllers/search.php */
|