-
+
- | No service logs found. |
+ No bookings found. |
-
-
+
|
- |
- |
+ |
+ |
|
|
diff --git a/workers.php b/care_staff.php
similarity index 65%
rename from workers.php
rename to care_staff.php
index 0ece1b6..e282ded 100644
--- a/workers.php
+++ b/care_staff.php
@@ -2,11 +2,11 @@
require_once 'db/config.php';
require_once 'header.php';
-$workers = [];
+$care_staff = [];
try {
$db = db();
- $stmt = $db->query("SELECT id, full_name, ndis_worker_screening_number, first_aid_expiry FROM support_workers ORDER BY created_at DESC");
- $workers = $stmt->fetchAll(PDO::FETCH_ASSOC);
+ $stmt = $db->query("SELECT id, full_name, ndis_worker_screening_number, first_aid_expiry FROM care_staff ORDER BY created_at DESC");
+ $care_staff = $stmt->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $e) {
echo ' Error: ' . $e->getMessage() . ' ';
}
@@ -14,8 +14,8 @@ try {
?>
@@ -28,18 +28,18 @@ try {
-
+
- | No support workers found. |
+ No care staff found. |
-
-
+
|
|
|
- View
+ View
|
diff --git a/participant_detail.php b/client_detail.php
similarity index 52%
rename from participant_detail.php
rename to client_detail.php
index a1c6751..b817d44 100644
--- a/participant_detail.php
+++ b/client_detail.php
@@ -3,26 +3,26 @@ require_once 'db/config.php';
require_once 'header.php';
if (!isset($_GET['id']) || !filter_var($_GET['id'], FILTER_VALIDATE_INT)) {
- echo 'Invalid participant ID. ';
+ echo 'Invalid client ID. ';
require_once 'footer.php';
exit;
}
-$participant_id = $_GET['id'];
-$participant = null;
+$client_id = $_GET['id'];
+$client = null;
try {
$db = db();
- $stmt = $db->prepare("SELECT * FROM participants WHERE id = :id");
- $stmt->bindParam(':id', $participant_id, PDO::PARAM_INT);
+ $stmt = $db->prepare("SELECT * FROM clients WHERE id = :id");
+ $stmt->bindParam(':id', $client_id, PDO::PARAM_INT);
$stmt->execute();
- $participant = $stmt->fetch(PDO::FETCH_ASSOC);
+ $client = $stmt->fetch(PDO::FETCH_ASSOC);
} catch (PDOException $e) {
echo 'Error: ' . $e->getMessage() . ' ';
}
-if (!$participant) {
- echo 'Participant not found. ';
+if (!$client) {
+ echo 'Client not found. ';
require_once 'footer.php';
exit;
}
@@ -59,55 +59,55 @@ function render_detail_area($label, $value) {
- Participant Details
-
-
-
+ Client Details
+
+
+
Contact Info
-
-
-
-
-
+
+
+
+
+
NDIS Plan
-
-
-
-
-
+
+
+
+
+
Disability, Needs & Risks
-
-
-
-
-
-
+
+
+
+
+
+
Intake Notes
-
+
\ No newline at end of file
diff --git a/participants.php b/clients.php
similarity index 61%
rename from participants.php
rename to clients.php
index 0180d0d..dbd18f0 100644
--- a/participants.php
+++ b/clients.php
@@ -5,8 +5,8 @@ require_once 'header.php';
$logs = [];
try {
$db = db();
- $stmt = $db->query("SELECT id, full_legal_name, ndis_participant_number, primary_phone, email FROM participants ORDER BY created_at DESC");
- $participants = $stmt->fetchAll(PDO::FETCH_ASSOC);
+ $stmt = $db->query("SELECT id, full_legal_name, ndis_client_number, primary_phone, email FROM clients ORDER BY created_at DESC");
+ $clients = $stmt->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $e) {
echo 'Error: ' . $e->getMessage() . ' ';
}
@@ -17,12 +17,12 @@ $error = $_GET['error'] ?? '';
?>
-Participant successfully deleted.
+Client successfully deleted.
An error occurred.
@@ -39,19 +39,19 @@ $error = $_GET['error'] ?? '';
-
+
- | No participants found. |
+ No clients found. |
-
+
|
- |
+ |
|
|
- View
+ View
|
diff --git a/compliance.php b/compliance.php
index 9f353a0..efc5ba9 100644
--- a/compliance.php
+++ b/compliance.php
@@ -12,19 +12,19 @@ try {
$ninety_days_from_now = date('Y-m-d', strtotime('+90 days'));
// NDIS Plan Reviews
- $plan_stmt = $db->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 = $db->prepare("SELECT id, full_legal_name, ndis_plan_end_date FROM clients 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");
+ // Staff Screening Expiries
+ $screening_stmt = $db->prepare("SELECT id, full_name, ndis_worker_screening_expiry FROM care_staff 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 = $db->prepare("SELECT id, full_name, first_aid_expiry FROM care_staff 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);
@@ -108,7 +108,7 @@ function get_days_until_badge($date) {
-
+
@@ -117,14 +117,14 @@ function get_days_until_badge($date) {
- Worker Screening Expiries
+ Staff Screening Expiries
- No upcoming screening expiries.
-
-
+
@@ -140,7 +140,7 @@ function get_days_until_badge($date) {
-
-
+
diff --git a/db/setup.php b/db/setup.php
index 150160d..a594a5c 100644
--- a/db/setup.php
+++ b/db/setup.php
@@ -4,11 +4,11 @@ require_once 'config.php';
try {
$db = db();
$sql = <<exec($sql);
- echo "Table `participants` created successfully." . PHP_EOL;
+ echo "Table `clients` created successfully." . PHP_EOL;
} catch (PDOException $e) {
die("DB ERROR: " . $e->getMessage());
}
diff --git a/db/setup_servicelogs.php b/db/setup_bookings.php
similarity index 58%
rename from db/setup_servicelogs.php
rename to db/setup_bookings.php
index 2583281..2f304e8 100644
--- a/db/setup_servicelogs.php
+++ b/db/setup_bookings.php
@@ -4,22 +4,22 @@ require_once 'config.php';
try {
$db = db();
$sql = <<exec($sql);
- echo "Table `service_logs` created successfully." . PHP_EOL;
+ echo "Table `bookings` created successfully." . PHP_EOL;
} catch (PDOException $e) {
die("DB ERROR: " . $e->getMessage());
}
diff --git a/db/setup_workers.php b/db/setup_care_staff.php
similarity index 82%
rename from db/setup_workers.php
rename to db/setup_care_staff.php
index 28b2cec..afc6480 100644
--- a/db/setup_workers.php
+++ b/db/setup_care_staff.php
@@ -4,7 +4,7 @@ require_once 'config.php';
try {
$db = db();
$sql = <<exec($sql);
- echo "Table `support_workers` created successfully." . PHP_EOL;
+ echo "Table `care_staff` created successfully." . PHP_EOL;
} catch (PDOException $e) {
die("DB ERROR: " . $e->getMessage());
}
diff --git a/delete_client.php b/delete_client.php
new file mode 100644
index 0000000..56735c0
--- /dev/null
+++ b/delete_client.php
@@ -0,0 +1,33 @@
+prepare("DELETE FROM clients WHERE id = :id");
+ $stmt->bindParam(':id', $client_id, PDO::PARAM_INT);
+ $stmt->execute();
+
+ if ($stmt->rowCount() > 0) {
+ header('Location: clients.php?message=deleted');
+ } else {
+ header('Location: clients.php?error=not_found');
+ }
+ exit;
+
+} catch (PDOException $e) {
+ // In a real app, you'd log this error, not expose it
+ header('Location: clients.php?error=db_error');
+ exit;
+}
diff --git a/delete_participant.php b/delete_participant.php
deleted file mode 100644
index e386a9f..0000000
--- a/delete_participant.php
+++ /dev/null
@@ -1,33 +0,0 @@
-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_client.php
similarity index 75%
rename from edit_participant.php
rename to edit_client.php
index fb910ae..92b8bf6 100644
--- a/edit_participant.php
+++ b/edit_client.php
@@ -4,25 +4,25 @@ require_once 'header.php';
$message = '';
$error = '';
-$participant = null;
+$client = null;
if (!isset($_GET['id']) && !isset($_POST['id'])) {
- echo 'No participant ID specified. ';
+ echo 'No client ID specified. ';
require_once 'footer.php';
exit;
}
-$participant_id = $_GET['id'] ?? $_POST['id'];
+$client_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 = $db->prepare("SELECT * FROM clients WHERE id = :id");
+ $stmt->bindParam(':id', $client_id, PDO::PARAM_INT);
$stmt->execute();
- $participant = $stmt->fetch(PDO::FETCH_ASSOC);
+ $client = $stmt->fetch(PDO::FETCH_ASSOC);
- if (!$participant) {
- throw new Exception("Participant not found.");
+ if (!$client) {
+ throw new Exception("Client not found.");
}
} catch (Exception $e) {
$error = "Error: " . $e->getMessage();
@@ -42,9 +42,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
}
- $sql = "UPDATE participants SET
+ $sql = "UPDATE clients SET
full_legal_name = :full_legal_name,
- ndis_participant_number = :ndis_participant_number,
+ ndis_client_number = :ndis_client_number,
date_of_birth = :date_of_birth,
preferred_contact_method = :preferred_contact_method,
primary_phone = :primary_phone,
@@ -70,11 +70,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$stmt = $db->prepare($sql);
$consent = isset($_POST['consent_for_info_sharing']) ? 1 : 0;
- $participant_id = $_POST['id'];
+ $client_id = $_POST['id'];
- $stmt->bindParam(':id', $participant_id, PDO::PARAM_INT);
+ $stmt->bindParam(':id', $client_id, PDO::PARAM_INT);
$stmt->bindParam(':full_legal_name', $_POST['full_legal_name']);
- $stmt->bindParam(':ndis_participant_number', $_POST['ndis_participant_number']);
+ $stmt->bindParam(':ndis_client_number', $_POST['ndis_client_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']);
@@ -98,7 +98,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$stmt->execute();
- header("Location: participant_detail.php?id=" . $participant_id . "&message=updated");
+ header("Location: client_detail.php?id=" . $client_id . "&message=updated");
exit;
} catch (Exception $e) {
@@ -114,7 +114,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
- Edit Participant:
+ Edit Client:
@@ -125,36 +125,36 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
-
@@ -210,15 +210,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
Disability & Needs
-
+
-
+
-
+
@@ -226,22 +226,22 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
Risk & Safety
-
+
-
+
-
+
@@ -249,7 +249,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
diff --git a/edit_worker.php b/edit_staff.php
similarity index 70%
rename from edit_worker.php
rename to edit_staff.php
index 4c1354c..26c534f 100644
--- a/edit_worker.php
+++ b/edit_staff.php
@@ -4,25 +4,25 @@ require_once 'header.php';
$message = '';
$error = '';
-$worker = null;
+$staff = null;
if (!isset($_GET['id']) && !isset($_POST['id'])) {
- echo 'No worker ID specified. ';
+ echo 'No staff ID specified. ';
require_once 'footer.php';
exit;
}
-$worker_id = $_GET['id'] ?? $_POST['id'];
+$staff_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 = $db->prepare("SELECT * FROM care_staff WHERE id = :id");
+ $stmt->bindParam(':id', $staff_id, PDO::PARAM_INT);
$stmt->execute();
- $worker = $stmt->fetch(PDO::FETCH_ASSOC);
+ $staff = $stmt->fetch(PDO::FETCH_ASSOC);
- if (!$worker) {
- throw new Exception("Support worker not found.");
+ if (!$staff) {
+ throw new Exception("Care staff member not found.");
}
} catch (Exception $e) {
$error = "Error: " . $e->getMessage();
@@ -39,7 +39,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
throw new Exception("Full Name and ID are required fields.");
}
- $sql = "UPDATE support_workers SET
+ $sql = "UPDATE care_staff SET
full_name = :full_name,
contact_info = :contact_info,
ndis_worker_screening_number = :ndis_worker_screening_number,
@@ -51,9 +51,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$stmt = $db->prepare($sql);
- $worker_id = $_POST['id'];
+ $staff_id = $_POST['id'];
- $stmt->bindParam(':id', $worker_id, PDO::PARAM_INT);
+ $stmt->bindParam(':id', $staff_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']);
@@ -64,7 +64,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$stmt->execute();
- header("Location: worker_detail.php?id=" . $worker_id . "&message=updated");
+ header("Location: staff_detail.php?id=" . $staff_id . "&message=updated");
exit;
} catch (Exception $e) {
@@ -74,7 +74,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
?>
- Edit Support Worker:
+ Edit Staff Member:
@@ -85,42 +85,42 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
-
diff --git a/header.php b/header.php
index f2d7241..6934de5 100644
--- a/header.php
+++ b/header.php
@@ -14,10 +14,9 @@
$current_page = basename($_SERVER['PHP_SELF']);
$pages = [
'index.php' => 'Dashboard',
- 'participants.php' => 'Participants',
- 'workers.php' => 'Support Workers',
- 'service_logs.php' => 'Service Logs',
- 'compliance.php' => 'Compliance',
+ 'clients.php' => 'Clients',
+ 'care_staff.php' => 'Care Staff',
+ 'bookings.php' => 'Bookings', 'compliance.php' => 'Compliance',
];
?>
diff --git a/index.php b/index.php
index 8150b19..0d0def5 100644
--- a/index.php
+++ b/index.php
@@ -3,31 +3,31 @@ require_once 'db/config.php';
require_once 'header.php';
// Fetch counts for dashboard cards
-$participant_count = db()->query("SELECT COUNT(*) FROM participants")->fetchColumn();
-$worker_count = db()->query("SELECT COUNT(*) FROM support_workers")->fetchColumn();
-$service_log_count = db()->query("SELECT COUNT(*) FROM service_logs")->fetchColumn();
+$client_count = db()->query("SELECT COUNT(*) FROM clients")->fetchColumn();
+$staff_count = db()->query("SELECT COUNT(*) FROM care_staff")->fetchColumn();
+$booking_count = db()->query("SELECT COUNT(*) FROM bookings")->fetchColumn();
// Fetch upcoming compliance alerts (e.g., expiring in 90 days)
$ninety_days_from_now = date('Y-m-d', strtotime('+90 days'));
-$compliance_alerts = db()->query("SELECT COUNT(*) FROM participants WHERE ndis_plan_end_date <= '$ninety_days_from_now'")->fetchColumn();
-$worker_alerts = db()->query("SELECT COUNT(*) FROM support_workers WHERE ndis_worker_screening_expiry <= '$ninety_days_from_now' OR first_aid_expiry <= '$ninety_days_from_now'")->fetchColumn();
+$compliance_alerts = db()->query("SELECT COUNT(*) FROM clients WHERE ndis_plan_end_date <= '$ninety_days_from_now'")->fetchColumn();
+$worker_alerts = db()->query("SELECT COUNT(*) FROM care_staff WHERE ndis_worker_screening_expiry <= '$ninety_days_from_now' OR first_aid_expiry <= '$ninety_days_from_now'")->fetchColumn();
$total_alerts = $compliance_alerts + $worker_alerts;
// Chart Data
-// Participants per month
-$participants_per_month_q = db()->query("SELECT DATE_FORMAT(created_at, '%Y-%m') as month, COUNT(*) as count FROM participants GROUP BY month ORDER BY month");
-$participants_per_month = $participants_per_month_q->fetchAll(PDO::FETCH_ASSOC);
-$participant_months = json_encode(array_column($participants_per_month, 'month'));
-$participant_counts = json_encode(array_column($participants_per_month, 'count'));
+// Clients per month
+$clients_per_month_q = db()->query("SELECT DATE_FORMAT(created_at, '%Y-%m') as month, COUNT(*) as count FROM clients GROUP BY month ORDER BY month");
+$clients_per_month = $clients_per_month_q->fetchAll(PDO::FETCH_ASSOC);
+$client_months = json_encode(array_column($clients_per_month, 'month'));
+$client_counts = json_encode(array_column($clients_per_month, 'count'));
-// Services per month
-$services_per_month_q = db()->query("SELECT DATE_FORMAT(service_date, '%Y-%m') as month, COUNT(*) as count FROM service_logs GROUP BY month ORDER BY month");
-$services_per_month = $services_per_month_q->fetchAll(PDO::FETCH_ASSOC);
-$service_months = json_encode(array_column($services_per_month, 'month'));
-$service_counts = json_encode(array_column($services_per_month, 'count'));
+// Bookings per month
+$bookings_per_month_q = db()->query("SELECT DATE_FORMAT(service_date, '%Y-%m') as month, COUNT(*) as count FROM bookings GROUP BY month ORDER BY month");
+$bookings_per_month = $bookings_per_month_q->fetchAll(PDO::FETCH_ASSOC);
+$booking_months = json_encode(array_column($bookings_per_month, 'month'));
+$booking_counts = json_encode(array_column($bookings_per_month, 'count'));
// Billing status
-$billing_status_q = db()->query("SELECT billing_status, COUNT(*) as count FROM service_logs GROUP BY billing_status");
+$billing_status_q = db()->query("SELECT billing_status, COUNT(*) as count FROM bookings GROUP BY billing_status");
$billing_status = $billing_status_q->fetchAll(PDO::FETCH_ASSOC);
$billing_status_labels = json_encode(array_column($billing_status, 'billing_status'));
$billing_status_counts = json_encode(array_column($billing_status, 'count'));
@@ -36,24 +36,24 @@ $billing_status_counts = json_encode(array_column($billing_status, 'count'));
Compliance Alerts
@@ -64,30 +64,30 @@ $billing_status_counts = json_encode(array_column($billing_status, 'count'));
- Participants Added Per Month
-
+ Clients Added Per Month
+
- Services Provided Per Month
-
+ Bookings Per Month
+
- Service Billing Status
+ Booking Billing Status
|