@extends('layouts.master') @section('css') @endsection @section('title') بيانات الشاحنة @stop @section('page-header') @endsection @section('content') @php $lp = Mcamara\LaravelLocalization\Facades\LaravelLocalization::getCurrentLocale(); $v = function ($f) use ($truck) { return old($f, $truck->{$f}); }; $d = function ($f) use ($truck) { return old($f, $truck->{$f} ? $truck->{$f}->format('Y-m-d') : ''); }; $stLabel = ['expired' => 'منتهية', 'soon' => 'قربت تنتهي', 'ok' => 'سارية']; $daysLeft = function ($date) { if (!$date) return null; $today = \Carbon\Carbon::now('Asia/Riyadh')->startOfDay(); return (int) $today->diffInDays(\Carbon\Carbon::parse($date->format('Y-m-d'), 'Asia/Riyadh'), false); }; $insS = $truck->insurance_status; $istS = $truck->istimara_status; $insD = $daysLeft($truck->insurance_expiry); $istD = $daysLeft($truck->istimara_expiry); @endphp @if (count($errors) > 0)
@endif
{{ csrf_field() }}
{{ $truck->plate_number }} @if ($truck->activeTrip) محمّلة: {{ $truck->activeTrip->from_region }} ← {{ $truck->activeTrip->to_region }} @else فاضية @endif {{ $trips }} رحلة
{{-- بيانات أساسية --}}
بيانات الشاحنة
{{-- التأمين والاستمارة --}}
@if ($insS) {{ $stLabel[$insS] }}{{ $insD !== null ? ($insD >= 0 ? ' · باقي ' . $insD . ' يوم' : ' من ' . abs($insD) . ' يوم') : '' }} @else مش متسجل @endif
التأمين
@if ($istS) {{ $stLabel[$istS] }}{{ $istD !== null ? ($istD >= 0 ? ' · باقي ' . $istD . ' يوم' : ' من ' . abs($istD) . ' يوم') : '' }} @else مش متسجلة @endif
الاستمارة
إلغاء
@include('trucks._driver_modal') @include('trucks._region_add') @endsection