<div class="content-wrapper">
    <div class="container-xxl flex-grow-1 container-p-y">
        <div class="row justify-content-center">
            <div class="col-lg-12">
                <div class="card shadow border border-primary">
                    <div class="card-header bg-primary text-white d-flex align-items-center justify-content-between">
                        <div>
                            <i class="menu-icon ti ti-users-group me-2"></i>
                            <strong class="text-uppercase">View Meeting</strong>
                        </div>
                        <span class="badge bg-light text-primary border border-primary fs-6 px-3 py-2 shadow-sm">
                            #<?php echo e($meetingData->id ?? 'N/A'); ?>

                        </span>
                    </div>

                    <div class="card-body px-4 py-4">
                        <!-- Meeting Info -->
                        <h5 class="text-primary fw-bold border-bottom pb-2 mb-4">Meeting Information</h5>
                        <div class="row mb-3">
                            <div class="col-md-6 mb-3">
                                <label class="form-label fw-bold">Meeting Title:</label>
                                <p class="form-control-plaintext border p-2 bg-light rounded">
                                    <?php echo e($meetingData->meeting_title); ?>

                                </p>
                            </div>
                            <div class="col-md-6 mb-3">
                                <label class="form-label fw-bold">Meeting Type:</label>
                                <p class="form-control-plaintext border p-2 bg-light rounded">
                                    <?php echo e($meetingData->meeting_type ?? 'N/A'); ?>

                                </p>
                            </div>
                            <div class="col-md-6 mb-3">
                                <label class="form-label fw-bold">Date:</label>
                                <p class="form-control-plaintext border p-2 bg-light rounded">
                                    <?php echo e(\Carbon\Carbon::parse($meetingData->meeting_date)->format('d M Y')); ?>

                                </p>
                            </div>
                            <div class="col-md-6 mb-3">
                                <label class="form-label fw-bold">Start Time:</label>
                                <p class="form-control-plaintext border p-2 bg-light rounded">
                                    <?php echo e(\Carbon\Carbon::parse($meetingData->meeting_start_time ?? $meetingData->meeting_time)->format('h:i A')); ?>

                                </p>
                            </div>
                            <div class="col-md-6 mb-3">
                                <label class="form-label fw-bold">End Time:</label>
                                <p class="form-control-plaintext border p-2 bg-light rounded">
                                    <?php if(!empty($meetingData->meeting_end_time)): ?>
                                        <?php echo e(\Carbon\Carbon::parse($meetingData->meeting_end_time)->format('h:i A')); ?>

                                    <?php else: ?>
                                        N/A
                                    <?php endif; ?>
                                </p>
                            </div>
                            <div class="col-md-6 mb-3">
                                <label class="form-label fw-bold">Resource Person:</label>
                                <p class="form-control-plaintext border p-2 bg-light rounded">
                                    <?php echo e($meetingData->resource_person); ?>

                                </p>
                            </div>
                            <div class="col-md-6 mb-3">
                                <label class="form-label fw-bold">Resource Position:</label>
                                <p class="form-control-plaintext border p-2 bg-light rounded">
                                    <?php echo e($meetingData->resource_position); ?>

                                </p>
                            </div>
                            <div class="col-md-6 mb-3">
                                <label class="form-label fw-bold">Resource Contact No:</label>
                                <p class="form-control-plaintext border p-2 bg-light rounded">
                                    <?php echo e($meetingData->resource_contact_no); ?>

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

                        <?php
                            $meetingType = strtolower($meetingData->meeting_type ?? '');
                        ?>

                        <?php if($meetingType === 'group meeting' && $meetingData->group_meeting_data): ?>
                            <h5 class="text-success fw-bold border-bottom pb-2 mb-3">Group Meeting Details</h5>
                            <?php
                                $groupData = json_decode($meetingData->group_meeting_data, true);
                            ?>
                            <ul class="list-group mb-4">
                                <?php $__currentLoopData = $groupData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <li class="list-group-item d-flex justify-content-between align-items-center">
                                        <strong><?php echo e(ucwords(str_replace('_', ' ', $key))); ?></strong>
                                        <span><?php echo e($value ?: 'N/A'); ?></span>
                                    </li>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </ul>
                        <?php elseif($meetingType === 'village meeting' && $meetingData->village_meeting_data): ?>
                            <h5 class="text-info fw-bold border-bottom pb-2 mb-3">Village Meeting Details</h5>
                            <?php
                                $villageData = json_decode($meetingData->village_meeting_data, true);
                            ?>
                            <ul class="list-group mb-4">
                                <?php $__currentLoopData = $villageData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <li class="list-group-item d-flex justify-content-between align-items-center">
                                        <strong><?php echo e(ucwords(str_replace('_', ' ', $key))); ?></strong>
                                        <span><?php echo e($value ?: 'N/A'); ?></span>
                                    </li>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </ul>
                        <?php elseif(
                            ($meetingType === 'awareness meeting' || $meetingType === 'awarness meeting') &&
                                $meetingData->awarness_meeting_data): ?>
                            <h5 class="text-warning fw-bold border-bottom pb-2 mb-3">Awareness Meeting Details</h5>
                            <?php
                                $awarnessData = json_decode($meetingData->awarness_meeting_data, true);
                            ?>
                            <ul class="list-group mb-4">
                                <?php $__currentLoopData = $awarnessData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <li class="list-group-item d-flex justify-content-between align-items-center">
                                        <strong><?php echo e(ucwords(str_replace('_', ' ', $key))); ?></strong>
                                        <span><?php echo e($value ?: 'N/A'); ?></span>
                                    </li>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </ul>
                        <?php else: ?>
                            <p>No additional meeting details available.</p>
                        <?php endif; ?>

                        <hr class="mt-4 mb-4">
                        <h5 class="text-primary fw-bold border-bottom pb-2 mb-3">Member Attendance</h5>

                        <div class="table-responsive">
                            <table class="table table-striped table-bordered align-middle text-center">
                                <thead class="table-primary">
                                    <tr>
                                        <th>#</th>
                                        <th>Full Name</th>
                                        <th>NIC</th>
                                        <th>Old Account Number</th>
                                        <th>Present / Absent</th>
                                        <th>Remarks</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $count = 1; ?>
                                    <?php $__currentLoopData = $memRecord; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rec): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>
                                            <td><?php echo e($count++); ?></td>
                                            <td><?php echo e($rec['fullName']); ?></td>
                                            <td><?php echo e($rec['nicNumber']); ?></td>
                                            <td><?php echo e($rec['oldAccNo']); ?></td>
                                            <td>
                                                <?php if($rec['absent'] == 0): ?>
                                                    <span class="badge bg-danger px-3 py-2">Absent</span>
                                                <?php else: ?>
                                                    <span class="badge bg-success px-3 py-2">Present</span>
                                                <?php endif; ?>
                                            </td>
                                            <td><?php echo e($rec['remarks']); ?></td>
                                        </tr>
                                    <?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/meetings/view_meetings.blade.php ENDPATH**/ ?>