This repository has been archived by the owner on Aug 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduct_manager.php
64 lines (60 loc) · 2.44 KB
/
product_manager.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
require("php/Core.php");
Core::init();
if (!UserManager::isAdminLogged()) Core::postRedirect("index.php");
if (isset($_GET["remove"])){
SneakersManager::removeSneaker($_GET["remove"]);
Core::postRedirect("product_manager.php");
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>SNEAKERAN | Správce produktů</title>
<link rel="stylesheet" href="styles/style.css">
<link rel="stylesheet" href="styles/Main.css">
<link rel="icon" href="favicon.svg">
</head>
<body>
<?php
echo ComponentDrawer::drawNav(false,false);
?>
<main >
<div class="widget shadow-soft" >
<div class="fs-50 textcenter shadow-soft-text">Zboží</div>
<div class="grid-ctr" style="margin: 20px">
<a href="product_creation.php"><button class="shadow-soft">Přidat produkt</button></a>
</div>
<table class="fullwidth exclude-first">
<tr>
<td>ID</td>
<td colspan="2">Bota</td>
<td>Cena</td>
<td>Nástroje</td>
</tr>
<?php
foreach (SneakersManager::getAllSneakersData() as $sneaker){
echo "<tr>";
echo "<td>$sneaker[id]</td>";
echo "<td><img alt='' class='product-preview' src=src/imgs/sneakers/$sneaker[imgpath]></td>";
echo "<td>$sneaker[name]</td>";
echo "<td>".FormatUtils::formatMoney($sneaker["price"])."</td>";
echo "<td>
<a href='product_amount_manager.php?product=$sneaker[id]'><img alt='' style='width: 20px' src='src/imgs/box.svg'>
<a href='product_manager.php?remove=$sneaker[id]'><img alt='' style='width: 20px' src='src/imgs/x.svg'></a>
</td>";
echo "<td></a></td>";
echo "</tr>";
}
?>
</table>
</div>
</main>
<footer class="white textcenter">© 2022 Copyright: Jaroslav Korčák</footer>
<img src="src/imgs/sneaker_black.svg" alt="" id="sneaker">
</body>
</html>