# Conflicts:
#	web/templates/home.html
This commit is contained in:
2024-12-10 22:52:23 +01:00
14 changed files with 635 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>

View File

@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="cs">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vytvořit Novou Opravu</title>
<link rel="stylesheet" href="{{url_for('static', filename='css/style.css')}}">
</head>
<body>
<header>
<div class="header">
<h1>Vytvořit Novou Opravu</h1>
</div>
</header>
<div class="container">
<form action="{{ url_for('create_repair') }}" method="post" class="form-container">
<label for="id_zamestnance">Zaměstnanec:</label>
<select id="id_zamestnance" name="id_zamestnance" required>
<option value="" disabled selected>Vyberte zaměstnance</option>
{% for employee in employees %}
<option value="{{ employee['ID_Uzivatele'] }}">{{ employee['Jmeno'] }} {{ employee['Prijmeni'] }}</option>
{% endfor %}
</select>
<label for="nazev">Název:</label>
<input type="text" id="nazev" name="nazev" required>
<label for="popis">Popis:</label>
<textarea id="popis" name="popis" required></textarea>
<button type="submit" class="button">Vytvořit</button>
</form>
</div>
<footer class="footer">
<div>Made by Hrachovina</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html lang="cs">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Editovat Objednávku</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>
Editovat Objednávku
</h1>
<div class="buttons">
<a href="{{ url_for('administrator') }}" class="button">Zpět na Tabulku Objednávek</a>
</div>
</div>
</header>
<div class="container">
<div class="content">
<h2>Editovat Objednávku</h2>
<form action="{{ url_for('edit_order', order_id=order['ID_Objednavky']) }}" method="post" class="form-container">
<label for="stav">Stav:</label>
<input type="text" id="stav" name="stav" value="{{ order['Stav'] }}" required>
<label for="id_zamestnance">Přiřazený zaměstnanec:</label>
<input type="text" id="id_zamestnance" name="id_zamestnance" value="{{ order['ID_Zamestnance'] }}" required>
<label for="popis">Popis:</label>
<input type="text" id="popis" name="popis" value="{{ order['Popis'] }}" required>
<label for="datum_konce">Datum expedice:</label>
<input type="date" id="datum_konce" name="datum_konce" value="{{ order['Datum_Konce'] }}">
<button type="submit" class="button">Aktualizovat</button>
</form>
</div>
</div>
<footer class="footer" id="kontakt">
<div>Made by Hrachovina and Kirsch</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html lang="cs">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Editovat Opravu</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>
Editovat Opravu
</h1>
<div class="buttons">
<a href="{{ url_for('repairs') }}" class="button">Zpět na Seznam Oprav</a>
</div>
</div>
</header>
<div class="container">
<div class="content">
<h2>Editovat Opravu</h2>
<form action="{{ url_for('edit_repair', repair_id=repair['ID_Opravy']) }}" method="post" class="form-container">
<label for="id_zamestnance">Zaměstnanec:</label>
<select id="id_zamestnance" name="id_zamestnance" required>
{% for employee in employees %}
<option value="{{ employee['ID_Uzivatele'] }}" {% if employee['ID_Uzivatele'] == repair['ID_Zamestnance'] %}selected{% endif %}>{{ employee['Jmeno'] }} {{ employee['Prijmeni'] }}</option>
{% endfor %}
</select>
<label for="nazev">Název:</label>
<input type="text" id="nazev" name="nazev" value="{{ repair['Nazev'] }}" required>
<label for="popis">Popis:</label>
<textarea id="popis" name="popis" required>{{ repair['Popis'] }}</textarea>
<button type="submit" class="button">Aktualizovat</button>
</form>
</div>
</div>
<footer class="footer" id="kontakt">
<div>Made by Hrachovina</div>
</footer>
</body>
</html>

View File

@@ -23,6 +23,7 @@
<div class="buttons">
{% if session.get('logged_in') %}
<a href="{{ url_for('administrator') }}" class="button">Administrace</a>
<a href="{{ url_for('repairs') }}" class="button">Správa Oprav</a>
<a href="{{ url_for('logout') }}" class="button">Odhlásit se</a>
{% else %}
<a href="{{ url_for('login') }}" class="button">Administrace</a>
@@ -128,13 +129,13 @@
<div class="form-container">
<span class="close-button" onclick="closeReservationForm()">&times;</span>
<h2>Rezervace</h2>
<form>
<form action="{{ url_for('create_reservation') }}" method="post">
<label for="fullName">Celé jméno: <span class="required">*</span></label>
<input type="text" id="fullName" name="fullName" required>
<label for="email">Email: <span class="required">*</span></label>
<input type="email" id="email" name="email" required>
<label for="date">Datum: <span class="required">*</span></label>
<input type="date" id="date" name="date" required>
<input type="text" id="date" name="date" required readonly>
<label for="description">Popis: <span class="required">*</span></label>
<textarea id="description" name="description" rows="4" required></textarea>
<button type="submit" class="button">Odeslat</button>
@@ -147,6 +148,7 @@
document.querySelector(target).scrollIntoView({ behavior: 'smooth' });
}
</script>
<script src="{{ url_for('static', filename='scripts/reservation.js') }}"></script>
</body>
</html>

View File

@@ -0,0 +1,80 @@
<!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">
<h2>Opravy</h2>
<div class="repair-table">
{% 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> <!-- New column for actions -->
</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']) }}">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 -->
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No repairs found.</p>
{% endif %}
</div>
</div>
</div>
<footer class="footer" id="kontakt">
<div>Made by Hrachovina</div>
</footer>
</body>
</html>