    <?php
        use Carbon\Carbon;
    ?>
    <?php if($getAccType == 'COLLECTION'): ?>
        <div class="content-wrapper">
            <div class="container-xxl flex-grow-1 container-p-y">
                <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-device-desktop-cog"></i>View Account Details
                    </div>
                    <div class="card-body">
                        <br>
                        <table class="table table-sm datatableView">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th>Date</th>
                                    <th>Collection By</th>
                                    <th>Member Name</th>
                                    <th>Division</th>
                                    <th>Village</th>
                                    <th>Amount</th>
                                    <th>Description</th>
                                    <th>Status</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                    $count = 1;
                                ?>
                                <?php $__currentLoopData = $getAccountDetails; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php
                                        $cryptId = Crypt::encrypt($data->id);
                                        $date = $data->created_at;
                                        $formatted = Carbon::parse($date)->format('Y-m-d h:i:s A');
                                    ?>
                                    <tr>
                                        <td><?php echo e($count++); ?></td>
                                        <td><?php echo e($formatted); ?></td>
                                        <td>
                                            <?php $__currentLoopData = $getUser; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php if($user->id == $data->collectionBy): ?>
                                                    <?php echo e($user->name); ?>

                                                <?php endif; ?>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </td>
                                        <td>
                                            <?php $__currentLoopData = $getMember; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $mem): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php if($mem->id == $data->memberId): ?>
                                                    <?php echo e($mem->firstName); ?> <?php echo e($mem->lastName); ?>

                                                <?php endif; ?>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </td>
                                        <td>
                                            <?php $__currentLoopData = $getMember; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $mem): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php if($mem->id == $data->memberId): ?>
                                                    <?php $__currentLoopData = $getDivision; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $div): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <?php if($div->id == $mem->divisionId): ?>
                                                            <?php echo e($div->divisionName); ?>

                                                        <?php endif; ?>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php endif; ?>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </td>
                                        <td>
                                            <?php $__currentLoopData = $getMember; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $mem): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php if($mem->id == $data->memberId): ?>
                                                    <?php $__currentLoopData = $getVillage; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $vill): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <?php if($vill->id == $mem->villageId): ?>
                                                            <?php echo e($vill->villageName); ?>

                                                        <?php endif; ?>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php endif; ?>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </td>
                                        <td><?php echo e(number_format($data->amount, 2)); ?></td>
                                        <td><?php echo e($data->description); ?></td>
                                        <td>
                                            <?php if($data->status == 'Credit'): ?>
                                                <span class="badge bg-success">Credit</span>
                                            <?php else: ?>
                                                <span class="badge bg-danger">Debit</span>
                                            <?php endif; ?>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    <?php elseif($getAccType == 'BANK'): ?>
        <div class="content-wrapper">
            <div class="container-xxl flex-grow-1 container-p-y">
                <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-device-desktop-cog"></i>View Account Details
                    </div>
                    <div class="card-body">
                        <br>
                        <table class="table table-sm datatableView">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th>Date</th>
                                    <th>Type</th>
                                    <th>Description</th>
                                    <th>Status</th>
                                    <th>Amount</th>
                                    <th>Balance</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                    $count = 1;
                                ?>
                                <?php $__currentLoopData = $getAcctransferHis; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $TransHis): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php
                                        $date = $TransHis->created_at;
                                        $formatted = Carbon::parse($date)->format('Y-m-d');
                                    ?>

                                    <tr>
                                        <td><?php echo e($count++); ?></td>
                                        <td>
                                            <?php if($TransHis->date == ''): ?>
                                                <?php echo e($formatted); ?>

                                            <?php else: ?>
                                                <?php echo e($TransHis->date); ?>

                                            <?php endif; ?>
                                        </td>
                                        <td>
                                            <?php if($TransHis->remarks == 'Opening Balance'): ?>
                                                Opening
                                            <?php elseif(Str::contains($TransHis->remarks, 'Expensive')): ?>
                                                Expensive
                                            <?php elseif(Str::contains($TransHis->remarks, 'Income')): ?>
                                                Income
                                            <?php else: ?>
                                                <?php if($TransHis->fromAccountId == $decId): ?>
                                                    <?php
                                                        $accountName = '';
                                                    ?>
                                                    <?php $__currentLoopData = $getAccount; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $acc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <?php if($acc->id == $TransHis->toAccountId): ?>
                                                            <?php
                                                                $accountName = $acc->name;
                                                            ?>
                                                        <?php endif; ?>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                    <a href="#" data-name ="<?php echo e($accountName); ?>"  data-amount = "<?php echo e(number_format($TransHis->transferAmount, 2)); ?>" data-remarks="<?php echo e($TransHis->remarks); ?>"
                                                        id="viewTransfer">Transfer</a>
                                                <?php else: ?>
                                                    <?php
                                                        $accountName = '';
                                                    ?>
                                                    <?php $__currentLoopData = $getAccount; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $acc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <?php if($acc->id == $TransHis->fromAccountId): ?>
                                                            <?php
                                                                $accountName = $acc->name;
                                                            ?>
                                                        <?php endif; ?>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                    <a href="#" data-name ="<?php echo e($accountName); ?>" data-amount = "<?php echo e(number_format($TransHis->transferAmount, 2)); ?>" data-remarks="<?php echo e($TransHis->remarks); ?>"
                                                        id="viewTransfer">Transfer</a>
                                                <?php endif; ?>
                                            <?php endif; ?>
                                        </td>
                                        <td><?php echo e(str_replace(['Expensive', 'Income'], '', $TransHis->remarks)); ?></td>
                                        <td>
                                            <?php if($TransHis->fromAccountId == $decId): ?>
                                                <span class="badge bg-danger">Debit</span>
                                            <?php else: ?>
                                                <span class="badge bg-success">Credit</span>
                                            <?php endif; ?>
                                        </td>
                                        <td>
                                            <?php echo e(number_format($TransHis->transferAmount, 2)); ?>

                                        </td>
                                        <td>
                                            <?php if($TransHis->fromAccountId == $decId): ?>
                                                <?php echo e(number_format($TransHis->fromAccountBalance, 2)); ?>

                                            <?php else: ?>
                                                <?php echo e(number_format($TransHis->toAccountBalance, 2)); ?>

                                            <?php endif; ?>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    <?php endif; ?>

