-
Notifications
You must be signed in to change notification settings - Fork 19
/
profile.php
243 lines (241 loc) · 10.2 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
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<!-- Including Header PHP -->
<?php include "includes/header.php"; ?>
<?php include "includes/db.php"; ?>
<?php include "admin/includes/functions.php";?>
<!-- Navigation -->
<?php include "includes/navigation.php"; ?>
<?php
if(isset($_GET['user'])){
$get_username = $_GET['user'];
if($get_username !== ''){
$query = "SELECT * FROM users WHERE username = '{$get_username}' ";
$select_profile = mysqli_query($connection, $query);
while($row = mysqli_fetch_assoc($select_profile)){
$user_id = $row['user_id'];
$username = $row['username'];
$user_firstname = $row['user_firstname'];
$user_lastname = $row['user_lastname'];
$user_birthday = $row['user_birthday'];
$user_city = $row['user_city'];
$user_country = $row['user_country'];
$user_sex = $row['user_sex'];
$user_bio = $row['user_bio'];
$user_number = $row['user_number'];
$user_twitter = $row['user_twitter'];
$user_medium = $row['user_medium'];
$user_instagram = $row['user_instagram'];
$user_site = $row['user_site'];
$user_reg = $row['user_reg'];
$user_email = $row['user_email'];
$user_image = $row['user_image'];
$user_role = $row['user_role'];
$user_facebook = $row['user_facebook'];
$user_likes = $row['user_likes'];
$user_interests = $row['user_interests'];
$user_status = $row['user_status'];
?>
<!-- Page Content -->
<div class="container">
<div class="row">
<!-- Blog Entries Column -->
<div class="container text-center">
<div class="row">
<div class="col-sm-3 well">
<div class="well"> <img src="images/user_pic/<?php echo $user_image; ?>" class="img-circle" height="85" width="85" alt="<?php echo $username; ?>">
<br>
<a href="#" class="btn btn-danger disabled" disabled>
<?php echo $username; ?>
</a>
</p>
</div>
<div class="well">
<p>
<ul class="pagination">
<li class="disabled"><a href="#">Interests</a></li>
</ul>
</p>
<p>
<?php //select interest based on comma and generet random classs
$tags = $user_interests;
$tags = explode(',',$tags);
foreach ($tags as $tag) {
$classes = array('primary','default','success','info','warning','danger');
$class = array_rand($classes);
echo "<span class='label label-$classes[$class]'>$tag</span>";
}
?> </p>
</div>
<div class="alert alert-success fade in"> <a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<?php echo $user_bio; ?>
</div>
<?php
if ($user_site !== '') {
echo "<p><a href='http://$user_site'>Visit Website</a></p>";
}
?>
</div>
<div class="col-sm-7">
<div class="row">
<div class="col-sm-9">
<div class="panel panel-default text-left">
<div class="panel-body">
<p contenteditable="true">Status: Feeling Blue</p>
<button type="button" class="btn btn-default btn-sm"> <span class="glyphicon glyphicon-thumbs-up"></span> Like </button>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="panel text-right">
<div class="panel-body">
<button type="button" class="btn btn-default btn-sm disabled text-right"> <span class="glyphicon glyphicon-thumbs-up"></span> 8 </button>
</div>
</div>
</div>
</div>
<table class="table table-striped table-bordered table-hover">
<tbody>
<tr>
<div class="row">
<div class="well"> <b>Personal Information</b> </div>
</div>
</tr>
<tr>
<td class="text-left" width="19%"> <b>First Name</b> </td>
<td class="text-left" width="1%"> <b>:</b> </td>
<td class="text-left" width="80%">
<p>
<?php echo $user_firstname; ?>
</p>
</td>
</tr>
<tr>
<td class="text-left" width="20%"> <b>Last Name</b> </td>
<td class="text-left" width="1%"> <b>:</b> </td>
<td class="text-left" width="80%">
<p>
<?php echo $user_lastname; ?>
</p>
</td>
</tr>
<tr>
<td class="text-left" width="20%"> <b>Gander</b> </td>
<td class="text-left" width="1%"> <b>:</b> </td>
<td class="text-left" width="80%">
<p>
<?php echo $user_sex; ?>
</p>
</td>
</tr>
</tbody>
</table>
<table class="table table-striped table-bordered table-hover">
<tbody>
<tr>
<div class="row">
<div class="well"> <b>Contect Information</b> </div>
</div>
</tr>
<tr>
<td class="text-left" width="19%"> <b>Mobile</b> </td>
<td class="text-left" width="1%"> <b>:</b> </td>
<td class="text-left" width="80%">
<p>
<a href="<?php echo $user_number; ?>">
<?php echo $user_number; ?>
</a>
</p>
</td>
</tr>
<tr>
<td class="text-left" width="20%"> <b>Email</b> </td>
<td class="text-left" width="1%"> <b>:</b> </td>
<td class="text-left" width="80%">
<p>
<a href="mailto:<?php echo $user_email; ?>">
<?php echo $user_email; ?>
</a>
</p>
</td>
</tr>
<tr>
<td class="text-left" width="20%"> <b>City</b> </td>
<td class="text-left" width="1%"> <b>:</b> </td>
<td class="text-left" width="80%">
<p>
<?php echo $user_city; ?>
</p>
</td>
</tr>
<tr>
<td class="text-left" width="20%"> <b>Country</b> </td>
<td class="text-left" width="1%"> <b>:</b> </td>
<td class="text-left" width="80%">
<p>
<?php echo $user_country; ?>
</p>
</td>
</tr>
</tbody>
</table>
<table class="table table-striped table-bordered table-hover">
<tbody>
<tr>
<div class="row">
<div class="well"> <b>Bio</b> </div>
</div>
</tr>
<tr>
<td class="text-center" width="100%">
<?php echo $user_bio; ?>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-2 well">
<div class="thumbnail">
<p>Birthday:</p> <img src="images/site_icon/birthday.jpg" alt="Paris" width="400" height="300">
<p><strong>Paris</strong></p>
<p>
<?php
$date=date_create("$user_birthday");
date_add($date,date_interval_create_from_date_string("0 days"));
echo date_format($date,"l, F d Y")."</p>";
$todayDate = date('Y-m-d');
if($user_birthday == $todayDate){
echo "<button class='btn btn-primary'>Wish</button>";
}
?>
</div>
<?php
if(isset($_SESSION['username'])){
echo "<div class='well'>
<p><a href='users/user_inbox.php?source=send_msg&user_id=$user_id' class='btn btn-success'>Send Message</a></p>
</div>";
}
?>
<?php
if($user_twitter !== '' or $user_medium !== '' or $user_instagram !== '' or $user_facebook !== ''){
echo "<div class='panel'>
<p>Social Networks</p>
<a href='http://facebook.com/$user_facebook'><span><i class='fa fa-fw fa-facebook-square'></i></span></a> | <a href='http://twitter.com/$user_twitter'><span><i class='fa fa-fw fa-twitter-square'></i></span></a> | <a href='http://medium.com/$user_medium'><span><i class='fa fa-fw fa-medium'></i></span></a> | <a href='http://instagram.com/$user_instagram'><span><i class='fa fa-fw fa-instagram'></i></span></a>
</div>";
}
?> </div>
</div>
</div>
</div>
</div>
<?php
}
} else {
header("Locaton: ../index.php");
}
} else {
header("Locaton: ../index.php");
}
?>
<!-- /.row -->
<hr>
<!-- Including Footer PHP -->
<?php include "includes/footer.php"; ?>