<?php $__env->startSection('title','Trips'); ?>
<?php $__env->startSection('page_title','Trips & Dispatch'); ?>
<?php $__env->startSection('content'); ?>
<div class="page-head"><div><h1>Trips & Dispatch</h1><p>Vehicle, driver, vendor, timing and trip-rate control.</p></div><a class="btn btn-primary" href="<?php echo e(route('trips.create')); ?>">+ New Trip</a></div>
<div class="card"><div class="toolbar"><form class="search"><input class="control" name="search" value="<?php echo e(request('search')); ?>" placeholder="Trip, job, vehicle"><select class="control" name="status"><option value="">All statuses</option><?php $__currentLoopData = ['scheduled','vehicle_assigned','driver_assigned','in_transit','reached_destination','delivered','cancelled']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($s); ?>" <?php if(request('status')===$s): echo 'selected'; endif; ?>><?php echo e(ucwords(str_replace('_',' ',$s))); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select><button class="btn btn-secondary">Filter</button></form><span class="muted"><?php echo e($trips->total()); ?> trips</span></div><div class="table-wrap"><table class="table"><thead><tr><th>Trip</th><th>Job / Customer</th><th>Pickup</th><th>Vehicle</th><th>Driver</th><th>Vendor</th><th>Rates</th><th>Status</th><th></th></tr></thead><tbody><?php $__empty_1 = true; $__currentLoopData = $trips; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $trip): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><tr><td><strong><?php echo e($trip->trip_number); ?></strong></td><td><?php echo e($trip->job?->job_number); ?><div class="muted"><?php echo e($trip->job?->customer?->legal_name); ?></div></td><td><?php echo e(optional($trip->pickup_at)->format('d M Y H:i')); ?></td><td><?php echo e($trip->vehicle?->plate_number ?? '—'); ?></td><td><?php echo e($trip->driver?->name ?? '—'); ?></td><td><?php echo e($trip->vendor?->legal_name ?? 'Own vehicle'); ?></td><td>C <?php echo e(number_format((float)$trip->customer_rate,2)); ?> / V <?php echo e(number_format((float)$trip->vendor_rate,2)); ?></td><td><span class="badge status-<?php echo e($trip->status); ?>"><?php echo e(ucwords(str_replace('_',' ',$trip->status))); ?></span></td><td><a class="btn btn-secondary btn-sm" href="<?php echo e(route('trips.show',$trip)); ?>">Open</a></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><tr><td colspan="9" class="empty">No trips found.</td></tr><?php endif; ?></tbody></table></div><?php echo e($trips->links()); ?></div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/cbo/public_html/resources/views/trips/index.blade.php ENDPATH**/ ?>