

<?php if(auth()->user()->type =='admin'): ?>
    <?php $__env->startSection('title',trans('layout.customer')); ?>
<?php else: ?>
    <?php $__env->startSection('title',trans('layout.staff')); ?>
<?php endif; ?>

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

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

<?php $__env->startSection('main-content'); ?>
    <div class="row page-titles mx-0">
        <div class="col-sm-6 p-md-0">
            <div class="welcome-text">
                <?php if(auth()->user()->type =='admin'): ?>
                    <h4><?php echo e(trans('layout.customer')); ?></h4>
                <?php else: ?>
                    <h4><?php echo e(trans('layout.staff')); ?></h4>
                <?php endif; ?>
                <p class="mb-0"></p>
            </div>
        </div>
        <div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>"><?php echo e(trans('layout.home')); ?></a></li>
                <?php if(auth()->user()->type =='admin'): ?>
                    <li class="breadcrumb-item active"><a href="javascript:void(0)"><?php echo e(trans('layout.customer')); ?></a></li>
                <?php else: ?>
                    <li class="breadcrumb-item active"><a href="javascript:void(0)"><?php echo e(trans('layout.staff')); ?></a></li>
                <?php endif; ?>
            </ol>
        </div>
    </div>
    <!-- row -->

    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-header">
                    <h4 class="card-title"><?php echo e(trans('layout.list')); ?></h4>
                    <div class="pull-right">
                        <a href="<?php echo e(route('customers.create')); ?>"
                           class="btn btn-sm btn-primary"><?php echo e(trans('layout.create')); ?></a>
                    </div>
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table table-responsive-md">
                            <thead>
                            <tr>
                                <th><strong>#</strong></th>
                                <th><strong><?php echo e(trans('layout.name')); ?></strong></th>
                                <?php if(auth()->user()->type =='restaurant_owner'): ?>
                                <th><strong><?php echo e(trans('layout.role')); ?></strong></th>
                                <?php endif; ?>
                                <?php if(auth()->user()->type =='admin'): ?>
                                    <th><strong><?php echo e(trans('layout.plan_name')); ?></strong></th>
                                    <th><strong><?php echo e(trans('layout.expiry_date')); ?></strong></th>
                                <th><strong><?php echo e(trans('layout.status')); ?></strong></th>
                                <?php else: ?>
                                    <th></th>
                                    <th></th>
                                <?php endif; ?>
                                <th><strong><?php echo e(trans('layout.action')); ?></strong></th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php $__currentLoopData = $customers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=> $customer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php $currentPlan=isset($customer->current_plans[0])?$customer->current_plans[0]:''; ?>
                                <tr>
                                    <td><?php echo e(++$key); ?></td>
                                    <td><?php echo e($customer->name); ?></td>
                                    <?php if(auth()->user()->type =='restaurant_owner'): ?>
                                    <td><?php echo e(ucfirst(str_replace('_', ' ', $customer->role))); ?></td>
                                    <?php endif; ?>

                                    <?php if(auth()->user()->type=='admin'): ?>
                                        <td><?php echo e($currentPlan?ucwords($currentPlan->plan->title):''); ?></td>
                                        <td><?php echo e($currentPlan?$customer->current_plans[0]->expired_date:''); ?></td>
                                    <td>
                                        <?php if($currentPlan?ucwords($customer->current_plans[0]->status=='approved'):''): ?>
                                            <span class="badge light badge-success"><?php echo e($currentPlan?ucwords($customer->current_plans[0]->status):''); ?></span>
                                        <?php else: ?>
                                            <span class="badge light badge-warning"><?php echo e($currentPlan?ucwords($customer->current_plans[0]->status):''); ?></span>
                                        <?php endif; ?>
                                    </td>
                                    <?php else: ?>
                                        <td></td>
                                        <td></td>
                                    <?php endif; ?>
                                    <td>
                                        <div class="dropdown">
                                            <button type="button" class="btn btn-success light sharp"
                                                    data-toggle="dropdown">
                                                <svg width="20px" height="20px" viewBox="0 0 24 24" version="1.1">
                                                    <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
                                                        <rect x="0" y="0" width="24" height="24"/>
                                                        <circle fill="#000000" cx="5" cy="12" r="2"/>
                                                        <circle fill="#000000" cx="12" cy="12" r="2"/>
                                                        <circle fill="#000000" cx="19" cy="12" r="2"/>
                                                    </g>
                                                </svg>
                                            </button>
                                            <div class="dropdown-menu">
                                                <a href="<?php echo e(route('customers.edit',[$customer])); ?>" class="dropdown-item"
                                                   type="button"><?php echo e(trans('layout.edit')); ?></a>
                                                <button class="dropdown-item" type="button"
                                                        data-message="<?php echo e(trans('layout.message.customer_delete_warning')); ?>"
                                                        data-action='<?php echo e(route('customers.destroy',[$customer])); ?>'
                                                        data-input={"_method":"delete"}
                                                        data-toggle="modal"
                                                        data-target="#modal-confirm"><?php echo e(trans('layout.delete')); ?></button>

                                                <?php if(auth()->user()->type=='admin'): ?>
                                                    <button class="dropdown-item" type="button"
                                                            data-message="<?php echo e(trans('layout.message.login_as_warning')); ?>"
                                                            data-action='<?php echo e(route('restaurant.login.as',['id'=>$customer->id])); ?>'
                                                            data-input={"_method":"get"}
                                                            data-toggle="modal"
                                                            data-target="#modal-confirm"><?php echo e(trans('layout.login_as')); ?></button>
                                                <?php endif; ?>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

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

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

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

<?php echo $__env->make('layouts.dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\php\picoqr\resources\views/customer/index.blade.php ENDPATH**/ ?>