<div class="content-wrapper">
    <div class="container-xxl flex-grow-1 container-p-y">
        <div class="row">
            <div class="col">
                <div class="card shadow">
                    <div class="card-header text-uppercase custom-header bg-primary text-bg-info fw-bold">
                        <i class="menu-icon ti ti-users-group"></i> Manage Death Subscription
                    </div>
                    <div class="card-body">
                        <div class="row mt-3">
                            <table class="table table-sm datatableView">
                                <thead>
                                    <tr>
                                        <th>#</th>
                                        <th>Id</th>
                                        <th>Name</th>
                                        <th>NIC number</th>
                                        <th>Division</th>
                                        <th>Village</th>
                                        <th>Small Group</th>
                                        <th>Profession</th>
                                        <th>Old Account Number</th>
                                        <th>Total</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php
                                        $count = 1;
                                    ?>
                                    <?php $__currentLoopData = $getSavings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $savings): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php
                                            $encryptedId = encrypt($savings->deathId);
                                        ?>
                                        <?php if(auth()->user()->userType == 'superAdmin'): ?>
                                            <tr>
                                                <td><?php echo e($count++); ?></td>
                                                <td> <a href="<?php echo e(route('view_death_history', $encryptedId)); ?>">
                                                        <?php echo e($savings->deathId ?? 'N/A'); ?>

                                                    </a></td>
                                                <td><?php echo e($savings->member->firstName ?? 'N/A'); ?> <?php echo e($savings->member->lastName ?? 'N/A'); ?></td>
                                                <td><?php echo e($savings->member->nicNumber ?? 'N/A'); ?></td>
                                                <td>
                                                    <?php if($savings->member->divisionId == ''): ?>
                                                        -
                                                    <?php else: ?>
                                                        <?php echo e($savings->member->division->divisionName); ?>

                                                    <?php endif; ?>
                                                </td>
                                                <td>
                                                    <?php if($savings->member->villageId == ''): ?>
                                                        -
                                                    <?php else: ?>
                                                        <?php echo e($savings->member->village->villageName); ?>

                                                    <?php endif; ?>
                                                </td>
                                                <?php if($savings->member->smallGroupId == ''): ?>
                                                    <td>-</td>
                                                <?php else: ?>
                                                    <td><?php echo e($savings->member->smallgroup->smallGroupName); ?></td>
                                                <?php endif; ?>
                                                <td><?php echo e($savings->member->profession); ?></td>
                                                <td><?php echo e($savings->member->oldAccountNumber); ?></td>

                                                <td>Rs.<?php echo e($savings->totalAmount ?? 'N/A'); ?></td>

                                            </tr>
                                        <?php else: ?>
                                        <?php
                                                $divArray = auth()->user()->division;
                                                $vilArray = auth()->user()->village;
                                            ?>
                                            <?php if($divArray != '' || $divArray != null || $vilArray != '' || $vilArray != null): ?>
                                                <?php if(in_array($savings->member->divisionId, json_decode(auth()->user()->division)) &&
                                                        in_array($savings->member->villageId, json_decode(auth()->user()->village))): ?>
                                                            <tr>
                                                <td><?php echo e($count++); ?></td>
                                                <td> <a href="<?php echo e(route('view_death_history', $encryptedId)); ?>">
                                                        <?php echo e($savings->deathId ?? 'N/A'); ?>

                                                    </a></td>
                                                <td><?php echo e($savings->member->firstName ?? 'N/A'); ?></td>
                                                <td><?php echo e($savings->member->nicNumber ?? 'N/A'); ?></td>
                                                <td>
                                                    <?php if($savings->member->divisionId == ''): ?>
                                                        -
                                                    <?php else: ?>
                                                        <?php echo e($savings->member->division->divisionName); ?>

                                                    <?php endif; ?>
                                                </td>
                                                <td>
                                                    <?php if($savings->member->villageId == ''): ?>
                                                        -
                                                    <?php else: ?>
                                                        <?php echo e($savings->member->village->villageName); ?>

                                                    <?php endif; ?>
                                                </td>
                                                <?php if($savings->member->smallGroupId == ''): ?>
                                                    <td>-</td>
                                                <?php else: ?>
                                                    <td><?php echo e($savings->member->smallgroup->smallGroupName); ?></td>
                                                <?php endif; ?>
                                                <td><?php echo e($savings->member->profession); ?></td>
                                                <td><?php echo e($savings->member->oldAccountNumber); ?></td>

                                                <td><?php echo e($savings->totalAmount ?? 'N/A'); ?></td>

                                            </tr>
                                                <?php endif; ?>
                                            <?php endif; ?>
                                        <?php endif; ?>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php /**PATH /home/techhdyz/swd.technathi.cloud/resources/views/pages/allpages/death_manage.blade.php ENDPATH**/ ?>