[eluser]Unknown[/eluser]
Hi,
I try to search in my system library system search by author,book name.And i wrote these codes for searching .
Controller
Code:
function searchbyauthor()
{
$this->load->view('front/front_searchbyauthor');
}
function searchbyauthor_do()
{
$this->load->model('front/search_model');
$data['show'] = $this->search_model->searchbyauthors_do();
$this->load->view('front\front_searchbyauthorlist',$data);
}
Model
Code:
<?php
class search_model extends Model {
var $author_name = ' ';
function search_model()
{
parent::Model();
$this->load->helper('date');
}
function searchbyauthors_do()
{
$this->db->like('author_name', $_POST['author_name'], 'both');
$query = $this->db->get('authors');
return $query->result();
}
}
View
Code:
<!--[if !IE]>start row<![endif]-->
<div class="row">
<label>Auhtor Name :</label>
<div class="inputs">
<span class="input_wrapper"><input class="text" name="author_name" type="text" /></span>
</div>
</div>
<!--[if !IE]>end row<![endif]-->
And button
Code:
<span class="button blue_button search_button"><span><span>Search for Me</span></span><input name="" type="submit" /></span>
It's working correctly but i cant added pagination into that system.How can i add or config search result ll be in pagination page.
Thanks,sorry for English