@extends('layouts.user.user') @section('title', 'View Project') @section('page', 'View Project') @php $amount = $quote_detail->estimate_cost ?? 0; if ($amount >= 10000000) { $formatted = number_format($amount / 10000000, 2) . ' Cr'; } elseif ($amount >= 100000) { $formatted = number_format($amount / 100000, 2) . ' Lakh'; } else { $formatted = number_format($amount, 2); } @endphp @section('content')
@if(session('success')) @endif @if(session('error')) @endif
{{-- Top Header --}}
View Project
{{-- Right-side Action Buttons --}}
@if($project->status !== 'in-progress') {{-- APPROVE BUTTON --}}
@csrf
@else {{-- CHAT BUTTON --}} Chat @endif {{-- REQUEST FOR CHANGE BUTTON --}} @if($project->status !== 'completed') Request for Change @endif
{{-- Tabs --}} {{-- Tab Contents --}}
{{-- Tab 1: Project Details --}}
{{ $quote_detail->title ?? 'Cement Plant Building' }}
{{ $quote_detail->location ?? 'Pune – Maharashtra' }}
#{{ $project->id ?? 'G7THY78' }}

{{-- 1) Building Type (from spec) --}}
Building Type
{{ $frameTypes->firstWhere('id', $spec->building_type ?? null)->name ?? 'AS PER DESIGN' }}
{{-- 2) Quantity (from spec) --}}
Quantity
{{ $spec->quantity ?? 'AS PER DESIGN' }} {{ !empty($spec->quantity_type) ? ' (' . $spec->quantity_type . ')' : '' }}
{{-- 3) Geometry (from geometry) --}}
Geometry (L × W × H)
{{ $geometry->length_input ?? $geometry->length ?? '—' }} {{ $geometry->length_unit ?? '' }} × {{ $geometry->width_input ?? $geometry->width ?? '—' }} {{ $geometry->width_unit ?? '' }} × {{ $geometry->clear_height_input ?? $geometry->clear_height ?? '—' }} {{ $geometry->height_unit ?? '' }}
{{-- 4) Sheeting Summary (roof/wall) --}}
Sheeting
Roof: {{ $roof->sheet_type ?? 'AS PER DESIGN' }} {{ !empty($roof->thk_mm) ? ' / ' . $roof->thk_mm . 'mm' : '' }}
Wall: {{ $wall->sheet_type ?? 'AS PER DESIGN' }} {{ !empty($wall->thk_mm) ? ' / ' . $wall->thk_mm . 'mm' : '' }}

