@extends('layouts.master') @section('content') @php $PayType = config('custom.PayType'); $states = config('custom.states'); $driverType = config('custom.driverType'); $bad_zone = config('custom.bad_zone'); $tTypes = config('custom.trailers_types'); $vendors = config('custom.vendors'); $repairTypes = config('custom.repairTypes'); @endphp @php $validate = []; $activeTab1 = ''; $activeTab2 = ''; $currentTab1 = ''; $currentTab2 = ''; @endphp @if ($errors->any()) @foreach ($errors->all() as $error) @php $validate[] = $error; @endphp @endforeach @endif @if ( $errors->has('STATUS') || $errors->has('FIRST_NAME') || $errors->has('LAST_NAME') || $errors->has('EXPIRY_DATE') || $errors->has('DL_STATE_PROV') || $errors->has('ENDORSEMENTS') || $errors->has('CODE')) @php $currentTab1 = 'current'; $activeTab1 = 'active'; @endphp @elseif ( $errors->has('PHONE') || $errors->has('EMAIL') || $errors->has('CELL_PHONE') || $errors->has('EMERGENCY_PHONE') || $errors->has('SECONDARY_CONTRACT') || $errors->has('NOSMS')) @php $currentTab2 = 'current'; $activeTab2 = 'active'; @endphp @else @php $currentTab1 = 'current'; $activeTab1 = 'active'; @endphp @endif @php $TRAILER_ID = 0; $TRAILER_TYPE = $LENGTH_1 = ''; @endphp @foreach($trailersData as $trailersD) @if($trailersD['ID'] == $Crposttrucks['DEFAULT_TRAILER_1']) @php $TRAILER_ID = $trailersD['TRAILER_ID']; $TRAILER_TYPE = $trailersD['TRAILER_TYPE']; $LENGTH_1 = $trailersD['LENGTH_1']; @endphp @endif @endforeach @section('style') @endsection() @php $assignedDrivers = explode(',', $Crposttrucks['ASSIGNED_DRIVER']); $driverInfo = []; $primaryDriver = null; $secondaryDriver = null; foreach ($drivers as $driver) { if (in_array($driver->DRIVER_ID, $assignedDrivers)) { if (!$primaryDriver) { $primaryDriver = '' . $driver->NAME . ' - ' . $driver->PHONE; } elseif (!$secondaryDriver) { $secondaryDriver = '' . $driver->NAME . ' - ' . $driver->PHONE; } } } $driverInfoText = $driverInfoText = ''; if ($primaryDriver) { $driverInfoText .= 'Primary: ' . $primaryDriver; } if ($secondaryDriver) { $driverInfoText .= ',Secondary: ' . $secondaryDriver; } // dd($driverInfoText); @endphp

Truck Board Edit

@if(!empty($primaryDriver)) {!! $primaryDriver !!}- @endif Truck# @if($Crposttrucks['TRUCK_ID'] > 0) {{ $Crposttrucks['UNIT_ID'] }} - @endif Trailer# @if($TRAILER_ID > 0) {{ $TRAILER_ID }} @endif

@csrf
@csrf

Dispatch info

Distance from Current to Delivery City/State: Calculating...


@php if (!empty($Crposttrucks['PER_MILE_RATE'])) { $rate_parts = explode('-', $Crposttrucks['PER_MILE_RATE']); if (count($rate_parts) === 2) { list($min_value, $max_value) = $rate_parts; $min_value = (float)$min_value; $max_value = (float)$max_value; } else { $min_value = 0.50; $max_value = 8.00; } } else { $min_value = 0.50; $max_value = 8.00; } @endphp
Min: {{ number_format($min_value, 2) }} Max: {{ number_format($max_value, 2) }}
0 0
@error('ACTIVE')

{{ $message }}

@enderror
{!! htmlspecialchars_decode($Crposttrucks['notes']) !!}

Truck Information

{{$Crposttrucks['UNIT_ID']}} - {{$Crposttrucks['MAKE']}}/{{$Crposttrucks['MODEL']}}/{{$Crposttrucks['YEAR']}}

View Truck

Please Select Multiple Driver
@php $assignedDriver = $Crposttrucks['ASSIGNED_DRIVER']; $selectedDriverIds = json_decode($assignedDriver, true); if (json_last_error() !== JSON_ERROR_NONE) { $selectedDriverIds = explode(',', $assignedDriver); } $selectedDriverIds = (array) $selectedDriverIds; $selectedDriverIds = array_map('trim', $selectedDriverIds); $filteredDriverIds = array_filter($selectedDriverIds, function ($id) use ($drivers) { return $drivers->contains('DRIVER_ID', $id); }); $redirectUrl = null; if (!empty($filteredDriverIds)) { $firstDriverId = reset($filteredDriverIds); $redirectUrl = route('assets.drivers.edit', $firstDriverId); } @endphp
@if ($redirectUrl) View Driver @endif
@if(!empty($Crposttrucks['DEFAULT_TRAILER_1'])) @endif

@foreach ($drivers as $driver)@php $DRIVER_TYPE = $driver->DRIVER_TYPE @endphp @endforeach @php $assignedDrivers = explode(',',$Crposttrucks['ASSIGNED_DRIVER']); $dType = count($assignedDrivers) > 1 ? 'TEAM' : 'SOLO'; @endphp
@if(empty($dType)) @php $dType = 'SOLO'; @endphp @endif

