SHARE
TWEET

Untitled

a guest Jun 16th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div class="custom-radio">
  2.    <input type="checkbox"  class="batchCheckbox" name="batch[]" value=" {{$item->indivgroup_option}}">
  3.  <label><span></span>{{ ($item->indivgroup_option =='i')?"Individual Tour":"Group Tour" }}</label>
  4.   </div>
  5.  @endforeach
  6.      
  7. var categories;
  8.  var getfilters = function () {
  9. $.ajax({
  10.     type: 'POST',
  11.     headers: {
  12.         'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  13.     },
  14.  
  15.     url:'{{URL::to('offer-category')}}',
  16.  
  17.     data: {categories: categories},
  18.     error: function(e) {
  19.         console.log(e.responseText);
  20.     },
  21.     success: function (data) {
  22.         console.log(data);
  23.         $('#myResponse').html(data);
  24.     }});
  25.  };
  26.  
  27.  
  28.     $(document).ready(function() {
  29.         $('input[type="checkbox"]').on('change', function(event) {
  30.            event.preventDefault();
  31.     categories = $("input:checkbox:checked").map(function(){
  32.     return $(this).val();
  33.       }).get(); // <----
  34.     $('#myResponse').html(categories.toString()); // <---- 'one,two,three;
  35.       getfilters();
  36.         });
  37.         });
  38.      
  39. public function getoffergroup(Request $request)
  40.  {
  41.  
  42.  $input  = array(Input::get('categories'));
  43.   $posts=Offer::whereIn('indivgroup_option' , $input)->get();
  44.   $categories = Category::getGroup();
  45.   return response()->view('offer.archive', compact('offers', 'categories'));
  46.  }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top