Repository navigation
Expand file tree
/
Copy pathsolus_enterStu.php
More file actions
204 lines (182 loc) · 9.4 KB
/
Copy pathsolus_enterStu.php
File metadata and controls
204 lines (182 loc) · 9.4 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
<!-- // Purpose: To enter student information into database
// 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)){
// Get the student information from the database
$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>Add 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']:''?>"><em>Please enter 8 Numeral numbers</em></td>
</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']:''?>"><em>Please do not enter special characters and spaces</em></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']:''?>"><em>Please do not enter special characters and spaces</em></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']:''?>"><em>Please do not enter special characters and spaces</em></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']:''?>"><em>Please enter 'Male' or 'Female' or 'NA'</em></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']:''?>"><em>Please enter 6 characters netid</em></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']:''?>"><em>Please enter the country e.g.Canada</em></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']:''?>"><em>Please enter 'valid' or 'null'</em></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']:''?>"><em>Please enter your phone number</em></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']:''?>"><em>Please enter your local street address</em></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']:''?>"><em>Please enter your local city<em></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']:''?>"><em>Please enter your province<em></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']:''?>"><em>Please enter your 6 characters post code with a space in the middle<em></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']:''?>"><em>Please enter your permanent street address<em></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']:''?>"><em>Please enter your permanent city<em></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']:''?>"><em>Please enter your permanent province<em></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']:''?>"><em>Please enter your permanent street address<em></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']:''?>"><em>Please enter your permanent contact number<em></td>
</div>
</tr>
</table>
<div class="">
<div>
<div style="margin-left: 50px;margin-top: 10px">
<?php
// if the id is empty, it means that the user is adding a new student
if(empty($id)){?>
<input type="submit" value="Add Student" style="height: 28px">
<?php }else
// if the id is not empty, it means that the user is editing a student
{ ?>
<input type="submit" value="Eidt Student" style="height: 28px">
<?php } ?>
<a href="index.php" style="padding: 2px 6px;background: #54c4e5;color: white">Home</a>
</div>
</div>
</div>
<!-- <input type="submit" value="Next">-->
</form>
</div>
</div>
</div>
</body>
</html>