forked from muzaffertuna/Student-Teacher-Information-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
student.php
254 lines (232 loc) · 14.1 KB
/
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
<!DOCTYPE html>
<?php
$ssn = $_POST['ssn'];
include '.\dbConnect.php';
$query_studentName = "SELECT studentname
FROM Student WHERE ssn = '$ssn' ";
$query_yearr = "SELECT DISTINCT yearr
FROM Sectionn";
$query_semester = "SELECT DISTINCT semester
FROM Sectionn";
$query_courseCode = "Select courseCode FROM Course";
$query_many = "Select issn,courseCode,yearr,semester,sectionId from sectionn ";
$result_studentName = mysqli_query($conn, $query_studentName);
$result_yearr = mysqli_query($conn, $query_yearr);
$result_semester = mysqli_query($conn, $query_semester);
$result_courseCode = mysqli_query($conn, $query_courseCode);
$result_many = mysqli_query($conn, $query_many);
$row = mysqli_fetch_assoc($result_studentName);
$studentName = $row["studentname"];
echo "<h4>" . "Students's Page" . "</h4>";
?>
<html>
<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">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<title>Student Page</title>
</head>
<body>
<div class="container mt-3 " >
<div class="card ">
<div class="card-header bg-primary d-flex justify-content-center">
<h6 style="text-align: start;" class="text-light"><?php echo $studentName ?></h6>
<a href="index.php"><i class="fa-solid fa-graduation-cap fa-3x" style="color: #000000;"></i></a>
<h6 class="ms-2 mt-2"style="text-align: center">Student's Page</h6>
</div>
<div class="card-body border " style="background-color: #CFD8DC";>
<div class="row g-2 mt-1">
<div class="col-6">
<div class="card" >
<div class="card-body">
<h5 class="card-title">My Degree</h5>
<p class="card-text">Are you graduate or undergraduate?</p>
<?php
$query2 = "SELECT gradorUgrad From Student Where ssn = '$ssn' ";
$result2 = mysqli_query($conn, $query2);
$row2 = mysqli_fetch_assoc($result2);
$gradorUgrad = $row2["gradorUgrad"];
if ($gradorUgrad == 1) {
echo "<div class='p-3 border bg-success text-light' style='font-size: 24px;'>" . "GRADUATE" . "</div>";
} else {
echo "<div class='p-3 border bg-danger text-light' style='font-size: 24px;'>" . "UNDERGRADUATE" . "</div>";
}
?>
</div>
</div>
</div>
<div class="col-6">
<div class="card">
<div class="card-body">
<h5 class="card-title">My Courses</h5>
<p class="card-text">Courses that you are taking.</p>
<div class="p-3 border bg-light"><a href="smycourses.php?ssn=<?php echo $ssn; ?>" class="btn btn-primary">My Courses</a></div>
</div>
</div>
</div>
</div>
<div class="row g-2 mt-1">
<div class="col-6">
<div class="card" >
<div class="card-body">
<h5 class="card-title">My Projects</h5>
<p class="card-text">Projects list that you are working in.</p>
<div class="p-3 border bg-light"><a href="smyprojects.php?ssn=<?php echo $ssn; ?>" class="btn btn-primary ">My Projects</a></div>
</div>
</div>
</div>
<div class="col-6">
<div class="card">
<div class="card-body">
<h5 class="card-title">Grade Report</h5>
<p class="card-text">Your grades for academic your career.</p>
<div class="p-3 border bg-light"><a href="smygradereport.php?ssn=<?php echo $ssn; ?>" class="btn btn-primary">Grade Report</a></div>
</div>
</div>
</div>
</div>
<div class="row g-2 mt-1">
<div class="col-6">
<div class="card" >
<div class="card-body">
<h5 class="card-title">Weekly Schedule</h5>
<p class="card-text">You can see your weekly schedule.</p>
<div class="p-3 border bg-light"><a href="sweeklyschedule.php?ssn=<?php echo $ssn; ?>" class="btn btn-primary">Weekly Schedule</a></div>
</div>
</div>
</div>
<div class="col-6">
<div class="card">
<div class="card-body">
<h5 class="card-title">Your Advisor</h5>
<p class="card-text">Your Advisor who is advising you.</p>
<?php
$query3 = "SELECT I.iname From Student AS S, Instructor As I Where S.ssn = '$ssn' AND S.advisorSsn = I.ssn";
$result3 = mysqli_query($conn, $query3);
$row3 = mysqli_fetch_assoc($result3);
$iName = $row3["iname"];
echo "<div class='p-3 border bg-success text-light' style='font-size: 24px;'>" . "$iName" . "</div>";
?>
</div>
</div>
</div>
</div>
<div class="row g-2 mt-1">
<div class="col-6">
<div class="card" >
<div class="card-body">
<h5 class="card-title">My Curriculum</h5>
<p class="card-text">Lessons that you are supposed to take.</p>
<div class="p-3 border bg-light"><a href="smylessons.php?ssn=<?php echo $ssn; ?>" class="btn btn-primary ">My Curriculum</a></div>
</div>
</div>
</div>
<div class="col-6">
<div class="card">
<div class="card-body">
<h5 class="card-title">My Department</h5>
<p class="card-text">You can see your department that you are studying.</p>
<?php
$query4 = "SELECT dName From Student AS S Where S.ssn = '$ssn'";
$result4 = mysqli_query($conn, $query4);
$row4 = mysqli_fetch_assoc($result4);
$dName = $row4["dName"];
echo "<div class='p-3 border bg-success text-light' style='font-size: 24px;'>" . "$dName" . "</div>";
?>
</div>
</div>
</div>
</div>
<div class="row g-2 mt-1">
<div class="col-6">
<div class="card" >
<div class="card-body">
<h5 class="card-title">List Students</h5>
<p class="card-text">List the students taking course C in a given year Y and semester S..</p>
<form method="post" action="slisttakingcourse.php" class="text-center">
<label for="disabledSelect" class="form-label" style="font-weight: bold;">Choose Year</label>
<select name="yearr" id="disabledSelect" class="form-select border-2">
<?php
while ($row5 = mysqli_fetch_assoc($result_yearr)) {
$yearr = $row5["yearr"];
echo "<option>", $yearr;
}
?>
</select>
<label for="disabledSelect" class="form-label" style="font-weight: bold;">Choose Semester</label>
<select name="semester" id="disabledSelect" class="form-select border-2">
<?php
while ($row6 = mysqli_fetch_assoc($result_semester)) {
$semester = $row6["semester"];
echo "<option>", $semester;
}
?>
</select>
<label for="disabledSelect" class="form-label" style="font-weight: bold;">Choose Course Code</label>
<select name="courseCode" id="disabledSelect" class="form-select border-2">
<?php
while ($row7 = mysqli_fetch_assoc($result_courseCode)) {
$courseCode = $row7["courseCode"];
echo "<option>", $courseCode;
}
?>
</select>
<button type="submit" class="btn btn-primary mt-3">List Students</button>
</form>
</div>
</div>
</div>
<div class="col-6">
<div class="card h-100" >
<div class="card-body">
<h5 class="card-title">List Students In Section</h5>
<p class="card-text">List the students taking course C in a given section.</p>
<form method="post" action="slistinsection.php" class="text-center">
<label for="disabledSelect" class="form-label" style="font-weight: bold;">Choose Section</label>
<select name="x" id="disabledSelect" class="form-select border-2">
<?php
while ($row8 = mysqli_fetch_assoc($result_many)) {
$issn = $row8["issn"];
$courseCode = $row8["courseCode"];
$yearr = $row8["yearr"];
$semester = $row8["semester"];
$sectionId = $row8["sectionId"];
echo "<option value='$issn,$courseCode,$yearr,$semester,$sectionId'>Instructor SSN: $issn Course Code: $courseCode Year: $yearr Semester: $semester Section ID: $sectionId</option>";
}
?>
</select>
<button type="submit" class="btn btn-primary mt-3">List Students</button>
</form>
</div>
</div>
</div>
</div>
<div class="row g-2 mt-1">
<div class="col-6">
<div class="card" >
<div class="card-body">
<h5 class="card-title">Display All Scores</h5>
<p class="card-text">Display all scores of a student S of a course C in the form [examname, score].</p>
<form method="post" action="sdisplayallscores.php" class="text-center">
<label for="disabledSelect" class="form-label" style="font-weight: bold;">Display All Scores</label>
<select name="courseCode" id="disabledSelect" class="form-select border-2">
<?php
mysqli_data_seek($result_courseCode, 0);
while ($row = mysqli_fetch_assoc($result_courseCode)) {
$courseCode = $row["courseCode"];
echo "<option>", $courseCode;
}
?>
</select>
<input type="hidden" name="ssn" value="<?php echo $ssn; ?>">
<button type="submit" class="btn btn-primary mt-3">List Students</button>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>