Repository navigation
Expand file tree
/
Copy pathsolus_editStu.php
More file actions
197 lines (174 loc) · 8.77 KB
/
Copy pathsolus_editStu.php
File metadata and controls
197 lines (174 loc) · 8.77 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
<!-- Purpose: Edit a student's information
Author: Songyu Yang -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Student Management System</title>
<link rel="stylesheet" type = "text/css" href="main.css">
<link rel="stylesheet" type = "text/css" href="Table_CSS.css">
</head>
<body>
<style>
.textClass{
height: 25px;
width: 360px;
}
.textClass label{
/*width: 50px;*/
}
.textClass input{
height: 25px;
}
.labelClass{
width: 240px;
}
</style>
<?php
include 'solus_connectdb.php';
// get the id from the url
$id = isset($_GET['id']) ? $_GET['id'] : '';
if (!empty($id)) {
$sql = "SELECT * FROM student WHERE id = :id";
$stmt = $connection->prepare($sql);
$stmt->bindParam(':id', $id);
$stmt->execute();
$info = $stmt->fetch(PDO::FETCH_ASSOC);
}
?>
<div>
<div style="display: flex">
<div style="margin: auto">
<h1>Welcome to Solus</h1>
<h3>Edit a Student Information</h3>
</div>
</div>
<div class="header" style="display: flex;">
<div style="margin: auto">
<form action="solus_enterStuInfo.php" method="post">
<table>
<tr>
<div >
<td class="labelClass"><label for="id">ID:</label></td>
<td><input type="text" id="id" name="id" class="textClass" value="<?=isset($info['id'])?$info['id']:''?>" readonly></td>
<input type="hidden" name="type" value="1">
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="firstName">First Name:</label></td>
<td><input type="text" id="firstName" name="firstName" class="textClass" value="<?=isset($info['id'])?$info['first']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="middleName">Middle Name:</label></td>
<td><input type="text" id="middleName" name="middleName" class="textClass" value="<?=isset($info['id'])?$info['middleName']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="lastName">Last Name:</label></td>
<td><input type="text" id="lastName" name="lastName" class="textClass" value="<?=isset($info['id'])?$info['lastName']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="gender">Gender:</label></td>
<td><input type="text" id="gender" name="gender" class="textClass" value="<?=isset($info['id'])?$info['gender']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="netid">NetID:</label></td>
<td><input type="text" id="netid" name="netid" class="textClass" value="<?=isset($info['id'])?$info['netid']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="citizenship">Citizenship:</label></td>
<td><input type="text" id="citizenship" name="citizenship" class="textClass" value="<?=isset($info['id'])?$info['citizenship']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="visaStatus">Visa Status:</label></td>
<td><input type="text" id="visaStatus" name="visaStatus" class="textClass" value="<?=isset($info['id'])?$info['visaStatus']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="phone">Phone:</label></td>
<td><input type="text" id="phone" name="phone" class="textClass" value="<?=isset($info['id'])?$info['phone']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="localStreetAddress">Local Street Address:</label></td>
<td><input type="text" id="localStreetAddress" name="localStreetAddress" class="textClass" value="<?=isset($info['id'])?$info['localStreetAddress']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="localCity">Local City:</label></td>
<td><input type="text" id="localCity" name="localCity" class="textClass" value="<?=isset($info['id'])?$info['localCity']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="localProvince">Local Province:</label></td>
<td><input type="text" id="localProvince" name="localProvince" class="textClass" value="<?=isset($info['id'])?$info['localProvince']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="localPC">Local Postal Code:</label></td>
<td><input type="text" id="localPC" name="localPC" class="textClass" value="<?=isset($info['id'])?$info['localPC']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="permStreetAddress">Permanent Street Address:</label></td>
<td><input type="text" id="permStreetAddress" name="permStreetAddress" class="textClass" value="<?=isset($info['id'])?$info['permStreetAddress']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="permCity">Permanent City:</label></td>
<td><input type="text" id="permCity" name="permCity" class="textClass" value="<?=isset($info['id'])?$info['permCity']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="permProvince">Permanent Province:</label></td>
<td><input type="text" id="permProvince" name="permProvince" class="textClass" value="<?=isset($info['id'])?$info['permProvince']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="permPC">Permanent Postal Code:</label></td>
<td><input type="text" id="permPC" name="permPC" class="textClass" value="<?=isset($info['id'])?$info['permPC']:''?>"></td>
</div>
</tr>
<tr>
<div >
<td class="labelClass"><label for="emergencyContactNumber">Emergency Contact Number:</label></td>
<td><input type="text" id="emergencyContactNumber" name="emergencyContactNumber" class="textClass" value="<?=isset($info['id'])?$info['emergencyContactNumber']:''?>"></td>
</div>
</tr>
</table>
<div class="">
<div>
<div style="margin-left: 50px;margin-top: 10px">
<input type="submit" value="Edit Student" style="height: 28px">
<a href="index.php?role=1" style="padding: 2px 6px;background: #54c4e5;color: white">Home</a>
</div>
</div>
</div>
<!-- <input type="submit" value="Next">-->
</form>
</div>
</div>
</div>
</body>
</html>