@extends ('../welcome') @section('content')
{{-- Basic Data --}}
@if ($unit->client) @endif @if ($unit->building->phase->project->is_residential == 1) @endif @if (!empty($unit->client_id)) @if (!empty($facilities)) @endif @endif
Client: @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('clients-show')) {{ $unit->client->name }} @else {{ $unit->client->name }} @endif
Unit Name: {{ $unit->name ?? '' }}
{{ $unit->building->phase->project->is_residential == 1 ? 'Building Name' : 'Floor' }} @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('buildings-show')) {{ $unit->building->name }} - {{ $unit->building->phase->project->is_residential == 1 ? $unit->building->type : $unit->building->phase->type }} @else {{ $unit->building->name }} - {{ $unit->building->phase->project->is_residential == 1 ? $unit->building->type : $unit->building->phase->type }} @endif
Phase Name: @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('phases-show')) {{ $unit->building->phase->name }} @else {{ $unit->building->phase->name }} @endif
Project Name: @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('projects-show')) {{ $unit->building->phase->project->name }} @else {{ $unit->building->phase->project->name }} @endif
Floor: {{ $unit->floor == 0 ? 'Ground' : $unit->floor }}
BedRooms: {{ $unit->bedrooms ?? 0 }}
BathRooms: {{ $unit->bathrooms ?? 0 }}
Dressing: {{ $unit->dressing ?? 0 }}
Unit Space : {{ $unit->unit_space ?? '' }}
Garden Space : {{ $unit->garden_space ?? '' }}
Roof Space : {{ $unit->roof_space ?? '' }}
Unit Type {{ $unit->typee->name ?? '' }}
Unit View {{ $unit->vieww->name ?? '' }}
Finishing Level {{ $unit->finishingLevel->name ?? '' }}
Description {{ $unit->description ?? '' }}
Delivery Date : {{ $payment->delivery_date ?? '' }}
Status {{ $unit->status == 'taken' ? 'Contracted' : $unit->status }}
Booked date : {{ $unit->Booked_date ? $unit->Booked_date : '' }}
Facilities: @for ($i = 0; $i < count($facilities); $i++)
  • {{ $facilities[$i]['name'] }} - {{ $facilities[$i]['price'] }}L.E
  • @endfor
    Unit Price "With Facilities" : {{ $payment->total_price ?? '' }}
    Mentainance Amount: {{ $payment->mentainance ?? '00' }}
    Total Amount: {{ $payment->total_amount ?? '00' }}
    Remaining: @if (empty($payment->remaining)) {{ $payment->remaining <= 0 ? 'Done' : $payment->remaining }} @endif
    {{-- Prices --}} @foreach($unit->prices as $price) @if($unit->project_id == 7) @if($price->years == '1') @if(auth()->user()->role->hasPermission('units-one-year-price')) @endif @endif @if($price->years == '2') @if(auth()->user()->role->hasPermission('units-two-years-price')) @endif @endif @if($price->years == '3') @if(auth()->user()->role->hasPermission('units-three-years-price')) @endif @endif @if($price->years == '4') @if(auth()->user()->role->hasPermission('units-four-years-price')) @endif @endif @if($price->years == '5') @if(auth()->user()->role->hasPermission('units-five-years-price')) @endif @endif @if($price->years == '6') @if(auth()->user()->role->hasPermission('units-six-years-price')) @endif @endif @if($price->years == '8') @if(auth()->user()->role->hasPermission('units-eight-years-price')) @endif @endif @else @endif @endforeach
    years unit meter price unit price garden price roof price total price
    {{$price->years}} {{$price->meter_price}} {{$price->price}} {{$price->garden_price}} {{$price->roof_price}} {{$price->total_price}}{{$price->years}} {{$price->meter_price}} {{$price->price}} {{$price->garden_price}} {{$price->roof_price}} {{$price->total_price}}{{$price->years}} {{$price->meter_price}} {{$price->price}} {{$price->garden_price}} {{$price->roof_price}} {{$price->total_price}}{{$price->years}} {{$price->meter_price}} {{$price->price}} {{$price->garden_price}} {{$price->roof_price}} {{$price->total_price}}{{$price->years}} {{$price->meter_price}} {{$price->price}} {{$price->garden_price}} {{$price->roof_price}} {{$price->total_price}}{{$price->years}} {{$price->meter_price}} {{$price->price}} {{$price->garden_price}} {{$price->roof_price}} {{$price->total_price}}{{$price->years}} {{$price->meter_price}} {{$price->price}} {{$price->garden_price}} {{$price->roof_price}} {{$price->total_price}}
    {{$price->years}} {{$price->meter_price}} {{$price->price}} {{$price->garden_price}} {{$price->roof_price}} {{$price->total_price}}
    7 {{$unit->unit_meter_price}} {{$unit->unit_meter_price * $unit->unit_space}} {{$unit->garden_total_price}} {{$unit->roof_total_price}} {{$unit->unit_total_price}}
    @if ($unit->status == 'taken') {{-- Payments Card --}} @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('units-paymentPlan'))

    Payment Plan

    @foreach ($unit->batches as $batch) @endforeach
    Title Type Amount Date Status Created by
    {{ $batch->title ?? '' }} {{ $batch->type ?? '' }} {{ $batch->amount ?? '' }} {{ $temp[0] }} {{ $batch->status ?? '' }} {{ $batch->user?->name ?? '' }}
    @endif {{-- Contracts card --}} @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('units-contracts'))

    Contracts

    @foreach ($unit->contracts as $contract) @if (!empty($contract->contract?->name)) @else @endif @endforeach
    Contract name Client id Client name Is Delivered ? Contract Date Action
    {{ $contract->contract?->name ?? '' }} {{ $contract->client->id ?? '' }} {{ $contract->client->name ?? '' }} {{ $contract->is_delivered == 0 ? 'not yet' : 'delivered' }} {{ $contract->contract_date ?? '' }} @if ($contract->is_delivered == 0) @endif
    {{ $contract->client->id ?? '' }} {{ $contract->client->name ?? '' }} {{ $contract->contract_date ?? '' }} {{ $contract->is_delivered == 0 ? 'not yet' : 'delivered' }}
    @endif @endif {{-- Files Card --}} @if (count($unit->files) != 0) @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('units-files'))

    Attached Files

    @foreach ($unit->files as $file) @endforeach
    {{ $file->file }}-{{ $file->created_at }}
    @csrf @method('DELETE')
    @endif @endif {{-- Images Card --}} @if (count($unit->images) != 0) @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('units-gallery'))

    Images

    @foreach ($unit->images as $key => $value)
    {{ $value->name }}
    @endforeach
    @endif @endif
    @endsection