-
Notifications
You must be signed in to change notification settings - Fork 0
/
_add-student.php
411 lines (359 loc) · 21.8 KB
/
_add-student.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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
<?php
include('./includes/config.php');
session_start();
if (isset($_SESSION['uname'])) {
$coor = $_SESSION['uname'][1]; //call username of coordinator
?>
<!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">
<title>UCC|SRM</title>
<link rel="icon" href="./assets/image/csd.png" type="image/x-icon">
<link rel="stylesheet" href="./assets/css/style.css">
<link rel="stylesheet" href="./node_modules/bootstrap-icons/font/bootstrap-icons.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.5/css/dataTables.bootstrap5.min.css">
<script>
if (window.history.replaceState) {
window.history.replaceState(null, null, window.location.href);
}
</script>
</head>
<body>
<!--//////////////////////////////////////////////////////
NAVBAR SECTION
////////////////////////////////////////////////////// -->
<nav class="navbar navbar-expand-lg navbar-dark bg-blue-dark fixed-top">
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#sidebar" aria-controls="offcanvasExample">
<span class="navbar-toggler-icon" data-bs-target="#sidebar"></span>
</button>
<a href="#" class="logo">
<img src="./assets/image/csd.png" alt="logo image">
</a>
<a class="navbar-brand" href="https://ucc-caloocan.edu.ph/">
Scholastic Record Management
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#topNavBar" aria-controls="topNavBar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="topNavBar">
<ul class="navbar-nav d-flex ms-auto my-3 my-lg-0">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle ms-2" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-person-fill"></i>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item" href="./polisher/changeinfo.php?admin_id=<?php echo $_SESSION['uname'][2]; ?>">Change Password</a></li>
<li><a class="dropdown-item" href="coorlogout.php">Log-out</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<!--//////////////////////////////////////////////////////
Off-canvas
////////////////////////////////////////////////////// -->
<!-- offcanvas -->
<div class="offcanvas offcanvas-start sidebar-nav" tabindex="-1" id="sidebar">
<div class="offcanvas-body p-0">
<nav class="navbar-dark">
<ul class="navbar-nav">
<li>
<div class="mb-3 text-muted fs-4 fw-bold text-uppercase px-3">
<?php if (isset($_SESSION['uname'])) {
echo $_SESSION['uname'][1]; //firstname
}
?>
</div>
</li>
<li>
<div class="text-muted small fw-bold text-uppercase px-3">
SCHOLASTIC
</div>
</li>
<li>
<a href="./_dashboard.php" class="nav-link px-3 active">
<span class="me-2"><i class="bi bi-columns"></i></span>
<span>Dashboard</span>
</a>
</li>
<li class="my-4">
<hr class="dropdown-divider bg-light" />
</li>
<li>
<div class="text-muted small fw-bold text-uppercase px-3 mb-3">
Manage
</div>
</li>
<li>
<a class="nav-link px-3 sidebar-link" data-bs-toggle="collapse" href="#classesSub">
<span class="me-2"><i class="bi bi-book"></i></span>
<span>Classes</span>
<span class="ms-auto">
<span class="right-icon">
<i class="bi bi-chevron-down"></i>
</span>
</span>
</a>
<div class="collapse" id="classesSub">
<ul class="navbar-nav ps-3">
<li>
<a href="./_create-class.php" class="nav-link px-3">
<span class="me-2"><i class="bi bi-file-earmark-plus"></i></span>
<span>Create Class</span>
</a>
</li>
<li>
<a href="./_manage-class.php" class="nav-link px-3">
<span class="me-2"><i class="bi bi-kanban"></i></span>
<span>Manage Class</span>
</a>
</li>
</ul>
</div>
</li>
<li>
<li>
<a class="nav-link px-3 sidebar-link" data-bs-toggle="collapse" href="#subjectsSub">
<span class="me-2"><i class="bi bi-pen"></i></span>
<span>Subjects</span>
<span class="ms-auto">
<span class="right-icon">
<i class="bi bi-chevron-down"></i>
</span>
</span>
</a>
<div class="collapse" id="subjectsSub">
<ul class="navbar-nav ps-3">
<li>
<a href="./_create-subject.php" class="nav-link px-3">
<span class="me-2"><i class="bi bi-file-earmark-plus"></i></span>
<span>Add Subjects</span>
</a>
</li>
<li>
<a href="./_manage-subject.php" class="nav-link px-3">
<span class="me-2"><i class="bi bi-kanban"></i></span>
<span>Manage Subjects</span>
</a>
</li>
<li>
<a href="./_addsubjectcombination.php" class="nav-link px-3">
<span class="me-2"><i class="bi bi-bounding-box"></i></span>
<span>Add Curricullum</span>
</a>
</li>
<li>
<a href="./_managesubjectcombination.php" class="nav-link px-3">
<span class="me-2"><i class="bi bi-tools"></i></span>
<span>Manage Curricullum</span>
</a>
</li>
</ul>
</div>
</li>
<li>
<li>
<a class="nav-link px-3 sidebar-link" data-bs-toggle="collapse" href="#facultySub">
<span class="me-2"><i class="bi bi-person-rolodex"></i></span>
<span>Faculty</span>
<span class="ms-auto">
<span class="right-icon">
<i class="bi bi-chevron-down"></i>
</span>
</span>
</a>
<div class="collapse" id="facultySub">
<ul class="navbar-nav ps-3">
<li>
<a href="./_create-faculty.php" class="nav-link px-3">
<span class="me-2"><i class="bi bi-person-plus"></i></span>
<span>Create Faculty</span>
</a>
</li>
<li>
<a href="./_add-prof.php" class="nav-link px-3">
<span class="me-2"><i class="bi bi-person-plus-fill"></i></span>
<span>Add Professors</span>
</a>
</li>
<li>
<a href="./_manage-faculty.php" class="nav-link px-3">
<span class="me-2"><i class="bi bi-person-video2"></i></span>
<span>Manage Faculty</span>
</a>
</li>
</ul>
</div>
</li>
<li>
<a href="./_students.php" class="nav-link px-3 active">
<span class="me-1"><i class="bi bi-person-bounding-box"></i></span>
<span>Enrolled Students</span>
</a>
</li>
</ul>
</nav>
</div>
</div>
<!-- offcanvas -->
<main class="mt-5 pt-3">
<div class="container-fluid">
<div class="row">
<div class="col-md-12 p-header">
Add Student
</div>
</div>
</div>
<div style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb" class="row breadcrumb-div">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Faculty</a></li>
<li class="breadcrumb-item active" aria-current="page">Add Professors</li>
</ol>
</div>
<section class="section">
<div class="container-fluid">
<div class="row">
<div class="form-spacing">
<div class="col-md-12">
<div class="panel">
<div class="panel-heading">
<div class="panel-title">
<h5>Fill the Information Below</h5>
</div>
</div>
<div class="panel-body">
<form class="row g-3 form-group" method="post" action="./Functions/add_function.php">
<div class="col-md-6">
<label for="inputfname" class="form-label">First Name</label>
<input name="firstname" type="input" class="form-control" id="inputfname" required>
</div>
<div class="col-md-6">
<label for="inputmiddlename" class="form-label">Middle Name</label>
<input name="middlename" type="input" class="form-control" id="inputmiddlename" required>
</div>
<div class="col-md-8">
<label for="inputlastname" class="form-label">Last Name</label>
<input name="lastname" type="input" class="form-control" id="inputlastname">
</div>
<div class="col-md-4">
<label for="inputgender" class="form-label">Gender</label>
<select name="gender" id="inputgender" class="form-select">
<option selected>Choose...</option>
<option>Male</option>
<option>Female</option>
</select>
</div>
<div class="col-md-4">
<label for="inputcourse" class="form-label">Add Course</label>
<select name="course" class="form-select" id="inputcourse" required="required">
<option value="">Select Course</option>
<?php $sql = "SELECT * from srms_tblcourses";
$query = $dbh->prepare($sql);
$query->execute();
$results = $query->fetchAll(PDO::FETCH_OBJ);
if ($query->rowCount() > 0) {
foreach ($results as $result) { ?>
<option value="<?php echo htmlentities($result->Course); ?>"><?php echo htmlentities($result->Course); ?></option>
<?php }
} ?>
</select>
</div>
<div class="col-md-4">
<label for="inputyear" class="form-label">Add Year</label>
<select name="year" id="inputyear" class="form-select">
<option selected>Choose...</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
</div>
<div class="col-md-4">
<label for="inputsection" class="form-label">Add Section</label>
<select name="section" id="inputsection" class="form-select">
<option selected>Choose...</option>
<option>A</option>
<option>B</option>
<option>C</option>
<option>D</option>
</select>
</div>
<div class="col-md-12">
<label for="inputstudentnum" class="form-label">Student Number</label>
<input name="studentsnumber" type="number" class="form-control" id="inputstudentnum">
</div>
<div class="col-md-8">
<label for="inputclass" class="form-label">Add Student to Class</label>
<select name="class" class="form-control" id="inputcourse" required="required">
<option value="">Select Course</option>
<?php $sql = "SELECT * from srms_tblclasses";
$query = $dbh->prepare($sql);
$query->execute();
$results = $query->fetchAll(PDO::FETCH_OBJ);
if ($query->rowCount() > 0) {
foreach ($results as $result) { ?>
<option value="<?php echo htmlentities($result->class_id); ?>"><?php echo htmlentities($result->Course); ?> (<?php echo htmlentities($result->Year); ?>-<?php echo htmlentities($result->Section); ?>)</option>
<?php }
} ?>
</select>
</div>
<div class="col-md-4">
<label for="selectstatus" class="form-label">Status</label>
<select name="status" id="selectstatus" class="form-select">
<option selected>Choose...</option>
<option>Active</option>
<option>Non-Active</option>
</select>
</div>
<div class="col-12">
<label for="inputAddress" class="form-label">Address</label>
<input name="address" type="text" class="form-control" id="inputAddress" placeholder="1234 Main St">
</div>
<div class="col-6">
<label for="inputEmail" class="form-label">Email Address</label>
<input name="email" type="text" class="form-control" id="inputEmail" placeholder="[email protected]">
</div>
<div class="col-6">
<label for="inputnum" class="form-label">Contact Number</label>
<input name="contactnum" type="text" class="form-control" id="inputnum" placeholder="093788...">
</div>
<div class="col-12">
<button name="addstud" type="submit" class="btn btn-primary">Add</button>
</div>
</form>
</div>
</div>
</div>
<!-- /.col-md-12 -->
</div>
</div>
</div>
<!-- /.content-container -->
</div>
</section>
</main>
<?php
} else {
header("location:login.php");
}
?>
<script src=".//node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src=".//node_modules/bootstrap/dist/js/bootstrap.bundle.min.js.map"></script>
<!-- for datatables -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.min.js"></script>
<script src=".//node_modules/jquery/dist/jquery.js"></script>
<script src=".//assets/js/script.js"></script>
<script src=".//assets/js/dataTables.bootstrap5.min.js"></script>
<script src=".//assets/js/jquery.dataTables.min.js"></script>
<script type="text/javascript">
setTimeout(function() {
document.getElementById("alert").style.display = "none";
}, 3000);
</script>
</body>
</html>