diff --git a/controllers/patient.controller.js b/controllers/patient.controller.js
index f99bd7c..d15be6a 100644
--- a/controllers/patient.controller.js
+++ b/controllers/patient.controller.js
@@ -33,12 +33,12 @@ async function listPatients(req, res) {
const params = [];
if (firstname) {
- sql += " AND firstname LIKE ?";
+ sql += " AND LOWER(firstname) LIKE LOWER(?)";
params.push(`%${firstname}%`);
}
if (lastname) {
- sql += " AND lastname LIKE ?";
+ sql += " AND LOWER(lastname) LIKE LOWER(?)";
params.push(`%${lastname}%`);
}
@@ -79,7 +79,7 @@ async function listPatients(req, res) {
// ✅ Sidebar dynamisch
sidebarPartial: selectedPatient
- ? "partials/patient-sidebar"
+ ? "partials/patient_sidebar"
: "partials/sidebar",
// ✅ Active dynamisch
@@ -114,7 +114,7 @@ function showEditPatient(req, res) {
res.render("patient_edit", {
title: "Patient bearbeiten",
- sidebarPartial: "partials/patient-sidebar",
+ sidebarPartial: "partials/patient_sidebar",
active: "patient_edit",
patient: results[0],
@@ -538,7 +538,7 @@ function showMedicationPlan(req, res) {
res.render("patient_plan", {
title: "Medikationsplan",
- sidebarPartial: "partials/patient-sidebar",
+ sidebarPartial: "partials/patient_sidebar",
active: "patient_plan",
patient: patients[0],
@@ -675,7 +675,7 @@ async function showPatientOverviewDashborad(req, res) {
res.render("patient_overview_dashboard", {
title: "Patient Dashboard",
- sidebarPartial: "partials/patient-sidebar",
+ sidebarPartial: "partials/patient_sidebar",
active: "patient_dashboard",
patient,
diff --git a/controllers/service.controller.js b/controllers/service.controller.js
index e274daa..948a0c2 100644
--- a/controllers/service.controller.js
+++ b/controllers/service.controller.js
@@ -287,7 +287,7 @@ async function listOpenServices(req, res, next) {
res.render("open_services", {
title: "Offene Leistungen",
- sidebarPartial: "partials/sidebar-empty",
+ sidebarPartial: "partials/patient_sidebar",
active: "services",
rows,
diff --git a/public/js/patients_sidebar.js b/public/js/patients_sidebar.js
index 0b63905..e06d9e7 100644
--- a/public/js/patients_sidebar.js
+++ b/public/js/patients_sidebar.js
@@ -40,7 +40,7 @@ document.addEventListener("DOMContentLoaded", () => {
radios.forEach((radio) => {
radio.addEventListener("change", () => {
- const id = radio.dataset.id;
+ const id = radio.value;
const firstname = radio.dataset.firstname;
const lastname = radio.dataset.lastname;
diff --git a/views/layout.ejs b/views/layout.ejs
index 5e4b5ab..486ec33 100644
--- a/views/layout.ejs
+++ b/views/layout.ejs
@@ -42,5 +42,6 @@
+