<?php $__env->startSection('css'); ?>
<link href="<?php echo e(URL::asset('assets/plugins/datatable/css/dataTables.bootstrap4.min.css')); ?>" rel="stylesheet" />
<link href="<?php echo e(URL::asset('assets/plugins/datatable/css/buttons.bootstrap4.min.css')); ?>" rel="stylesheet">
<link href="<?php echo e(URL::asset('assets/plugins/datatable/css/responsive.bootstrap4.min.css')); ?>" rel="stylesheet" />
<link href="<?php echo e(URL::asset('assets/plugins/datatable/css/jquery.dataTables.min.css')); ?>" rel="stylesheet">
<link href="<?php echo e(URL::asset('assets/plugins/datatable/css/responsive.dataTables.min.css')); ?>" rel="stylesheet">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('title'); ?>
    ID Card Requests
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<!-- row opened -->
<div class="row row-sm">
    <!--div-->
    <div class="col-xl-12">
        <div class="card mg-b-20">
            <div class="card-header pb-0">
                <div class="d-flex justify-content-between">
                    <h4 class="card-title mg-b-0"><?php echo e(trans('dashboard.id_card_requests')); ?></h4>
                </div>
            </div>
            <div class="card-body">
                <div class="table-responsive">
                    <table id="example" class="table key-buttons text-md-nowrap">
                        <thead>
                            <tr>
                                <th class="border-bottom-0"><?php echo e(trans('dashboard.name')); ?></th>
                                <th class="border-bottom-0"><?php echo e(trans('dashboard.status')); ?></th>
                                <th class="border-bottom-0"><?php echo e(trans('dashboard.notes')); ?></th>
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(['accept_id_card_request', 'reject_id_card_request', 'view_id_card_request'])): ?>
                                    <th class="border-bottom-0"><?php echo e(trans('dashboard.actions')); ?></th>
                                <?php endif; ?>
                                <th class="border-bottom-0"><?php echo e(trans('dashboard.created')); ?></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $__currentLoopData = $id_card_requests; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id_card_request): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td><?php echo e($id_card_request->user->{'name_' . $locale}); ?></td>
                                    <td><?php echo e(trans('dashboard.'.$id_card_request->status)); ?></td>
                                    <td><?php echo e($id_card_request->notes); ?></td>
                                    <?php if($id_card_request->status == 'pending'): ?>
                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(['accept_id_card_request', 'reject_id_card_request'])): ?>
                                            <td class="row pl-3 mr-1">
                                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('accept_id_card_request')): ?>
                                                    <form class="pl-3" action="<?php echo e(route('id_card_requests.accept')); ?>" method="post">
                                                        <?php echo csrf_field(); ?>
                                                        <input type="hidden" name="user_id" value="<?php echo e($id_card_request->user->id); ?>">
                                                        <input type="hidden" name="id_card_request_id" value="<?php echo e($id_card_request->id); ?>">
                                                        <button class="btn btn-success" type="submit"><?php echo e(trans('dashboard.accept')); ?></button>
                                                    </form>
                                                <?php endif; ?>
                                                &nbsp;&nbsp;

                                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('reject_id_card_request')): ?>
                                                    <form class="pl-3" action="<?php echo e(route('id_card_requests.reject')); ?>" method="post">
                                                        <?php echo csrf_field(); ?>
                                                        <input type="hidden" name="user_id" value="<?php echo e($id_card_request->user->id); ?>">
                                                        <input type="hidden" name="id_card_request_id" value="<?php echo e($id_card_request->id); ?>">
                                                        <button class="btn btn-danger" type="submit"><?php echo e(trans('dashboard.reject')); ?></button>
                                                    </form>
                                                <?php endif; ?>
                                            </td>
                                        <?php endif; ?>
                                    <?php else: ?>
                                        <td class="row pl-3 mr-1">
                                            <a target="_blank" href="<?php echo e(route('id_card', $id_card_request->user->id)); ?>" class="btn btn-warning"><?php echo e(trans('dashboard.view')); ?></a>
                                        </td>
                                    <?php endif; ?>
                                    <td><?php echo e($id_card_request->created_at->diffForHumans()); ?></td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <!--/div-->
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('js'); ?>
<!-- Internal Data tables -->
<script src="<?php echo e(URL::asset('assets/plugins/datatable/js/jquery.dataTables.min.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/datatable/js/dataTables.dataTables.min.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/datatable/js/dataTables.responsive.min.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/datatable/js/responsive.dataTables.min.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/datatable/js/jquery.dataTables.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/datatable/js/dataTables.bootstrap4.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/datatable/js/dataTables.buttons.min.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/datatable/js/buttons.bootstrap4.min.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/datatable/js/jszip.min.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/datatable/js/pdfmake.min.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/datatable/js/vfs_fonts.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/datatable/js/buttons.html5.min.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/datatable/js/buttons.print.min.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/datatable/js/buttons.colVis.min.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/datatable/js/dataTables.responsive.min.js')); ?>"></script>
<script src="<?php echo e(URL::asset('assets/plugins/datatable/js/responsive.bootstrap4.min.js')); ?>"></script>
<!--Internal  Datatable js -->
<script src="<?php echo e(URL::asset('assets/js/table-data.js')); ?>"></script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/valu/Documents/GitHub/ABC-IDP/resources/views/admin/id_card_requests/index.blade.php ENDPATH**/ ?>