prepare( "INSERT INTO shipments (shipper_name, shipper_company, origin_city, destination_city, cargo_description, weight_tons, pickup_date, delivery_date, payment_method) VALUES (:shipper_name, :shipper_company, :origin_city, :destination_city, :cargo_description, :weight_tons, :pickup_date, :delivery_date, :payment_method)" ); $stmt->execute([ ':shipper_name' => $shipperName, ':shipper_company' => $shipperCompany, ':origin_city' => $origin, ':destination_city' => $destination, ':cargo_description' => $cargo, ':weight_tons' => $weight, ':pickup_date' => $pickupDate, ':delivery_date' => $deliveryDate, ':payment_method' => $payment, ]); $_SESSION['shipper_name'] = $shipperName; set_flash('success', t('success_shipment')); header('Location: ' . url_with_lang('shipper_dashboard.php')); exit; } } $shipments = []; try { $stmt = db()->query("SELECT * FROM shipments ORDER BY created_at DESC LIMIT 20"); $shipments = $stmt->fetchAll(); } catch (Throwable $e) { $shipments = []; } render_header(t('shipper_dashboard'), 'shipper'); $flash = get_flash(); ?>
= e(t('no_shipments')) ?>
| = e(t('origin')) ?> | = e(t('destination')) ?> | = e(t('status')) ?> | = e(t('offer')) ?> | = e(t('actions')) ?> |
|---|---|---|---|---|
| = e($row['origin_city']) ?> | = e($row['destination_city']) ?> | = e(status_label($row['status'])) ?> | = $row['offer_price'] ? e($row['offer_price'] . ' / ' . ($row['offer_owner'] ?? '')) : e(t('no_offers')) ?> | = e(t('view')) ?> |