

@extends('layouts.agencies')
 @section('title', 'Client Booking')
 @section('content')
 <?php Fun::lang()?>
 <div class="main-content-wrapper">
      <div class="main-content-wrapper">
         <div class="breadcrumb">
             <div class="container">
                 <ul class="">
                     <li><a href="{{route('dashboard-agencies.index')}}">Dashboard<span>/</span></a></li>
                     <li><a href="#">Clients<span>/</span></a></li>
                     <li><a href="">Client Booking</a></li>
                 </ul>
             </div>
         </div>
         
     </section>  
 
     <div class="main-box"> 
         <div class="main-content">
             <div class="main-admin-dashboard">
                 <div class="container">
                     <div class="page-wrapper">
                         <div class="row">
                             <div class="col-sm-12 col-xs-12">
                               <div class="form-wrapper" style="overflow-x:auto;">
                                  <table class="table table-bordered" id="customers-table">
                                    <thead>
                                      <tr>
                                          <th>No</th>
                                          <th>Date</th>
                                          <th>Full Name</th>
                                          <th>Gender</th>
                                          <th>Phone</th>
                                          <th>Address</th>
                                          <th>Category</th>
                                          <th>Project</th>
                                          <th>Item</th>
                                      </tr>
                                    </thead>
                                  </table>
                                </div>
                             </div>
                         </div>
                     </div>
                 </div>
             </div>
         </div>
     </div>
 </div>

 @endsection
@section('script')

<script type="text/javascript">
      $(document).ready(function() {
	    $('.main-spinner').show();
			var index =  $('#customers-table').DataTable({
            "lengthMenu": [[20, 25, 50, 100, 500], [20, 25, 50, 100, 500]],
            ordering:  false,
            "serverSide": true,
            ajax: "{{ route('datatable.get_report_client_booked') }}",
                columns: [
                {data: 'DT_RowIndex',width: '4px'},
                {data: 'sale_date'},
                {data: 'client_fullname'},
                {data: 'client_gender'},
                {data: 'client_phone1'},
                {data: 'client_address'},
                {data: 'category_name'},
                {data: 'project_name'},
                {data: 'item_name'},
                    
                ],
                "initComplete": function(settings, json) {
                    $('.main-spinner').hide();
                }	       
			});
			index.on( 'order.dt search.dt', function () {
				index.column(0, {search:'applied', order:'applied'}).nodes().each( function (cell, i) {
					cell.innerHTML = i+1 ;
				} );
			} ).draw();
			$.fn.dataTable.ext.errMode = 'throw';
		});
	</script>

@endsection
