231 lines
7.4 KiB
Plaintext
231 lines
7.4 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title>Patientenübersicht</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
|
<link rel="stylesheet" href="/css/bootstrap.min.css" />
|
|
<link rel="stylesheet" href="/bootstrap-icons/bootstrap-icons.min.css" />
|
|
<script src="/js/flash_auto_hide.js"></script>
|
|
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
background: #f4f6f9;
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
|
|
Roboto, Ubuntu;
|
|
}
|
|
|
|
.layout {
|
|
display: flex;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.main {
|
|
flex: 1;
|
|
padding: 0;
|
|
background: #f4f6f9;
|
|
overflow: hidden;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.radio-col {
|
|
width: 45px;
|
|
}
|
|
|
|
.auto-hide-flash {
|
|
transition: opacity 0.6s ease, transform 0.6s ease;
|
|
}
|
|
|
|
.auto-hide-flash.flash-hide {
|
|
opacity: 0;
|
|
transform: translateY(-10px);
|
|
pointer-events: none;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="layout">
|
|
<!-- ✅ Sidebar -->
|
|
<%- include("partials/patient_sidebar", { active: "patients_list", patient: null }) %>
|
|
|
|
<!-- ✅ MAIN -->
|
|
<div class="main">
|
|
<nav class="navbar navbar-dark bg-dark position-relative px-3">
|
|
<div
|
|
class="position-absolute top-50 start-50 translate-middle d-flex align-items-center gap-2 text-white"
|
|
>
|
|
<i class="bi bi-people fs-4"></i>
|
|
<span class="fw-semibold fs-5">Patientenübersicht</span>
|
|
</div>
|
|
|
|
<div class="ms-auto">
|
|
<a href="/dashboard" class="btn btn-outline-primary btn-sm">
|
|
⬅️ Dashboard
|
|
</a>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="container-fluid mt-4">
|
|
<%- include("partials/flash") %>
|
|
|
|
<div class="d-flex gap-2 mb-3">
|
|
<a href="/patients/create" class="btn btn-success">
|
|
+ Neuer Patient
|
|
</a>
|
|
</div>
|
|
|
|
<div class="card shadow">
|
|
<div class="card-body">
|
|
<!-- Suchformular -->
|
|
<form method="GET" action="/patients" class="row g-2 mb-4">
|
|
<div class="col-md-3">
|
|
<input
|
|
type="text"
|
|
name="firstname"
|
|
class="form-control"
|
|
placeholder="Vorname"
|
|
value="<%= query?.firstname || '' %>"
|
|
/>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<input
|
|
type="text"
|
|
name="lastname"
|
|
class="form-control"
|
|
placeholder="Nachname"
|
|
value="<%= query?.lastname || '' %>"
|
|
/>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<input
|
|
type="date"
|
|
name="birthdate"
|
|
class="form-control"
|
|
value="<%= query?.birthdate || '' %>"
|
|
/>
|
|
</div>
|
|
|
|
<div class="col-md-3 d-flex gap-2">
|
|
<button type="submit" class="btn btn-primary w-100">
|
|
Suchen
|
|
</button>
|
|
<a href="/patients" class="btn btn-secondary w-100">
|
|
Zurücksetzen
|
|
</a>
|
|
</div>
|
|
</form>
|
|
|
|
<!-- Tabelle -->
|
|
<div class="table-responsive">
|
|
<table class="table table-bordered table-hover align-middle table-sm">
|
|
<thead class="table-dark">
|
|
<tr>
|
|
<th class="radio-col">✔</th>
|
|
<th>Name</th>
|
|
<th>N.I.E. / DNI</th>
|
|
<th>Geschlecht</th>
|
|
<th>Geburtstag</th>
|
|
<th>E-Mail</th>
|
|
<th>Telefon</th>
|
|
<th>Adresse</th>
|
|
<th>Land</th>
|
|
<th>Status</th>
|
|
<th>Notizen</th>
|
|
<th>Erstellt</th>
|
|
<th>Geändert</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<% if (patients.length === 0) { %>
|
|
<tr>
|
|
<td colspan="13" class="text-center text-muted">
|
|
Keine Patienten gefunden
|
|
</td>
|
|
</tr>
|
|
<% } %>
|
|
|
|
<% patients.forEach(p => { %>
|
|
<tr>
|
|
<td class="text-center">
|
|
<input
|
|
type="radio"
|
|
name="selectedPatient"
|
|
class="form-check-input patient-radio"
|
|
data-id="<%= p.id %>"
|
|
data-firstname="<%= p.firstname %>"
|
|
data-lastname="<%= p.lastname %>"
|
|
data-waiting="<%= p.waiting_room ? '1' : '0' %>"
|
|
data-active="<%= p.active ? '1' : '0' %>"
|
|
/>
|
|
</td>
|
|
|
|
<td>
|
|
<strong><%= p.firstname %> <%= p.lastname %></strong>
|
|
</td>
|
|
|
|
<td><%= p.dni || "-" %></td>
|
|
|
|
<td>
|
|
<% if (p.gender === 'm') { %>m
|
|
<% } else if (p.gender === 'w') { %>w
|
|
<% } else if (p.gender === 'd') { %>d
|
|
<% } else { %>-<% } %>
|
|
</td>
|
|
|
|
<td>
|
|
<%= new Date(p.birthdate).toLocaleDateString("de-DE") %>
|
|
</td>
|
|
|
|
<td><%= p.email || "-" %></td>
|
|
<td><%= p.phone || "-" %></td>
|
|
|
|
<td>
|
|
<%= p.street || "" %> <%= p.house_number || "" %><br />
|
|
<%= p.postal_code || "" %> <%= p.city || "" %>
|
|
</td>
|
|
|
|
<td><%= p.country || "-" %></td>
|
|
|
|
<td>
|
|
<% if (p.active) { %>
|
|
<span class="badge bg-success">Aktiv</span>
|
|
<% } else { %>
|
|
<span class="badge bg-danger">Inaktiv</span>
|
|
<% } %>
|
|
</td>
|
|
|
|
<td style="max-width: 200px">
|
|
<%= p.notes ? p.notes.substring(0, 80) : "-" %>
|
|
</td>
|
|
|
|
<td><%= new Date(p.created_at).toLocaleString("de-DE") %></td>
|
|
<td><%= new Date(p.updated_at).toLocaleString("de-DE") %></td>
|
|
</tr>
|
|
<% }) %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="text-muted mt-2" style="font-size: 13px;">
|
|
Patient auswählen → Sidebar links zeigt Aktionen ✅
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="/js/bootstrap.bundle.min.js"></script>
|
|
<!-- ✅ Helmet-safe -->
|
|
<script src="/js/patients_sidebar.js"></script>
|
|
</body>
|
|
</html>
|