
<?php $__env->startPush('style'); ?>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<?php $__env->stopPush(); ?>
<?php $__env->startSection('content'); ?>
<script type="text/javascript">
//alert();
$(document).ready(function(){
//  alert('sus');   
      // DataTable
      // var  category= $('#searchBycategory').val();
      // alert(category);
      var questable=$('#questions').DataTable({
         processing: true,
         serverSide: true,
       
         //ajax: "<?php echo e(route('getQues')); ?>",
           // Read values
         ajax: {
       'url':"<?php echo e(route('getQues')); ?>",
       
       'data': function(d){
          // Read values
          d.category = $('#searchBycategory').val();
         // var name = $('#searchByName').val();
 
        
       }
    }, 
         columns: [
             { data: 'id' },
            { data: 'question' },
             { data: 'category_name' },
             { data: 'weightage_title' },
             { data: 'question_category' },
            { data: 'action' },
            
         ]
      });
   
    $('#searchBycategory').change(function(){
 // alert();
    questable.draw();
  });
  
    });


</script>
<div class="container">
    <div class="row ">
        <div class="col-md-12">

          <?php if(session()->has('message')): ?>
            <p class="btn btn-success btn-block btn-sm custom_message text-left"><?php echo e(session()->get('message')); ?></p>
          <?php endif; ?>

          <div class="card ">
            <div class="card-header">
                <div class="row">
                    <div class="col-8">
                        <h4 class="card-title">Questions List</h4>
                    </div>
                    <div class="col-4 text-right">
                        <a href="<?php echo e(route('addquestion')); ?>" class="btn btn-sm btn-primary">Add Questions</a>
                    </div>
                </div>
            </div>
            <div class="card-body">
                <div class="row">
                    <div class="col-4">
                    <select id="searchBycategory" class="form-control">
                    <?php ?>
            <option value=''>search category</option>
            <?php foreach ($categories as $key => $value) {?>
               <option value="<?php echo $value->id;?>"><?php echo $value->category_name;?></option>
            <?php }?>
             
            </select>
                    </div>
                    </div>
            
                <div class="">
                <table class="table table-bordered" id="questions">
    <thead>
       <tr>
                            <th >No</th>
                            <th >Question</th>
                            <th >category Name</th>
                            <th >Weightage Title</th>
                            <th >Question Category</th>
                            
                            <th >ACTION</th>
                        </tr>
    </thead>
    <tbody>
      
    </tbody>
  </table>
                  
                </div>
            </div>
        </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', ['pageSlug' => 'questions'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/sibzsolu/public_html/training/stimclex/resources/views/questions/questionslist.blade.php ENDPATH**/ ?>