-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.php
81 lines (78 loc) · 2.64 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
<?php
$pageTitle = 'Profile Page';
$cssLink = "CSS/profile.css";
require_once './ProductClass.php';
require_once './ImageClass.php';
include './header.php';
$usersProducts = Product::findUsersProducts($currentUser->userID);
$profilePic = Image::findImageByID($currentUser->profile_pic);
if (!$loggedIn) {
header("Location: index.php");
}
//var_dump($usersProducts);
?>
<section>
<h1>Welcome, <?php echo $currentUser->username ?></h1>
<hr>
</section>
<section id="personalInformation">
<div class="titleBar">
<h2>Personal Information
<span class="profile-options">
<a href="editProfile.php">
<img src="images/icons/edit-pencil.png">Edit</a>
</span>
</h2>
</div>
<div id="profileImgBox" >
<img src="<?php echo $profilePic ?>"/>
</div>
<div id="informationBox">
<ul style="border-left: solid 1px black;">
<li><h3>First Name: <?php echo $currentUser->firstName ?></h3></li><br>
<li><h3>Last Name: <?php echo $currentUser->lastName ?> </h3></li><br>
<li><h3>Account Type: <?php echo $currentUser->type ?></h3></li><br>
</ul>
<a class="button" id="deleteButton"
href="deleteAccount.php?id=<?php echo $currentUser->userID; ?>"
onclick="return confirm('Are you sure you want to delete your account?')">
<p style="margin:5px">
Delete Account
<img src="images/icons/garbage-can.png" class="iconImg"/>
</p>
</a>
</div>
</section>
<section id="myRecentProducts" >
<div class="titleBar">
<h2>
My Recent Products
<span class="profile-options">
<a href="viewUserProducts.php?id=<?php echo $currentUser->userID; ?>"><img src="images/icons/list.png"/>View all </a>
</span>
</h2>
</div>
<?php if (count($usersProducts) != 0) { ?>
<div class="rowContainer">
<!--<ul>-->
<?php
for ($i = 0; $i < count($usersProducts); $i++) {
if ($i > 3) {
break;
}
?>
<div class="productBox">
<img style="" src="<?php echo $usersProducts[$i]["reference"] ?>" alt="" />
</div>
<?php } ?>
<!--</ul>-->
</div>
<?php } ?>
<a class="button" style="float: right" href="addProduct.php">
<p style="margin:5px">
Add Product
<img src="images/icons/plus-sign.png" style="width:17px;height:20px;" />
</p>
</a>
</section>
<?php include './footer.php'; ?>