@extends('layouts.app') @section('title', 'Edit Job') @section('breadcrumb')Jobs Edit {{ $job->job_number }}@endsection @section('content')
{{-- ── Job details form ─────────────────────────────────────────────── --}}
@csrf @method('PUT')

Update Job

deposit_paid ? 'checked' : '' }} class="rounded">
cm_paid ? 'checked' : '' }} class="rounded">
delivery_paid ? 'checked' : '' }} class="rounded">
final_paid ? 'checked' : '' }} class="rounded">
Cancel
{{-- ── File Upload Module ────────────────────────────────────────────── --}}

Job Files ({{ $job->documents->count() }} file{{ $job->documents->count() !== 1 ? 's' : '' }})

{{-- Upload form --}}
@csrf

Drag & drop files here or click to browse

PDF, Word, Excel, Images, ZIP — max 20 MB each

{{-- File preview row (shown after selection) --}}
{{-- Existing files list --}} @if($job->documents->isNotEmpty())
@foreach($job->documents as $doc)
{{-- File type icon --}} @php $mime = $doc->file_type ?? ''; $icon = 'fa-file'; $iconColor = 'text-slate-400'; if (str_contains($mime, 'pdf')) { $icon = 'fa-file-pdf'; $iconColor = 'text-red-400'; } elseif (str_contains($mime, 'word') || str_ends_with($doc->file_path, '.doc') || str_ends_with($doc->file_path, '.docx')) { $icon = 'fa-file-word'; $iconColor = 'text-blue-400'; } elseif (str_contains($mime, 'excel') || str_contains($mime, 'spreadsheet') || str_ends_with($doc->file_path, '.xls') || str_ends_with($doc->file_path, '.xlsx') || str_ends_with($doc->file_path, '.csv')) { $icon = 'fa-file-excel'; $iconColor = 'text-green-400'; } elseif (str_contains($mime, 'image')) { $icon = 'fa-file-image'; $iconColor = 'text-purple-400'; } elseif (str_contains($mime, 'zip') || str_contains($mime, 'compressed')) { $icon = 'fa-file-archive'; $iconColor = 'text-yellow-400'; } @endphp

{{ $doc->name }}

{{ $doc->formatted_size }} • {{ $doc->created_at->format('d M Y, g:i a') }} @if($doc->uploader) • {{ $doc->uploader->name }} @endif

@can('delete', $doc)
@csrf @method('DELETE')
@else @php $authUser = auth()->user(); $role = $authUser->role?->name; @endphp @if(in_array($role, ['office_admin','project_manager']) || $doc->uploaded_by === $authUser->id)
@csrf @method('DELETE')
@endif @endcan
@endforeach
@else

No files uploaded yet.

@endif
@push('scripts') @endpush @endsection