-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.php
65 lines (57 loc) · 2.07 KB
/
menu.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles/main.css">
<link rel="stylesheet" href="styles/responsive.css">
<title>pizzaria</title>
</head>
<body class="body-menu">
<?php
include("header.php");
?>
<main>
<div class="menu-container">
<h2 class="de-menu-kaart">De Menu-kaart</h2>
<div class="zoekveld">
<form method="POST">
<input type="text" name="zoekveld" placeholder="Zoeken...">
</form>
</div>
<div class="menu-kaart-container">
<?php
require_once("config.php");
if (isset($_POST['zoekveld'])) {
$stmt = $conn->prepare("SELECT * FROM menu WHERE naam LIKE ?");
$zoeken = "%" . $_POST['zoekveld'] . "%";
$stmt->bind_param("s", $zoeken );
} else {
$stmt = $conn->prepare("SELECT * FROM menu");
}
if ($stmt->execute()) {
$is_run = $stmt->get_result();
while ($result = mysqli_fetch_assoc($is_run)) {
echo '<div class="menu-kaart">
<div class="menu-kaart-naam">
<p>' . $result['naam'] . '</p>
</div>
<div class="menu-kaart-omschrijving">
<p>' . $result['omschrijving'] . '</p>
</div>
<div class="menu-kaart-prijs">
<h3>€' . $result['prijs'] . '</h3>
</div>
</div>';
}
} else {
echo "Something happend :o";
}
?>
</div>
</div>
<footer>
</footer>
</body>
</html>