-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathuser-profile.php
170 lines (94 loc) · 3.81 KB
/
user-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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.rtl.min.css" integrity="sha384-+qdLaIRZfNu4cVPK/PxJJEy0B0f3Ugv8i482AKY7gwXwhaCroABd086ybrVKTa0q" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css" integrity="sha384-DyZ88mC6Up2uqS4h/KRgHuoeGwBcD4Ng9SiP4dIRy0EXTlnuz47vAwmeGwVChigm" crossorigin="anonymous"/>
<title>Document</title>
<link rel="stylesheet" href="assets/css/style.css">
<link rel="stylesheet" href="assets/css/profile-page.css">
<link rel="stylesheet" href="assets/css/section.css">
<link rel="stylesheet" href="assets/css/posting.css">
<link rel="stylesheet" href="assets/css/right_col.css">
<link rel="stylesheet" href="assets/css/responsive.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
</head>
<body>
<?php
include("config.php");
if(isset($_POST['target_id']))
{
$target_id = $_POST['target_id'];
$sql = "SELECT * FROM Users WHERE User_ID = $target_id;";
$stmt = $conn->prepare($sql);
if($stmt->execute())
{
$user_array = $stmt->get_result();
}
else{
header("location: home.php");
exit;
}
}
else
{
header("location: home.php");
}
?>
<header class="profile-header">
<div class="profile-container">
<?php foreach ($user_array as $array_user){?>
<div class="profile">
<div class="profile-image">
<img src="<?php echo "assets/images/profiles/".$array_user['IMAGE'] ?>" alt="profile picture">
</div>
<div class="profile-user-settings">
<h1 class="profile-user-name"><?php echo $array_user['USER_NAME'] ?></h1>
</div>
<div class="profile-status">
<ul>
<li><span class="profile-status-count"><?php echo $array_user['POSTS'] ?></span> Posts</li>
<li><span class="profile-status-count"><?php echo $array_user['FALLOWING'] ?></span> Fallowing</li>
<li><span class="profile-status-count"><?php echo $array_user['FALLOWERS'] ?></span> Followers</li>
</ul>
</div>
<div class="social">
<ul>
<li><i class="fas fa-envelope"></i><a href="<?php echo $array_user['EMAIL'] ?>" id="email_id">Email</a></li>
<li><i class="fab fa-facebook-square"></i><a href="<?php echo $array_user['FACEBOOK'] ?>" id="email_id">Facebook</a></li>
<li><i class="fab fa-whatsapp-square"></i><a href="<?php echo $array_user['WHATSAPP'] ?>" id="email_id">Whatsapp</a></li>
</ul>
</div>
<div class="profile-bio">
<p><span class="profile-real-name"><?php echo $array_user['FULL_NAME'] ?></span><?php echo " ".$array_user['BIO'] ?></p>
</div>
<form action="">
<button type="submit" class="fallow-btns">Fallow</button>
</form>
<?php }?>
</div>
</div>
</header>
<!-- design photo gallery -->
<main>
<div class="profile-container">
<div class="gallery">
<?php include('get_targetPosts.php')?>
<?php foreach ($posts as $post){?>
<div class="gallery-items">
<img src="<?php echo "./assets/images/posts/".$post['Img_Path'];?>" alt="post" class="gallery-img">
<div class="gallery-item-info">
<ul>
<li class="gallery-items-likes"><span class="hide-gallery-elements">Reactions : <?php echo $post['Likes'];?></span>
<i class="icon fas fa-thumbs-up"></i>
</li><br>
</ul>
</div>
</div>
<?php }?>
</div>
</div>
</main>
</body>
</html>