prepare("INSERT INTO trucks (user_id, truck_type, load_capacity, plate_no, registration_expiry_date, insurance_expiry_date, is_approved) VALUES (?, ?, ?, ?, ?, ?, 0)"); $stmt->execute([$userId, $truckType, $loadCapacity, $plateNo, $regExpiry, $insExpiry]); set_flash('success', 'Truck added successfully, pending admin approval.'); } header('Location: ' . url_with_lang('truck_owner_dashboard.php')); exit; } $trucks = db()->prepare("SELECT * FROM trucks WHERE user_id = ?"); $trucks->execute([$userId]); $myTrucks = $trucks->fetchAll(); // Fetch Available Shipments $availShipments = []; try { $stmt = db()->query("SELECT * FROM shipments WHERE status = 'posted' ORDER BY created_at DESC"); $availShipments = $stmt->fetchAll(); } catch (Throwable $e) {} render_header('Truck Owner Dashboard', 'owner'); $flash = get_flash(); ?>
Manage your trucks and view available shipments.
No trucks registered yet.
No shipments available at the moment.
| Route | Details | Dates | Action |
|---|---|---|---|
|
= e($row['origin_city']) ?>
= e($row['destination_city']) ?>
= e(t('type_' . strtolower($row['shipment_type']))) ?>
Price: $= e($row['target_price']) ?>
|
= e($row['cargo_description']) ?>
= e($row['weight_tons']) ?> Tons • = e($row['payment_method']) ?>
|
Pick: = e(date('M d', strtotime($row['pickup_date']))) ?>
Drop: = e(date('M d', strtotime($row['delivery_date']))) ?>
|
View |