-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprofile.php
executable file
·183 lines (154 loc) · 7.66 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
<?php
session_start();
if(!isset($_SESSION['userId'])){
header("Location: login.php");
}
spl_autoload_register(function($name){
$name = strtolower($name);
require_once(getcwd()."/logic/classes/$name.class.php");
});
$user = new Reader($_SESSION['userId']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap"
rel="stylesheet"
/>
<link
rel="icon"
href="assets/img/logo.svg"
type="image/svg"
sizes="16x16"
/>
<link rel="stylesheet" href="./assets/css/style.css" />
<script
src="https://kit.fontawesome.com/1239ccb1ec.js"
crossorigin="anonymous"
></script>
<script src="assets/js/main.js"></script>
<title>Pangaea</title>
</head>
<body>
<!-- html files will be injected into the divs defined here-->
<div id="navbar"></div>
<!-- JS file injections-->
<script>
$(function () {
$("#navbar").load("./components/navbar.php");
});
</script>
<form enctype="multipart/form-data" method="POST" id='avatar-form'>
<input type="file" name="profile-pic" class="hidden" id="file-add" name="profileImage">
</form>
<form enctype="multipart/form-data" method="POST" id="profile-details">
<div class=" w-11/12 lg:w-6/12 mx-auto flex flex-col p-6 border rounded-sm mt-6 shadow text-gray-500 mb-6">
<div class="flex flex-col justify-center items-center mb-3">
<div id="fallback-avatar">
<i class="fas fa-user-circle m-2 text-blue-400 text-9xl mx-2"></i>
</div>
<div id="avatar-div" class="hidden w-24 h-24 overflow-hidden rounded-full border shadow-lg mb-2">
<img id="avatar" src="assets/img/larry.jpeg" class="w-full h-full object-cover" alt="">
</div>
<button
type="button"
id="change-btn"
class="rounded text-white bg-blue-500 py-2 px-4 text-xs font-bold"
>
Change
</button>
</div>
<div class="flex flex-row p-2 mb-4 rounded-sm justify-between">
<div class="flex flex-col">
<span class="text-xs font-bold mb-1">firstname</span>
<input name="firstname" placeholder="Firstname" type="text" class="text-md p-2 border focus:outline-none rounded" value="<?php
echo $user->getFirstName();
?>" autofocus>
</div>
<div class="flex flex-col">
<span class="text-xs font-bold mb-1">lastname</span>
<input name="lastname" placeholder="Lastname" type="text" class="text-md p-2 border focus:outline-none rounded" value="<?php
echo $user->getLastName();
?>" >
</div>
</div>
<div class="flex flex-col p-2 mb-4 rounded-sm">
<span class="text-xs font-bold mb-1">email</span>
<input name="email" placeholder="Your email" type="email" class="text-md p-2 border focus:outline-none rounded" value="<?php
echo $user->getEmail();
?>" >
</div>
<div class="flex flex-row p-2 mb-4 rounded-sm justify-between">
<div class="flex flex-col">
<span class="text-xs font-bold mb-2">old password</span>
<input type="password" class="text-md p-2 border focus:outline-none rounded" name="old-password" placeholder="Enter old password">
<span class="text-red-500" id="password-error"></span>
</div>
<div class="flex flex-col">
<span class="text-xs font-bold mb-2">new password</span>
<input type="password" class="text-md mb-2 p-2 border focus:outline-none rounded" name="new-password" placeholder="Enter a new password">
<span class="text-xs font-bold mb-2">confirm password</span>
<input type="password" class="text-md p-2 border focus:outline-none rounded" name="password-confirmation" placeholder="Confirm password">
</div>
</div>
<div class="flex flex-col p-2 mb-4 rounded-sm">
<span class="text-xs font-bold mb-1">mpesa number</span>
<input name="phone-number" placeholder="Your phone number" type="text" class="text-md p-2 border focus:outline-none rounded" value="<?php echo $user->getPhoneNumber() ?>" >
</div>
<div class="flex flex-row justify-end mb-3">
<button
id="save-btn"
type="submit"
class="rounded text-white bg-blue-500 py-2 px-4 text-xs font-bold"
>
Save
</button>
</div>
</div>
</form>
<!-- <div class="flex flex-col sm:flex bg-gray-100 rounded-md w-full sm:w-8/12 sm:mx-auto sm:mt-6 shadow overflow-hidden mb-10">
<div class="mx-20 m-12">
<img src="assets\img\larry.jpeg" alt="" srcset="" class="rounded-full h-24 w-24">
</div>
<div class="text-right m-2">
<button
class="bg-red-400 hover:bg-green-700 text-white font-bold py-2 px-4 border border-red-400 rounded"
>
Edit
</button>
</div>
<div class="">
<div class="rounded-md shadow-lg bg-white m-2">
<p class="text-sm text-gray-500 font-bold">NAME</p>
<p>Susan Ng'ang'a</p>
</div>
<div class="rounded-md shadow-lg bg-white m-2">
<p class="text-sm text-gray-500 font-bold">USERNAME</p>
<p>snganga@pangaea</p>
</div>
<div class="rounded-md shadow-lg bg-white m-2">
<p class="text-sm text-gray-500 font-bold">BIO</p>
<p>Susan is a young creative lady that believes in the power that a pen and open mind hold.</p>
</div>
<div class="rounded-md shadow-lg bg-white m-2">
<p class="text-sm text-gray-500 font-bold">MPESA NUMBER</p>
<p>+254 708-502-805</p>
</div>
<div class="text-right m-2">
<button
class="bg-green-500 hover:bg-red-700 text-white font-bold py-2 px-4 border border-greenma-900 rounded"
>
Save
</button>
</div>
</div>
</div> -->
<script src="assets/js/profile.js"></script>
</body>
</html>