This commit is contained in:
2024-12-09 20:30:19 +01:00
parent d080b6287c
commit 9b5f3b23fb
13 changed files with 636 additions and 43 deletions

View File

@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Uživatelská Tabulka</title>
<title>Administrativní pracovníci</title>
<link rel="stylesheet" href="{{url_for('static', filename='css/style.css')}}">
<script src="{{url_for('static', filename='scripts/user_table.js')}}"></script>
</head>
@@ -18,7 +18,7 @@
<a href="{{ url_for('home') }}" style="text-decoration: none;">
<img src="{{url_for('static', filename='img/logo.webp')}}" alt="Logo" class="logo">
</a>
Uživatelská Tabulka
Administrativní pracovníci
</h1>
<div class="buttons">
<a href="{{ url_for('home') }}" class="button">Zpět na Domovskou Stránku</a>
@@ -28,9 +28,7 @@
</div>
</header>
<nav class="navbar">
<h2 id="users-table">Tabulka Uživatelů</h2>
</nav>
<div class="container">
<div class="content">
@@ -39,8 +37,10 @@
{% elif session.get('role_id') != 1 %}
<p>Nemáte oprávnění zobrazit tuto stránku.</p>
{% else %}
<div class="user-table">
<nav class="navbar-users-table">
<h2 id="users-table">Správa Uživatelů</h2>
</nav>
{% if users %}
<table>
<thead>
@@ -61,7 +61,13 @@
<td>{{ user['Jmeno'] }}</td>
<td>{{ user['Prijmeni'] }}</td>
<td>{{ user['Email'] }}</td>
<td>{{ user['Role_ID'] }}</td>
<td>
{% for role in roles %}
{% if role['Role_ID'] == user['Role_ID'] %}
{{ role['Nazev'] }}
{% endif %}
{% endfor %}
</td>
<td>{{ user['Username'] }}</td>
<td>
<a href="{{ url_for('edit_user', user_id=user['ID_Uzivatele']) }}">Edit</a>
@@ -79,8 +85,55 @@
<p>No users found.</p>
{% endif %}
</div>
<div class="order-management">
<nav class="navbar-orders-table">
<h2 id="orders-table">Správa objednávek</h2>
</nav>
{% if orders %}
<table>
<thead>
<tr>
<th>Číslo objednávky</th>
<th>Datum začátku</th>
<th>Datum konce</th>
<th>Stav</th>
<th>Přiřazený zaměstnanec</th>
<th>Popis</th>
<th>Akce</th> <!-- New column for actions -->
</tr>
</thead>
<tbody>
{% for order in orders %}
<tr style="text-align: center;">
<td>{{ order['ID_Objednavky'] }}</td>
<td>{{ order['Datum_Zacatku'] }}</td>
<td>{{ order['Datum_Konce'] }}</td>
<td>{{ order['Stav'] }}</td>
<td>
{% for user in users %}
{% if user['ID_Uzivatele'] == order['ID_Zamestnance'] %}
{{ user['Jmeno'] }} {{ user['Prijmeni'] }}
{% endif %}
{% endfor %}
</td>
<td>{{ order['Popis'] }}</td>
<td>
<a href="{{ url_for('edit_order', order_id=order['ID_Objednavky']) }}">Edit</a>
</td> <!-- Edit button -->
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<table>
<tr style="text-align: center;">
<td colspan="7">Nenalezeny žádné objednávky k zobrazení.</td>
</tr>
</table>
{% endif %}
</div>
{% endif %}
</div>
</div>
</div>
<footer class="footer" id="kontakt">
<div>Made by Hrachovina</div>