<!DOCTYPE html>
<html>
<head>
    <title>User Registration</title>
    <style>
        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 8px;
        }
        th, td {
            border: 1px solid #ddd;
            padding: 8px;
            text-align: left;
        }
        th {
            background-color: #f2f2f2;
        }
        span {
            font-size: 9px;
        }
    </style>
</head>
<body>
<h1>User Registration Report</h1>
<table>
    <thead>
    <tr>
        <th>Sl No</th>
        <th>User ID</th>
        <th>Name</th>
        <th>Mobile Number</th>
        <th>Nationality</th>
        <th>Sect</th>
        <th>Subscription Plan</th>
        <th>Status</th>
        @if($gender == 'Female')
        <th>Parent Approval</th>
        @endif
        <th>Created Date</th>
    </tr>
    </thead>
    <tbody>
    @foreach($users as $index => $user)
        <tr>
            <td> {{ ($index+1) }} </td>
            <td> {{ $user->user_number }} </td>
            <td> {{ $user->name }} </td>
            <td> {{ $user->dial_code." ".$user->phone }} </td>
            <td> {{ $user->nationality->name??'N/A' }} </td>
            <td> {{ $user->details->sect->name?? 'N/A' }} </td>
            <td> {{ $user->plan->name??'N/A' }} </td>
            <td> {{ $user->status == 1 ? 'Active':'Inactive' }} </td>
            @if($gender == 'Female')
            <td>{{ $user->parent_approval == 1 ? 'Approved':'Not Approved' }}</td>
            @endif
            <td> {{ $user->created_at->format('d/m/y H:i A'); }} </td>
        </tr>
    @endforeach
    </tbody>
</table>
</body>
</html>
