-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
203 lines (162 loc) · 6.72 KB
/
home.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<?php
include 'components/connect.php';
if(isset($_COOKIE['user_id'])){
$user_id = $_COOKIE['user_id'];
}else{
$user_id = '';
}
$select_likes = $conn->prepare("SELECT * FROM `likes` WHERE user_id = ?");
$select_likes->execute([$user_id]);
$total_likes = $select_likes->rowCount();
$select_comments = $conn->prepare("SELECT * FROM `comments` WHERE user_id = ?");
$select_comments->execute([$user_id]);
$total_comments = $select_comments->rowCount();
$select_bookmark = $conn->prepare("SELECT * FROM `bookmark` WHERE user_id = ?");
$select_bookmark->execute([$user_id]);
$total_bookmarked = $select_bookmark->rowCount();
?>
<!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>home</title>
<!-- font awesome cdn link -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css">
<!-- custom css file link -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<?php include 'components/user_header.php'; ?>
<!-- quick select section starts -->
<section class="quick-select">
<h1 class="heading">quick options</h1>
<div class="box-video">
<h1 class="heading1">Video Courses</h1>
<div class="container">
<div class="video-container">
<div class="video-youtube">
<img src="https://img.youtube.com/vi/dQw4w9WgXcQ/hqdefault.jpg" alt="Video Thumbnail" class="thumbnail">
<a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ" target="_blank">
<div class="play-button"></div>
</a>
<div class="card-content">
<h3>Never Gonna Give You Up</h3>
<a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ" target="_blank">Watch on YouTube</a>
</div>
</div>
<div class="video-youtube">
<img src="https://img.youtube.com/vi/dQw4w9WgXcQ/hqdefault.jpg" alt="Video Thumbnail" class="thumbnail">
<a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ" target="_blank">
<div class="play-button"></div>
</a>
<div class="card-content">
<h3>Never Gonna Give You Up</h3>
<a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ" target="_blank">Watch on YouTube</a>
</div>
</div>
<div class="video-youtube">
<img src="https://img.youtube.com/vi/dQw4w9WgXcQ/hqdefault.jpg" alt="Video Thumbnail" class="thumbnail">
<a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ" target="_blank">
<div class="play-button"></div>
</a>
<div class="card-content">
<h3>Never Gonna Give You Up</h3>
<a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ" target="_blank">Watch on YouTube</a>
</div>
</div>
</div>
</div><br>
</div>
<div class="box-container">
<?php
if($user_id != ''){
?>
<div class="box">
<h3 class="title">Available Courses</h3>
<p>Select the appropriate university to view on the courses.</p>
<a href="University_list.php" class="inline-btn">get started</a>
</div>
<?php
}else{
?>
<div class="box" style="text-align: center;">
<h3 class="title">please login or register</h3>
<div class="flex-btn" style="padding-top: .5rem;">
<a href="login.php" class="option-btn">login</a>
<a href="register.php" class="option-btn">register</a>
</div>
</div>
<?php
}
?>
<div class="box">
<h3 class="title">top categories</h3>
<div class="flex">
<a href="search_course.php?"><i class="fas fa-code"></i><span>development</span></a>
<a href="#"><i class="fas fa-chart-simple"></i><span>business</span></a>
<a href="#"><i class="fas fa-pen"></i><span>design</span></a>
<a href="#"><i class="fas fa-chart-line"></i><span>marketing</span></a>
<a href="#"><i class="fas fa-music"></i><span>music</span></a>
<a href="#"><i class="fas fa-camera"></i><span>photography</span></a>
<a href="#"><i class="fas fa-cog"></i><span>software</span></a>
<a href="#"><i class="fas fa-vial"></i><span>science</span></a>
</div>
</div>
<div class="box">
<h3 class="title">popular topics</h3>
<div class="flex">
<a href="#"><i class="fab fa-html5"></i><span>HTML</span></a>
<a href="#"><i class="fab fa-css3"></i><span>CSS</span></a>
<a href="#"><i class="fab fa-js"></i><span>javascript</span></a>
<a href="#"><i class="fab fa-react"></i><span>react</span></a>
<a href="#"><i class="fab fa-php"></i><span>PHP</span></a>
<a href="#"><i class="fab fa-bootstrap"></i><span>bootstrap</span></a>
</div>
</div>
</div>
</section>
<!-- quick select section ends -->
<!-- courses section starts -->
<section class="courses">
<h1 class="heading">latest courses</h1>
<div class="box-container">
<?php
$select_courses = $conn->prepare("SELECT * FROM `playlist` WHERE status = ? ORDER BY date DESC LIMIT 6");
$select_courses->execute(['active']);
if($select_courses->rowCount() > 0){
while($fetch_course = $select_courses->fetch(PDO::FETCH_ASSOC)){
$course_id = $fetch_course['id'];
$select_tutor = $conn->prepare("SELECT * FROM `tutors` WHERE id = ?");
$select_tutor->execute([$fetch_course['tutor_id']]);
$fetch_tutor = $select_tutor->fetch(PDO::FETCH_ASSOC);
?>
<div class="box">
<div class="tutor">
<img src="uploaded_files/<?= $fetch_tutor['image']; ?>" alt="">
<div>
<h3><?= $fetch_tutor['name']; ?></h3>
<span><?= $fetch_course['date']; ?></span>
</div>
</div>
<img src="uploaded_files/<?= $fetch_course['thumb']; ?>" class="thumb" alt="">
<h3 class="title"><?= $fetch_course['title']; ?></h3>
<a href="playlist.php?get_id=<?= $course_id; ?>" class="inline-btn">view playlist</a>
</div>
<?php
}
}else{
echo '<p class="empty">no courses added yet!</p>';
}
?>
</div>
<div class="more-btn">
<a href="courses.php" class="inline-option-btn">view more</a>
</div>
</section>
<!-- courses section ends -->
<!-- custom js file link -->
<script src="js/script.js"></script>
</body>
</html>