Mission Dashboard
| Mission Name | Drone | Status | Date | Actions |
|---|---|---|---|---|
| No missions found. Create one to get started! | ||||
prepare($sql); $stmt->execute([ ':name' => $name, ':drone' => $drone, ':status' => $status, ':mission_date' => $mission_date, ]); // Redirect to avoid form resubmission header("Location: index.php"); exit; } catch (PDOException $e) { // For a real app, you'd log this error die("Error saving mission: " . $e->getMessage()); } } } // Fetch all missions try { $pdo = db(); $stmt = $pdo->query("SELECT id, name, drone, status, DATE_FORMAT(mission_date, '%Y-%m-%d') as mission_date FROM missions ORDER BY mission_date DESC"); $missions = $stmt->fetchAll(); } catch (PDOException $e) { die("Error fetching missions: " . $e->getMessage()); } function getStatusClass($status) { switch (strtolower($status)) { case 'completed': return 'status-completed'; case 'in progress': return 'status-in-progress'; case 'scheduled': return 'status-pending'; default: return 'status-pending'; } } ?>
Welcome to your mission control center
| Mission Name | Drone | Status | Date | Actions |
|---|---|---|---|---|
| No missions found. Create one to get started! | ||||