mardi 15 mars 2016

how to fliter dynamical using isotope jquery from the database using laravel5

i have three div class i am using isotope jquery for filter the data from database.when the jquery set static is working fine but i am control the filter using sqlquery its not possible to get the solution..if u have on idea plzzz share and how to filter the data

My Html:

 <div class="container">
            <div class="block-content block-content-small-padding">
                <div class="block-content-inner">
                    <h2 class="center">Recent Properties</h2>
                    <ul class="properties-filter">
                        <li class="selected"><a href="#"  data-filter="*"><span>All</span></a></li>
                         <li><a href="#" data-filter=".property-featured" ><span>Featured</span></a></li>
                        <li><a href="#property-rent"  data-filter=".property-rent" ><span>Rent</span></a></li>
                        <li><a href="#property-sale"  data-filter=".property-sale" ><span>Sale</span></a></li>
                    </ul>


                        <div class="properties-items isotope"  style="position: relative; overflow: hidden; height: 810px;">
                            <div class="row ">

                @foreach($val as $value)
                 <div class="property-item col-sm-6 col-md-3 isotope-item" style="position: absolute; left: 0px; top: 0px; transform: translate3d(0px, 0px, 0px);">
                                    <div class="property-box">
                                        <div class="property-box-inner">
                                            <h3 class="property-box-title"><a href="#">{{$value->city}}</a></h3>
                                            <h4 class="property-box-subtitle"><a href="#">{{$value->state}}</a></h4>
                                            <div class="property-box-picture">
                                                <div class="property-box-price">{{$value->property_price}}</div>
                                                   <div class="">
                                                    <a href="#" class="property-box-picture-target">
                                                        <img src="images/test/{{$value->image}}" alt="">
                                                    </a>
                                                </div>
                                             </div>
                                        </div>
                                    </div>
                            </div>



                        <div class="property-item property-rent   col-sm-6 col-md-3 isotope-item"  id="rent" style="position: absolute; left: 0px; top: 0px; transform: translate3d(0px, 0px, 0px);">
                                    <div class="property-box">
                                        <div class="property-box-inner">
                                            <h3 class="property-box-title"><a href="#">{{$value->city}}</a></h3>
                                            <h4 class="property-box-subtitle"><a href="#">{{$value->state}}</a></h4>
                                            <div class="property-box-picture">
                                                <div class="property-box-price">{{$value->property_price}}</div>
                                                <div class="">
                                                    <a href="#" class="property-box-picture-target">
                                                        <img src="images/test/{{$value->image}}" alt="">
                                                    </a>
                                                </div>
                                             </div>
                                        </div>
                                    </div>
                                </div>  


                                 <div class="property-item property-sale   col-sm-6 col-md-3 isotope-item" style="position: absolute; left: 0px; top: 0px; transform: translate3d(0px, 0px, 0px);">
                                    <div class="property-box">
                                        <div class="property-box-inner">
                                            <h3 class="property-box-title"><a href="#">{{$value->city}}</a></h3>
                                            <h4 class="property-box-subtitle"><a href="#">{{$value->state}}</a></h4>
                                            <div class="property-box-picture">
                                                <div class="property-box-price">{{$value->property_price}}</div>
                                                <div class="">
                                                    <a href="#" class="property-box-picture-target">
                                                        <img src="images/test/{{$value->image}}" alt="">
                                                    </a>
                                                </div>
                                             </div>
                                        </div>
                                    </div>
                                </div> 
                @endforeach 
                        </div>
                        </div>
                        </div>
                </div>               
            </div>

controller:

  public function index()
         {
        $view=DB::table('property_details')
         ->get();
             return View::make('index', array('val'=>$view));               
            } 
     public function rentshow()
    {  
        $view=DB::table('property_details')
        ->where('sale_or_rent','=','rent')
        ->get();
        return View::make('index', array('val'=>$view));        

     }
      public function saleshow()
    {  
        $view=DB::table('property_details')
        ->where('sale_or_rent','=','sale')
        ->get();
        return View::make('index', array('val'=>$view));        

     }

routes:

  Route::get('/', array('as' => 'pages', 'uses' => 'PageController@index'));
 Route::get('rentshow', array('as' => 'rentshow', 'uses' =>  'PageController@rentshow'));
Route::get('saleshow', array('as' => 'saleshow', 'uses' => 'PageController@saleshow'));



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire