-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyprofile.php
467 lines (378 loc) · 16.9 KB
/
myprofile.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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
<!DOCTYPE html>
<html>
<title>Haritha Hara</title>
<link rel="icon" href="nitc.png">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://www.w3schools.com/lib/w3-theme-blue-grey.css">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Open+Sans'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/as.css">
<style>
html, body, h1, h2, h3, h4, h5 {font-family: "Open Sans", sans-serif}
</style>
<body class="w3-theme-l5">
<?php
$username='deshank';
include_once('db-connect.php');
$sql = "SELECT username,name,email,mobile,address,location,coordinator,postalcode,image_id
FROM userdetails
where username='$username'";
$result= mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
$name=$row['name'];
$email=$row['email'];
$address=$row['address'];
$image_id=$row['image_id'];
}
}
?>
<!-- Navbar -->
<div class="w3-top">
<div class="w3-bar w3-theme-d2 w3-left-align w3-large">
<a class="w3-bar-item w3-button w3-hide-medium w3-hide-large w3-right w3-padding-large w3-hover-white w3-large w3-theme-d2" href="javascript:void(0);" onclick="openNav()"><i class="fa fa-bars"></i></a>
<a href="home.php" class="w3-bar-item w3-button w3-padding-large w3-theme-d4"><i class="fa fa-tree w3-margin-right"></i>Haritha Hara</a>
<a href="#" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white" title="News"><i class="fa fa-globe"></i></a>
<a href="myprofile.php" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white" title="Account Settings"><i class="fa fa-user"></i></a>
<a href="challenge.php" class="w3-bar-item w3-button w3-hide-small w3-padding-large w3-hover-white" title="Messages"><i class="fa fa-refresh"></i></a>
<div class="w3-dropdown-hover w3-hide-small">
<button class="w3-button w3-padding-large" title="Notifications" onclick="location='Notification.php'"><i class="fa fa-bell"></i><span class="w3-badge w3-right w3-small w3-green"></span></button>
</div>
<a href="#" class="w3-bar-item w3-button w3-hide-small w3-right w3-padding-large w3-hover-white" title="My Account">
<?php echo "<img src= 'pic/".$image_id."'"." width='25' height='25' class='w3-circle'/>" ; ?>
</a>
</div>
</div>
<!-- Navbar on small screens -->
<div id="navDemo" class="w3-bar-block w3-theme-d2 w3-hide w3-hide-large w3-hide-medium w3-large">
<a href="#" class="w3-bar-item w3-button w3-padding-large">Link 1</a>
<a href="#" class="w3-bar-item w3-button w3-padding-large">Link 2</a>
<a href="#" class="w3-bar-item w3-button w3-padding-large">Link 3</a>
<a href="#" class="w3-bar-item w3-button w3-padding-large">My Profile</a>
</div>
<!-- Page Container -->
<div class="w3-container w3-content" style="max-width:1400px;margin-top:80px">
<!-- The Grid -->
<div class="w3-row">
<!-- Left Column -->
<!-- Profile -->
<div class="w3-card w3-round w3-white" style="background-image:url(pic/profilebanner.jpg)">
<div class="w3-container">
<h3 class="w3-center"> <B>My Profile</B></h3>
<p class="w3-center"> <?php echo "<img src= 'pic/".$image_id."'"." width='106' height='125' class='w3-circle'/>" ; ?> </p>
<b>
<p class="w3-center" ><i class="fa fa-pencil fa-fw w3-margin-right w3-text-theme"></i> <?php echo $name; ?></p>
<p class="w3-center" ><i class="fa fa-home fa-fw w3-margin-right w3-text-theme"></i> <?php echo $address; ?></p>
<p class="w3-center" ><i class="fa fa-envelope fa-fw w3-margin-right w3-text-theme"></i> <?php echo $email; ?></p>
</b>
</div>
<br>
<div class="w3-col m3">
<!-- Accordion -->
<div class="w3-card w3-round">
<div class="w3-white">
<button onclick="myFunction('Demo1')" class="w3-button w3-block w3-theme-l1 w3-left-align"><i class="fa fa-circle-o-notch fa-fw w3-margin-right"></i> My Groups</button>
<div id="Demo1" class="w3-hide w3-container">
<p>Some text..</p>
</div>
<button onclick="myFunction('Demo2')" class="w3-button w3-block w3-theme-l1 w3-left-align"><i class="fa fa-calendar-check-o fa-fw w3-margin-right"></i> My Events</button>
<div id="Demo2" class="w3-hide w3-container">
<p>Some other text..</p>
</div>
<button onclick="" class="w3-button w3-block w3-theme-l1 w3-left-align"><i class="fa fa-users fa-fw w3-margin-right"></i> My Photos</button>
<div id="Demo3" class="w3-hide w3-container">
<div class="w3-row-padding">
<br>
</div>
</div>
</div>
</div>
<br>
<!-- Alert Box -->
<div class="w3-container w3-display-container w3-round w3-theme-l4 w3-border w3-theme-border w3-margin-bottom w3-hide-small">
<span onclick="this.parentElement.style.display='none'" class="w3-button w3-theme-l3 w3-display-topright">
<i class="fa fa-remove"></i>
</span>
<p><strong>Daily Quote</strong></p>
<p>Progress is impossible without change, and those who cannot change their minds cannot change anything.</p>
</div>
<!-- Alert Box -->
<div class="w3-container w3-display-container w3-round w3-theme-l4 w3-border w3-theme-border w3-margin-bottom w3-hide-small">
<span onclick="this.parentElement.style.display='none'" class="w3-button w3-theme-l3 w3-display-topright">
<i class="fa fa-remove"></i>
</span>
<p><strong>Week Quote</strong></p>
<p>The Earth is what we all have in common. <br> — Wendell Berr -</p>
</div>
<!-- End Left Column -->
</div>
</div>
<!-- Middle Column -->
<div class="w3-col m7">
<div class="w3-row-padding">
<div class="w3-col m12">
<div class="w3-card w3-round w3-white">
<div class="w3-container w3-padding">
<h6 class="w3-opacity">Feel Free to share your Ideas</h6>
<form action="addpost.php" method="POST" enctype="multipart/form-data">
<input type="text" class="w3-border w3-padding" name="post" placeholder="Write Something..........." style="width: 100%"> </p>
<input type="hidden" name="MAX_FILE_SIZE" value="512000" />
<input type ="file" name="photo1" id="photo" class="w3-button w3-theme">
<input type ="file" name="photo2" id="photo" class="w3-button w3-theme">
<input type="submit" value="Submit" class="w3-button w3-theme" >
</form>
</div>
</div>
</div>
</div>
<!-- taking post details from dataset -->
<?php
$sql2 = "SELECT postdetails.username,post_id,picture,text,postdetails.location,time,picture2,userdetails.name,image_id,posttype
FROM postdetails , userdetails
Where postdetails.username=userdetails.username and postdetails.username='$username'
ORDER BY time DESC ;" ;
$result= mysqli_query($conn, $sql2);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
$name=$row['name'];
$image_id1=$row['picture'];
$image_id2=$row['picture2'];
$text=$row['text'];
$location=$row['location'];
$time=$row['time'];
$image_id=$row['image_id'];
$zero='null';
$post=$row['post_id'];
$posttype=$row['posttype'];
if ($image_id2 == $zero && $image_id1 != $zero){
?>
<div class="w3-container w3-card w3-white w3-round w3-margin"><br>
<?php echo "<img src= 'pic/".$image_id."'"." width='40' class='w3-circle'/>" ; ?>
<span class="w3-right w3-opacity"><?php echo $time; ?></span>
<b> <?php echo $name; ?></b><br>
<hr class="w3-clear">
<p><?php echo $text; ?></p>
<?php echo "<img src= 'pic/".$image_id1."'"." width='100%' height='500' class='w3-margin-bottom'>" ; ?>
<br>
<hr><hr>
<div style="background-color:#E0E0E0 ;padding: 20px ; border: 1px">
<!-- comment retrieving from the database and echo -->
<?php
$sql3 = "SELECT comment,time,comment.username,name,image_id
FROM comment,userdetails
Where comment.post_id='$post' AND comment.username=userdetails.username
ORDER BY time DESC" ;
$result5= mysqli_query($conn, $sql3);
if (mysqli_num_rows($result5) > 0) {
while($row = mysqli_fetch_assoc($result5)) {
$time2=$row['time'];
$image_idcomment=$row['image_id'];
$text1=$row['comment'];
$namecom=$row['name'];
?>
<?php echo "<img src= 'pic/".$image_idcomment."'"." width='20' class='w3-circle'/>" ; echo $namecom; ?>
<span class="w3-right w3-opacity"><?php echo $time2; ?></span>
<p><?php echo $text1; ?> </p>
<?php
}
}
?></div>
<form action="addcomment.php" method="POST" enctype="multipart/form-data">
<input type="text" class="w3-border w3-padding" name="comment" placeholder="Comment Something..........." style="width: 100%"> </p>
<input type="hidden" name="username" value=<?php echo $username ?> >
<input type="hidden" name="postid" value=<?php echo $post ?> >
<button type="submit" class="w3-button w3-theme-d2 w3-margin-bottom"><i class="fa fa-comment"></i> Comment</button>
</form>
</div>
<?php
}
elseif ($image_id1 == $zero){
?>
<div class="w3-container w3-card w3-white w3-round w3-margin"><br>
<?php echo "<img src= 'pic/".$image_id."'"." width='40' class='w3-circle'/>" ; ?>
<span class="w3-right w3-opacity"><?php echo $time; ?></span>
<b> <?php echo $name; ?></b><br>
<hr class="w3-clear">
<p><?php echo $text; ?></p>
<hr><hr>
<div style="background-color:#E0E0E0 ;padding: 20px ; border: 1px"> <!-- comment retrieving from the database and echo -->
<?php
$sql3 = "SELECT comment,time,comment.username,name,image_id
FROM comment,userdetails
Where comment.post_id='$post' AND comment.username=userdetails.username
ORDER BY time DESC" ;
$result5= mysqli_query($conn, $sql3);
if (mysqli_num_rows($result5) > 0) {
while($row = mysqli_fetch_assoc($result5)) {
$time2=$row['time'];
$image_idcomment=$row['image_id'];
$text1=$row['comment'];
$namecom=$row['name'];
?>
<?php echo "<img src= 'pic/".$image_idcomment."'"." width='20' class='w3-circle'/>" ; echo " "; echo $namecom; ?>
<span class="w3-right w3-opacity"><?php echo $time2; ?></span>
<p><?php echo $text1; ?> </p>
<?php
}
}
?>
</div>
<form action="addcomment.php" method="POST" enctype="multipart/form-data">
<input type="text" class="w3-border w3-padding" name="comment" placeholder="Comment Something..........." style="width: 100%"> </p>
<input type="hidden" name="username" value=<?php echo $username ?> >
<input type="hidden" name="postid" value=<?php echo $post ?> >
<button type="submit" class="w3-button w3-theme-d2 w3-margin-bottom"><i class="fa fa-comment"></i> Comment</button>
</form>
</div>
<?php
}
else{
?>
<div class="w3-container w3-card w3-white w3-round w3-margin"><br>
<?php echo "<img src= 'pic/".$image_id."'"." width='40' class='w3-circle'/>" ; ?>
<span class="w3-right w3-opacity"><?php echo $time; ?></span>
<b> <?php echo $name; ?></b><br>
<hr class="w3-clear">
<p><?php echo $text; ?></p>
<div class="w3-row-padding" style="margin:0 -16px">
<div class="w3-half">
<?php echo "<img src= 'pic/".$image_id1."'"." width='100%' class='w3-margin-bottom'>" ; ?>
</div>
<div class="w3-half">
<?php echo "<img src= 'pic/".$image_id2."'"." width='100%' class='w3-margin-bottom'>" ; ?>
</div>
</div>
<hr><hr>
<div style="background-color:#E0E0E0 ;padding: 20px ; border: 1px">
<!-- comment retrieving from the database and echo -->
<?php
$sql3 = "SELECT comment,time,comment.username,name,image_id
FROM comment,userdetails
Where comment.post_id='$post' AND comment.username=userdetails.username
ORDER BY time DESC" ;
$result5= mysqli_query($conn, $sql3);
if (mysqli_num_rows($result5) > 0) {
while($row = mysqli_fetch_assoc($result5)) {
$time2=$row['time'];
$image_idcomment=$row['image_id'];
$text1=$row['comment'];
$namecom=$row['name'];
?>
<?php echo "<img src= 'pic/".$image_idcomment."'"." width='20' class='w3-circle'/>" ; echo $namecom; ?>
<span class="w3-right w3-opacity"><?php echo $time2; ?></span>
<p><?php echo $text1; ?> </p>
<?php
}
}
?>
</div>
<form action="addcomment.php" method="POST" enctype="multipart/form-data">
<input type="text" class="w3-border w3-padding" name="comment" placeholder="Comment Something..........." style="width: 100%"> </p>
<input type="hidden" name="username" value=<?php echo $username ?> >
<input type="hidden" name="postid" value=<?php echo $post ?> >
<button type="submit" class="w3-button w3-theme-d2 w3-margin-bottom"><i class="fa fa-comment"></i> Comment</button>
</form>
</div>
<?php
}
}
}
?>
<!-- End Middle Column -->
</div>
<!-- Right Column -->
<div class="w3-col m2">
<div class="w3-card w3-round w3-white w3-center">
<div class="w3-container">
<p>Upcoming Events:</p>
<img src="pic/blog-2.jpg" alt="Forest" style="width:100%;">
<p><strong>Holiday - Activity</strong></p>
<p>Friday 27<sup>th</sup> 15:00</p>
<p><button class="w3-button w3-block w3-theme-l4">Info</button></p>
</div>
</div>
<br>
<?php
$sql = "SELECT username,image_id,name
FROM userdetails
where username
not in(
select followee
from followtable
where follower='$username' )
limit 2;" ;
$result= mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
if($row['username'] != $username){
$namefollow=$row['name'];
$image_idfollow=$row['image_id'];
$followee_username=$row['username'];
?> <div class="w3-container w3-display-container w3-round w3-theme-l4 w3-border w3-theme-border w3-margin-bottom w3-hide-small">
<span onclick="this.parentElement.style.display='none'" class="w3-button w3-theme-l3 w3-display-topright">
<i class="fa fa-remove"></i>
</span>
<div class="w3-container">
<p><h5>Follow</h5></p>
<?php echo "<img src= 'pic/".$image_idfollow."'"." width='50%' class='w3-circle'/>" ; ?><br>
<span><?php echo $namefollow; ?></span>
<div class="w3-row w3-opacity">
<div class="w3-half">
<form action="follow.php" method="POST">
<input type="hidden" name="follower" value=<?php echo $username ?>>
<input type="hidden" name="followee" value=<?php echo $followee_username ?>>
<button class="w3-button w3-block w3-green w3-section" title="Accept"><i class="fa fa-check"></i></button>
</form>
</div>
</div>
</div>
</div>
<br>
<?php
}
}
}
?>
<div class="w3-card w3-round w3-white w3-padding-32 w3-center">
<p><i class="fa fa-bug w3-xxlarge"></i></p>
<p>For Any Technical issue <br> <br>--Contact-- <br> Team Incredible_6 <br>8137027213</p>
</div>
<!-- End Right Column -->
</div>
<!-- End Grid -->
</div>
<!-- End Page Container -->
</div>
<br>
<!-- Footer -->
<footer class="w3-container w3-theme-d5">
<center>
<p>Powered by Incredible_6 SIH Grand Finale</a></p></center>
</footer>
<script>
// Accordion
function myFunction(id) {
var x = document.getElementById(id);
if (x.className.indexOf("w3-show") == -1) {
x.className += " w3-show";
x.previousElementSibling.className += " w3-theme-d1";
} else {
x.className = x.className.replace("w3-show", "");
x.previousElementSibling.className =
x.previousElementSibling.className.replace(" w3-theme-d1", "");
}
}
// Used to toggle the menu on smaller screens when clicking on the menu button
function openNav() {
var x = document.getElementById("navDemo");
if (x.className.indexOf("w3-show") == -1) {
x.className += " w3-show";
} else {
x.className = x.className.replace(" w3-show", "");
}
}
</script>
</body>
</html>