<?php $__env->startSection('panel'); ?>
    <div class="row">
        <div class="col-lg-12">
            <div class="card b-radius--10">
                <div class="card-body p-0">
                    <div class="table-responsive--sm table-responsive">
                        <table class="table--light style--two table">
                            <thead>
                                <tr>
                                    <th><?php echo app('translator')->get('S.N.'); ?></th>
                                    <th><?php echo app('translator')->get('DPS No.'); ?> | <?php echo app('translator')->get('Plan'); ?></th>
                                    <th><?php echo app('translator')->get('User'); ?></th>
                                    <th><?php echo app('translator')->get('Amount'); ?></th>
                                    <th><?php echo app('translator')->get('Installment'); ?></th>
                                    <th><?php echo app('translator')->get('Next Installment'); ?></th>
                                    <th><?php echo app('translator')->get('After Matured'); ?></th>
                                    <th><?php echo app('translator')->get('Created'); ?></th>
                                    <th><?php echo app('translator')->get('Status'); ?></th>
                                    <?php $hasPermission = App\Models\Role::hasPermission('admin.dps.installments')  ? 1 : 0;
            if($hasPermission == 1): ?>
                                        <th><?php echo app('translator')->get('Action'); ?></th>
                                    <?php endif ?>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__empty_1 = true; $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dps): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <tr>
                                        <td><?php echo e(__($loop->index + $data->firstItem())); ?></td>

                                        <td>
                                            <span class="fw-bold"><?php echo e(__($dps->dps_number)); ?></span>
                                            <span class="d-block text--info"><?php echo e(__(@$dps->plan->name)); ?></span>
                                        </td>

                                        <td>
                                            <span class="fw-bold d-block"><?php echo e(__(@$dps->user->fullname)); ?></span>
                                            <?php if($dps->user): ?>
                                                <span class="small">
                                                    <?php $hasPermission = App\Models\Role::hasPermission('admin.users.detail')  ? 1 : 0;
            if($hasPermission == 1): ?>
                                                        <a href="<?php echo e(route('admin.users.detail', $dps->user_id)); ?>"><span>@</span><?php echo e(@$dps->user->username); ?></a>
                                                    <?php else: ?>
                                                        <span>@</span><?php echo e(@$dps->user->username); ?>

                                                    <?php endif ?>
                                                </span>
                                            <?php endif; ?>
                                        </td>

                                        <td>
                                            <span><?php echo e($general->cur_sym . showAmount($dps->per_installment)); ?></span>
                                            <span class="text--info d-block"><?php echo app('translator')->get('Per'); ?>
                                                <?php echo e(__($dps->installment_interval)); ?>

                                                <?php echo app('translator')->get('days'); ?>
                                            </span>
                                        </td>

                                        <td>
                                            <span><?php echo app('translator')->get('Total'); ?> : <?php echo e(getAmount($dps->total_installment)); ?></span>
                                            <span class="text--info d-block"><?php echo app('translator')->get('Given'); ?> :
                                                <?php echo e(__($dps->given_installment)); ?></span>
                                        </td>

                                        <td>
                                            <?php if(@$dps->nextInstallment->installment_date): ?>
                                                <?php echo e(showDateTime($dps->nextInstallment->installment_date, 'd M, Y')); ?>

                                            <?php else: ?>
                                                <?php echo app('translator')->get('N/A'); ?>
                                            <?php endif; ?>
                                        </td>

                                        <td>
                                            <?php echo e($general->cur_sym); ?><?php echo e(showAmount($dps->depositedAmount() + $dps->profitAmount())); ?>


                                            <span class="text--info d-block">
                                                <?php echo e($general->cur_sym); ?><?php echo e(showAmount($dps->depositedAmount())); ?>

                                                + <?php echo e(getAmount($dps->interest_rate)); ?>%
                                            </span>
                                        </td>

                                        <td><?php echo e(showDateTime($dps->created_at, 'd M, Y')); ?></td>
                                        <td><?php echo $dps->statusBadge;?></td>

                                        <?php $hasPermission = App\Models\Role::hasPermission('admin.dps.installments')  ? 1 : 0;
            if($hasPermission == 1): ?>
                                            <td>
                                                <a class="btn btn-sm btn-outline--primary" href="<?php echo e(route('admin.dps.installments', $dps->id)); ?>">
                                                    <i class="las la-history"></i> <?php echo app('translator')->get('Installments'); ?>
                                                </a>
                                            </td>
                                        <?php endif ?>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <tr>
                                        <td class="text-muted text-center" colspan="100%"><?php echo e(__($emptyMessage)); ?></td>
                                    </tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                </div>
                <?php if($data->hasPages()): ?>
                    <div class="card-footer py-4">
                        <?php echo e(paginateLinks($data)); ?>

                    </div>
                <?php endif; ?>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('breadcrumb-plugins'); ?>
    <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.search-form','data' => ['dateSearch' => 'yes','placeholder' => 'DPS No.']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('search-form'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['dateSearch' => 'yes','placeholder' => 'DPS No.']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\viserbank\core\resources\views/admin/dps/index.blade.php ENDPATH**/ ?>