-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.php
126 lines (85 loc) · 2.99 KB
/
profile.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
<?php
include 'components/connect.php';
if(isset($_COOKIE['user_id'])){
$user_id = $_COOKIE['user_id'];
}else{
$user_id = '';
header('location:login.php');
}
$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>profile</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'; ?>
<section class="profile">
<h1 class="heading">profile details</h1>
<div class="details">
<div class="user">
<img src="uploaded_files/<?= $fetch_profile['image']; ?>" alt="">
<h3><?= $fetch_profile['name']; ?></h3>
<p>mentee</p>
<a href="update.php" class="inline-btn">update profile</a>
</div>
<div class="box-container">
<div class="box">
<div class="flex">
<i class="fas fa-bookmark"></i>
<div>
<h3><?= $total_bookmarked; ?></h3>
<span>saved playlists</span>
</div>
</div>
<a href="#" class="inline-btn">view playlists</a>
</div>
<div class="box">
<div class="flex">
<i class="fas fa-heart"></i>
<div>
<h3><?= $total_likes; ?></h3>
<span>liked tutorials</span>
</div>
</div>
<a href="#" class="inline-btn">view liked</a>
</div>
<div class="box">
<div class="flex">
<i class="fas fa-comment"></i>
<div>
<h3><?= $total_comments; ?></h3>
<span>video comments</span>
</div>
</div>
<a href="#" class="inline-btn">view comments</a>
</div>
</div>
</div>
</section>
<!-- profile section ends -->
<!-- footer section starts -->
<footer class="footer">
© copyright @ 2022 by <span>mr. web designer</span> | all rights reserved!
</footer>
<!-- footer section ends -->
<!-- custom js file link -->
<script src="js/script.js"></script>
</body>
</html>