This repository has been archived on 2025-05-05. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
vwa_project/web/templates/repairs.html

137 lines
4.4 KiB
HTML

<!DOCTYPE html>
<html lang="cs">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Správa Oprav</title>
<link rel="stylesheet" href="{{url_for('static', filename='css/style.css')}}">
</head>
<body>
<header>
<div class="header">
<div class="contact-info">
<span>Kontakt: 123 123 123 | Otevírací doba: 9-18 hod | auto@servis.cz </span>
</div>
<h1 class="nazev">
<a href="{{ url_for('home') }}" style="text-decoration: none;">
<img src="{{url_for('static', filename='img/logo.webp')}}" alt="Logo" class="logo">
</a>
Správa Oprav
</h1>
<div class="buttons">
<a href="{{ url_for('home') }}" class="button">Zpět na Domovskou Stránku</a>
<a href="{{ url_for('create_repair') }}" class="button">Vytvořit Novou Opravu</a>
<a href="{{ url_for('logout') }}" class="button">Odhlásit se</a>
</div>
</div>
</header>
<div class="container">
<div class="content">
{% 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>
<tr>
<th>ID Opravy</th>
<th>Jméno Zaměstnance</th>
<th>Název</th>
<th>Popis</th>
<th>Použité Produkty</th>
<th>Akce</th>
</tr>
</thead>
<tbody>
{% for repair in repairs %}
<tr>
<td>{{ repair['ID_Opravy'] }}</td>
<td>{{ repair['Jmeno'] }} {{ repair['Prijmeni'] }}</td>
<td>{{ repair['Nazev'] }}</td>
<td>{{ repair['Popis'] }}</td>
<td>
{% for product in repair['products'] %}
{{ product['Nazev'] }} ({{ product['Pocet_Produktu'] }})<br>
{% endfor %}
</td>
<td>
<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>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<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">
<div>Made by Hrachovina</div>
</footer>
</body>
</html>