0, 'offers' => 0, 'confirmed' => 0, ]; try { $pdo = db(); $stats['shipments'] = (int) $pdo->query("SELECT COUNT(*) FROM shipments")->fetchColumn(); $stats['offers'] = (int) $pdo->query("SELECT COUNT(*) FROM shipments WHERE offer_price IS NOT NULL")->fetchColumn(); $stats['confirmed'] = (int) $pdo->query("SELECT COUNT(*) FROM shipments WHERE status IN ('confirmed','in_transit','delivered')")->fetchColumn(); } catch (Throwable $e) { // Keep the landing page stable even if DB is unavailable. } $recentShipments = []; try { $stmt = db()->query("SELECT * FROM shipments ORDER BY created_at DESC LIMIT 5"); $recentShipments = $stmt->fetchAll(); } catch (Throwable $e) { $recentShipments = []; } render_header(t('app_name'), 'home'); try { $stmt = db()->query("SELECT * FROM landing_sections WHERE is_active = 1 ORDER BY section_order ASC, id ASC"); $landingSections = $stmt->fetchAll(); foreach ($landingSections as $sec): if ($sec['section_type'] === 'hero'): ?>
= e($sec['subtitle'] ?: t('hero_subtitle')) ?>
= e($sec['subtitle'] ?: t('motivation_phrase')) ?>
= e(t('feature_1_desc')) ?>
= e(t('feature_2_desc')) ?>
= e(t('feature_3_desc')) ?>
= e(t('marketing_desc_1')) ?>
= e(t('marketing_desc_2')) ?>
Secure booking and track the delivery until completion.
| = e(t('shipper_company')) ?> | = e(t('origin')) ?> | = e(t('destination')) ?> | = e(t('status')) ?> |
|---|---|---|---|
| = e($row['shipper_company']) ?> |
= e($row['origin_city']) ?>
|
= e($row['destination_city']) ?>
|
= e(status_label($row['status'])) ?> |
= e($sec['subtitle'] ?: 'Check out our Frequently Asked Questions to learn more about how our platform works.') ?>
View FAQ= e($sec['subtitle'] ?: 'Join our platform today to find reliable trucks or secure the best shipments in the market.') ?>