day of hard work with xkirsch #2
This commit is contained in:
@@ -29,8 +29,13 @@
|
||||
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<h2>Opravy</h2>
|
||||
<div class="repair-table">
|
||||
{% if not session.get('logged_in') %}
|
||||
<p>Musíte se přihlásit, abyste mohli zobrazit tuto stránku.</p>
|
||||
{% else %}
|
||||
<div class="user-table">
|
||||
<nav class="table-header">
|
||||
<h2 id="users-table">Správa Oprav</h2>
|
||||
</nav>
|
||||
{% if repairs %}
|
||||
<table>
|
||||
<thead>
|
||||
@@ -40,7 +45,7 @@
|
||||
<th>Název</th>
|
||||
<th>Popis</th>
|
||||
<th>Použité Produkty</th>
|
||||
<th>Akce</th> <!-- New column for actions -->
|
||||
<th>Akce</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -56,11 +61,11 @@
|
||||
{% endfor %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ url_for('edit_repair', repair_id=repair['ID_Opravy']) }}">Edit</a>
|
||||
<a href="{{ url_for('edit_repair', repair_id=repair['ID_Opravy']) }}" class="button-link">Edit</a>
|
||||
<form action="{{ url_for('delete_repair', repair_id=repair['ID_Opravy']) }}" method="post" style="display:inline;" onsubmit="return confirm('Opravdu chcete smazat tuto opravu?');">
|
||||
<button type="submit" class="button-link">Delete</button>
|
||||
</form>
|
||||
</td> <!-- Edit and Delete buttons -->
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
@@ -69,10 +74,62 @@
|
||||
<p>No repairs found.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="order-management">
|
||||
<nav class="table-header">
|
||||
<h2 id="orders-table">Správa Objednávek</h2>
|
||||
</nav>
|
||||
{% if orders %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<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>
|
||||
</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> /
|
||||
<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>
|
||||
</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>
|
||||
|
||||
<footer class="footer" id="kontakt">
|
||||
<footer class="footer">
|
||||
<div>Made by Hrachovina</div>
|
||||
</footer>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user