diff --git a/add_participant.php b/add_participant.php
new file mode 100644
index 0000000..790ff85
--- /dev/null
+++ b/add_participant.php
@@ -0,0 +1,216 @@
+prepare($sql);
+
+ $consent = isset($_POST['consent_for_info_sharing']) ? 1 : 0;
+
+ $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();
+
+ $message = "Participant successfully added!";
+
+ } catch (Exception $e) {
+ $error = "Error: " . $e->getMessage();
+ }
+}
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/add_worker.php b/add_worker.php
new file mode 100644
index 0000000..4488e90
--- /dev/null
+++ b/add_worker.php
@@ -0,0 +1,94 @@
+prepare($sql);
+
+ $stmt->bindParam(':full_name', $_POST['full_name']);
+ $stmt->bindParam(':contact_info', $_POST['contact_info']);
+ $stmt->bindParam(':ndis_worker_screening_number', $_POST['ndis_worker_screening_number']);
+ $stmt->bindParam(':ndis_worker_screening_expiry', $_POST['ndis_worker_screening_expiry']);
+ $stmt->bindParam(':first_aid_expiry', $_POST['first_aid_expiry']);
+ $stmt->bindParam(':qualifications', $_POST['qualifications']);
+ $stmt->bindParam(':hourly_rate', $_POST['hourly_rate']);
+
+ $stmt->execute();
+
+ $message = "Support worker successfully added!";
+
+ } catch (Exception $e) {
+ $error = "Error: " . $e->getMessage();
+ }
+}
+?>
+
+
+ Add New Support Worker
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api/summarize_notes.php b/api/summarize_notes.php
new file mode 100644
index 0000000..578b8b3
--- /dev/null
+++ b/api/summarize_notes.php
@@ -0,0 +1,55 @@
+ 'No notes provided.']);
+ exit;
+}
+
+$notes = $input['notes'];
+
+$prompt = << [
+ ['role' => 'system', 'content' => $prompt],
+ ],
+ ]);
+
+ if (!empty($resp['success'])) {
+ $text = LocalAIApi::extractText($resp);
+ $json_output = LocalAIApi::decodeJsonFromResponse($resp);
+
+ if ($json_output) {
+ echo json_encode($json_output);
+ } else {
+ // If the model didn't return valid JSON, try to wrap its text output in a JSON structure.
+ echo json_encode(['support_needs_summary' => $text]);
+ }
+ } else {
+ throw new Exception($resp['error'] ?? 'Unknown AI error');
+ }
+
+} catch (Exception $e) {
+ http_response_code(500);
+ echo json_encode(['error' => 'AI Service Error: ' . $e->getMessage()]);
+}
diff --git a/assets/css/style.css b/assets/css/style.css
new file mode 100644
index 0000000..5b912d3
--- /dev/null
+++ b/assets/css/style.css
@@ -0,0 +1,325 @@
+/* General Styles */
+@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
+
+:root {
+ --primary-color: #3498db;
+ --secondary-color: #2ecc71;
+ --background-color: #f4f7f6;
+ --surface-color: #ffffff;
+ --text-color: #34495e;
+ --light-gray-color: #ecf0f1;
+ --border-color: #e0e0e0;
+}
+
+* {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+}
+
+body {
+ font-family: 'Poppins', sans-serif;
+ background-color: var(--background-color);
+ color: var(--text-color);
+ display: flex;
+ min-height: 100vh;
+}
+
+a {
+ text-decoration: none;
+ color: var(--primary-color);
+ transition: color 0.3s ease;
+}
+
+a:hover {
+ color: #2980b9;
+}
+
+/* Sidebar Navigation */
+.sidebar {
+ width: 250px;
+ background-color: var(--surface-color);
+ padding: 2rem 1rem;
+ position: fixed;
+ height: 100%;
+ border-right: 1px solid var(--border-color);
+ display: flex;
+ flex-direction: column;
+}
+
+.sidebar .logo {
+ font-size: 1.5rem;
+ font-weight: 600;
+ text-align: center;
+ margin-bottom: 2rem;
+ color: var(--primary-color);
+}
+
+.sidebar nav a {
+ display: block;
+ padding: 0.9rem 1.5rem;
+ margin-bottom: 0.5rem;
+ border-radius: 8px;
+ color: var(--text-color);
+ font-weight: 500;
+ transition: background-color 0.3s ease, color 0.3s ease;
+}
+
+.sidebar nav a:hover,
+.sidebar nav a.active {
+ background-color: var(--primary-color);
+ color: var(--surface-color);
+}
+
+.sidebar .footer {
+ margin-top: auto;
+ text-align: center;
+ font-size: 0.8rem;
+ color: #95a5a6;
+}
+
+/* Main Content Area */
+.main-content {
+ margin-left: 250px;
+ flex-grow: 1;
+ padding: 2rem;
+ display: flex;
+ flex-direction: column;
+}
+
+.main-content header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 2rem;
+}
+
+.main-content header h1 {
+ font-size: 2rem;
+ font-weight: 600;
+}
+
+.btn,
+button,
+input[type="submit"] {
+ background-color: var(--primary-color);
+ color: white;
+ padding: 0.75rem 1.5rem;
+ border: none;
+ border-radius: 8px;
+ cursor: pointer;
+ font-family: 'Poppins', sans-serif;
+ font-weight: 500;
+ transition: background-color 0.3s ease, transform 0.2s ease;
+ display: inline-block;
+ text-align: center;
+}
+
+.btn:hover,
+button:hover,
+input[type="submit"]:hover {
+ background-color: #2980b9;
+ transform: translateY(-2px);
+}
+
+.btn-secondary {
+ background-color: var(--secondary-color);
+}
+.btn-secondary:hover {
+ background-color: #27ae60;
+}
+
+.btn-danger {
+ background-color: #e74c3c;
+}
+.btn-danger:hover {
+ background-color: #c0392b;
+}
+
+
+/* Dashboard Cards */
+.card-container {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
+ gap: 1.5rem;
+ animation: fadeIn 1s ease-out;
+}
+
+.card {
+ background-color: var(--surface-color);
+ border-radius: 12px;
+ padding: 1.5rem;
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
+ transition: transform 0.3s ease, box-shadow 0.3s ease;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+.card:hover {
+ transform: translateY(-5px);
+ box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
+}
+
+.card h3 {
+ font-size: 1.2rem;
+ font-weight: 600;
+ margin-bottom: 0.5rem;
+}
+
+.card p {
+ font-size: 2.5rem;
+ font-weight: 700;
+ color: var(--primary-color);
+ margin-bottom: 1rem;
+}
+
+.card .card-link {
+ font-weight: 600;
+ align-self: flex-start;
+}
+
+/* Tables */
+table {
+ width: 100%;
+ border-collapse: collapse;
+ background-color: var(--surface-color);
+ border-radius: 12px;
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
+ overflow: hidden;
+}
+
+th, td {
+ padding: 1rem;
+ text-align: left;
+ border-bottom: 1px solid var(--border-color);
+}
+
+th {
+ background-color: var(--light-gray-color);
+ font-weight: 600;
+}
+
+tbody tr:last-child td {
+ border-bottom: none;
+}
+
+tbody tr:hover {
+ background-color: #f9f9f9;
+}
+
+/* Forms */
+form {
+ background-color: var(--surface-color);
+ padding: 2rem;
+ border-radius: 12px;
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
+}
+
+.form-group {
+ margin-bottom: 1.5rem;
+}
+
+.form-group label {
+ display: block;
+ margin-bottom: 0.5rem;
+ font-weight: 500;
+}
+
+.form-group input,
+.form-group select,
+.form-group textarea {
+ width: 100%;
+ padding: 0.75rem;
+ border: 1px solid var(--border-color);
+ border-radius: 8px;
+ font-family: 'Poppins', sans-serif;
+}
+
+.form-group input:focus,
+.form-group select:focus,
+.form-group textarea:focus {
+ outline: none;
+ border-color: var(--primary-color);
+ box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
+}
+
+/* Detail Views */
+.detail-container {
+ background-color: var(--surface-color);
+ padding: 2rem;
+ border-radius: 12px;
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
+}
+
+.detail-container h1 {
+ margin-bottom: 1.5rem;
+}
+
+.detail-grid {
+ display: grid;
+ grid-template-columns: 1fr 2fr;
+ gap: 1rem;
+}
+
+.detail-grid strong {
+ font-weight: 600;
+}
+
+.detail-actions {
+ margin-top: 2rem;
+ display: flex;
+ gap: 1rem;
+}
+
+
+/* Animations */
+@keyframes fadeIn {
+ from {
+ opacity: 0;
+ transform: translateY(20px);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+.main-content > * {
+ animation: fadeIn 0.5s ease-out forwards;
+}
+
+/* Feedback/Alerts */
+.feedback {
+ padding: 1rem;
+ margin-bottom: 1.5rem;
+ border-radius: 8px;
+ color: var(--surface-color);
+}
+.feedback.success {
+ background-color: var(--secondary-color);
+}
+.feedback.error {
+ background-color: #e74c3c;
+}
+
+/* Charts */
+.charts-container {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
+ gap: 1.5rem;
+ margin-top: 2rem;
+}
+
+.chart-card {
+ background-color: var(--surface-color);
+ border-radius: 12px;
+ padding: 1.5rem;
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
+}
+
+.chart-card h3 {
+ font-size: 1.2rem;
+ font-weight: 600;
+ margin-bottom: 1rem;
+}
diff --git a/assets/js/main.js b/assets/js/main.js
new file mode 100644
index 0000000..dcc24b3
--- /dev/null
+++ b/assets/js/main.js
@@ -0,0 +1,69 @@
+document.addEventListener('DOMContentLoaded', function () {
+ const summarizeBtn = document.getElementById('summarize-with-ai');
+ const intakeNotes = document.getElementById('intake_notes');
+
+ if (summarizeBtn && intakeNotes) {
+ summarizeBtn.addEventListener('click', async () => {
+ const notes = intakeNotes.value;
+ if (!notes.trim()) {
+ alert('Please enter some intake notes first.');
+ return;
+ }
+
+ summarizeBtn.disabled = true;
+ summarizeBtn.innerHTML = 'Summarizing...';
+
+ try {
+ const response = await fetch('api/summarize_notes.php', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify({ notes: notes })
+ });
+
+ if (!response.ok) {
+ throw new Error('Network response was not ok.');
+ }
+
+ const data = await response.json();
+
+ if (data.error) {
+ throw new Error(data.error);
+ }
+
+ if (data.summary) {
+ // This is a simple example. We'll populate fields based on a hypothetical structured response.
+ // A real implementation would need to parse the summary more intelligently.
+ const summary = data.summary;
+
+ // Example of populating fields:
+ if (summary.full_legal_name) {
+ document.getElementById('full_legal_name').value = summary.full_legal_name;
+ }
+ if (summary.email) {
+ document.getElementById('email').value = summary.email;
+ }
+ if (summary.primary_phone) {
+ document.getElementById('primary_phone').value = summary.primary_phone;
+ }
+ if (summary.primary_disability) {
+ document.getElementById('primary_disability').value = summary.primary_disability;
+ }
+ if (summary.support_needs_summary) {
+ document.getElementById('support_needs_summary').value = summary.support_needs_summary;
+ }
+
+ alert('AI summarization complete. Please review the populated fields.');
+ }
+
+ } catch (error) {
+ console.error('AI Summarization Error:', error);
+ alert('An error occurred while summarizing the notes. Please check the console.');
+ } finally {
+ summarizeBtn.disabled = false;
+ summarizeBtn.innerHTML = 'Summarize with AI';
+ }
+ });
+ }
+});
\ No newline at end of file
diff --git a/compliance.php b/compliance.php
new file mode 100644
index 0000000..9f353a0
--- /dev/null
+++ b/compliance.php
@@ -0,0 +1,152 @@
+prepare("SELECT id, full_legal_name, ndis_plan_end_date FROM participants WHERE ndis_plan_end_date <= :end_date AND ndis_plan_end_date >= CURDATE() ORDER BY ndis_plan_end_date ASC");
+ $plan_stmt->bindParam(':end_date', $ninety_days_from_now);
+ $plan_stmt->execute();
+ $plan_alerts = $plan_stmt->fetchAll(PDO::FETCH_ASSOC);
+
+ // Worker Screening Expiries
+ $screening_stmt = $db->prepare("SELECT id, full_name, ndis_worker_screening_expiry FROM support_workers WHERE ndis_worker_screening_expiry <= :end_date AND ndis_worker_screening_expiry >= CURDATE() ORDER BY ndis_worker_screening_expiry ASC");
+ $screening_stmt->bindParam(':end_date', $ninety_days_from_now);
+ $screening_stmt->execute();
+ $screening_alerts = $screening_stmt->fetchAll(PDO::FETCH_ASSOC);
+
+ // First Aid Expiries
+ $fa_stmt = $db->prepare("SELECT id, full_name, first_aid_expiry FROM support_workers WHERE first_aid_expiry <= :end_date AND first_aid_expiry >= CURDATE() ORDER BY first_aid_expiry ASC");
+ $fa_stmt->bindParam(':end_date', $ninety_days_from_now);
+ $fa_stmt->execute();
+ $first_aid_alerts = $fa_stmt->fetchAll(PDO::FETCH_ASSOC);
+
+} catch (PDOException $e) {
+ $error = "Database Error: " . $e->getMessage();
+}
+
+function get_days_until_badge($date) {
+ $now = time();
+ $your_date = strtotime($date);
+ $datediff = $your_date - $now;
+ $days = round($datediff / (60 * 60 * 24));
+
+ $class = ' ';
+ if ($days < 0) $class = 'expired';
+ elseif ($days <= 30) $class = 'urgent';
+ elseif ($days <= 60) $class = 'soon';
+ else $class = 'safe';
+
+ $text = ($days < 0) ? "Expired" : "{$days} days";
+
+ return "{$text}";
+}
+
+?>
+
+
+
+
+
+
+
+
+
+
+
NDIS Plan Reviews (Next 90 Days)
+
+
+ - No upcoming plan reviews.
+
+
+ -
+
+
+
+
+
+
+
+
+
+
Worker Screening Expiries
+
+
+ - No upcoming screening expiries.
+
+
+ -
+
+
+
+
+
+
+
+
+
+
First Aid Certificate Expiries
+
+
+ - No upcoming First Aid expiries.
+
+
+ -
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/db/setup.php b/db/setup.php
new file mode 100644
index 0000000..150160d
--- /dev/null
+++ b/db/setup.php
@@ -0,0 +1,37 @@
+exec($sql);
+ echo "Table `participants` created successfully." . PHP_EOL;
+} catch (PDOException $e) {
+ die("DB ERROR: " . $e->getMessage());
+}
diff --git a/db/setup_servicelogs.php b/db/setup_servicelogs.php
new file mode 100644
index 0000000..2583281
--- /dev/null
+++ b/db/setup_servicelogs.php
@@ -0,0 +1,25 @@
+exec($sql);
+ echo "Table `service_logs` created successfully." . PHP_EOL;
+} catch (PDOException $e) {
+ die("DB ERROR: " . $e->getMessage());
+}
diff --git a/db/setup_workers.php b/db/setup_workers.php
new file mode 100644
index 0000000..28b2cec
--- /dev/null
+++ b/db/setup_workers.php
@@ -0,0 +1,23 @@
+exec($sql);
+ echo "Table `support_workers` created successfully." . PHP_EOL;
+} catch (PDOException $e) {
+ die("DB ERROR: " . $e->getMessage());
+}
diff --git a/delete_participant.php b/delete_participant.php
new file mode 100644
index 0000000..e386a9f
--- /dev/null
+++ b/delete_participant.php
@@ -0,0 +1,33 @@
+prepare("DELETE FROM participants WHERE id = :id");
+ $stmt->bindParam(':id', $participant_id, PDO::PARAM_INT);
+ $stmt->execute();
+
+ if ($stmt->rowCount() > 0) {
+ header('Location: participants.php?message=deleted');
+ } else {
+ header('Location: participants.php?error=not_found');
+ }
+ exit;
+
+} catch (PDOException $e) {
+ // In a real app, you'd log this error, not expose it
+ header('Location: participants.php?error=db_error');
+ exit;
+}
diff --git a/edit_participant.php b/edit_participant.php
new file mode 100644
index 0000000..fb910ae
--- /dev/null
+++ b/edit_participant.php
@@ -0,0 +1,256 @@
+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();
+ }
+}
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/edit_worker.php b/edit_worker.php
new file mode 100644
index 0000000..4c1354c
--- /dev/null
+++ b/edit_worker.php
@@ -0,0 +1,127 @@
+No worker ID specified.';
+ require_once 'footer.php';
+ exit;
+}
+
+$worker_id = $_GET['id'] ?? $_POST['id'];
+
+try {
+ $db = db();
+ $stmt = $db->prepare("SELECT * FROM support_workers WHERE id = :id");
+ $stmt->bindParam(':id', $worker_id, PDO::PARAM_INT);
+ $stmt->execute();
+ $worker = $stmt->fetch(PDO::FETCH_ASSOC);
+
+ if (!$worker) {
+ throw new Exception("Support worker not found.");
+ }
+} catch (Exception $e) {
+ $error = "Error: " . $e->getMessage();
+ echo "$error
";
+ require_once 'footer.php';
+ exit;
+}
+
+if ($_SERVER['REQUEST_METHOD'] === 'POST') {
+ try {
+ $db = db();
+
+ if (empty($_POST['full_name']) || empty($_POST['id'])) {
+ throw new Exception("Full Name and ID are required fields.");
+ }
+
+ $sql = "UPDATE support_workers SET
+ full_name = :full_name,
+ contact_info = :contact_info,
+ ndis_worker_screening_number = :ndis_worker_screening_number,
+ ndis_worker_screening_expiry = :ndis_worker_screening_expiry,
+ first_aid_expiry = :first_aid_expiry,
+ qualifications = :qualifications,
+ hourly_rate = :hourly_rate
+ WHERE id = :id";
+
+ $stmt = $db->prepare($sql);
+
+ $worker_id = $_POST['id'];
+
+ $stmt->bindParam(':id', $worker_id, PDO::PARAM_INT);
+ $stmt->bindParam(':full_name', $_POST['full_name']);
+ $stmt->bindParam(':contact_info', $_POST['contact_info']);
+ $stmt->bindParam(':ndis_worker_screening_number', $_POST['ndis_worker_screening_number']);
+ $stmt->bindParam(':ndis_worker_screening_expiry', $_POST['ndis_worker_screening_expiry']);
+ $stmt->bindParam(':first_aid_expiry', $_POST['first_aid_expiry']);
+ $stmt->bindParam(':qualifications', $_POST['qualifications']);
+ $stmt->bindParam(':hourly_rate', $_POST['hourly_rate']);
+
+ $stmt->execute();
+
+ header("Location: worker_detail.php?id=" . $worker_id . "&message=updated");
+ exit;
+
+ } catch (Exception $e) {
+ $error = "Error: " . $e->getMessage();
+ }
+}
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/footer.php b/footer.php
new file mode 100644
index 0000000..17c7245
--- /dev/null
+++ b/footer.php
@@ -0,0 +1,3 @@
+
+