-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathon-show.php
97 lines (82 loc) · 3.61 KB
/
on-show.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vizyondaki Filmler</title>
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css" />
<link rel="stylesheet" href="assets/style.css">
</head>
<body>
<?php include 'partials/header.php'; ?>
<div class="on-show-main">
<?php
function getSymbolPath($tag)
{
$symbolPaths = [
'+7' => './assets/content-rating-system/7yas.png',
'+13' => './assets/content-rating-system/13yas.png',
'+18' => './assets/content-rating-system/18yas.png',
'genel' => './assets/content-rating-system/genel.png',
'olumsuz' => './assets/content-rating-system/olumsuz.png',
'siddet' => './assets/content-rating-system/siddet.png',
];
return isset($symbolPaths[$tag]) ? $symbolPaths[$tag] : './assets/content-rating-system/genel.png';
}
?>
<div class="on-show-container">
<?php
$mysqli = new mysqli("localhost", "root", "", "ethereal_cineaste");
$result = $mysqli->query("SELECT * FROM on_show_movie ORDER BY id DESC LIMIT 20");
if (!$result) {
die("Failed to retrieve notes: " . $mysqli->error);
}
while ($row = $result->fetch_assoc()) {
?>
<div class="on-show-card">
<div class="on-show-card-image">
<?php
$imageURL = str_replace('../', '', $row['card_image']);
echo '<img src="' . $imageURL . '" alt="" />';
?>
</div>
<div class="on-show-card-top-layer">
<div class="on-show-card-symbols">
<?php
$contentRatingTags = $row['content_rating_tags'];
$tagsArray = explode(',', $contentRatingTags);
foreach ($tagsArray as $tag) {
$symbolPath = getSymbolPath($tag);
echo '<img src="' . $symbolPath . '" alt="' . $tag . '" />';
}
?>
</div>
<div class="on-show-card-text">
<h3>
<?php echo $row['movie_name'] ?>
</h3>
<h4>
<?php echo $row['director_name'] ?>
</h4>
<p>
<?php echo $row['genres']; ?>
</p>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
<?php include 'partials/footer.php'; ?>
<script src="assets/main.js"></script>
</body>
</html>