forked from ugwuanyiandy/Website-NACOSS-UNN
-
Notifications
You must be signed in to change notification settings - Fork 1
/
profile$2.php
197 lines (190 loc) · 10.2 KB
/
profile$2.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
<?php
/*
* Copyright 2015 NACOSS UNN Developers Group (NDG).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
if (empty($array)) {
$array = $user->getUserData();
}
?>
<div>
<h2>Edit Profile</h2>
<div class="row ntm nbm">
<a class="place-right bg-hover-dark fg-hover-white" href="profile.php?p=1">
Cancel Edit
</a>
</div>
<div class="row bg-grayLighter grid">
<div class="padding10">
<?php
if (isset($array["editProfileForm"])) {
if ($success) {
?>
<p class="fg-NACOSS-UNN">Profile was successfully updated.</p>
<?php } else { ?>
<p class="fg-red"><?= $error_message ?></p>
<?php
}
}
?>
<form method="post" enctype="multipart/form-data" action="profile.php?p=2">
<div class="row" >
<h2 class="bg-grayLight padding5">Personal Information</h2>
<div class="row ntm">
<label class="span3">Name<span class="fg-red">*</span></label>
<div class="span9">
<input class="" style="width: inherit" type='text' required maxlength="30" placeholder="Last name" name='last_name'
<?= isset($array['last_name']) ? "value='" . $array['last_name'] . "'" : ""; ?> tabindex='3' />
<input class="" style="width: inherit" type='text' required maxlength="30" placeholder="First name" name='first_name'
<?= isset($array['first_name']) ? "value='" . $array['first_name'] . "'" : ""; ?> tabindex='4' />
</div>
</div>
<div class="row ntm" >
<label class="span3">Other names</label>
<div class="span9">
<input type='text' maxlength="30" style="width: inherit" name='other_names'
<?= isset($array['other_names']) ? "value='" . $array['other_names'] . "'" : ""; ?> tabindex='5' />
</div>
</div>
<div class="row ntm" >
<label class="span3">Reg. Number<span class="fg-red">*</span></label>
<div class="span9">
<input name='regno' required style="width: inherit" maxlength="11" type='text'
<?= isset($array['regno']) ? "value='" . $array['regno'] . "'" : ""; ?> tabindex='6' />
</div>
</div>
<div class="row ntm" >
<label class="span3">Date of Birth</label>
<!--old data-format="dddd, mmmm d, yyyy"-->
<div class="span9 input-control text" data-role="datepicker"
data-date="<?= isset($array['dob']) ? $array['dob'] : "2015-01-01"; ?>"
data-format="yyyy-mm-dd"
data-position="top"
data-effect="slide">
<input type="text" name="dob">
<button type="button" class="btn-date"></button>
</div>
</div>
<div class="row ntm" >
<label class="span3">Bio</label>
<textarea class="span9" name='bio' style="width: inherit" tabindex='7'><?=
isset($array['bio']) ?
$array['bio'] :
"";
?></textarea>
</div>
<div class="row ntm">
<label class="span3">Change Picture <small><em>(max 250kb)</em></small></label>
<div class="span9 input-control file">
<input type="file" name="pic_url" value="<?= isset($array['pic_url']) ? $array['pic_url'] : ""; ?>"/>
<button class="btn-file"></button>
</div>
</div>
<h2 class="bg-grayLight padding5">Contact Information</h2>
<div class="row ntm" >
<label class="span3">Phone<span class="fg-red">*</span></label>
<div class="span9">
<input name='phone' required style="width: inherit" type='tel'
<?= isset($array['phone']) ? "value='" . $array['phone'] . "'" : ""; ?> tabindex='8' />
</div>
</div>
<div class="row ntm" >
<label class="span3">Email<span class="fg-red">*</span>
</label>
<div class="span9">
<input name='email' style="width: inherit" required type='email'
<?= isset($array['email']) ? "value='" . $array['email'] . "'" : ""; ?> tabindex='9' />
</div>
</div>
<div class="row ntm" >
<label class="span3">Address 1</label>
<textarea class="span9" name='address1' style="width: inherit" tabindex='10'><?=
isset($array['address1']) ?
$array['address1'] :
"";
?></textarea>
</div>
<div class="row ntm" >
<label class="span3">Address 2</label>
<textarea class="span9" name='address2' style="width: inherit" tabindex='11'><?=
isset($array['address2']) ?
$array['address2'] :
"";
?></textarea>
</div>
<h2 class="bg-grayLight padding5">Education</h2>
<?php
$deptOption = array("COMPUTER SCIENCE",
"COMPUTER SCIENCE/MATHEMATICS",
"COMPUTER SCIENCE/STATISTICS",
"COMPUTER SCIENCE/PHYSICS",
"COMPUTER SCIENCE/GEOLOGY");
$levelOption = array("100",
"200",
"300",
"400");
?>
<div class="row ntm">
<label class="span3">Department</label>
<div class="span9">
<select class="span9" name="department">
<?php
foreach ($deptOption as $value) {
$selected = isset($array['department']) ? strcasecmp($value, $array['department']) === 0 : FALSE;
echo "<option " . ($selected ? "selected" : "") . ">$value</option>";
}
?>
</select>
<select name="level">
<?php
foreach ($levelOption as $value) {
$selected = isset($array['level']) ? strcasecmp($value, $array['level']) === 0 : FALSE;
echo "<option " . ($selected ? "selected" : "") . ">$value Level</option>";
}
?>
</select>
</div>
</div>
<div class="row ntm" >
<label class="span3">Expected year of Graduation</label>
<div class="span9">
<input name='entry_year' style="width: inherit" required type='text'
<?= isset($array['entry_year']) ? "value='" . $array['entry_year'] . "'" : ""; ?> tabindex='9' />
</div>
</div>
<div class="row ntm" >
<label class="span3">Interests</label>
<textarea class="span9" name='interests' style="width: inherit" tabindex='7'><?=
isset($array['interests']) ?
$array['interests'] :
"";
?></textarea>
<small><em>e.g. Programming, Gaming, Graphics</em></small>
</div>
<h2 class="bg-grayLight padding5">Enter Password</h2>
<div class="row ntm" >
<label class="span3">Password<span class="fg-red">*</span></label>
<div class="span9">
<input class="password" name='password' style="width: inherit" type='password' tabindex='2' />
</div>
</div>
<div class="row ntm">
<input class="offset3 button default bg-NACOSS-UNN bg-hover-dark" type='submit'
name='editProfileForm' value='Update' tabindex='9'/>
</div>
</div>
</form>
</div>
</div>
</div>