Actually I'm doing filtering option with pagination.And in that I use checkbox and price slider for performing filters.
I wrote code for the checkbox option as when pagination links were clicked it must checked which checkboxes were clicked..
And coding is here,
<?php
if(isset($_REQUEST['key'])){
$key_val = $_REQUEST['key'];
if(in_array($amn->ht_amenity_id, $key_val)){
?>
<label>
<input class="i-check iCheck-helper" name="{{$keys[$i]}}" type="checkbox" value="{{$amn->ht_amenity_id}}" checked="checked" />{{$amn->ht_amenity_name}}
<?php
echo "<br/><br/>";
}
else{
?>
<label>
<input class="i-check iCheck-helper" name="{{$keys[$i]}}" type="checkbox" value="{{$amn->ht_amenity_id}}" />{{$amn->ht_amenity_name}}
<?php
echo "<br/><br/>";
}}
?>
It works for me..
Here is My code for price slider,
<li>
<h5 class="booking-filters-title">Price</h5>
<?php
if(isset($_REQUEST['from']) && isset($_REQUEST['to'])){
$from = $_REQUEST['from'];
$to = $_REQUEST['to'];
echo $from;exit;
?>
<input type="text" id="price-slider" value="$from;$to">
<?php
}
else{
?>
<input type="text" id="price-slider">
<?php
}
?>
</li>
I tried like this way..But it didn't work for me..
When my pagination links were clicks it pass all the values through the URL.And also the results were given as per my filters.
But the price slider does not change after my pagination links were clicked..
And here is my controller code,
$query = "SELECT `h`.*,".$countquery.",".$minquery." FROM `abserve_hotels` as `h`";
$query1 = DB::select($query.$sqlCond);
// $perPage = 2;
$currentPage = Input::get('page', 1) - 1;
$pagedData = array_slice($query1, $currentPage * $perPage, $perPage);
$query1 = new Paginator($pagedData, count($query1), $perPage);
$query1->setPath('hotelresults');
And in My view I use echo $query1->appends($_REQUEST)->render();
like this to call the pagination
Someone help me.. Thanks