-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuserprofile.php
56 lines (45 loc) · 1.41 KB
/
userprofile.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
<?php
session_start();
include "config/db.php";
include "templates/htmlheader.php";
if(!isset($_GET['id']))
{
echo "The page has incomplete parametes.";
return;
}
$id = $_GET['id'];
$getprofile = "select * from user where id = $id";
$result = mysqli_query($db, $getprofile);
$user = mysqli_fetch_assoc($result);
$getposts = "select count(id) from post where userid = $id";
$process = mysqli_query($db, $getposts);
$count = mysqli_fetch_assoc($process);
?>
<div class="row">
<div class="col-md-8 offset-md-2">
<h1>Profile Page</h1>
<hr>
</div>
</div>
<div class="row">
<div class="col-md-6 offset-md-2">
Last Name: <?= $user['lastname'] ?> <br>
First Name: <?= $user['firstname'] ?><br>
Middle Name: <?= $user['middlename'] ?><br>
Extension: <?= $user['extension'] ?><br>
Email: <?= $user['email'] ?><br>
Date of Birth: <?= $user['dateofbirth'] ?><br>
Number of posts: <?= $count['count(id)'] ?> <a href="searchposts.php?param=userid&id=<?= $id?>">View posts</a><br>
</div>
<div class="col-md-2">
<?php if($user['imageid'] == "") { ?>
No profile pic uploaded
<!-- <a class="btn btn-primary" href="uploadprofilepic.php?userid=<?= $user['id']?>">Upload profile image</a> -->
<?php } else { ?>
<img src="assets/profileimages/" alt="">
<?php }?>
</div>
</div>
<?php
include "templates/footer.php";
?>