-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
51 lines (51 loc) · 1.63 KB
/
search.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
<?php
require("php/database.php");
session_start();
$result = $database->select("subject", ["id", "titel", "image", "subtext"], ["titel[~]" => "%" . $_POST['search'] . " %"]);
?>
<!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">
<?php
require("components/style.php");
?>
<title><?php echo $open; ?> - Search</title>
</head>
<body>
<?php require("components/navbar.php"); ?>
<main id="article">
<div class="container">
<div id="rowing" class="row mb-5 mt-3">
<?php
if (count($result) == 0){
echo "<p>De video waar jij naar zocht kon niet worden gevodnen.</p>";
}
foreach ($result as $item) {
$image = $item['image'];
echo "
<div class='colum col-sm-12 col-md-6 col-lg-4'>
<article class='card' style='background-image: url(";
echo $image;
echo "); '>
<div class='card-body'>
<h2>".$item['titel']."</h2>
<p>".$item['subtext']."</p>
<p class='read'><a class='stretched-link' href='video.php?id=".$item['id']."'>Lees verder...</a></p>
</div>
</article>
</div>";
}
?>
</div>
</div>
</main>
<?php
require("components/footer.php");
require("components/scripts.php");
?>
<script type="text/javascript" src="js/search.js"></script>
</body>
</html>