@extends('layouts.training_centre_layout') @section('content')
{{-- TAB NAVIGATION LINKS (Standard Bootstrap Nav Tabs) --}}
{{-- TAB 1: Basic Details (Now the first tab) --}}
Basic Training Centre Details
{{-- Use row and g-3 for consistent gap and symmetric structure --}}
{{-- Row 1: Status, App Number, Centre Name --}} {{-- APPLICATION STATUS --}}
Application Status
@php $status = $centre->application_status ?? 'Not Started'; $statusUpper = strtoupper($status); $badgeClass = 'bg-secondary'; switch (strtolower($status)) { case 'approved': $badgeClass = 'bg-success'; break; case 'rejected': $badgeClass = 'bg-danger'; break; case 'in progress': $badgeClass = 'bg-primary'; break; case 'not started': default: $badgeClass = 'bg-warning text-dark'; break; } @endphp {{ $statusUpper }}
{{-- Application Number --}}
Application Number

{{ $centre->application_number ?? '❌ Not Generated' }}

{{-- Centre Name --}}
Centre Name

{{ $basicDetails->centre_name ?? '❌ Not Provided' }}

{{-- Row 2: Director, Email, Phone --}} {{-- Director Name --}}
Director Name

{{ $basicDetails->director_name ?? '❌ Not Provided' }}

{{-- Official Email --}}
Email

{{ $basicDetails->official_email ?? '❌ Not Provided' }}

{{-- Primary Phone --}}
Phone

{{ $basicDetails->primary_phone ?? '❌ Not Provided' }}

{{-- Row 3: Year, Website, Address --}} {{-- Establish Year --}}
Establish Year

{{ $basicDetails->establish_year ?? '❌ Not Provided' }}

{{-- Website --}}
Website

@if($basicDetails->website) {{ $basicDetails->website }} @else ❌ Not Provided @endif

{{-- Address --}}
Address Line

{{ $address->address ?? '❌ Not Provided' }}

{{-- Row 4: State, District, City --}} {{-- State --}}
State

{{ $address->stateMapped->state_name_en ?? '❌ Not Provided' }}

{{-- District --}}
District

{{ $address->districtMapped->district_name_en ?? '❌ Not Provided' }}

{{-- City --}}
City

{{ $address->city ?? '❌ Not Provided' }}

{{-- Row 5: Pincode, Landmark, Coordinates --}} {{-- PinCode --}}
PinCode

{{ $address->pincode ?? '❌ Not Provided' }}

{{-- Landmark --}}
Landmark

{{ $address->landmark ?? '❌ Not Provided' }}

{{-- Coordinates with button to open map modal --}}
GPS Coordinates

Lat: {{ $address->latitude ?? '❌ N/A' }}
Long: {{ $address->longitude ?? '❌ N/A' }} @if($address->latitude && $address->longitude) @endif


{{-- NAV BUTTONS --}}
{{-- MAP MODAL --}} @if($address->latitude && $address->longitude) @endif {{-- TAB 2: Trainers (PREVIOUS and NEXT) --}}
Trainer
{{-- Your main content goes here (trainer list, etc.) --}}
@if ($trainers->count() > 0) @foreach ($trainers as $trainer)
{{-- Main details --}}
{{ $trainer->name ?? 'Not Specified' }}

Date of Birth: {{ $trainer->dob ? \Carbon\Carbon::parse($trainer->dob)->format('d M Y') : 'N/A' }}

Education: {{ $trainer->higher_qualification ?? 'N/A' }}

Experience: {{ $trainer->experience ? $trainer->experience . ' years' : 'N/A' }}

