@extends('backend.layouts.admin.app') @section('content') @php($lockFields = false) @endphp

{{ $title }}

@include('backend.layouts.alert')
@php if (isset($job)) { $lockFields = method_exists($job, 'isInProgress') ? $job->isInProgress() : (($job->status ?? null) === \App\Models\MineJob::STATUS_IN_PROGRESS); } @endphp
@csrf @if(isset($job)) @method('PUT') @endif {{-- Always set status to pending for new jobs --}} @if(!isset($job)) @endif
@if ($errors->has('mine_name')) {{ $errors->first('mine_name') }} @endif
@if ($errors->has('po')) {{ $errors->first('po') }} @endif
@php $loadingEmailInit = []; if (isset($job) && !empty($job->loading_recipient_emails)) { if (is_array($job->loading_recipient_emails)) { $loadingEmailInit = $job->loading_recipient_emails; } else { $decoded = json_decode($job->loading_recipient_emails, true); if (is_array($decoded)) { $loadingEmailInit = $decoded; } else { $loadingEmailInit = [ (string) $job->loading_recipient_emails ]; } } } @endphp @if ($errors->has('loading_recipient_emails')) {{ $errors->first('loading_recipient_emails') }} @endif
@php $offloadingEmailInit = []; if (isset($job) && !empty($job->offloading_recipient_emails)) { if (is_array($job->offloading_recipient_emails)) { $offloadingEmailInit = $job->offloading_recipient_emails; } else { $decoded = json_decode($job->offloading_recipient_emails, true); if (is_array($decoded)) { $offloadingEmailInit = $decoded; } else { $offloadingEmailInit = [ (string) $job->offloading_recipient_emails ]; } } } @endphp @if ($errors->has('offloading_recipient_emails')) {{ $errors->first('offloading_recipient_emails') }} @endif
{{-- --}}
@if ($errors->has('loading_location_id')) {{ $errors->first('loading_location_id') }} @endif
@if ($errors->has('load_time')) {{ $errors->first('load_time') }} @endif
{{-- --}}
@if ($errors->has('offloading_location_id')) {{ $errors->first('offloading_location_id') }} @endif
@if ($errors->has('offload_time')) {{ $errors->first('offload_time') }} @endif
@if ($errors->has('distance_km')) {{ $errors->first('distance_km') }} @endif
@if ($errors->has('load_weight')) {{ $errors->first('load_weight') }} @endif
{{--
Documents
WX-TRK-5421Truck
Driver: John Duo
@if(isset($job) && $job->transporters->count() > 0) @foreach($job->transporters as $transporter) @endforeach @else @endif
Transporter Vehicles Creation Date Job Status Action
{{ $transporter->name ?? null }} {{ $job->trips->where('transport_id', $transporter->id)->count() }} {{$transporter->created_at?->format('d/m/Y, h:i A') ?? null}} @if($job->status) {{ ucfirst($job->status_label) }} @else Pending @endif
@if(isset($job) && $job->documents && $job->documents->count() > 0) @foreach($job->documents as $document) @endforeach @else @endif
Documents Transporter Uploaded By Date & Time Action
{{ $document->mandatoryDocument->name }} {{ $document->transporter->name ?? null }} {{ $document->uploadedBy->name ?? null }} {{ $document->uploaded_date_time?->format('d/m/Y, h:i A') ?? null }}
--}}
@endsection