diff --git a/controllers/patient.controller.js b/controllers/patient.controller.js index 2021378..089a21a 100644 --- a/controllers/patient.controller.js +++ b/controllers/patient.controller.js @@ -461,7 +461,8 @@ function movePatientToWaitingRoom(req, res) { ` UPDATE patients SET waiting_room = 1, - discharged = 0 + discharged = 0, + status = 'waiting' WHERE id = ? `, [patientId], diff --git a/views/dashboard.ejs b/views/dashboard.ejs index d8855ed..6c4a80c 100644 --- a/views/dashboard.ejs +++ b/views/dashboard.ejs @@ -2,107 +2,245 @@ - Dashboard + Praxis System + - + + - - - -
- - <%- include("partials/flash") %> - - -
-

Willkommen, <%= user.username %>

- -
- - 🪑 Wartezimmer - - - <% if (user.role === 'arzt') { %> - - 👥 Userverwaltung - - <% } %> - - Patientenübersicht - - - Medikamentenübersicht - - - <% if (user.role === 'arzt') { %> - 🧾 Leistungen - <% } %> - - - 🧾 Offene Leistungen - - - <% if (user.role === 'arzt') { %> - - 📜 Änderungsprotokoll (Services) - - <% } %> <% if (user.role === 'arzt') { %> - - 🏢 Firmendaten - - <% } %> <% if (user.role === 'arzt') { %> - - 💶 Abrechnung - - <% } %> + +
+
+

Willkommen, <%= user.username %>

-
- + <%- include("partials/flash") %> + + -
-
🪑 Wartezimmer-Monitor
+
+
🪑 Wartezimmer-Monitor
-
- <% const maxSlots = 21; for (let i = 0; i < maxSlots; i++) { const p = - waitingPatients && waitingPatients[i]; %> +
+ <% const maxSlots = 21; + for (let i = 0; i < maxSlots; i++) { + const p = waitingPatients && waitingPatients[i]; + %> + + <% if (p) { %> + <% if (user.role === 'arzt') { %> + +
+
<%= p.firstname %> <%= p.lastname %>
+
+ <%= new Date(p.birthdate).toLocaleDateString("de-DE") %> +
+
+
+ <% } else { %> +
+
+
<%= p.firstname %> <%= p.lastname %>
+
+ <%= new Date(p.birthdate).toLocaleDateString("de-DE") %> +
+
+
+ <% } %> + <% } %> -
- <% if (p) { %> -
<%= p.firstname %> <%= p.lastname %>
-
- <%= new Date(p.birthdate).toLocaleDateString("de-DE") %> -
- <% } else { %> -
- Freier Platz -
<% } %>
- - <% } %> +
diff --git a/views/dashboard.ejs_ols b/views/dashboard.ejs_ols new file mode 100644 index 0000000..d8855ed --- /dev/null +++ b/views/dashboard.ejs_ols @@ -0,0 +1,110 @@ + + + + + Dashboard + + + + + + + + +
+ + <%- include("partials/flash") %> + + +
+

Willkommen, <%= user.username %>

+ +
+ + 🪑 Wartezimmer + + + <% if (user.role === 'arzt') { %> + + 👥 Userverwaltung + + <% } %> + + Patientenübersicht + + + Medikamentenübersicht + + + <% if (user.role === 'arzt') { %> + 🧾 Leistungen + <% } %> + + + 🧾 Offene Leistungen + + + <% if (user.role === 'arzt') { %> + + 📜 Änderungsprotokoll (Services) + + <% } %> <% if (user.role === 'arzt') { %> + + 🏢 Firmendaten + + <% } %> <% if (user.role === 'arzt') { %> + + 💶 Abrechnung + + <% } %> +
+
+ + +
+
🪑 Wartezimmer-Monitor
+ +
+ <% const maxSlots = 21; for (let i = 0; i < maxSlots; i++) { const p = + waitingPatients && waitingPatients[i]; %> + +
+ <% if (p) { %> +
<%= p.firstname %> <%= p.lastname %>
+
+ <%= new Date(p.birthdate).toLocaleDateString("de-DE") %> +
+ <% } else { %> +
+ Freier Platz +
+ <% } %> +
+ + <% } %> +
+
+
+ + diff --git a/views/waiting_room.ejs b/views/waiting_room.ejs index 752ecad..1cfcc68 100644 --- a/views/waiting_room.ejs +++ b/views/waiting_room.ejs @@ -1,79 +1,67 @@ - - + + Wartezimmer - - - - - - + +
+ + <%- include("partials/flash") %> <% if (patients.length === 0) { %> +
Keine Patienten im Wartezimmer
+ <% } else { %> + + + + + + + + + + + <% patients.forEach(p => { %> + + + + + + <% }) %> + +
NameGeburtstagAktion
<%= p.firstname %> <%= p.lastname %><%= new Date(p.birthdate).toLocaleDateString("de-DE") %> + <% if (user.role === 'arzt') { %> +
+ +
+ <% } else { %> + 🔒 Nur Arzt + <% } %> +
+ + <% } %>
- - - - -
- - - <%- include("partials/flash") %> - - <% if (patients.length === 0) { %> -
- Keine Patienten im Wartezimmer -
- <% } else { %> - - - - - - - - - - - - <% patients.forEach(p => { %> - - - - - - <% }) %> - - -
NameGeburtstagAktion
<%= p.firstname %> <%= p.lastname %><%= new Date(p.birthdate).toLocaleDateString("de-DE") %> - <% if (user.role === 'arzt') { %> -
- -
- <% } else { %> - 🔒 Nur Arzt - <% } %> -
- - <% } %> - -
- - +