- Express + EJS server-rendered app - Supabase PostgreSQL database - Auth: username/password with bcrypt - Dashboard with business stats - Load CRUD with filters - WhatsApp message parser - Payment tracking - Shipper & vehicle management - Reports (monthly, top shippers, routes) - Government-app aesthetic (tricolor theme) - Dark mode support - Docker + Coolify deployment ready - Seed data from existing business ledger (88 loads, 41 shippers, 70 vehicles)
56 lines
1.9 KiB
Text
56 lines
1.9 KiB
Text
<%- include('../partials/header', { activeMenu: 'vehicles' }) %>
|
|
|
|
<div class="page-header">
|
|
<div>
|
|
<h1 class="page-title">🚚 Vehicles</h1>
|
|
<p class="page-subtitle">Manage your vehicle fleet</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="table-responsive">
|
|
<table class="table">
|
|
<thead><tr><th>Number</th><th>Type</th><th>City</th><th>Active</th><th>Actions</th></tr></thead>
|
|
<tbody>
|
|
<% for (const v of vehicles) { %>
|
|
<tr>
|
|
<td><strong><%= v.number %></strong></td>
|
|
<td><%= v.type || '—' %></td>
|
|
<td><%= v.city || '—' %></td>
|
|
<td><span class="badge badge-<%= v.is_active ? 'success' : 'gray' %>"><%= v.is_active ? 'Active' : 'Inactive' %></span></td>
|
|
<td><a href="/vehicles/<%= encodeURIComponent(v.id) %>" class="btn btn-sm btn-outline">View</a></td>
|
|
</tr>
|
|
<% } %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card mt-4">
|
|
<div class="card-header"><h3 class="card-title">Add Vehicle</h3></div>
|
|
<div class="card-body">
|
|
<form method="POST" action="/vehicles" class="form-row">
|
|
<input type="hidden" name="_csrf" value="<%= _csrf %>">
|
|
<div class="form-group">
|
|
<input type="text" name="number" class="form-input" placeholder="Vehicle Number (e.g. MH12AB1234)" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<select name="type" class="form-input">
|
|
<option value="open">Open</option>
|
|
<option value="closed">Closed</option>
|
|
<option value="container">Container</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<input type="text" name="city" class="form-input" placeholder="City">
|
|
</div>
|
|
<div class="form-group">
|
|
<button type="submit" class="btn btn-primary">Add</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<%- include('../partials/footer') %>
|