2024-05-23 20:49:34 +02:00
|
|
|
<%- include('partials/header') %>
|
|
|
|
<% birthday = new Date(mitglied.geburtsdatum) %>
|
|
|
|
|
2024-05-29 20:55:02 +02:00
|
|
|
<h1> <%= mitglied.vorname %> <%= mitglied.nachname %> </h1>
|
2024-05-23 20:49:34 +02:00
|
|
|
|
2024-05-27 22:14:35 +02:00
|
|
|
<div id="view" class="mt-5">
|
|
|
|
<strong> Geburtsdatum: </strong> <%= birthday.getDate() %>.<%= birthday.getMonth() + 1 %>.<%= birthday.getFullYear() %> (<%= mitglied.age %>)</br>
|
2024-05-27 20:37:35 +02:00
|
|
|
<strong> Adresse: </strong> <%= mitglied.adresse %> </br>
|
2024-05-27 22:14:35 +02:00
|
|
|
<strong> Riege: </strong> <%= riege %> </br>
|
2024-05-31 21:45:21 +02:00
|
|
|
<strong> Anwesend: </strong> <%= anwesend %> Mal </br>
|
2024-05-27 20:37:35 +02:00
|
|
|
<% numbers.forEach(number => { %>
|
|
|
|
<% if (number.verbindung === 4) { %>
|
|
|
|
<strong> Telefonnummer: </strong> <%= number.nummer %> </br>
|
|
|
|
<% }}) %>
|
|
|
|
|
|
|
|
<h2>Notfallnummern</h2>
|
|
|
|
<p>
|
|
|
|
<% numbers.forEach(number => { %>
|
|
|
|
<% if (number.verbindung != 4) { %>
|
2024-05-30 17:43:11 +02:00
|
|
|
<strong><%= number.bezeichnung %> - <%= number.name %>: </strong> <%= number.nummer %> <% if (number.stand) { %>(stand: <%= ("00" + birthday.getDate()).slice(-2) %>.<%= ("00" + (birthday.getMonth() + 1)).slice(-2) %>.<%= number.stand.getFullYear() %>) <% } %></br>
|
2024-05-27 20:37:35 +02:00
|
|
|
<% }}) %>
|
|
|
|
</p>
|
|
|
|
|
2024-05-27 22:14:35 +02:00
|
|
|
<% if (session && session.role === 'admin') { %>
|
|
|
|
<button class="btn btn-primary" onclick="toggleDivs()">Zum Edit-Modus wechseln</button>
|
|
|
|
<% } %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<% if (session && session.role === 'admin') { %>
|
|
|
|
<div id="edit" class="mt-5 d-none">
|
2024-05-30 17:43:11 +02:00
|
|
|
|
|
|
|
<form method="POST" action="/update-mitglied">
|
|
|
|
Geburtsdatum: <input type="date" id="geburt" name="geburt" value="<%= birthday.getFullYear() %>-<%= ('00' + (birthday.getMonth() + 1)).slice(-2) %>-<%= ('00' + birthday.getDate()).slice(-2) %>"></br>
|
2024-05-27 22:14:35 +02:00
|
|
|
<input type="hidden" name="id" value="<%= id %>">
|
|
|
|
<input type="hidden" name="type" value="adresse">
|
|
|
|
<strong> Adresse: </strong> <input name="adresse" type="text" value="<%= mitglied.adresse %>">
|
|
|
|
<button type="submit">Speichern</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
|
|
<form method="POST" action="/set-Riege">
|
|
|
|
<input type="hidden" name="id" value="<%= id %>">
|
|
|
|
<strong>Riege: </strong><select name="riege">
|
|
|
|
<option value=1 <% if ( riege === 1) { %> selected <% } %>> Riege 1</option>
|
|
|
|
<option value=2 <% if ( riege === 2) { %> selected <% } %>> Riege 2</option>
|
|
|
|
<option value=3 <% if ( riege === 3) { %> selected <% } %>> Riege 3</option>
|
|
|
|
<option value=4 <% if ( riege === 4) { %> selected <% } %>> Riege 4</option>
|
|
|
|
<option value=5 <% if ( riege === 5) { %> selected <% } %>> Riege 5</option>
|
|
|
|
</select>
|
|
|
|
<button type="submit">Speichern</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<% numbers.forEach(number => { %>
|
|
|
|
<form method="POST" action="/update-mitglied">
|
|
|
|
<input type="hidden" name="telid" value="<%= number.id %>">
|
|
|
|
<input type="hidden" name="type" value="tel-delete">
|
|
|
|
<input type="hidden" name="id" value="<%= id %>">
|
|
|
|
<strong><%= number.bezeichnung %> - <%= number.name %>: </strong> <%= number.nummer %>
|
|
|
|
<button type="submit">löschen</button>
|
|
|
|
</form>
|
|
|
|
<% }) %>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<h2>Telefonnummer hinzufügen</h2>
|
2024-05-27 20:37:35 +02:00
|
|
|
<form method="POST" action="/update-mitglied">
|
2024-05-27 22:14:35 +02:00
|
|
|
<input type="hidden" name="id" value="<%= id %>">
|
|
|
|
<input type="hidden" name="type" value="tel">
|
2024-05-27 20:37:35 +02:00
|
|
|
<select name="verbindung">
|
|
|
|
<option value=1>Mutter</option>
|
|
|
|
<option value=2>Vater</option>
|
|
|
|
<option value=3>Eltern</option>
|
|
|
|
<option value=4>Eigene</option>
|
|
|
|
<option value=5>Oma</option>
|
|
|
|
<option value=6>Opa</option>
|
|
|
|
</select>
|
|
|
|
<input name="name" placeholder="Name" type="text" >
|
|
|
|
<input name="nummer" placeholder="+49 123 456 789" type="text">
|
|
|
|
<button type="submit">Speichern</button>
|
|
|
|
</form>
|
2024-05-27 22:14:35 +02:00
|
|
|
<button class="btn btn-secondary" onclick="toggleDivs()">Zum View-Modus wechseln</button>
|
|
|
|
</div>
|
|
|
|
<% } %>
|
2024-05-27 20:37:35 +02:00
|
|
|
|
2024-05-27 22:14:35 +02:00
|
|
|
<script>
|
|
|
|
function toggleDivs() {
|
|
|
|
$('#view').toggleClass('d-none d-block');
|
|
|
|
$('#edit').toggleClass('d-none d-block');
|
|
|
|
}
|
|
|
|
</script>
|
2024-05-27 20:37:35 +02:00
|
|
|
|
2024-05-23 20:49:34 +02:00
|
|
|
|
|
|
|
<%- include('partials/footer') %>
|