-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaylist.php
More file actions
69 lines (67 loc) · 2.1 KB
/
playlist.php
File metadata and controls
69 lines (67 loc) · 2.1 KB
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
69
<?php
require("php/database.php");
session_start();
if (!isset($_GET['id'])) {
header("Location: /tutorial/");
return false;
}
//Dit is de query voor het uitlezen van de data
$sql = "SELECT id, titel, image, subtext FROM subject WHERE leerlijn = '". $_GET["id"] ."';";
$result = $conn->query($sql);
//echo $sql;
if($stmt = $conn->prepare("SELECT name FROM cat WHERE id = ?")) {
$stmt->bind_param("s", $_GET["id"]);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows > 0) {
$stmt->bind_result($naam);
$stmt->fetch();
}
}
?>
<!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; ?> - Playlists - <?php echo $naam;?></title>
</head>
<body>
<?php require("components/navbar.php"); ?>
<main id="article">
<div class="container">
<h1 class="fw-bold text-center mb-5"><?php echo $naam;?> Lesstoffen</h1>
<div class="row mb-5">
<?php
if ($result->num_rows === 0){
echo "<p>Er zijn geen videos gevonden probeer het later nog een keer of notificeer de leraar voor meer informatie.</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");
?>
</body>
</html>