<?php $__env->startSection('main-container'); ?>
<main id="main" class="main">
<?php echo $__env->make('cdn', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<div class="row page-titles mx-0">

    <div class="col-sm-6 p-md-0">

        <div class="breadcrumb-range-picker">

             <h4>Report</h4>

        </div>

    </div>

    <div class="row">
    <form action="<?php echo e(route('report.search')); ?>" method="get">
    <div class="col-md-12">
        <div class="row">
            <div class="col-md-4">
                <div class="form-group">
                    <select class="form-control dropdown-toggle" name="user_id">
                        <option value="">Select User</option>
                        <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($user->id); ?>" <?php echo e($user->id == $request->user_id ? 'selected' : ''); ?>><?php echo e($user->name); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
            </div>
            <div class="col-md-4">
                <div class="form-group">
                    <select class="form-control dropdown-toggle" name="location">
                        <option value="">Select Location</option>
                        <?php $__currentLoopData = $locations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $loc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($loc->id); ?>" <?php echo e($loc->id == $request->location ? 'selected' : ''); ?>><?php echo e($loc->name); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
            </div>
            <div class="col-md-4">
            </div>
        </div>
    </div>
     <div class="col-md-12">
        <div class="row">
            <div class="col-md-4">
                <div class="form-group">
                    <label for="date_from">Date From</label>
                    <input type="date" name="date_from" class="form-control" value="<?php echo e($request->date_from); ?>">
                </div>
            </div>

            <div class="col-md-4">
                <div class="form-group">
                    <label for="date_to">Date To</label>
                    <input type="date" name="date_to" class="form-control" value="<?php echo e($request->date_to); ?>">
                </div>
            </div>

            <div class="col-md-1 form-group" style="margin-top:30px;">
                <input type="submit" class="btn btn-primary" value="Search">
            </div>

            <div class="col-md-1 form-group" style="margin-top:30px;">
                <a href="<?php echo e(route('reports')); ?>" class="btn btn-primary text-white">Refresh</a>
            </div>

        </div>
    </div>
</form>

</div>

<div class="container-fluid">

    <?php echo $__env->make('flash_msg', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>


    <div class="row">

        <div class="col-12">

            <div class="card">

                <div class="card-body">

                    <div class="table-responsive">

                        <table class="table table-border table-hover table-sm" id="tabl">
                            <thead>

                                <tr>

                                    <th>#</th>

                                    <th>Name</th>

                                    <th>Party Name</th>

                                    <th>Location</th>

                                    <th>Date</th>

                                    <th>Action</th>

                                </tr>

                            </thead>

                            <tbody>

                                <?php if(!empty($datas)): ?>

                                    <?php $__currentLoopData = $datas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                                        <tr>
                                            
                                            <td><?php echo e(++$key); ?></td>

                                            <td><?php echo e($value->User->name ?? 'N/A'); ?></td>

                                            <td><?php echo e($value->party_name); ?></td>

                                            <td><?php echo e($value->Location->name ?? 'N/A'); ?></td>

                                            <td><?php echo e($value->created_at->format('Y-m-d')); ?></td>

                                            <td>
                                                 <a role="button" data-toggle="modal" data-target="#viewComplain-<?php echo e($value->id); ?>">
                                                <button type="button" class="btns success-btn btn-sm" title="More Details" alt="More Details"><i class="fas fa-eye"></i> 
                                                </button>
                                                </a>
                                            </td>


                                               <!-- Modal view remark-->

                                                    <div class="modal fade" id="viewComplain-<?php echo e($value->id); ?>" tabindex="-1" role="dialog" aria-labelledby="editModalLabel" aria-hidden="true">

                                                    <div class="modal-dialog" role="document">

                                                    <div class="modal-content">

                                                      <div class="modal-header btns primary-btn">

                                                        <h5 class="modal-title" id="editModalLabel">Report</h5>

                                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">

                                                          <span aria-hidden="true" style="color: white !important;">&times;</span>

                                                        </button>

                                                      </div>

                                                      <div class="modal-body">

                                                        <div class="row">

                                                            <div class="col-lg-6 mb-2">

                                                                  <label for="exampleFormControlTextarea1"><strong>Name:</strong>&nbsp <?php echo e($value->User->name ?? 'N/A'); ?></label>

                                                            </div>

                                                            <div class="col-lg-6 mb-2">

                                                                  <label for="exampleFormControlTextarea1"><strong>Location:</strong>&nbsp <?php echo e($value->Location->name ?? 'N/A'); ?></label>

                                                            </div>

                                                        </div>

                                                        <div class="row">

                                                            <div class="col-lg-6 mb-2">

                                                                  <label for="exampleFormControlTextarea1"><strong>Date:</strong>&nbsp <?php echo e($value->created_at->format('Y-m-d')); ?></label>

                                                            </div>

                                                            <div class="col-lg-6 mb-2">

                                                                  <label for="exampleFormControlTextarea1"><strong>Party Name:</strong>&nbsp <?php echo e($value->party_name); ?></label>

                                                            </div>

                                                        </div>

                                                        <div class="row">

                                                            <div class="col-lg-6 mb-2">

                                                                  <label for="exampleFormControlTextarea1"><strong>Mobile:</strong>&nbsp <?php echo e($value->mobile_no); ?></label>

                                                            </div>

                                                            <div class="col-lg-6 mb-2">

                                                                  <label for="exampleFormControlTextarea1"><strong>Address:</strong>&nbsp <?php echo e($value->address); ?></label>

                                                            </div>

                                                        </div>

                                                        <div class="row">

                                                            <div class="col-lg-6 mb-2">

                                                                  <label for="exampleFormControlTextarea1"><strong>Item Name:</strong>&nbsp <?php echo e($value-> item_name); ?></label>

                                                            </div>

                                                            <div class="col-lg-6 mb-2">

                                                                  <label for="exampleFormControlTextarea1"><strong>Vahicle No:</strong>&nbsp <?php echo e($value->vahicle_no); ?></label>

                                                            </div>

                                                        </div>

                                                        <div class="row">

                                                            <div class="col-lg-6 mb-2">

                                                                  <label for="exampleFormControlTextarea1"><strong>Gross Weight</strong>&nbsp <?php echo e($value->gross_weight); ?></label>

                                                            </div>

                                                            <div class="col-lg-6 mb-2">

                                                                  <label for="exampleFormControlTextarea1"><strong>Tare Weight:</strong>&nbsp <?php echo e($value->tare_weight); ?></label>

                                                            </div>

                                                        </div>

                                                        <div class="row">

                                                            <div class="col-lg-6 mb-2">

                                                                  <label for="exampleFormControlTextarea1"><strong>Net Weight:</strong>&nbsp <?php echo e($value-> net_weight); ?></label>

                                                            </div>

                                                            <div class="col-lg-6 mb-2">

                                                                  <label for="exampleFormControlTextarea1"><strong>Bag:</strong>&nbsp <?php echo e($value->bag); ?></label>

                                                            </div>

                                                        </div>

                                                        <div class="row">

                                                            <div class="col-lg-6 mb-2">

                                                                  <label for="exampleFormControlTextarea1"><strong>Moishcher:</strong>&nbsp <?php echo e($value-> moishcher); ?></label>

                                                            </div>

                                                            <div class="col-lg-6 mb-2">

                                                                  <label for="exampleFormControlTextarea1"><strong>Remarks:</strong>&nbsp <?php echo e($value->remarks); ?></label>

                                                            </div>

                                                        </div>

                                                        <div class="row">

                                                            <div class="col-lg-6 mb-2">

                                                                  <label for="exampleFormControlTextarea1"><strong>Kata Slip Image:</strong></label>
                                                                  <br>

                                                                   <?php if($value->kata_slip_image): ?>
                                                                        <img src="<?php echo e(asset('public/Report/' . $value->kata_slip_image)); ?>" height="80" width="80" alt="Image">
                                                                    <?php else: ?>
                                                                        <p>Image Not Found</p>
                                                                    <?php endif; ?>


                                                            </div>


                                                            <div class="col-lg-6 mb-2">

                                                                  <label for="exampleFormControlTextarea1"><strong>Photo Click Lori Image:</strong></label>

                                                                  <br>

                                                                  <?php if($value->photo_click_lori_image): ?>
                                                                        <img src="<?php echo e(asset('public/Report/' . $value->photo_click_lori_image)); ?>" height="80" width="80" alt="Image">
                                                                  <?php else: ?>
                                                                      <p>Image Not Found</p>
                                                                  <?php endif; ?>


                                                            </div>

                                                        </div>

                                                    </div>

                                                 </div>

                                            </div>

                                        </div>


                                        </tr>

                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                <?php endif; ?>
                                
                            </tbody>

                            <tfoot>

                                <tr>
                                    <th>#</th>

                                    <th>Name</th>

                                     <th>Party Name</th>

                                    <th>Location</th>

                                    <th>Date</th>

                                    <th>Action</th>
                                </tr>


                            </tfoot>

                        </table>

                    </div>

                </div>

            </div>

        </div>

    </div>

</div>
</main><!-- End #main -->

<script type="text/javascript">
     $(document).ready(function () {
      $('#tabl').DataTable({
         
      });
  });
  </script>

<?php $__env->stopSection(); ?>




<?php echo $__env->make('frontend.layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/vinecork/public_html/webdev/dailyCRM/resources/views/report/index.blade.php ENDPATH**/ ?>