
<?php $__env->startSection('title', 'Pre Claim Data'); ?>

<?php $__env->startSection('content'); ?>
    <div class="container-xxl flex-grow-1 container-p-y">
        <div class="d-flex justify-content-between align-items-center mb-3">
            <div>
                <h4 class="fw-bold mb-0">
                    Pre Claim Data (<?php echo e($batch->batch_number ?? ('Batch #' . $batch->id)); ?>)
                </h4>
                <div class="text-muted">
                    <span>Type: <strong><?php echo e($batch->file_type); ?></strong></span>
                    <span class="ms-3">Path: <code><?php echo e($batch->file_path); ?></code></span>
                </div>
            </div>
            <a href="<?php echo e(route('admin.preclaim')); ?>" class="btn btn-outline-secondary">Back</a>
        </div>

        <div class="card">
            <div class="card-body">
                <form method="GET" class="row g-2 mb-3">
                    <div class="col-md-6">
                        <input type="text" name="search" value="<?php echo e(request('search')); ?>" class="form-control" placeholder="Search rows">
                    </div>
                    <div class="col-md-3">
                        <button class="btn btn-primary" type="submit">Search</button>
                        <a href="<?php echo e(route('admin.preclaim-data', $batch->id)); ?>" class="btn btn-outline-secondary">Reset</a>
                    </div>
                </form>

                <div class="table-responsive text-nowrap">
                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>Member ID</th>
                            <th>Payer ID</th>
                            <th>Name</th>
                            <th>DOB</th>
                            <th>Optum</th>
                            <th>Created</th>
                        </tr>
                        </thead>
                        <tbody class="table-border-bottom-0">
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $rows; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <?php
                                $data = is_array($row->row_data) ? $row->row_data : (array) $row->row_data;
                                $resp = is_array($row->response_data) ? $row->response_data : (array) $row->response_data;
                                $ok = (bool) ($resp['ok'] ?? false);
                            ?>
                            <tr>
                                <td><?php echo e($row->id); ?></td>
                                <td><?php echo e($data['memberId'] ?? $data['member_id'] ?? '-'); ?></td>
                                <td><?php echo e($data['payerId'] ?? $data['payer_id'] ?? '-'); ?></td>
                                <td><?php echo e(trim(($data['firstName'] ?? $data['first_name'] ?? '') . ' ' . ($data['lastName'] ?? $data['last_name'] ?? '')) ?: '-'); ?></td>
                                <td><?php echo e($data['dateOfBirth'] ?? $data['date_of_birth'] ?? '-'); ?></td>
                                <td>
                                    <span class="badge <?php echo e($ok ? 'bg-label-success' : 'bg-label-danger'); ?>">
                                        <?php echo e($ok ? 'OK' : 'FAILED'); ?>

                                    </span>
                                </td>
                                <td><?php echo e(optional($row->created_at)->format('Y-m-d H:i')); ?></td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr>
                                <td colspan="7" class="text-center">No rows found</td>
                            </tr>
                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        </tbody>
                    </table>
                </div>

                <div class="mt-2">
                    <?php echo e($rows->links()); ?>

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


<?php echo $__env->make('admin.layout.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\laragon\www\medibill\resources\views/admin/preclaim/data.blade.php ENDPATH**/ ?>