<?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>Clients</h4></div>
            <div class="card-body">
                <br>
                <table class="table table-hover datatable">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>Name</th>
                            <th>Email</th>
                            <th>Company</th>
                            <th>Created at</th>
                            <th></th>
                            
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__currentLoopData = $clients; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $client): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td><?php echo e($loop->iteration); ?></td>
                                <td>
                                    <?php echo e($client->fname.' '.$client->lname); ?>

                                </td>
                                <td>
                                    <?php echo e($client->email1); ?>

                                </td>
                                <td>
                                    <?php echo e($client->company_name); ?>

                                </td>
                                <td>
                                    <?php echo e($client->created_at); ?>

                                </td>
                                <td>
                                    <?php if(!is_null($client->user->is_approved)): ?>
                                    <button class="btn <?php echo e($client->user->is_approved ? 'bg-success':'bg-secondary'); ?>"><?php echo e($client->user->is_approved ? "Approved":"Declined"); ?></button>
                                    <?php else: ?>
                                    <a href="<?php echo e(route('user_approve', $client->email1)); ?>" class="btn btn-info btn-sm btn-block">Approve</a>
                                    <a href="<?php echo e(route('user_decline', $client->email1)); ?>" class="btn btn-danger btn-sm btn-block">Decline</a>
                                    <?php endif; ?>
                                </td>
                                
                                <td>
                                <form action="<?php echo e(route('clients.destroy', $client->id )); ?>" method="POST">
                                    <?php echo method_field('DELETE'); ?>
                                    <?php echo csrf_field(); ?>
                                    <button class="btn 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>
        $(document).ready( function () {
            $('.datatable').DataTable();
        } );
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('dashboard.base', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\pec_portal\resources\views/dashboard/clients/index.blade.php ENDPATH**/ ?>