@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