Trailer Information

@if($TRAILER_ID > 0)

{{ $TRAILER_ID }} - {{$TRAILER_TYPE}}/{{$LENGTH_1}}

View Trailer
@endif

@php $trailer_LOAD_BARS = !empty($Crposttrucks['LOAD_BARS']) ? $Crposttrucks['LOAD_BARS'] : 0; @endphp
@php $trailer_PADS = !empty(!empty($Crposttrucks['PADS'])) ? $Crposttrucks['PADS'] : 0; @endphp
@php $trailer_CHAINS = !empty(!empty($Crposttrucks['CHAINS'])) ? $Crposttrucks['CHAINS'] : 0; @endphp
@php $trailer_LEVELERS = !empty(!empty($Crposttrucks['LEVELERS'])) ? $Crposttrucks['LEVELERS'] : 0; @endphp
@php $trailer_RAMPS = !empty(!empty($Crposttrucks['RAMPS'])) ? $Crposttrucks['RAMPS'] : 0; @endphp
@php $trailer_TARPS = !empty(!empty($Crposttrucks['TARPS'])) ? $Crposttrucks['TARPS'] : 0; @endphp
@php $trailer_SIDES = !empty(!empty($Crposttrucks['SIDES'])) ? $Crposttrucks['SIDES'] : 0; @endphp
@php $trailer_STRAPS = !empty(!empty($Crposttrucks['STRAPS'])) ? $Crposttrucks['STRAPS'] : 0; @endphp
{!! htmlspecialchars_decode($Crposttrucks['COMMENTS']) !!}

Driver Information

{!! $driverInfoText !!} @if(!empty($Crposttrucks['CARD_NO'])) - {{$Crposttrucks['CARD_NO']}} @endif
@if(!empty($redirectUrl)) View Driver @endif

@if(!empty($driver->TRUCK_ID))
@endif
@php $trailer_maxpickup = !empty(!empty($Crposttrucks['max_picks'])) ? $Crposttrucks['max_picks'] : 0; @endphp
@php $max_drop = !empty(!empty($Crposttrucks['max_drops'])) ? $Crposttrucks['max_drops'] : 0; @endphp
@php $badarea_array = explode(",",$Crposttrucks['badareas']); @endphp
{!! htmlspecialchars_decode($Crposttrucks['DRIVER_NOTES']) !!}

Safety Info


@if(!empty($Crposttrucks['EXPIRY_DATE']) && $Crposttrucks['EXPIRY_DATE'] != '0000-00-00 00:00:00') {{ convertToMdy($Crposttrucks['EXPIRY_DATE']) }} @else {{ '-' }} @endif

@if($days_difference === '-') - @else {{ $days_difference }} @endif

@if(!empty($Crposttrucks['LIC_1_EXP_DATE']) && $Crposttrucks['LIC_1_EXP_DATE'] != '0000-00-00 00:00:00') {{ convertToMdy($Crposttrucks['LIC_1_EXP_DATE']) }} @else {{ '-' }} @endif

@if($days_difference === '-') - @else {{ $days_difference }} @endif

@if(!empty($Crposttrucks['INS_EXP']) && $Crposttrucks['INS_EXP'] != '0000-00-00 00:00:00')

{{ convertToMdy($Crposttrucks['INS_EXP']) }}

@else {{ '-' }} @endif

@if($days_difference === '-') - @else {{ $days_difference }} @endif

@if(!empty($Crposttrucks['truck_next_main']) && $Crposttrucks['truck_next_main'] != '0000-00-00 00:00:00') {{ convertToMdy($Crposttrucks['trailers_next_main']) }} @else {{ '-' }} @endif

@if($days_difference === '-') - @else {{ $days_difference }} @endif

@if(!empty($Crposttrucks['trailers_LIC_1_EXP_DATE']) && $Crposttrucks['trailers_LIC_1_EXP_DATE'] != '0000-00-00 00:00:00') {{ convertToMdy($Crposttrucks['trailers_LIC_1_EXP_DATE']) }} @else {{ '-' }} @endif

@if($days_difference === '-') - @else {{ $days_difference }} @endif

@if(!empty($Crposttrucks['INSURANCE_EXPIRY']) && $Crposttrucks['INSURANCE_EXPIRY'] != '0000-00-00 00:00:00') {{ convertToMdy($Crposttrucks['INSURANCE_EXPIRY']) }} @else {{ '-' }} @endif

@if($days_difference === '-') - @else {{ $days_difference }} @endif

@if(!empty($Crposttrucks['trailers_next_main']) && $Crposttrucks['trailers_next_main'] != '0000-00-00 00:00:00') {{ convertToMdy($Crposttrucks['trailers_next_main']) }} @else {{ '-' }} @endif

@if($days_difference === '-') - @else {{ $days_difference }} @endif

@foreach ($messages as $message) @if ($message['TYPE'] == "In-Bound")
User
User 1:

{{ $message['MESSAGE'] }}

{{ \Carbon\Carbon::parse($message['DATE'])->format('m/d/Y h:i A') }} PST
@elseif ($message['TYPE'] == "Out-Bound")
User 2:

{{ $message['MESSAGE'] }}

{{ \Carbon\Carbon::parse($message['DATE'])->format('m/d/Y h:i A') }} PST
User
@endif @endforeach
Cancel
@endsection() @section('script') @endsection