-
Notifications
You must be signed in to change notification settings - Fork 11
/
homepage.php
141 lines (134 loc) · 5.49 KB
/
homepage.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php
session_start();
// Only Allow Logged In Users
if (!(isset($_SESSION['loggedinanimeheaven']) && $_SESSION['loggedinanimeheaven'] == true)) {
header("Location: ./login.php");
}
include './db.php';
$genres = ["action", "romance", "family", "drama", "mystery"];
$movies = [];
foreach($genres as $genre) {
$movies[$genre] = [];
$sql = "SELECT * FROM movies WHERE movie_genre='$genre'";
$db_results = $conn->query($sql);
if(mysqli_num_rows($db_results) > 0) {
while($row = $db_results -> fetch_assoc()) {
array_push($movies[$genre], $row);
}
$movies = array_unique($movies, SORT_REGULAR);
}
}
?>
<!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">
<title>AnimeHeaven</title>
<!-- Favicon -->
<link rel="shortcut icon" type="image/png" href="./media/images/ah_logo.png"/>
<!-- Stylesheets -->
<link rel="stylesheet" href="./css/global.css">
<link rel="stylesheet" href="./css/homepage.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" />
</head>
<body>
<div class="homepage-wrapper">
<!-- Header Start -->
<header class="site-header">
<div class="wrapper site-header__wrapper">
<div class="site-header__start">
<a href="./homepage.php" class="brand"><img src="./media/images/ah_logo.png" alt="Logo"></a>
</div>
<div class="site-header__middle">
<nav class="nav">
<button class="nav__toggle" aria-expanded="false" type="button">
<i class="fas fa-bars"></i>
</button>
<ul class="nav__wrapper">
<li class="nav__item"><a href="./homepage.php">Home</a></li>
<li class="nav__item"><a href="./search.php">Search</a></li>
<li class="nav__item"><a href="./account.php">Account</a></li>
<?php
if (isset($_SESSION['uid'])) {
if ($_SESSION['uid'] == 1) {
echo '<li class="nav__item"><a href="./admin.php">Admin</a></li>';
}
}
?>
</ul>
</nav>
</div>
<div class="site-header__end">
<a class="button" href="./handlers/logoutHandler.php">Logout</a>
</div>
</div>
</header>
<!-- Header End -->
<!-- Image Slider Start-->
<div class="slider-wrapper">
<h2>Upcoming Movies</h2>
<div class="slider">
<div class="slides">
<input type="radio" name="radio-btn" id="radio1">
<input type="radio" name="radio-btn" id="radio2">
<input type="radio" name="radio-btn" id="radio3">
<input type="radio" name="radio-btn" id="radio4">
<div class="slide first">
<img src="./media/upcoming/blackclover.jpeg" height="100%" width="100%" object-fit="cover" alt="">
</div>
<div class="slide">
<img src="./media/upcoming/detective conan.png" height="100%" width="100%" object-fit="cover" alt="">
</div>
<div class="slide">
<img src="./media/upcoming/mha3.jpg" height="100%" width="100%" object-fit="cover" alt="">
</div>
<div class="slide">
<img src="./media/upcoming/josse.jpg" height="100%" width="100%" object-fit="cover" alt="">
</div>
<div class="navigation-auto">
<div class="auto-btn1"></div>
<div class="auto-btn2"></div>
<div class="auto-btn3"></div>
<div class="auto-btn4"></div>
</div>
</div>
</div>
</div>
<!-- Image Slider End-->
<!-- Genres Start -->
<div class="genre-wrapper">
<?php
foreach($movies as $genre => $content) {
if(!empty($content)) {
$movie_genre = ucwords($genre);
echo "<div class=\"genre-heading\">
<h2>$movie_genre Genre</h2>
</div>";
echo "<div class=\"genre-movies\">";
foreach($content as $movie) {
$mid = $movie['mid'];
$movie_cover_path = $movie['movie_cover_path'];
$movie_name = ucwords($movie['movie_name']);
echo "<a href=\"./play.php?mid=$mid\">
<img src=\"$movie_cover_path\" alt=\"$movie_name\">
</a>";
}
echo "</div>";
}
}
?>
</div>
<!-- Genres End -->
<!-- Footer Start -->
<footer>
<img src="./media/images/ah_logo.png">
<h3> © Made by <a href="https://www.subhashissuara.com/" target="_blank">Subhashis Suara</a> and <a href="https://github.com/AvinashKumarTiu" target="_blank">Avinash Kumar Tiu</a></h3>
</footer>
</div>
<!-- Footer End -->
<!-- JS Scripts -->
<script src="./scripts/script.js"></script>
</body>
</html>