-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile.php
More file actions
131 lines (88 loc) · 3.07 KB
/
profile.php
File metadata and controls
131 lines (88 loc) · 3.07 KB
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
<?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>Student</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 @ 2024 by <span>letsdoitbycode</span> | All Rights Reserved
</footer>
<!-- footer section ends -->
<!-- custom js file link -->
<script src="js/script.js"></script>
<!-- ChatBOT -->
<script src="https://cdn.botpress.cloud/webchat/v1/inject.js"></script>
<script src="https://mediafiles.botpress.cloud/3c62e3d2-b983-49ef-a8cf-03309bf39e0b/webchat/config.js" defer></script>
</body>
</html>