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

@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="cs">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Přidat Zásobu</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')}}">
</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>
Přidat Zásobu
</h1>
<div class="buttons">
<a href="{{ url_for('administrator') }}" class="button">Zpět na Tabulku Produktů</a>
</div>
</div>
</header>
<div class="container">
<div class="content">
<h2>Přidat Zásobu</h2>
<form action="{{ url_for('add_product_stock', product_id=product['ID_Produktu']) }}" method="post" class="form-container">
<label for="quantity">Množství:</label>
<input type="number" id="quantity" name="quantity" required>
<button type="submit" class="button">Přidat</button>
</form>
</div>
</div>
<footer class="footer" id="kontakt">
<div>Made by Hrachovina and Kirsch</div>
</footer>
</body>
</html>

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>

View File

@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="cs">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Přidat Nový Produkt</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/create_product.js')}}"></script>
</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>
Přidat Nový Produkt
</h1>
<div class="buttons">
<a href="{{ url_for('administrator') }}" class="button">Zpět na Administraci</a>
</div>
</div>
</header>
<div class="container">
<div class="content">
{% if not session.get('logged_in') or session.get('role_id') != 1 %}
<p>Nemáte oprávnění k přístupu na tuto stránku.</p>
{% else %}
<form action="{{ url_for('create_product') }}" method="post" class="form-container" onsubmit="handleCreateProduct(event)">
<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>
<label for="momentalni_zasoba">Momentální Zásoba:</label>
<input type="number" id="momentalni_zasoba" name="momentalni_zasoba" required>
<label for="minimalni_zasoba">Minimální Zásoba:</label>
<input type="number" id="minimalni_zasoba" name="minimalni_zasoba" required>
<button type="submit" class="button">Přidat</button>
</form>
{% endif %}
</div>
</div>
<footer class="footer" id="kontakt">
<div>Made by Hrachovina and Kirsch</div>
</footer>
</body>
</html>

View File

@@ -4,6 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vytvořit Nového Uživatele</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/create_user.js')}}"></script>
</head>
@@ -42,7 +43,11 @@
<input type="email" id="email" name="email" required>
<label for="role">Role:</label>
<input type="text" id="role" name="role" required>
<select id="role" name="role" required>
{% for role in roles %}
<option value="{{ role['Role_ID'] }}">{{ role['Nazev'] }}</option>
{% endfor %}
</select>
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>

View File

@@ -1,10 +1,10 @@
<!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="icon" href="{{url_for('static', filename='img/logo.webp')}}" type="image/x-icon">
<link rel="stylesheet" href="{{url_for('static', filename='css/style.css')}}">
</head>
<body>
@@ -34,12 +34,18 @@
<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>
<select id="id_zamestnance" name="id_zamestnance" required>
{% for user in users %}
<option value="{{ user['ID_Uzivatele'] }}" {% if user['ID_Uzivatele'] == order['ID_Zamestnance'] %}selected{% endif %}>
{{ user['Jmeno'] }} {{ user['Prijmeni'] }}
</option>
{% endfor %}
</select>
<label for="popis">Popis:</label>
<input type="text" id="popis" name="popis" value="{{ order['Popis'] }}" required>
<textarea id="popis" name="popis" rows="4" required>{{ order['Popis'] }}</textarea>
<label for="datum_konce">Datum expedice:</label>
<label for="datum_konce">Datum konce:</label>
<input type="date" id="datum_konce" name="datum_konce" value="{{ order['Datum_Konce'] }}">
<button type="submit" class="button">Aktualizovat</button>

View File

@@ -0,0 +1,56 @@
<!DOCTYPE html>
<html lang="cs">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Editovat Produkt</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')}}">
</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 Produkt
</h1>
<div class="buttons">
<a href="{{ url_for('administrator') }}" class="button">Zpět na Tabulku Produktů</a>
</div>
</div>
</header>
<div class="container">
<div class="content">
<h2>Editovat Produkt</h2>
<form action="{{ url_for('edit_product', product_id=product['ID_Produktu']) }}" method="post" class="form-container">
<label for="nazev">Název:</label>
<input type="text" id="nazev" name="nazev" value="{{ product['Nazev'] }}" required>
<label for="popis">Popis:</label>
<textarea id="popis" name="popis" rows="4" required>{{ product['Popis'] }}</textarea>
<label for="momentalni_zasoba">Momentální Zásoba:</label>
<input type="number" id="momentalni_zasoba" name="momentalni_zasoba" value="{{ product['Momentalni_Zasoba'] }}" required>
<label for="minimalni_zasoba">Minimální Zásoba:</label>
<input type="number" id="minimalni_zasoba" name="minimalni_zasoba" value="{{ product['Minimalni_Zasoba'] }}" required>
<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

@@ -4,6 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Editovat Uživatele</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')}}">
</head>
<body>
@@ -27,6 +28,7 @@
<div class="container">
<div class="content">
<h2>Editovat Uživatele</h2>
<form action="{{ url_for('edit_user', user_id=user['ID_Uzivatele']) }}" method="post" class="form-container">
<label for="jmeno">Jméno:</label>
<input type="text" id="jmeno" name="jmeno" value="{{ user['Jmeno'] }}" required>

View File

