243 lines
8.2 KiB
Plaintext
243 lines
8.2 KiB
Plaintext
<%- include("partials/page-header", {
|
|
user,
|
|
title: t.patienteoverview.patienttitle,
|
|
subtitle: "",
|
|
showUserName: true
|
|
}) %>
|
|
|
|
<div class="content p-4">
|
|
|
|
<%- include("partials/flash") %>
|
|
|
|
<!-- Aktionen oben -->
|
|
<div class="d-flex gap-2 mb-3">
|
|
<a href="/patients/create" class="btn btn-success">
|
|
+ <%=t.patienteoverview.newpatient%>
|
|
</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=<%=t.global.firstname%>
|
|
value="<%= query?.firstname || '' %>"
|
|
/>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<input
|
|
type="text"
|
|
name="lastname"
|
|
class="form-control"
|
|
placeholder=<%=t.global.lastname%>
|
|
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 class="btn btn-primary w-100"><%=t.global.search%></button>
|
|
<a href="/patients" class="btn btn-secondary w-100">
|
|
<%=t.global.reset2%>
|
|
</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 style="width:40px;"></th>
|
|
<th>ID</th>
|
|
<th><%=t.global.name%></th>
|
|
<th>N.I.E. / DNI</th>
|
|
<th><%=t.global.gender%></th>
|
|
<th><%=t.global.birthday%></th>
|
|
<th><%=t.global.email%></th>
|
|
<th><%=t.global.phone%></th>
|
|
<th><%=t.global.address%></th>
|
|
<th><%=t.global.country%></th>
|
|
<th><%=t.global.status%></th>
|
|
<th><%=t.global.notice%></th>
|
|
<th><%=t.global.create%></th>
|
|
<th><%=t.global.change%></th>
|
|
<th><%=t.global.action%></th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<% if (patients.length === 0) { %>
|
|
<tr>
|
|
<td colspan="15" class="text-center text-muted">
|
|
<%=t.patientoverview.nopatientfound%>
|
|
</td>
|
|
</tr>
|
|
<% } %>
|
|
|
|
<% patients.forEach(p => { %>
|
|
<tr>
|
|
|
|
<!-- ✅ RADIOBUTTON ganz vorne -->
|
|
<td class="text-center">
|
|
<form method="GET" action="/patients">
|
|
<!-- Filter beibehalten -->
|
|
<input type="hidden" name="firstname" value="<%= query.firstname || '' %>">
|
|
<input type="hidden" name="lastname" value="<%= query.lastname || '' %>">
|
|
<input type="hidden" name="birthdate" value="<%= query.birthdate || '' %>">
|
|
|
|
<input
|
|
class="patient-radio"
|
|
type="radio"
|
|
name="selectedPatientId"
|
|
value="<%= p.id %>"
|
|
<%= selectedPatientId === p.id ? "checked" : "" %>
|
|
/>
|
|
|
|
</form>
|
|
</td>
|
|
|
|
<td><%= p.id %></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-secondary">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>
|
|
|
|
<td class="text-nowrap">
|
|
<div class="dropdown">
|
|
<button class="btn btn-sm btn-outline-secondary" data-bs-toggle="dropdown">
|
|
<%=t.global.selection%> ▾
|
|
</button>
|
|
|
|
<ul class="dropdown-menu dropdown-menu-end">
|
|
|
|
<li>
|
|
<a class="dropdown-item" href="/patients/edit/<%= p.id %>">
|
|
✏️ <%=t.global.edit%>
|
|
</a>
|
|
</li>
|
|
|
|
<li><hr class="dropdown-divider" /></li>
|
|
|
|
<% if (p.waiting_room) { %>
|
|
<li>
|
|
<span class="dropdown-item text-muted">🪑 <%=t.global.waiting%></span>
|
|
</li>
|
|
<% } else { %>
|
|
<li>
|
|
<form method="POST" action="/patients/waiting-room/<%= p.id %>">
|
|
<button class="dropdown-item">🪑 <%=t.global.towaitingroom%></button>
|
|
</form>
|
|
</li>
|
|
<% } %>
|
|
|
|
<li><hr class="dropdown-divider" /></li>
|
|
|
|
<li>
|
|
<a class="dropdown-item" href="/patients/<%= p.id %>/medications">
|
|
💊 <%=t.sidebar.medications%>
|
|
</a>
|
|
</li>
|
|
|
|
<li><hr class="dropdown-divider" /></li>
|
|
|
|
<li>
|
|
<% if (p.active) { %>
|
|
<form method="POST" action="/patients/deactivate/<%= p.id %>">
|
|
<button class="dropdown-item text-warning">🔒 <%=t.global.lock%><</button>
|
|
</form>
|
|
<% } else { %>
|
|
<form method="POST" action="/patients/activate/<%= p.id %>">
|
|
<button class="dropdown-item text-success">🔓 <%=t.global.unlock%><</button>
|
|
</form>
|
|
<% } %>
|
|
</li>
|
|
|
|
<li>
|
|
<a class="dropdown-item" href="/patients/<%= p.id %>">
|
|
📋 <%=t.global.overview%>
|
|
</a>
|
|
</li>
|
|
|
|
<li><hr class="dropdown-divider" /></li>
|
|
|
|
<li class="px-3 py-2">
|
|
<form method="POST" action="/patients/<%= p.id %>/files" enctype="multipart/form-data">
|
|
<input type="file" name="file" class="form-control form-control-sm mb-2" required />
|
|
<button class="btn btn-sm btn-secondary w-100">
|
|
📎 <%=t.global.upload%>
|
|
</button>
|
|
</form>
|
|
</li>
|
|
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
|
|
</tr>
|
|
<% }) %>
|
|
</tbody>
|
|
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|