{{ $quote_detail->project_desc ?? 'Share any special requirements, timeline, or design details.' }}
@php $docTypeMap = [ 1 => 'techno_commercial', 2 => 'agreement_po', 4 => 'order_acceptance', 7 => 'dbr', 8 => 'customer_approval_drawings', ]; $fileDocs = [1, 2, 4, 7, 8]; $initialDocs = [ 1 => 'Techno - Commercial Offer', 2 => 'Agreement / PO (From Client to Meking)', 3 => 'CIF Form', 4 => 'Order Acceptance Form', ]; $colourDocs = [ 5 => 'Structure Colour Confirmation Sheet', 6 => 'Sheeting Colour Confirmation Sheet', ]; $designDocs = [ 7 => 'DBR', 8 => 'Customer Approval Drawings', ]; @endphp {{-- ================= Initial Documents ================= --}}
Initial Documents
@foreach($initialDocs as $id => $name) @php $col = $docTypeMap[$id] ?? null; $filePath = ($col && $projectDocs) ? $projectDocs->$col : null; @endphp
{{ $id }}
{{ $name }}
{{-- UPLOAD (only for fileDocs) --}} @if(in_array($id, $fileDocs))
@csrf
@endif {{-- EYE --}} @if($id == 3) @elseif($filePath) @else
@endif {{-- DOWNLOAD --}} @if(in_array($id, $fileDocs) && $filePath) @elseif($id == 3) {{-- CIF is blade-rendered, no file download --}}
@else
@endif
@endforeach {{-- ================= Colour Confirmation ================= --}}
Colour Confirmation
@foreach($colourDocs as $id => $name)
{{ $id }}
{{ $name }}
{{-- EYE — both 5 & 6 are blade pages --}} @if($id == 5) @elseif($id == 6) @endif {{-- DOWNLOAD — blade-only, no file --}}
@endforeach {{-- ================= Design ================= --}}
Design
@foreach($designDocs as $id => $name) @php $col = $docTypeMap[$id] ?? null; $filePath = ($col && $projectDocs) ? $projectDocs->$col : null; @endphp
{{ $id }}
{{ $name }}
{{-- UPLOAD --}}
@csrf
{{-- EYE --}} @if($filePath) @else
@endif {{-- DOWNLOAD --}} @if($filePath) @else
@endif
@endforeach
{{-- ================= Additional Project Docs ================= --}} @php $additionalDocs = [ 'fg_report' => 'FG Report', 'qc_report' => 'QC Report', 'tax_invoices' => 'Tax Invoices', 'grn' => 'GRN', 'anchor_bolt_inspection_report' => 'Anchor Bolt Inspection Report', 'alignment_report' => 'Alignment Report', 'roof_sheeting_checklist' => 'Roof Sheeting Checklist', 'wall_sheeting_checklist' => 'Wall Sheeting Checklist', 'completion_certificate' => 'Completion Certificate', 'stability_certificate' => 'Stability Certificate', ]; @endphp
Other Project Documents
@foreach($additionalDocs as $col => $name) @php $filePath = $projectDocs->$col ?? null; @endphp
-
{{ $name }}
{{-- VIEW --}} @if($filePath) @else
@endif {{-- No Upload/Download --}}
@endforeach
{{-- Tab 2: Payment Plans --}}
Payment Plans
Milestones and payment breakup for this project.
@forelse(($paymentPlans ?? collect()) as $plan)
{{-- LEFT SIDE --}}
Stage: {{ $plan->stage_name ?? 'Milestone' }}
{{-- Status + Invoice --}}
@php $status = strtolower($plan->status ?? 'pending'); // paid / pending / partial @endphp Paid Status: {{ strtoupper($plan->status ?? 'NA') }} @if(!empty($plan->invoice_file)) Download Invoice @endif
{{-- RIGHT SIDE: AMOUNT --}}
Stage Amount
₹ {{ number_format($plan->cost ?? 0) }}
@empty
No payment plans added yet.
@endforelse
{{-- Tab 3: 2D/3D Drawings --}}
{{-- 2D DRAWINGS SECTION --}}
2D Drawings
Images, PDFs and technical drawings.
@forelse(($project_designFiles ?? collect()) as $file) @php $filePath = 'uploads/projects/drawings_img/' . $file->file_name; $ext = strtolower(pathinfo($file->file_name, PATHINFO_EXTENSION)); $isImage = in_array($ext, ['jpg', 'jpeg', 'png', 'webp']); @endphp @empty
No 2D drawings uploaded.
@endforelse
{{-- 3D DESIGN SECTION (ONLY ONE) --}}
3D Designs
3D models and visualization files.
@if($designs)

3D Design

View 3D
@else
No 3D design uploaded.
@endif
{{-- Tab 4: Project Gallery --}} @if($project->status === 'in-progress') @endif {{-- Tab 5: Project Summary --}}
Project Summary
Quote overview and digital signature.
{{ $quote_detail->title ?? 'Cement Plant Building' }}
{{ $quote_detail->location ?? 'Pune - Maharashtra' }}
#{{ $quote_detail->project->id ?? 'NA' }}
Project Type
{{ $quote_detail->project->projectType->name ?? 'NA' }}
Quote Date
{{ $quote_detail->created_at ? $quote_detail->created_at->format('d-m-Y') : 'NA' }}
Estimate Quote
₹ {{ $amount ? $formatted : 'NA' }}
Final Quote
₹ {{ $quote_detail->final_quote ?? 'NA' }}
Digital Signature
@if(!empty($quote_detail->project->digital_signature)) Digital Signature @else
NA
@endif
Draw your signature here
{{-- Bottom Nav (mobile only) --}}
{{-- Success Modal --}} @endsection