@@ -4,6 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Autoservis</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/reservation.js')}}"></script>
</head>
@@ -22,11 +23,17 @@
</h1>
<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>
{% if session.get('role_id') == 1 %}
<a href="{{ url_for('administrator') }}" class="button">Administrace</a>
{% elif session.get('role_id') == 2 %}
<a href="{{ url_for('managers') }}" class="button">Manažerský panel</a>
<a href="{{ url_for('statistics') }}" class="button">Statistiky</a>
{% elif session.get('role_id') == 3 %}
<a href="{{ url_for('repairs') }}" class="button">Správa Oprav</a>
{% endif %}
<a href="{{ url_for('logout') }}" class="button">Odhlásit se</a>
{% else %}
<a href="{{ url_for('login') }}" class="button">Administrace</a>
<a href="{{ url_for('login') }}" class="button">Přihlásit se</a>
{% endif %}
<button class="button" onclick="openReservationForm()">Objednat se</button>
</div>
@@ -40,10 +47,10 @@
{% endif %}
<nav class="navbar">
<button class="button" onclick="smoothScroll('#about-header')">O nás</button>
<button class="button" onclick="smoothScroll('#directions')">K nám</button>
<button class="button" onclick="smoothScroll('#nabidka-sluzeb')">Služby</button>
<button class="button" onclick="smoothScroll('#recenze')">Recenze</button>
<button class="button" onclick="location.href='#about-header'">O nás</button>
<button class="button" onclick="location.href='#directions'">K nám</button>
<button class="button" onclick="location.href='#nabidka-sluzeb'">Služby</button>
<button class="button" onclick="location.href='#recenze'">Recenze</button>
</nav>
<div class="container">
@@ -120,7 +127,7 @@
</div>
</div>
</div>
<footer class="footer" id="kontakt">
<footer class="footer">
<div>Made by Hrachovina and Kirsch</div>
</footer>
@@ -134,8 +141,8 @@
<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="text" id="date" name="date" required readonly>
<label for="datum_konce">Požadované datum vrácení vozidla: <span class="required">*</span></label>
<input type="date" id="datum_konce" name="datum_konce" required>
<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>
@@ -144,11 +151,19 @@
</div>
<script>
function smoothScroll(target) {
document.querySelector(target).scrollIntoView({ behavior: 'smooth' });
function openReservationForm() {
const now = new Date();
const minDate = new Date();
minDate.setDate(now.getDate() + 3); // Exclude today and the next 2 days
const formattedMinDate = minDate.toISOString().split('T')[0];
document.getElementById('datum_konce').setAttribute('min', formattedMinDate);
document.getElementById('reservationForm').style.display = 'block';
}
function closeReservationForm() {
document.getElementById('reservationForm').style.display = 'none';
}
</script>
<script src="{{ url_for('static', filename='scripts/reservation.js') }}"></script>
</body>
</html>

View File

@@ -4,6 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Přihlášení</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')}}">
</head>
<body>

146
web/templates/managers.html Normal file
View File

@@ -0,0 +1,146 @@
<!DOCTYPE html>
<html lang="cs">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Správa Manažerů</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>
<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 Manažerů
</h1>
<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>
</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>
{% elif session.get('role_id') not in [1, 2] %}
<p>Nemáte oprávnění zobrazit tuto stránku.</p>
{% else %}
<div class="user-table">
<nav class="table-header">
<h2 id="users-table">Správa Uživatelů</h2>
</nav>
{% if users %}
<table>
<thead>
<tr>
<th>ID</th>
<th>Jméno</th>
<th>Prijmeni</th>
<th>Email</th>
<th>Role</th>
<th>Username</th>
<th>Akce</th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>{{ user['ID_Uzivatele'] }}</td>
<td>{{ user['Jmeno'] }}</td>
<td>{{ user['Prijmeni'] }}</td>
<td>{{ user['Email'] }}</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>
{% if user['Role_ID'] > session.get('role_id') %}
/ <form action="{{ url_for('delete_user', user_id=user['ID_Uzivatele']) }}" method="post" style="display:inline;" onsubmit="return confirm('Opravdu chcete smazat tohoto uživatele?');">
<button type="submit" class="button-link">Delete</button>
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No users 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>

View File

@@ -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>

View File

@@ -0,0 +1,57 @@
<!DOCTYPE html>
<html lang="cs">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Statistiky</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="https://cdn.jsdelivr.net/npm/chart.js"></script>
</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>
Statistika Oprav
</h1>
<div class="buttons">
<a href="{{ url_for('home') }}" class="button">Zpět na Domovskou Stránku</a>
<a href="{{ url_for('logout') }}" class="button">Odhlásit se</a>
</div>
</div>
</header>
<div class="container">
<div class="statistics-container">
<h2 class="statistics-header">Počet Oprav podle Zaměstnance</h2>
<canvas id="repairsChart"></canvas>
<script id="repairsData" type="application/json">{{ repairs_data | tojson }}</script>
</div>
<div class="statistics-container">
<h2 class="statistics-header">Počet Oprav podle Času</h2>
<div class="statistics-form">
<label for="startDate">Začátek:</label>
<input type="date" id="startDate" name="startDate">
<label for="endDate">Konec:</label>
<input type="date" id="endDate" name="endDate">
<button onclick="fetchRepairsByDate()">Zobrazit</button>
</div>
<canvas id="timeRepairsChart"></canvas>
</div>
</div>
<footer class="footer">
<div>Made by Hrachovina</div>
</footer>
<script src="{{url_for('static', filename='scripts/statistics.js')}}"></script>
</body>
</html>