day of hard work with xkirsch #2

This commit is contained in:
2024-12-10 23:02:58 +01:00
parent 6c55c1701c
commit 72fb73cb5f
18 changed files with 841 additions and 64 deletions

View File

@@ -4,6 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Administrativní pracovníci</title>
<link rel="icon" href="{{url_for('static', filename='img/logo.webp')}}" type="image/x-icon">
<link rel="stylesheet" href="{{url_for('static', filename='css/style.css')}}">
<script src="{{url_for('static', filename='scripts/user_table.js')}}"></script>
</head>
@@ -23,7 +24,8 @@
<div class="buttons">
<a href="{{ url_for('home') }}" class="button">Zpět na Domovskou Stránku</a>
<a href="{{ url_for('create_user') }}" class="button">Vytvořit Nového Uživatele</a>
<a href="{{ url_for('logout') }}" class="button">Odhlásit se</a> <!-- New Log Out button -->
<a href="{{ url_for('create_product') }}" class="button">Přidat Nový Produkt</a> <!-- Fixed route -->
<a href="{{ url_for('logout') }}" class="button">Odhlásit se</a>
</div>
</div>
</header>
@@ -38,7 +40,7 @@
<p>Nemáte oprávnění zobrazit tuto stránku.</p>
{% else %}
<div class="user-table">
<nav class="navbar-users-table">
<nav class="table-header">
<h2 id="users-table">Správa Uživatelů</h2>
</nav>
{% if users %}
@@ -51,7 +53,7 @@
<th>Email</th>
<th>Role</th>
<th>Username</th>
<th>Akce</th> <!-- New column for actions -->
<th>Akce</th>
</tr>
</thead>
<tbody>
@@ -76,7 +78,7 @@
<button type="submit" class="button-link">Delete</button>
</form>
{% endif %}
</td> <!-- Edit and Delete buttons -->
</td>
</tr>
{% endfor %}
</tbody>
@@ -86,20 +88,20 @@
{% endif %}
</div>
<div class="order-management">
<nav class="navbar-orders-table">
<nav class="table-header">
<h2 id="orders-table">Správa objednávek</h2>
</nav>
{% if orders %}
<table>
<thead>
<tr>
<th>Číslo objednávky</th>
<th>ID</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 -->
<th>Akce</th>
</tr>
</thead>
<tbody>
@@ -118,8 +120,11 @@
</td>
<td>{{ order['Popis'] }}</td>
<td>
<a href="{{ url_for('edit_order', order_id=order['ID_Objednavky']) }}">Edit</a>
</td> <!-- Edit button -->
<a href="{{ url_for('edit_order', order_id=order['ID_Objednavky']) }}">Edit</a> /
<form action="{{ url_for('delete_order', order_id=order['ID_Objednavky']) }}" method="post" style="display:inline;" onsubmit="return confirm('Opravdu chcete smazat tuto objednávku?');">
<button type="submit" class="button-link">Delete</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
@@ -132,10 +137,50 @@
</table>
{% endif %}
</div>
<div class="stock-management">
<nav class="table-header">
<h2 id="stock-table">Správa produktových zásob</h2>
</nav>
{% if products %}
<table>
<thead>
<tr>
<th>ID</th>
<th>Název</th>
<th>Popis</th>
<th>Momentální Zásoba</th>
<th>Minimální Zásoba</th>
<th>Akce</th>
</tr>
</thead>
<tbody>
{% for product in products %}
<tr style="text-align: center;">
<td>{{ product['ID_Produktu'] }}</td>
<td>{{ product['Nazev'] }}</td>
<td>{{ product['Popis'] }}</td>
<td>{{ product['Momentalni_Zasoba'] }}</td>
<td>{{ product['Minimalni_Zasoba'] }}</td>
<td>
<a href="{{ url_for('edit_product', product_id=product['ID_Produktu']) }}">Edit</a> /
<a href="{{ url_for('add_product_stock', product_id=product['ID_Produktu']) }}">Add</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<table>
<tr style="text-align: center;">
<td colspan="6">Nenalezeny žádné produkty k zobrazení.</td>
</tr>
</table>
{% endif %}
</div>
{% endif %}
</div>
</div>
<footer class="footer" id="kontakt">
<footer class="footer">
<div>Made by Hrachovina</div>
</footer>