-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSchoolAdminAdmin-EditUser.php
More file actions
97 lines (86 loc) · 4.08 KB
/
SchoolAdminAdmin-EditUser.php
File metadata and controls
97 lines (86 loc) · 4.08 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
<?php
$id = '';
$firstname = '';
$secondname = '';
$role = '';
$email = '';
$password = '';
$phonenumber = '';
$schoolname = '';
$teacherSubject = '';
$title = 'Edit User';
require 'includes/header.php';
require_once 'includes/auth_check.php';
require_once 'database/conn.php';
if (!isset($_GET['id'])) {
echo '<h1>User unavailable</h1>';
} else {
$id = $_GET['id'];
$results = $SchoolTeacher_Crud->getSchoolName();
$users = $SchoolTeacher_Crud->getTeacherByID($id);
?>
<div id="wrap">
<div id="main" class="container clear-top">
<strong>
<div class="p-3 mb-2 bg-warning text-dark text-center">
<h1>Edit User</h1>
</div>
</strong>
<form method="post" action="SchoolAdmin-EditPost.php">
<!--Hide the id value to the user-->
<input type="hidden" name="id" value="<?php echo $users['user_id']; ?>"/>
<div class="form-group">
<label for="firstname">First Name</label>
<input type="text" class="form-control" id="firstname" name="firstname"
value="<?php echo $users['firstname']; ?>">
</div>
<div class="form-group">
<label for="secondname">Second Name</label>
<input type="text" class="form-control" id="secondname" name="secondname"
value="<?php echo $users['secondname']; ?>">
</div>
<div class="form-group">
<label for="teacherSubject">What is the subject of the teacher in school (Choose from list)</label>
<select class="form-control" id="teacherSubject" name="teacherSubject">
<option>Mathematics</option>
<option>English</option>
<option>Physics</option>
<option>Biology</option>
<option>Chemistry</option>
<option>Programming</option>
</select>
</div>
<div class="form-group">
<label for="email">Email address</label>
<input type="email" class="form-control" id="email" name="email" aria-describedby="emailHelp"
value="<?php echo $users['email']; ?>">
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone
else.</small>
</div>
<div class="form-group">
<label for="phonenumber"> Contact Number</label>
<input type="text" class="form-control" id="phonenumber" name="phonenumber"
value="<?php echo $users['phonenumber'] ?>"" >
<small id="phoneHelp" class="form-text text-muted">We'll never share your phone number with anyone
else.</small>
</div>
<div class="form-group">
<label for="schoolname">School name (Choose from list)</label>
<select class="form-control" id="schoolname" name="schoolname">
< <?php $results = $crud->getSchoolName();
while ($r = $results->fetch(PDO::FETCH_ASSOC)) { ?>
<option value="<?php echo $r['school_id'] ?>" <?php if ($r['school_id'] == $users['school_id']) echo 'selected' ?>>
<?php echo $r['schoolname'] ?></option>
<?php } ?>
</select>
</div>
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1">
<label class="form-check-label" for="exampleCheck1">Check me out</label>
</div>
<button type="submit" name="submit" class="btn btn-success btn-block">Update User</button>
</form>
</div>
</div>
<?php } ?>
<?php require 'includes/footer.php';