-
Notifications
You must be signed in to change notification settings - Fork 0
/
products.php
68 lines (59 loc) · 2.05 KB
/
products.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
65
66
67
68
<!DOCTYPE html>
<html lang="uk">
<head>
<meta charset="UTF-8">
<title>Товари</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body class="background-image">
<div class="green-banner">
<p>Вітаємо!</p>
</div>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td colspan="3" class="header">
<img src="Images/img1.jpeg" alt="Header image" />
</td>
</tr>
<tr>
<td class="left_col">
<?php
include("menu.php");
?>
</td>
<td class="center_col">
<h1>Товари</h1>
<table cellpadding="5" cellspacing="0" width="100%">
<tr>
<th>Код товару</th>
<th>Найменування товару</th>
<th>Опис</th>
<th>Ціна</th>
<th>Одиниця виміру</th>
<th>Кількість в наявності</th>
</tr>
<?php
$conn = mysqli_connect("localhost", "root", "", "nuzp_proj2") or die("Помилка підключення: " . mysqli_connect_error());
$sql = "SELECT * FROM products";
$result = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_assoc($result)):
echo "<tr>
<td>{$row['id']}</td>
<td>{$row['product_name']}</td>
<td>{$row['description']}</td>
<td>{$row['price']}</td>
<td>{$row['unit']}</td>
<td>{$row['quantity_in_stock']}</td>
</tr>";
endwhile;
mysqli_close($conn);
?>
</table>
</td>
</tr>
<tr>
<td colspan="3" class="footer"> © 2023 </td>
</tr>
</table>
</body>
</html>