@php use Illuminate\Support\Str; @endphp

{{$societyinfo->cust_name}}

{{$societyinfo->contact_address}}
@if(!empty($resident_pdf_header_data['Email'])) E-mail: {{$resident_pdf_header_data['Email']}}
@endif @if(!empty($resident_pdf_header_data['Phone'])) Phone: {{$resident_pdf_header_data['Phone']}} @endif @if(!empty($resident_pdf_header_data['GST'])) GST: {{$resident_pdf_header_data['GST']}} @endif

@if($hasLogo) @endif

Resident report

Printed at {{date('d M Y H:i:s')}}

@if(isset($blood_group)) @endif @if(isset($emergency_contact) && !empty($emergency_contact)) @php $contactLabel = is_array($emergency_contact) ? ($emergency_contact['name'] ?? 'Emergency Contact') : 'Emergency Contact'; $contactValue = trim($resident->emergency_contact ?? 'N/A', '"'); @endphp {{-- --}} @endif @if(isset($dob)) @endif
Name : {{ ucfirst($resident->complainant_name ?? 'N/A') }} ({{ $resident->gender ?? 'N/A' }})
Phone : {{ $resident->contact_no ?? 'N/A' }}{{ isset($resident->contact_no_2) ? ' / ' . $resident->contact_no_2 : '' }}
Email : {{ $resident->email ?? 'N/A' }}
Current residence : @if(empty($resident->building_name) && empty($resident->apartment_name) && empty($resident->unit_name) && empty($resident->living_start_at)) N/A @else {{ $resident->building_name ?? '' }} @if(!empty($resident->apartment_name)) / {{ $resident->apartment_name }} @endif @if(!empty($resident->unit_name)) ({{ $resident->unit_name }}) @endif @if(!empty($resident->living_start_at))
since {{ $resident->living_start_at }} @endif @endif
Created since : {{ $resident->approved_at ?? 'N/A' }}
{{ $blood_group['name'] }} : {{ trim($resident->blood_group ?? 'N/A', '"') }}
{{ $contactLabel }}: {{ $contactValue }}
{{ $emergency_contact['name'] }}: {{ trim($resident->emergency_contact ?? 'N/A', '"') }}
Institute Emergency Contact: {{ $societyinfo->emergency_contact ?? 'N/A' }}
{{ $dob['name'] }} : {{ trim($resident->dob ?? 'N/A', '"') }}
Admission Number : {{ $academicDetail->registration_no ?? 'N/A' }}
Roll Number : {{ $academicDetail->reference_number ?? 'N/A' }}
@if(!empty($academic_course) && !empty($academic_course->label_en)) {{ $academic_course->label_en }} @else Course @endif : {{ $academicDetail->course_name ?? 'N/A' }}
Branch : {{ $academicDetail->branch_name ?? 'N/A' }}
Year : {{ $academicDetail->course_year ?? 'N/A' }}
Batch : {{ $academicDetail->batch_name ?? 'N/A' }}
@if(!empty($resident->file)) Resident Photo @else No Image Available @endif
@if ($show_address_details == 1 && !empty($addressDetails))

Address Details

@foreach($addressDetailKeys as $key => $value) @endforeach @if(!empty($addressDetails)) @foreach($addressDetailKeys as $key => $value) @endforeach @else @endif
{{ ucwords(str_replace('_', ' ', $key)) }}
{{ $addressDetails->{$key} ?? '-' }}
Address details not available
@endif
@if (!empty($resident->parents) && is_array($resident->parents))

Parent Information

@if(isset($name)) @endif @if(isset($phone_number)) @endif @if(isset($email)) @endif @if(isset($address)) @endif @if(isset($alternate_contact)) @endif @foreach($resident->parents as $parent) @if(isset($name)) @endif @if(isset($phone_number)) @endif @if(isset($email)) @endif @if(isset($address)) @endif @if(isset($alternate_contact)) @endif @endforeach
{{ $name['name'] }}{{ $phone_number['name'] }}{{ $email['name'] }}{{ $address['name'] }}{{ $alternate_contact['name'] }}
{{ $parent['name'] ?? 'N/A' }}{{ $parent['phone_number'] ?? 'N/A' }}{{ $parent['email'] ?? 'N/A' }}{{ $parent['address'] ?? 'N/A' }}{{ $parent['alternate_contact'] ?? 'N/A' }}
@endif
@if ($resident->local_guardians != null)

Local Guardians

