query('SELECT id, name FROM institutions ORDER BY name')->fetchAll(); $programs = $pdo->query('SELECT id, name FROM programs ORDER BY name')->fetchAll(); $courses = $pdo->query('SELECT id, name FROM courses ORDER BY name')->fetchAll(); // Handle form submissions if ($_SERVER['REQUEST_METHOD'] === 'POST') { $description = trim($_POST['description']); $rel_type = $_POST['rel_type']; $rel_id = $_POST['rel_id']; if (isset($_POST['add_outcome'])) { if (!empty($description) && !empty($rel_type) && !empty($rel_id)) { $stmt = $pdo->prepare('INSERT INTO learning_outcomes (description, rel_type, rel_id) VALUES (?, ?, ?)'); $stmt->execute([$description, $rel_type, $rel_id]); } } elseif (isset($_POST['update_outcome'])) { if (!empty($description) && !empty($rel_type) && !empty($rel_id) && !empty($id)) { $stmt = $pdo->prepare('UPDATE learning_outcomes SET description = ?, rel_type = ?, rel_id = ? WHERE id = ?'); $stmt->execute([$description, $rel_type, $rel_id, $id]); } header('Location: admin_learning_outcomes.php'); exit; } elseif (isset($_POST['delete_outcome'])) { if (!empty($id)) { $stmt = $pdo->prepare('DELETE FROM learning_outcomes WHERE id = ?'); $stmt->execute([$id]); } header('Location: admin_learning_outcomes.php'); exit; } } ?>
| Description | Linked To | Actions | Manage |
|---|---|---|---|
| " . htmlspecialchars($row['description']) . " | "; echo "" . ucfirst($row['rel_type']) . ': ' . htmlspecialchars($rel_name) . " | "; echo 'Edit Delete | '; echo 'Success Criteria Assessment Measures | '; echo "