prepare( "UPDATE shipments SET offer_owner = :offer_owner, offer_price = :offer_price, status = 'offered' WHERE id = :id AND status IN ('posted','offered')" ); $stmt->execute([ ':offer_owner' => $offerOwner, ':offer_price' => $offerPrice, ':id' => $shipmentId, ]); if ($stmt->rowCount() > 0) { set_flash('success', t('success_offer')); header('Location: ' . url_with_lang('truck_owner_dashboard.php')); exit; } else { $errors[] = t('error_invalid'); } } } $shipments = []; try { $stmt = db()->query("SELECT * FROM shipments WHERE status IN ('posted','offered') ORDER BY created_at DESC LIMIT 20"); $shipments = $stmt->fetchAll(); } catch (Throwable $e) { $shipments = []; } render_header(t('owner_dashboard'), 'owner'); $flash = get_flash(); ?>
= e(t('no_shipments')) ?>
| = e(t('shipper_company')) ?> | = e(t('origin')) ?> | = e(t('destination')) ?> | = e(t('weight')) ?> | = e(t('offer')) ?> | = e(t('actions')) ?> |
|---|---|---|---|---|---|
| = e($row['shipper_company']) ?> | = e($row['origin_city']) ?> | = e($row['destination_city']) ?> | = e($row['weight_tons']) ?> | = $row['offer_price'] ? e($row['offer_price'] . ' / ' . ($row['offer_owner'] ?? '')) : e(t('no_offers')) ?> |