@if(isset($resident->local_guardians)) @php $guardians = json_decode($resident->local_guardians); @endphp @foreach($guardians as $guardian) @endforeach @endif
Name Phone Email Address Relation
@if(isset($guardian->name)){{$guardian->name}}@endif @if(isset($guardian->phone_number)){{$guardian->phone_number}}@endif @if(isset($guardian->email)){{$guardian->email}}@endif @if(isset($guardian->address)){{$guardian->address}}@endif @if(isset($guardian->relation)){{$guardian->relation}}@endif
@endif
@if( !isset($resident->driving_license) && !isset($vehicleDetail->vehicle_type) && !isset($vehicleDetail->vehicle_registration_certificate) && !isset($vehicleDetail->vehicle_insurance_policy) && !isset($vehicleDetail->puc_certificate) && !isset($vehicleDetail->vehicle_owner_Name) && !isset($vehicleDetail->vehicle_owner_ontact) && $isVehicleManagement == 1 ) {{-- Do nothing, section won't appear if all data is missing --}} @else

Personal Vehicle Declaration

@if(isset($resident->driving_license)) @endif @if(isset($vehicleDetail->vehicle_type)) @endif @if(isset($vehicleDetail->vehicle_registration_certificate)) @endif @if(isset($vehicleDetail->vehicle_insurance_policy)) @endif
Driving License : {{ $resident->driving_license }}
Vehicle Type : {{ $vehicleDetail->vehicle_type }}
Vehicle Registration Certificate : File link
Vehicle Insurance Policy : {{ $vehicleDetail->vehicle_insurance_policy }}
@if(isset($vehicleDetail->puc_certificate)) @endif @if(isset($vehicleDetail->vehicle_owner_Name)) @endif @if(isset($vehicleDetail->vehicle_owner_ontact)) @endif
Valid PUC : File link
Vehicle Owner’s Name : {{ $vehicleDetail->vehicle_owner_Name }}
Vehicle Owner’s Contact : {{ $vehicleDetail->vehicle_owner_ontact }}
@endif


@if( !isset($resident->anti_ragging_declaration_by_student) && !isset($resident->anti_ragging_declaration_by_parent) && !isset($resident->indemnity_bond) ) {{-- Do nothing, section won't appear if all data is missing --}} @else

Anti-Ragging

@if(isset($resident->anti_ragging_declaration_by_student)) @endif @if(isset($resident->anti_ragging_declaration_by_parent)) @endif
Declaration by Student: {{ $resident->anti_ragging_declaration_by_student }}
Declaration by Parent: {{ $resident->anti_ragging_declaration_by_parent }}
@if(isset($resident->indemnity_bond)) @endif
Indemnity Bond: {{ $resident->indemnity_bond }}
@endif


@if( !isset($resident->hostel_undertaking) && !isset($resident->medical_declaration) && !isset($resident->medical_fitness_certificate_self_declaration) && !isset($resident->major_illness_allergies) && !isset($resident->severity) && !isset($resident->medicines_you_will_carry_with_you) && !isset($resident->other_remarks) ) {{-- Do nothing, section won't appear if all data is missing --}} @else

Medical

@if(isset($resident->hostel_undertaking)) @endif @if(isset($resident->medical_declaration)) @endif @if(isset($resident->medical_fitness_certificate_self_declaration)) @endif @if(isset($resident->major_illness_allergies)) @endif
Hostel Undertaking: {{ $resident->hostel_undertaking }}
Medical Declaration : {{ $resident->medical_declaration }}
Medical Fitness Certificate/Self Declaration : {{ $resident->medical_fitness_certificate_self_declaration }}
Any major illness/Allergies : {{ $resident->major_illness_allergies }}
@if(isset($resident->severity)) @endif @if(isset($resident->medicines_you_will_carry_with_you)) @endif @if(isset($resident->other_remarks)) @endif
Severity : {{ $resident->severity }}
Any Medicines you will carry with you : {{ $resident->medicines_you_will_carry_with_you }}
Other remarks : {{ $resident->other_remarks }}
@endif


@if (!empty($currentResidenceHistory))

Currently Living

Residence Type From Join Expected
{{ $currentResidenceHistory->name }} / {{ $currentResidenceHistory->apartment_name }} {{ $currentResidenceHistory->unit_type }} {{ $currentResidenceHistory->living_start_at ? date("d-m-Y", strtotime($currentResidenceHistory->living_start_at)) : 'N/A' }} {{ $currentResidenceHistory->room_join_date ? date("d-m-Y", strtotime($currentResidenceHistory->room_join_date)) : 'N/A' }} {{ $currentResidenceHistory->end_at ? date("d-m-Y", strtotime($currentResidenceHistory->end_at)) : 'N/A' }}
@endif
@if (count($residenceHistory) > 0)

Living History

@foreach($residenceHistory as $residence) @endforeach
Residence Type From Join To
{{ $residence->name }} / {{ $residence->apartment_name }} {{ $residence->unit_type }} {{ $residence->living_start_at ? date("d-m-Y", strtotime($residence->living_start_at)) : 'N/A' }} {{ $residence->room_join_date ? date("d-m-Y", strtotime($residence->room_join_date)) : 'N/A' }} {{ $residence->end_at ? date("d-m-Y", strtotime($residence->end_at)) : 'N/A' }}
@endif
@if(isset($walletTransactions) && !empty($data['walletTransactions']) && $isHostelRent == 1)

Ledger

@foreach($walletTransactions as $transaction) @endforeach
Date Type Amount Description Balance
{{ $transaction->clear_date }} {{ $transaction->direction }} {{ number_format($transaction->amount, 2) }} {{ $transaction->trans_description }} {{ number_format($transaction->community_balance, 2) }}
@endif
@if(isset($rent_bills) && !empty($rent_bills) && $isHostelRent == 1)

Rent Bills

@foreach($rent_bills as $bill) @endforeach
Bill No. Net Residence Billed at Type From To Cancelled?
{{$bill->bill_id}} {{$bill->net_amount}} {{$bill->building}} / {{$bill->apartment_name}} {{ $bill->approved_at ? date("d-m-Y", strtotime($bill->approved_at)) : 'N/A' }} {{$bill->billing_type}} {{ $bill->from_date ? date("d-m-Y", strtotime($bill->from_date)) : 'N/A' }} {{ $bill->to_date ? date("d-m-Y", strtotime($bill->to_date)) : 'N/A' }} {{ !empty($bill->cancelled_by) ? 'Yes' : 'No' }}
@endif
@if(isset($other_charges) && !empty($other_charges))

Other bills

@foreach($other_charges as $bill) @endforeach
Bill No. Amount Residence Billed at Type From To Cancelled?
{{$bill->bill_id}} {{$bill->amount}} {{$bill->building_name}} / {{$bill->apartment_name}} {{$bill->approved_at}} {{$bill->charge_text}} {{$bill->from_date}} {{$bill->to_date}} @if(!empty($bill->cancelled_by)) Yes @else No @endif
@endif
@if (count($documents) > 0)

KYC Documents

@foreach($documents as $index => $document)
@if(!empty($document->file_name)) @if(!Str::contains($document->file_name, '.pdf')) Document Image @else @endif @endif
{{ $document->name }}
@if(($index + 1) % 2 == 0)
@endif @endforeach
@endif
@if (count($leave_report) > 0)

@if(!empty($resident_tracking_leaves) && $resident_tracking_leaves->label_en != ""){{$resident_tracking_leaves->label_en}}@endif

@foreach($leave_report as $leave) @endforeach
Request No. Request At From To Reason Guardian Approval Approved By Reported On
{{$leave->id}} {{$leave->created_at}} {{$leave->from_date}} {{$leave->to_date}} {{$leave->template_description}} {{$leave->ex_approval_status}} {{$leave->approved_by_name}} {{$leave->reporting_dt}}
@endif
@if (count($complains) > 0)

Complains

@foreach($complains as $key => $complain) @endforeach
Complain No. Description Complaint Date Status
{{++$key}} {{$complain->complaint_subject ?? 'N/A'}} {{$complain->complaint_date ?? 'N/A'}} {{$complain->complaint_status ?? 'N/A'}}
@endif
@if (count($allotmentRestDetails) > 0)

Allotment

Session:   {{$allotmentRestDetails[0]->session_name}}  Apartment:   {{$allotmentRestDetails[0]->apartment_name}}  Building Name:   {{$allotmentRestDetails[0]->building_name}}  Unit Type:   {{$allotmentRestDetails[0]->unit_type_name}}
Living Start Date:   {{$allotmentRestDetails[0]->living_start_at}}  Booked Upto:   {{$allotmentRestDetails[0]->booked_up_to}}  
Payment Date:   {{$allotmentRestDetails[0]->complete_at}}   Amount:   {{$allotmentRestDetails[0]->amount}}   Discount:   {{$allotmentRestDetails[0]->discount}}   Net Amount:   {{$allotmentRestDetails[0]->net_amount}}  

@endif