-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
74 lines (74 loc) · 2.67 KB
/
index.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
69
70
71
72
73
74
<?php
require("php/database.php");
session_start();
$result1 = $database->select("subject", ["id", "titel", "subtext", "image"], ["uitgelicht" => 1, "ORDER" => "date", "LIMIT" => 2]);
$result2 = $database->select("cat", ["id", "name", "subtext", "headimage"], ["LIMIT" => 6]);
?>
<!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">
<meta name="description" content="Mathijs Clasener tutorials zijn leerstoffen om verschillende programmeertalen te leren. Studenten kunnen kiezen uitverschillende vakken">
<?php
require("components/style.php");
?>
<title>Home - <?php echo $open;?></title>
</head>
<body>
<?php require("components/navbar.php"); ?>
<main id="article">
<div class="container">
<h1 class="display-1 text-center fw-bolder">Vandaag in de Spotlight:</h1>
<div class="mt-4 mb-5 d-flex justify-content-center">
<?php
if (!$result1){
echo "<h1>Vandaag zijn er geen uitgelichte video's</h1>";
}
foreach ($result1 as $item) {
$image = $item['image'];
echo "
<div class='column me-5'>
<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>
<!--Hieronder zijn de verschillende cards aangemaakt voor de programmeertalen -->
<h2 class="fw-bold text-center mb-5">Bekijk hieronder andere programmeertalen:</h2>
<div class="row mb-5">
<?php
if (!$result2){
echo "<h1>Vandaag zijn er geen uitgelichte video's</h1>";
}
foreach ($result2 as $item2) {
$image1 = $item2['headimage'];
echo "<div class='colum col-sm-12 col-md-6 col-lg-4'>
<article class='card' style='background-image: url(". $image1 ."); '>";
echo "<div class='card-body'>
<h2>".$item2['name']."</h2>
<p>".$item2['subtext']."</p>
<p class='read'><a class='stretched-link' href='playlist.php?id=".$item2['id']."'>Lees verder...</a></p>
</div>
</article>
</div>";
}
?>
</div>
</div>
</main>
<?php
require("components/footer.php");
require("components/scripts.php");
?>
</body>
</html>