-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_student.php
98 lines (90 loc) · 3.51 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
<?php
$student_status = "active";
include('path.php');
include($ROOTPATH . '/app/controllers/student.php');
adminOnly();
?>
<!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">
<?php include("lender/head.php"); ?>
<link rel="stylesheet" href="assets/css/sidenav.css">
<link rel="stylesheet" href="assets/css/user.css">
<script src="assets/js/sidenav.js"></script>
<title>Result Management System</title>
</head>
<body id="body-pd">
<?php include("lender/sidebar.php"); ?>
<!--Container Main start-->
<div class="height-100 ">
<h5>Add Student <?php echo "for class: ".$_SESSION['class_assigned'] ?></h5>
<hr>
<div class="col-lg-6 card">
<div class="card-body">
<form action="add_student.php" class="needs-validation" method="post" novalidate>
<div class="form-group">
<label for="">Name</label>
<input type="text" class="form-control" value="<?php echo $name; ?>" name="name" required>
<div class="invalid-feedback">
Student Name is required
</div>
</div>
<br>
<div class="form-group">
<label for="">Date of Birth</label>
<input type="date" name="dob" class="form-control" value="<?php echo $dob; ?>" required>
<div class="invalid-feedback">
Date of Birth is required
</div>
</div>
<br>
<div class="form-group">
<label for="">Email(Optional)</label>
<input type="text" class="form-control" value="<?php echo $email; ?>" name="email" >
<div class="invalid-feedback">
Student Email is required
</div>
</div>
<br>
<div class="form-group">
<label for="">Student Code</label>
<input type="text" class="form-control <?php echo $p_status; ?>" value="<?php echo $code; ?>" name="index_number" required>
<div class="invalid-feedback">
Student Code is required
</div>
<div class="invalid-feedback">
<?php echo $p; ?>
</div>
</div>
<br>
<input type="hidden" name="class" value="<?php echo $_SESSION['class_assigned']; ?>">
<button class="form-control p-2 btn-primary" type="submit" name="add-stu">Add Student</button>
</form>
</div>
</div>
</div>
<!--Container Main end-->
<script>
// Example starter JavaScript for disabling form submissions if there are invalid fields
(function () {
'use strict'
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.querySelectorAll('.needs-validation')
// Loop over them and prevent submission
Array.prototype.slice.call(forms)
.forEach(function (form) {
form.addEventListener('submit', function (event) {
if (!form.checkValidity()) {
event.preventDefault()
event.stopPropagation()
}
form.classList.add('was-validated')
}, false)
})
})()
</script>
</body>
</html>