
@extends('layouts.theme')
@section('pageTitle', 'Vega Soft')
@section('page-content')



<style>

#fd_tbl tr td{
  padding:1px;

}

</style>

<div id="form-div">
<input type="hidden" id="hidden_status" value="0">
<input type="hidden" id="row_id" value="0">


<div class="page-header form-header" >
  <h4 class="page-title text-white"> Reports </h4>
    <nav aria-label="breadcrumb">
      <ol class="breadcrumb">
      
        <li class="breadcrumb-item text-white  icon-md " aria-current="page"> </li>
      </ol>
    </nav>
    

 
</div>
<div class="card">
    <div class="card-body">
    
<div class="row">




<div class="col-lg-12">



</div>


<div class="col-lg-12 col-md-12 col-sm-12 p-2">


<div class="row">
<div class="col-lg-4">

<div class="row">

<label for="" class="col-lg-3">Select Date</label>

<div class="col-lg-8">
<input type="text" class="form-control date_class" id="day" readonly> 
</div>

</div>


</div>
<div class="col-lg-4">

<div class="row">

<label for="" class="col-lg-3">Select Time</label>

<div class="col-lg-8">

<select   class="js-example-basic-single form-control " id="time_id" >
    <option value="0" selected>-All-</option>
          @foreach($time as $tm)
  <option value="{{$tm->id}}">{{$tm->name}}</option>
  @endforeach
</select>

</div>
</div>


</div>
<div class="col-lg-4">
<input type="button" class="btn btn-sm btn-warning" value="Load" onclick="load_list();">
</div>
    <table class="table table-responsive " id="fd_tbl">

<thead>

<tr>

<th>Sl No</th>
<th>Name</th>
<th>Food</th>





</tr>

</thead>

<tbody id="list_tbdy">


</tbody>


</table>

</div>



</div>

</div>



                   
    </div>



    </div>

</div>
</div>
</div>
<div id="table-div">
<div class="page-header form-header" >
  <h4 class="page-title text-white">  Food List <i class="fa fa-plus slide2" style="float:right;"></i></h4>
    <nav aria-label="breadcrumb">
      <ol class="breadcrumb">
      
        <li class="breadcrumb-item text-white  icon-md " aria-current="page"> </li>
      </ol>
    </nav>
</div>

  

<div class="card">
  


   
                              


    
    
</div>
</div>





<script type="text/javascript">




















function load_list(){


    $.ajax({
          url: "/get_report_list",
          type: "POST",
          data:{
             '_token': "{{ csrf_token() }}",
             day:$('#day').val(),
             time_id:$('#time_id').val()

          },
          error: function(response) {
          },
          success:function(response){
          
          var data = response['food'];



html='';
i=1;
          $(data).each(function(key,val){
console.log(val);
            html+='<tr>';
html+='<td>'+i+'</td>';
html+='<td>'+val['E_NAME']+'</td>';

html+='<td>'+val['fname']+'</td>';

html+='</tr>';


i++;

          });
      $("#list_tbdy").html(html);
         
          }
         });





}


var table = $('#fd_tbl').DataTable({
        dom: 'lBfrtip',
        'autoWidth':false,
        "searching": false,
        buttons: [
          
        ],
        "bLengthChange": true,
        "bSort" : true,
         "lengthMenu": [[ 20, 50,75,100, -1], [ 20, 50,75,100, "All"]],
         "pagingType": "full_numbers",
        columnDefs: [ {
            visible: false
        } ]
        
        
    });




</script>
@endsection