<table>
    <thead>
        <tr>
            <th>Name</th>
            <th>Given Name</th>
            <th>Additional Name</th>
            <th>Family Name</th>
            <th>Yomi Name</th>
            <th>Given Name Yomi</th>
            <th>Additional Name Yomi</th>
            <th>Family Name Yomi</th>
            <th>Name Prefix</th>
            <th>Name Suffix</th>
            <th>Initials</th>
            <th>Nickname</th>
            <th>Short Name</th>
            <th>Maiden Name</th>
            <th>Birthday</th>
            <th>Gender</th>
            <th>Location</th>
            <th>Billing Information</th>
            <th>Directory Server</th>
            <th>Mileage</th>
            <th>Occupation</th>
            <th>Hobby</th>
            <th>Sensitivity</th>
            <th>Priority</th>
            <th>Subject</th>
            <th>Notes</th>
            <th>Language</th>
            <th>Photo</th>
            <th>Group Membership</th>
            <th>E-mail 1 - Type</th>
            <th>E-mail 1 - Value</th>
            <th>E-mail 2 - Type</th>
            <th>E-mail 2 - Value</th>
            <th>E-mail 3 - Type</th>
            <th>E-mail 3 - Value</th>
            <th>Phone 1 - Type</th>
            <th>Phone 1 - Value</th>
            <th>Phone 2 - Type</th>
            <th>Phone 2 - Value</th>
            <th>Address 1 - Type</th>
            <th>Address 1 - Formatted</th>
            <th>Address 1 - Street</th>
            <th>Address 1 - City</th>
            <th>Address 1 - PO Box</th>
            <th>Address 1 - Region</th>
            <th>Address 1 - Postal Code</th>
            <th>Address 1 - Country</th>
            <th>Address 1 - Extended Address</th>
            <th>Organization 1 - Type</th>
            <th>Organization 1 - Name</th>
            <th>Organization 1 - Yomi Name</th>
            <th>Organization 1 - Title</th>
            <th>Organization 1 - Department</th>
            <th>Organization 1 - Symbol</th>
            <th>Organization 1 - Location</th>
            <th>Organization 1 - Job Description</th>
        </tr>
    </thead>
    <tbody>
        @foreach($query as $val)
        <tr>
            <td>{{ $val->name ?? '' }}</td> <!-- name -->
            <td>{{ $val->name ?? '' }}</td> <!-- GivenName -->
            <td>{{ $val->AdditionalName ?? '' }}</td> <!-- AdditionalName -->
            <td>{{ $val->designation ?? '' }}</td> <!-- FamilyName -->
            <td>{{ $val->YomiName ?? '' }}</td> <!-- YomiName -->
            <td>{{ $val->GivenNameYomi ?? '' }}</td> <!-- GivenNameYomi -->
            <td>{{ $val->AdditionalNameYomi ?? '' }}</td> <!-- AdditionalNameYomi -->
            <td>{{ $val->FamilyNameYomi ?? '' }}</td> <!-- FamilyNameYomi -->
            <td>{{ $val->NamePrefix ?? '' }}</td> <!-- NamePrefix -->
            <td>{{ $val->NameSuffix ?? '' }}</td> <!-- NameSuffix -->
            <td>{{ $val->Initials ?? '' }}</td> <!-- Initials -->
            <td>{{ $val->Nickname ?? '' }}</td> <!-- Nickname -->
            <td>{{ $val->ShortName ?? '' }}</td> <!-- ShortName -->
            <td>{{ $val->MaidenName ?? '' }}</td> <!-- MaidenName -->
            <td>{{ $val->Birthday ?? '' }}</td> <!-- Birthday -->
            <td>{{ $val->Gender ?? '' }}</td> <!-- Gender -->
            <td>{{ $val->Location ?? '' }}</td> <!-- Location -->
            <td>{{ $val->BillingInformation ?? '' }}</td> <!-- BillingInformation -->
            <td>{{ $val->DirectoryServer ?? '' }}</td> <!-- DirectoryServer -->
            <td>{{ $val->Mileage ?? '' }}</td> <!-- Mileage -->
            <td>{{ $val->Occupation ?? '' }}</td> <!-- Occupation -->
            <td>{{ $val->Hobby ?? '' }}</td> <!-- Hobby -->
            <td>{{ $val->Sensitivity ?? '' }}</td> <!-- Sensitivity -->
            <td>{{ $val->Priority ?? '' }}</td> <!-- Priority -->
            <td>{{ $val->Subject ?? '' }}</td> <!-- Subject -->
            <td>
                {{
                    trim(
                        rtrim(
                            ($val->category ? $val->category . ',' : '') .
                            ($val->sub_category ? $val->sub_category . ',' : '') .
                            ($val->remarks ?? ''),
                        ',')
                    )
                }}
            </td><!-- Notes -->
            <td>{{ $val->Language ?? '' }}</td> <!-- Language -->
            <td>{{ $val->Photo ?? '' }}</td> <!-- Photo -->
            <td>{{ $val->event_name ?? '' }}</td> <!-- GroupMembership -->
            <td>Work</td> <!-- Email1Type -->
            <td>{{ $val->email ?? '' }}</td> <!-- Email1Value -->
            <td>Work</td> <!-- Email2Type -->
            <td>{{ $val->email2 ?? '' }}</td> <!-- Email2Value -->
            <td>{{ $val->Email3Type ?? '' }}</td> <!-- Email3Type -->
            <td>{{ $val->Email3Value ?? '' }}</td> <!-- Email3Value -->
            <td>Main</td> <!-- Phone1Type -->
            <td>{{ $val->mobile_no ?? '' }}</td> <!-- Phone1Value -->
            <td>Work</td> <!-- Phone2Type -->
            <td>{{ $val->mobile_no2 ?? '' }}</td> <!-- Phone2Value -->
            <td>Work</td> <!-- Address1Type -->
            <td>{{ $val->address ?? '' }}</td> <!-- Address1Formatted -->
            <td>{{ $val->Address1Street ?? '' }}</td> <!-- Address1Street -->
            <td>{{ $val->city ?? '' }}</td> <!-- Address1City -->
            <td>{{ $val->Address1POBox ?? '' }}</td> <!-- Address1POBox -->
            <td>{{ $val->state ?? '' }}</td> <!-- Address1Region -->
            <td>{{ $val->pincode ?? '' }}</td> <!-- Address1PostalCode -->
            <td>{{ $val->Address1Country ?? '' }}</td> <!-- Address1Country -->
            <td>{{ $val->Address1ExtendedAddress ?? '' }}</td> <!-- Address1ExtendedAddress -->
            <td>{{ $val->Org1Type ?? '' }}</td> <!-- Org1Type -->
            <td>{{ $val->company_name ?? '' }}</td> <!-- Org1Name -->
            <td>{{ $val->Org1YomiName ?? '' }}</td> <!-- Org1YomiName -->
            <td>{{ $val->designation ?? '' }}</td> <!-- Org1Title -->
            <td>{{ $val->Org1Department ?? '' }}</td> <!-- Org1Department -->
            <td>{{ $val->Org1Symbol ?? '' }}</td> <!-- Org1Symbol -->
            <td>{{ $val->Org1Location ?? '' }}</td> <!-- Org1Location -->
            <td>{{ $val->Org1JobDescription ?? '' }}</td> <!-- Org1JobDescription -->
        </tr>
        @endforeach
    </tbody>
</table>