No participant ID specified.'; require_once 'footer.php'; exit; } $participant_id = $_GET['id'] ?? $_POST['id']; try { $db = db(); $stmt = $db->prepare("SELECT * FROM participants WHERE id = :id"); $stmt->bindParam(':id', $participant_id, PDO::PARAM_INT); $stmt->execute(); $participant = $stmt->fetch(PDO::FETCH_ASSOC); if (!$participant) { throw new Exception("Participant not found."); } } catch (Exception $e) { $error = "Error: " . $e->getMessage(); echo "
$error
"; require_once 'footer.php'; exit; } if ($_SERVER['REQUEST_METHOD'] === 'POST') { try { $db = db(); $required_fields = ['full_legal_name', 'id']; foreach ($required_fields as $field) { if (empty($_POST[$field])) { throw new Exception("'$field' is a required field."); } } $sql = "UPDATE participants SET full_legal_name = :full_legal_name, ndis_participant_number = :ndis_participant_number, date_of_birth = :date_of_birth, preferred_contact_method = :preferred_contact_method, primary_phone = :primary_phone, email = :email, address = :address, emergency_contact_name = :emergency_contact_name, emergency_contact_phone = :emergency_contact_phone, ndis_plan_start_date = :ndis_plan_start_date, ndis_plan_end_date = :ndis_plan_end_date, plan_manager_name = :plan_manager_name, plan_manager_contact = :plan_manager_contact, ndis_funding_budget_total = :ndis_funding_budget_total, primary_disability = :primary_disability, support_needs_summary = :support_needs_summary, communication_aids_methods = :communication_aids_methods, behaviours_of_concern = :behaviours_of_concern, risk_assessment_summary = :risk_assessment_summary, safety_plan = :safety_plan, consent_for_info_sharing = :consent_for_info_sharing, intake_notes = :intake_notes WHERE id = :id"; $stmt = $db->prepare($sql); $consent = isset($_POST['consent_for_info_sharing']) ? 1 : 0; $participant_id = $_POST['id']; $stmt->bindParam(':id', $participant_id, PDO::PARAM_INT); $stmt->bindParam(':full_legal_name', $_POST['full_legal_name']); $stmt->bindParam(':ndis_participant_number', $_POST['ndis_participant_number']); $stmt->bindParam(':date_of_birth', $_POST['date_of_birth']); $stmt->bindParam(':preferred_contact_method', $_POST['preferred_contact_method']); $stmt->bindParam(':primary_phone', $_POST['primary_phone']); $stmt->bindParam(':email', $_POST['email']); $stmt->bindParam(':address', $_POST['address']); $stmt->bindParam(':emergency_contact_name', $_POST['emergency_contact_name']); $stmt->bindParam(':emergency_contact_phone', $_POST['emergency_contact_phone']); $stmt->bindParam(':ndis_plan_start_date', $_POST['ndis_plan_start_date']); $stmt->bindParam(':ndis_plan_end_date', $_POST['ndis_plan_end_date']); $stmt->bindParam(':plan_manager_name', $_POST['plan_manager_name']); $stmt->bindParam(':plan_manager_contact', $_POST['plan_manager_contact']); $stmt->bindParam(':ndis_funding_budget_total', $_POST['ndis_funding_budget_total']); $stmt->bindParam(':primary_disability', $_POST['primary_disability']); $stmt->bindParam(':support_needs_summary', $_POST['support_needs_summary']); $stmt->bindParam(':communication_aids_methods', $_POST['communication_aids_methods']); $stmt->bindParam(':behaviours_of_concern', $_POST['behaviours_of_concern']); $stmt->bindParam(':risk_assessment_summary', $_POST['risk_assessment_summary']); $stmt->bindParam(':safety_plan', $_POST['safety_plan']); $stmt->bindParam(':consent_for_info_sharing', $consent, PDO::PARAM_INT); $stmt->bindParam(':intake_notes', $_POST['intake_notes']); $stmt->execute(); header("Location: participant_detail.php?id=" . $participant_id . "&message=updated"); exit; } catch (Exception $e) { $error = "Error: " . $e->getMessage(); } } ?>

Edit Participant:

AI-Assisted Intake

Participant Details

Contact Info

Plan Details

Disability & Needs

Risk & Safety

Consent

style="width: auto; margin-right: 10px;">
Cancel