<?php $__env->startSection('content'); ?>


<div class="container-fluid">
  <div class="fade-in">
    <div class="row">
      <div class="col-sm-12">
        <div class="card">
          <div class="card-header"><h4>Bookings</h4></div>
            <div class="card-body">
                <div class="row">
                    <a class="btn btn-lg btn-success ml-3" href="<?php echo e(route('bookings.create')); ?>">Add New Booking</a>
              
                </div>
                <br>
                <table class="table table-hover datatable tt">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>Date</th>
                            <th>Timeslot</th>
                            <th>Seats</th>
                            <th>Customer</th>
                            <th>Contact</th>
                            <th>Status</th>
                            

                            <th >Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__currentLoopData = $bookings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $booking): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td><?php echo e($loop->iteration); ?></td>
                                <td>
                                    <?php echo e($booking->booking_date); ?>

                                </td>
                                <td>
                                    <?php echo e($booking->timeslot); ?>

                                </td>

                                <td>
                                    <?php echo e($booking->seats); ?>

                                </td>

                               <td>
                                   <?php echo e($booking->user1.' '.$booking->user2); ?>

                               </td>
                                <td>
                                    <?php echo e($booking->contact); ?>

                                </td>
                                <td>
                                    <?php echo e($booking->status); ?>

                                </td>

                             <td>
                                <a href="<?php echo e(route('single_record_pdf', $booking->id )); ?>" class="btn btn-sm btn-success btn-sm text-white" target="_blank"><i class="cis-eye"></i> GenerateTicket</a>
                                <a href="<?php echo e(route('bookings.show', $booking->id )); ?>" class="btn btn-sm btn-secondary text-white">Details</a>
                                 <a href="<?php echo e(route('bookings.edit', $booking->id )); ?>" class="btn btn-sm btn-primary">Edit</a>

                                <?php if($booking->status == 'reserved'): ?>
                                    <a  class="btn btn-sm btn-warning text-white btn_cancel"
                                     href="<?php echo e(route('booking_canceled', $booking->id)); ?>">Cancel
                                </a>
                                <?php endif; ?>

                                <form class="d-inline-block" action="<?php echo e(route('bookings.destroy', $booking->id )); ?>" method="POST">
                                    <?php echo method_field('DELETE'); ?>
                                    <?php echo csrf_field(); ?>
                                    <button class="btn btn-sm btn-danger delete-bt">Delete</button>
                                </form>
                            </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>

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

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

<?php $__env->startSection('javascript'); ?>
    <script>
        //data-table work
        $(document).ready( function () {
            $('.datatable').DataTable({
                "order": [[ 0, "desc" ]]
            });
        } );
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('dashboard.base', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/deve/public_html/xtreme_laravel/resources/views/dashboard/bookings/index.blade.php ENDPATH**/ ?>