0) {
echo '
';
echo '
';
echo '
';
echo '
| Trip Name |
Location |
Start Date |
End Date |
Capacity |
Booked |
Cost (Member) |
Status |
Actions |
';
foreach ($trips as $trip) {
$publishButtonText = $trip['published'] == 1 ? 'Unpublish' : 'Publish';
$publishButtonClass = $trip['published'] == 1 ? 'btn-warning' : 'btn-success';
echo '
| ' . htmlspecialchars($trip['trip_name']) . ' |
' . htmlspecialchars($trip['location']) . ' |
' . date('M d, Y', strtotime($trip['start_date'])) . ' |
' . date('M d, Y', strtotime($trip['end_date'])) . ' |
' . $trip['vehicle_capacity'] . ' |
' . $trip['places_booked'] . ' / ' . $trip['vehicle_capacity'] . ' |
R ' . number_format($trip['cost_members'], 2) . ' |
' . ($trip['published'] == 1 ? 'Published' : 'Draft') . ' |
|
';
}
echo '
';
echo '
';
echo '
';
} else {
echo '
No trips found. Create one
';
}
?>