<?php $__env->startSection('css'); ?>
    <?php echo toastr_css(); ?>
<?php $__env->startSection('title'); ?>
    <?php echo e(trans('Record_trans.title_page')); ?>

<?php $__env->stopSection(); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page-header'); ?>
<!-- breadcrumb -->
<div class="page-title">
    <div class="row">
        <div class="col-sm-6">
            <h4 class="mb-0"> <?php echo e(trans('Record_trans.title_page')); ?></h4>
        </div>
        <div class="col-sm-6">
            <ol class="breadcrumb pt-0 pr-0 float-left float-sm-right ">
                <li class="breadcrumb-item"><a href="#" class="default-color"><?php echo e(trans('main_trans.Dashboard')); ?></a></li>
                <li class="breadcrumb-item active"> <?php echo e(trans('Record_trans.title_page')); ?></li>
            </ol>
        </div>
    </div>
</div>
<!-- breadcrumb -->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<!-- row -->
<div class="row">

    <div class="col-md-12 mb-30">
        <div class="card card-statistics h-100">
            <div class="card-body">

                <?php if($errors->any()): ?>
                    <div class="alert alert-danger">
                        <ul>
                            <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <li><?php echo e($error); ?></li>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </ul>
                    </div>
                <?php endif; ?>

                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('تصدير')): ?> 
                <a class="btn btn-warning"
                href="#">
                       تصدير
               </a>

               <a class="btn btn-info"
               href="<?php echo e(route('recordsCount')); ?>">
                      تقرير
              </a>
              <?php endif; ?>

            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('isAdmin')): ?> 
           <a href="<?php echo e(route('records.create')); ?>">
                <button type="button" class="btn btn-primary l-t-20">
                    <?php echo e(trans('Statment_trans.submit')); ?>

                </button>
                <br><br> 
            </a>
            <?php endif; ?>
          
                <div class="table-responsive">
                    <table id="datatable" class="table table-striped table-bordered p-0">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th><?php echo e(trans('Statment_trans.name')); ?></th>
                                <th><?php echo e(trans('Depts_trans.Name_Dept')); ?></th>
                                <th><?php echo e(trans('Statment_trans.date')); ?></th>
                                
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('isAdmin')): ?>
                                <th><?php echo e(trans('Statment_trans.by')); ?></th>
                                <?php endif; ?>
                                <th><?php echo e(trans('Statment_trans.Pay_process')); ?></th>
                                <th><?php echo e(trans('Statment_trans.Result_process')); ?></th>
                                <th><?php echo e(trans('Depts_trans.Processes')); ?></th>
                            </tr>
                        </thead>
                        <tboby>
                            <?php $__currentLoopData = $records; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $record): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td><?php echo e($index + 1); ?></td>
                                    <td><?php echo e($record->first_name); ?> <?php echo e($record->second_name); ?> <?php echo e($record->midell_name); ?> <?php echo e($record->last_name); ?></td>
                                    
                                    <td><?php echo e($record->dept->name); ?></td>
                                    <td><?php echo e(date('d-m-y', strtotime($record->created_at))); ?></td>
                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('isAdmin')): ?>
                                    <td><?php echo e($record->user->first_name); ?> <?php echo e($record->user->second_name); ?></td>
                                    <?php endif; ?>
                                    <td>
                                        <?php if($record->f_status == '0'): ?>
                                            <span class="label text-info">
                                                 <?php echo e(trans('Statment_trans.processing')); ?>

                                            </span>
                                        <?php elseif($record->f_status == '1'): ?>
                                        <span class="label text-success">
                                            <?php echo e(trans('Statment_trans.complate')); ?>

                                        </span>
                                        <?php else: ?>
                                        <span class="label text-danger">
                                            <?php echo e(trans('Statment_trans.reject')); ?>

                                        </span>
                                        <?php endif; ?>
                                    </td>
                                    <td>
                                        <?php if($record->r_status == '0'): ?>
                                            <span class="label text-info">
                                                 <?php echo e(trans('Statment_trans.processing')); ?>

                                            </span>
                                        <?php elseif($record->r_status == '1'): ?>
                                        <span class="label text-success">
                                            <?php echo e(trans('Statment_trans.complate')); ?>

                                        </span>
                                        <?php else: ?>
                                        <span class="label text-danger">
                                            <?php echo e(trans('Statment_trans.reject')); ?>

                                        </span>
                                        <?php endif; ?>
                                    </td>
                                    <td>
                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('isAdmin')): ?> 
                                       <a href="<?php echo e(route('records.edit', encrypt($record->id))); ?>">
                                        <button  type="button" class="btn btn-info btn-sm" data-toggle="modal"
                                        
                                        title="<?php echo e(trans('Statment_trans.Edit')); ?>"><i
                                            class="fa fa-edit"></i></button>
                                       </a>
                                       <?php endif; ?>
                                       <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('isUser')): ?> 
                                       <a href="<?php echo e(route('records.edit', encrypt($record->id))); ?>">
                                        <button  type="button" class="btn btn-info btn-sm" data-toggle="modal"
                                        
                                        title="<?php echo e(trans('Statment_trans.Edit')); ?>"><i
                                            class="fa fa-edit"></i></button>
                                       </a>
                                       <?php endif; ?>
                                       <a href="<?php echo e(route('records.show', encrypt($record->id))); ?>">
                                        <button  type="button" class="btn btn-success btn-sm" data-toggle="modal"
                                        
                                        title="<?php echo e(trans('Statment_trans.show')); ?>"><i
                                            class="fa fa-eye"></i></button>
                                       </a>
                                       <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check( 'حذف القيد')): ?>
                                        <button type="button" class="btn btn-danger btn-sm" data-toggle="modal"
                                            data-target="#delete<?php echo e($record->id); ?>"
                                            title="<?php echo e(trans('Statment_trans.Delete')); ?>"><i
                                                class="fa fa-trash"></i></button>
                                                <?php endif; ?>
                                    </td>
                                </tr>


    <!-- delete_modal_Subject -->
                                <div class="modal fade" id="delete<?php echo e($record->id); ?>" tabindex="-1" role="dialog"
                                    aria-labelledby="exampleModalLabel" aria-hidden="true">
                                    <div class="modal-dialog" role="document">
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <h5 style="font-family: 'Cairo', sans-serif;" class="modal-title"
                                                    id="exampleModalLabel">
                                                    <?php echo e(trans('Record_trans.delete_record')); ?>

                                                </h5> 
                                                <button type="button" class="close" data-dismiss="modal"
                                                    aria-label="Close">
                                                    <span aria-hidden="true">&times;</span>
                                                </button>
                                            </div>
                                            <div class="modal-body">
                                                <?php echo Form::open(['route' => ['records.destroy', $record->id], 'method' => 'DELETE']); ?>

                                                <?php echo e(method_field('Delete')); ?>

                                                <?php echo csrf_field(); ?>
                                                <?php echo e(trans('Statment_trans.Warning_certificat')); ?>

                                                <input id="id" type="hidden" name="id" class="form-control"
                                                    value="<?php echo e($record->id); ?>">
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-secondary"
                                                        data-dismiss="modal"><?php echo e(trans('Statment_trans.Close')); ?></button>
                                                    <button type="submit"
                                                        class="btn btn-danger"><?php echo e(trans('Statment_trans.Delete')); ?></button>
                                                </div>
                                                <?php echo Form::close(); ?>

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


                        </tboby>
                    </table>
                </div>
            </div>
        </div>
    </div>


</div>
<!-- row closed -->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
<?php echo toastr_js(); ?>
<?php echo app('toastr')->render(); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/eustedu/Certificates/resources/views/pages/Records/index.blade.php ENDPATH**/ ?>