{{-- Document Links - UPDATED CONTAINER --}}
{{-- Education Certificate --}} @if ($trainer->higher_qualification_certificate) Education Certificate @endif {{-- Experience Letter --}} @if ($trainer->experience_certificate) Experience Letter @endif {{-- NISD Certificate --}} {{-- TOT Certificate --}} @if ($trainer->nisd_tot_certificate) NISD TOT Master Trainer Certificate @endif {{-- TOA Certificate (Optional) --}} @if ($trainer->toa_certificate) NISD TOA Certificate @endif {{-- Show message if no documents are uploaded --}} @if ( !($trainer->higher_qualification_certificate || $trainer->experience_certificate || $trainer->nisd_certificate || $trainer->tot_certificate || $trainer->toa_certificate) ) No documents uploaded. @endif
@endforeach @else {{-- Message when no trainers found --}}

No trainers have been added yet.

@endif
{{-- NAV BUTTONS --}}
{{-- TAB 3: Infrastructure (PREVIOUS and NEXT) --}}
Infrastructure
{{-- Use row and g-3 for symmetric grid and gap --}} {{-- Total Area (Col 1/3) --}}
Total Area

{{ $infrastructure->total_area ?? '❌ Not Provided' }} sq ft

{{-- Classrooms (Col 2/3) --}}
Classrooms

{{ $infrastructure->classrooms ?? '❌ Not Provided' }}

{{-- Classroom Size Confirmation (Col 3/3) --}}
Classroom Size Confirmed

{{ $infrastructure->classroom_size_confirmation ?? '❌ Not Confirmed' }}

{{-- Demonstration Labs (Col 4/6) --}}
Demonstration Labs

{{ $infrastructure->number_of_laboratories ?? '❌ Not Provided' }}

{{-- Laboratory Size Confirmation (Col 5/6) --}}
Demonstration Lab Size Confirmed

{{ $infrastructure->laboratory_size_confirmation ?? '❌ Not Confirmed' }}

{{-- Facilities (Full Width Row) --}} {{-- Facilities (Full Width Row) --}}
Facilities
@if(!empty($facilityDetails) && count($facilityDetails) > 0)
    @foreach(collect($facilityDetails) as $facility)
  • {{ $facility['name'] ?? 'Unnamed Facility' }}
  • @endforeach
@else

❌ Not Provided

@endif
{{-- NAV BUTTONS --}}
{{-- TAB 4: Programs (PREVIOUS and NEXT) --}}
Training Programs
@if($selectedProgram->count() > 0) @foreach($selectedProgram as $program) @php $programData = $program->program ?? null; @endphp
{{ $program->program->title ?? 'N/A' }}

Duration: {{ $program->program->total_hours ?? 'N/A' }} hrs

Type: {{ $program->program->course_type_desc ?? 'N/A' }}

@endforeach @else
@endif
{{-- NAV BUTTONS --}}
{{-- TAB 5: Payment (PREVIOUS and NEXT) --}} @php $allowedPaymentStatuses = ['PAYMENT_SUBMITTED', 'PAYMENT_RECEIVED']; @endphp @if(isset($centre) && in_array(strtoupper($centre->application_status), $allowedPaymentStatuses))
Payment Details
@if($payment)
{{-- Payment Mode (Col 1) --}}
Payment Mode

{{ $payment->payment_mode ?? 'N/A' }}

{{-- Transaction ID (Col 2) --}}
Transaction ID

{{ $payment->transaction_id ?? 'N/A' }}

{{-- Transaction Date (Col 3) --}}
Transaction Date

{{ $payment->transaction_date ? \Carbon\Carbon::parse($payment->transaction_date)->format('d M Y') : 'N/A' }}

{{-- Amount (INR) (Col 4) --}}
Amount (INR)

{{ $payment->amount ?? 'N/A' }}

{{-- Transaction Details (Col 5) --}}
Transaction Details

{{ $payment->transaction_details ?? '-' }}

{{-- Receipt (Col 6) --}}
Receipt
@if($payment->receipt_path) View Receipt @else No receipt uploaded. @endif
@else @endif
{{-- NAV BUTTONS --}}
@endif {{-- TAB 6: Documents (PREVIOUS only) --}}
Documents & Declarations
Uploaded Documents
@foreach($uploadedFiles as $label => $files)
{{ $label }}

