-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyAccount.php
More file actions
executable file
·173 lines (163 loc) · 7.7 KB
/
myAccount.php
File metadata and controls
executable file
·173 lines (163 loc) · 7.7 KB
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
<?php
include __DIR__ . "/base_url.php";
include __DIR__ . "/controller/RouteController.php";
include __DIR__ . "/controller/AuthController.php";
include __DIR__ . "/main/userDetails.php";
checkUserIsLoggedIn();
$_SESSION['active'] = null;
$pageName = "My Account";
getHead(true, $pageName);
getNavbar(true);
?>
<div class="clearfix mb-5" style="background-color: #EEEEEE;">
<div class="float-left">
<div class="accountLeftContainer">
<div class="accountLeftPic">
<div class="row">
<div class="col">
<img src="<?php
if (isset($profileImage)) {
echo APP_URL . "/uploads/" . $profileImage;
} else {
echo APP_URL . "/public/img/profilePic.jpg";
}
?>" alt="profile pic" height="70px" width="70px" class="rounded-circle">
</div>
<div class="col">
<span class="cH2"><?= ucwords($name) ?></span>
</div>
</div>
</div>
<div class="boxBottom">
<a href="#" onclick="openTapMyAccount('myProfileId', 'My Profile')">
<img src="public/img/profile.png" alt="">
<span class="cH3">My Profile</span>
</a>
</div>
<br><br>
<div class="boxBottom">
<a href="#" onclick="openTapMyAccount('changePasswordId', 'Change Password')">
<img src="public/img/changePassword.png" alt="">
<span class="cH3">Change Password</span>
</a>
</div>
<br><br>
<div class="boxBottom">
<a href="">
<img src="public/img/signOut.png" alt="">
<a href="<?= APP_URL ?>/logout.php">Sign Out</a>
</a>
</div>
</div>
</div>
<div class="accountRightContainer mb-5">
<span class="cH1" id="title">My Profile</span>
<br> <br>
<?php
if (isset($msg)) {
echo '<div class="alert alert-danger h5">
<p>' . $msg . '</p>
</div>';
}
if (isset($_SESSION['msg_update'])) {
echo '<div class="alert alert-warning alert-dismissible fade show h5">
<p>' . $_SESSION['msg_update'] . '</p>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>';
}
?>
<div class="myProfile formSize tabContent" id="myProfileId">
<form class="mb-5 h5" id="update-form" method="POST" enctype="multipart/form-data" action="main/userDetails.php">
<input type="hidden" name="user-id" value="<?= ucwords($userId) ?>">
<div style="text-align: center;">
<img src="<?php
if (isset($profileImage)) {
echo APP_URL . "/uploads/" . $profileImage;
} else {
echo APP_URL . "/public/img/profilePic.jpg";
}
?>" alt="profile pic" height="150px" width="150px" class="rounded-circle" id="profilePic">
<br><br><br>
<!-- <div class="fileChoosenContainer mx-auto" style="width: 350px;">
<div class="form-inline">
<div class="form-group mb-2">
<input type="file" class="form-control-file" id="profilePictureInput" accept="image/*" onchange="uploadProfilePicture()" name="profile-pic" value="<?= ucwords($profileImage) ?>">
<input type="hidden" value="<?= ucwords($profileImage) ?>" name="profile-pic-name"/>
</div>
</div>
</div> -->
</div>
<div class="row">
<div class="col">
<label>Full Name</label>
<input type="text" class="form-control" name="name" value="<?= ucwords($name) ?>">
</div>
</div>
<div class="row mt-3">
<div class="col">
<label>Phone Number</label>
<input type="tel" class="form-control" placeholder="Phone Number" value="<?= ucwords($phone) ?>" name="phone">
</div>
<div class="col">
<label>Email address</label>
<input type="email" class="form-control" id="email" aria-describedby="emailHelp" name="email" value="<?= ucwords($email) ?>" readonly>
</div>
</div>
<div class="row mb-4 mt-3">
<div class="col">
<label>Address</label>
<textarea class="form-control" id="address" rows="3" name="address"><?= ucwords($address) ?></textarea>
</div>
</div>
<br><br>
<label class="h4">Kin Details</label>
<div class="row">
<div class="col">
<label class="h5">Your Name</label>
<input type="text" class="form-control" placeholder="Name" name="kin-name" value="<?= ucwords($kinName) ?>">
</div>
<div class="col">
<label class="h5">Phone Number</label>
<input type="tel" class="form-control" placeholder="phone number" name="kin-phone" value="<?= ucwords($kinPhone) ?>">
</div>
</div>
<br>
<div class="form-group">
<label class="h5">Email address</label>
<input type="email" class="form-control" id="kin-email" aria-describedby="emailHelp" name="kin-email" value="<?= ucwords($kinEmail) ?>">
</div>
<br><br>
<button type="submit" form="update-form" class="btn btn-success btn-lg btn-block" name="submit-update">Update</button>
</form>
</div>
<div class="changePassword formSize tabContent" id="changePasswordId">
<form method="POST">
<input type="hidden" name="user-id" value="<?= ucwords($userId) ?>">
<div class="form-group">
<label>Current Password</label>
<input type="password" class="form-control" id="password" name="password">
</div>
<div class="form-group">
<label>New Password</label>
<input type="password" class="form-control" id="newPassword" name="new-password">
</div>
<div class="form-group">
<label>Confirm Password</label>
<input type="password" class="form-control" id="confirmPassword" name="confirm-password">
</div>
<button type="submit" name="change_password" class="btn btn-success btn-lg btn-block">Change Password</button>
</form>
</div>
</div>
</div>
<?php
getFooter(true);
?>
<script src="<?= APP_URL ?>/function/script.js"></script>
<script>
$(function() {
openTapMyAccount('myProfileId', 'My Profile')
});
</script>