-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestpage.php
More file actions
217 lines (179 loc) · 6.24 KB
/
Copy pathtestpage.php
File metadata and controls
217 lines (179 loc) · 6.24 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<html>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
<head>
<style>
body {
background:#eef1f5;
margin:0;
font-family: Arial, sans-serif;
padding:30px;
}
.page-wrapper {
max-width:1100px;
margin:auto;
background:white;
padding:40px;
border-radius:12px;
box-shadow:0 0 20px rgba(0,0,0,0.08);
}
h2.section-title {
margin-top:40px;
font-size:20px;
font-weight:bold;
color:#003366;
display:flex;
align-items:center;
gap:10px;
}
.form-grid {
display:grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap:20px;
margin-top:20px;
}
label {
font-weight:bold;
font-size:14px;
color:#444;
}
input, select, textarea {
width:100%;
padding:12px;
border:1px solid #ccc;
border-radius:6px;
margin-top:5px;
background:#f8f9fa;
font-size:14px;
}
input[readonly] {
background:#e9ecef;
cursor:not-allowed;
}
.profile-pic-box {
text-align:center;
margin-bottom:20px;
}
.profile-pic {
width:120px;
height:120px;
border-radius:50%;
object-fit:cover;
border:3px solid #ddd;
}
.btn-save {
margin-top:30px;
width:100%;
padding:14px;
border:none;
background:#003366;
color:white;
font-size:16px;
border-radius:6px;
cursor:pointer;
}
.btn-save:hover {
background:#004a99;
}
</style>
<body>
<div class="page-wrapper">
<!-- PROFILE IMAGE -->
<div class="profile-pic-box">
<img class="profile-pic"
src="uploads/profile_pic/<?= htmlspecialchars($student['profile_pic'] ?? 'default.png') ?>"
id="pic_preview">
<br><br>
<input type="file" name="profile_pic" accept="image/*" onchange="loadPic(event)">
</div>
<form method="post" enctype="multipart/form-data">
<!-- PERSONAL INFO SECTION -->
<h2 class="section-title"><i class="fa fa-user"></i> Personal Information</h2>
<div class="form-grid">
<div>
<label>Registration / Student Number</label>
<input name="student_number" value="<?= htmlspecialchars($student['student_number']) ?>" readonly>
</div>
<div>
<label>Username</label>
<input name="username" value="<?= htmlspecialchars($userAccount['username']) ?>" required>
</div>
<div>
<label>New Password (optional)</label>
<input type="password" name="new_password">
</div>
<div>
<label>First Name</label>
<input name="first_name" required value="<?= htmlspecialchars($student['first_name']) ?>">
</div>
<div>
<label>Last Name</label>
<input name="last_name" required value="<?= htmlspecialchars($student['last_name']) ?>">
</div>
<div>
<label>Date of Birth</label>
<input type="date" name="dob" value="<?= htmlspecialchars($student['dob']) ?>">
</div>
<div>
<label>Gender</label>
<select name="gender">
<option value="">-- Select --</option>
<option value="Male" <?= $student['gender'] === "Male" ? "selected" : "" ?>>Male</option>
<option value="Female" <?= $student['gender'] === "Female" ? "selected" : "" ?>>Female</option>
<option value="Other" <?= $student['gender'] === "Other" ? "selected" : "" ?>>Other</option>
</select>
</div>
<div>
<label>Email</label>
<input name="email" value="<?= htmlspecialchars($student['email']) ?>">
</div>
<div>
<label>Phone</label>
<input name="phone" value="<?= htmlspecialchars($student['phone']) ?>">
</div>
<div>
<label>Emergency Phone</label>
<input name="emergency_phone" value="<?= htmlspecialchars($student['emergency_phone']) ?>">
</div>
<div style="grid-column: span 2;">
<label>Home Address</label>
<textarea name="address"><?= htmlspecialchars($student['address']) ?></textarea>
</div>
<div>
<label>National ID</label>
<input name="national_id" value="<?= htmlspecialchars($student['national_id']) ?>">
</div>
</div>
<!-- ACADEMIC INFO SECTION -->
<h2 class="section-title"><i class="fa fa-graduation-cap"></i> Academic Information</h2>
<div class="form-grid">
<div>
<label>Department</label>
<select name="department_id">
<option value="">-- Select Department --</option>
<?php foreach($depts as $d): ?>
<option value="<?= $d['id'] ?>" <?= ($student['department_id'] == $d['id']) ? 'selected' : '' ?>>
<?= htmlspecialchars($d['name']) ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div>
<label>Programme (Optional)</label>
<input placeholder="e.g. BSc Computer Science">
</div>
<div>
<label>Current Major (Optional)</label>
<input placeholder="e.g. Information Technology">
</div>
</div>
<button class="btn-save">Save Changes</button>
</form>
</div>
<script>
function loadPic(e){
document.getElementById("pic_preview").src =
URL.createObjectURL(e.target.files[0]);
}
</script>
</body>
</html>