{{ count($files) }} {{ Str::plural('file', count($files)) }}

@forelse($files as $file) @empty No file @endforelse
@endforeach

Declarations
@php $declarationLabels = [ 'agree_terms' => 'I agree to the Terms and Conditions and Privacy Policy', 'agree_inspection' => 'I agree to facility inspection by NISD officials', 'declare_info' => 'I declare that all information provided is accurate and complete', ]; @endphp

Declarations

Declarations confirmed for this application:
@foreach($declarations as $key => $value)
@endforeach

Application Timeline

Track the progress of your centre application

@php $centreApplicationStatus = $centreApplicationStatus ?? collect(); $statusInitiated = $centreApplicationStatus->firstWhere('application_status', 'INITIATED'); $statusPending = $centreApplicationStatus->firstWhere('application_status', 'PENDING'); $statusDf = $centreApplicationStatus->firstWhere('application_status', 'DISCREPANCY_FOUND'); $statusDr = $centreApplicationStatus->firstWhere('application_status', 'DISCREPANCY_REMOVED'); $statusApproved = $centreApplicationStatus->firstWhere('application_status', 'PAYMENT_PENDING'); // Logic to determine if a stage is complete $isPendingComplete = $statusPending != null; $isDfComplete = $statusDf != null; $isDrComplete = $statusDr != null; $isApprovedComplete = $statusApproved != null; @endphp {{-- 1. Application Initiated (Always checks for the INITIATED record) --}} @if ($statusInitiated)

Application Initiated

{{ date('d-M-Y, h:i A', strtotime($statusInitiated->created_at)) }}

Your application has been successfully initiated. @if (!$isPendingComplete) Please complete and submit the Application Form. @endif

@endif {{-- 2. Application Submitted (Checks for PENDING record) --}} @if ($isPendingComplete) {{-- Set class to 'completed' if DF or Approved, otherwise 'in-progress' (under review) --}}
{{-- Use checkmark if completed/passed, otherwise spinner for in-progress review --}}

Application Submitted

{{ date('d-M-Y, h:i A', strtotime($statusPending->created_at)) }}

Your application has been successfully submitted to the Authority for review.

@endif {{-- 3. Discrepancy Found (Checks for DISCRIPENCY_FOUND record) --}} @if ($isDfComplete)

Discrepancy Found

{{ date('d-M-Y, h:i A', strtotime($statusDf->created_at)) }}

Your application contains some discrepancies. Please review the remarks, address the issues, and resubmit your application.

@endif {{-- 4. Application Resubmitted (Checks for DISCRIPENCY_REMOVED record) --}} @if ($isDrComplete)

Application Resubmitted

{{ date('d-M-Y, h:i A', strtotime($statusDr->created_at)) }}

Your application has been re-submitted successfully and is back in the review queue.

@endif {{-- 5. Application Review & Scrutinization (Shows if submitted but not approved/rejected yet) --}} @if ($isPendingComplete && !$isApprovedComplete && !$isDfComplete)

Application Review & Scrutinization

Your application is currently being reviewed by our admissions team. This process typically takes 5-7 business days.

@elseif ($isDrComplete && !$isApprovedComplete)

Application Review & Scrutinization (Post-Resubmission)

{{ date('d-M-Y, h:i A', strtotime($statusDr->created_at)) }}

Your application is currently being reviewed by our admissions team after resubmission. This process typically takes 5-7 business days.

@endif {{-- 6. Application Decision/Approval (Checks for APPROVED record) --}} @if ($isApprovedComplete)

Application Approved

{{ date('d-M-Y, h:i A', strtotime($statusApproved->created_at)) }}

🎉 Congratulations! Your application has been successfully approved.

@elseif (($isPendingComplete && !$isDfComplete) || $isDrComplete) {{-- Shows as pending decision if submitted/resubmitted but not approved/rejected --}}

Application Decision

Your application will be either approved or rejected based on the ongoing review.

@endif
@endsection @section('pages-scripts') @endsection