<div class="modal fade" id="viewTransferModal" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered modal-lg">
        <div class="modal-content shadow-lg border-0 rounded-5">
            <div class="modal-body p-5 position-relative bg-white">

                <!-- Close Button -->
                <button type="button" class="btn-close position-absolute top-0 end-0 m-4" data-bs-dismiss="modal" aria-label="Close"></button>

                <!-- Modal Title -->
                <div class="text-center mb-5">
                    <h2 class="fw-bold text-primary">💸 View Transfer Details</h2>
                    <p class="text-muted">Review the transaction information carefully.</p>
                </div>

                <!-- Detail Fields -->
                <div class="row g-4">

                    <!-- Transfer Account -->
                    <div class="col-md-12">
                        <div class="card bg-white border-0 shadow-sm rounded-4">
                            <div class="card-body">
                                <h6 class="card-title text-secondary fw-semibold mb-2">🏦 Transfer Account</h6>
                                <p id="transferAcc" class="card-text text-dark fs-5 mb-0">--</p>
                            </div>
                        </div>
                    </div>

                    <!-- Transfer Amount -->
                    <div class="col-md-12">
                        <div class="card bg-warning-subtle border-0 shadow-sm rounded-4">
                            <div class="card-body">
                                <h6 class="card-title text-secondary fw-semibold mb-2">💰 Transfer Amount</h6>
                                <p id="transferAM" class="card-text text-success fs-4 fw-bold mb-0">--</p>
                            </div>
                        </div>
                    </div>

                    <!-- Transfer Remarks -->
                    <div class="col-md-12">
                        <div class="card bg-primary-subtle border-0 shadow-sm rounded-4">
                            <div class="card-body">
                                <h6 class="card-title text-secondary fw-semibold mb-2">📝 Transfer Remarks</h6>
                                <p id="transferRemark" class="card-text text-dark fs-5 mb-0">--</p>
                            </div>
                        </div>
                    </div>

                </div>

                <!-- Footer -->
                <div class="text-center mt-5">
                    <button type="button" class="btn btn-outline-primary px-4 py-2 rounded-pill" data-bs-dismiss="modal">
                        Close
                    </button>
                </div>

            </div>
        </div>
    </div>
</div>

<?php /**PATH /Users/anlex/Desktop/untitled folder/ngo/resources/views/pages/allpages/account/view_account_details.blade.php ENDPATH**/ ?>