This repository has been archived by the owner on Aug 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudent_report.php
288 lines (227 loc) · 11.8 KB
/
student_report.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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<?php
include($_SERVER['DOCUMENT_ROOT'].'/php/user_session_check.php'); //checks if user is logged on
$permission_status = 0;
foreach ($_SESSION['permissions'] as $item) {
//echo $item;
if ($item['position'] == "teacher" OR $item['position'] == "sso_admin") {
$permission_status = 1;
}
}
if ($permission_status == 1) {
$stud_id = htmlspecialchars($_GET['stud_id']); //htmlspecialchars prevents script injection
$class_id = htmlspecialchars($_GET['class']); //htmlspecialchars prevents script injection
$teach_id = $_SESSION['id'];
#include ($_SERVER["DOCUMENT_ROOT"] . "/php/report_info.php"); //gathers all revelant student information about their progress report card
include ($_SERVER['DOCUMENT_ROOT'] . "/php/progress_functions.php");
include ($_SERVER['DOCUMENT_ROOT'] . "/php/prepare_sql.php");
include ($_SERVER['DOCUMENT_ROOT'] . "/php/teacher-security.php"); //prevents other teachers from editing student's report card
?>
<!DOCTYPE html>
<html>
<title>Student Info</title> <!-- Name of site page in tab -->
<head>
<?php include ($_SERVER['DOCUMENT_ROOT'] . "/includes/head_includes.php"); ?>
<?php include ($_SERVER['DOCUMENT_ROOT'] . "/javascript/color.php"); ?>
<style>
input[type="checkbox"]:disabled {
visibility: hidden;
}
</style>
<script>
//CREDIT FOR CHECKBOX LIMITATION BASIC CODE TO http://jsfiddle.net/jaredhoyt/Ghtbu/1/
jQuery(function(){
var max = 3;
var checkboxes = $('input[type="checkbox"]');
checkboxes.change(function(){
var current = checkboxes.filter(':checked').length;
checkboxes.filter(':not(:checked)').prop('disabled', current >= max);
checkboxes.filter(':not(:checked)').prop('disabled', current >= max);
});
});
</script>
</head>
<body>
<p>
<?php //This displays the menu
include($_SERVER['DOCUMENT_ROOT'] . "/includes/toolbar.php");
include($_SERVER['DOCUMENT_ROOT'] . "/includes/optionsTab.php");
?>
<center>
<div class="subtitle">
<div id ="bfButton">
<?php if ($teacher_security_valid == 1) { ?>
<?php
#LINK TO PREVIOUS & NEXT STUDENT###################################################
include ($_SERVER['DOCUMENT_ROOT'].'/php/gather_class_student.php');
$i = 0;
foreach ($students as $student) {
if ($student['student_id'] == $stud_id) {
$len = count($students);
if ($i != 0) { #not the first student in the list
$prev_id = $students[$i-1]['student_id'];
echo "<div id = 'bButton'><a href = 'student_report.php?stud_id=$prev_id&class=$class_id'>Back</a></div>";
}
if ($i != $len) {#not last student on the list
$next_id = $students[$i+1]['student_id'];
echo "<div id= 'fButton'><a href = 'student_report.php?stud_id=$next_id&class=$class_id'>Next</a></div>";
}
}
$i+=1;
}
########################################################################
?>
<?php } ?>
</div>
<?php if ($teacher_security_valid == 1) { ?>
<h3 class="subtitle_title" Id="progTitle">
<?php
#retrieve student name##########################################################
$sql = "SELECT first_name, last_name FROM students
WHERE student_id = :student_id";
$student = null;
$student = single_return_prepare_select ($sql, $pdo, ['student_id' => $stud_id]);
################################################################################
#retrieve course code###########################################################
$sql = "SELECT course_code FROM courses WHERE course_id = :course_id";
$course = single_return_prepare_select($sql, $pdo, ['course_id' => $class_id]);
################################################################################
echo "<div id='classLink'><b><a href = '/class_students.php?class_id=$class_id'>" . $course['course_code'] . "</a></b><div id='name'>" . " - " . $student['last_name'] . ", " . $student['first_name'];
echo "</div></div>";
?>
<?php } ?>
</h3>
<?php if ($teacher_security_valid == 1) { ?>
<form name ="print" action="/php/pdf/student_pdf_report_card.php" method = "GET">
<input type = "hidden" name = 'stud_id' value = '<?php echo $stud_id?>'>
<button type="submit" class="progUp" id="printButton"></button>
</form>
<?php } ?>
</div>
<div id = "incase">
<div class="content" id = "s_list" style="text-align: left;">
<?php if ($teacher_security_valid == 1) { ?>
<?php
include ($_SERVER['DOCUMENT_ROOT'] . "/php/student_class_list.php"); //retrieves students in a specific class
if (count($students) >= 1 and !empty($students)) {
foreach ($students as $item) {
if ($item['level_id'] != 1) {
echo "<a class='s_list' href = 'student_report.php?stud_id=$item[student_id]&class=$class_id'>" . $item['last_name'] . ", " . $item['first_name'] . " ✔</a><br/>";
}
else{
echo "<a class='s_list' href = 'student_report.php?stud_id=$item[student_id]&class=$class_id'>" . $item['last_name'] . ", " . $item['first_name'] . "</a><br/>";
}
}
}
/*
include ($_SERVER['DOCUMENT_ROOT'] . "/php/class_students_info.php"); //retrieves teacher's students in a specific class
foreach ($results as $item) {
if ($item['level_id'] != 1) {
echo "<a class='s_list' href = 'student_report.php?stud_id=$item[student_id]&class=$class_id'>" . $item['last'] . ", " . $item['first'] . " ✔</a><br/>";
//adds check mark if student progress is complete
}
else {
echo "<a class='s_list' href = 'student_report.php?stud_id=$item[student_id]&class=$class_id'>" . $item['last'] . ", " . $item['first'] . "</a><br/>";
}
}*/
?>
<?php } ?>
</ul>
</div>
<div class="content" id ="p_list">
<p id="home">
<?php if ($teacher_security_valid == 1) { ?>
<div id="sPic">
<?php
/*Student Picture***********************************************************/
$sql = "SELECT OEN FROM student_info WHERE student_id = :stud_id";
$picture = single_return_prepare_select($sql, $pdo, [':stud_id' => $stud_id]);
$picture['OEN'] .= ".jpg";
$picture_location = "/images/studentPics/" . $picture['OEN'];
if (file_exists($_SERVER['DOCUMENT_ROOT'] . $picture_location) != 0) {
echo "<img src = '" . $picture_location . "'>";
}
else {
echo "<img src = '" . '/images/studentPics/Blank.jpg' . "'>";
}
/***************************************************************************/
?>
</div>
<?php
$sql = "SELECT progress_report.progress_id FROM progress_report
INNER JOIN student_progress ON student_progress.progress_id = progress_report.progress_id
WHERE student_progress.student_id = :student_id AND student_progress.class_id = :class_id";
$variables = array(':student_id' => $stud_id, ':class_id' => $class_id);
$results = single_return_prepare_select($sql, $pdo, $variables);
$progress_id = $results;
#retrieve current student level and interview request############################################################
$sql = "SELECT level_id, interview_request FROM progress_report WHERE progress_id = :progress_id";
$variables = array('progress_id' => $progress_id['progress_id']);
$student_progress = single_return_prepare_select($sql, $pdo, $variables);
#################################################################################################################
#retrieve current student level and interview request############################################################
$sql = "SELECT level_id, interview_request FROM progress_report WHERE progress_id = :progress_id";
$variables = array('progress_id' => $progress_id['progress_id']);
$student_progress = single_return_prepare_select($sql, $pdo, $variables);
#################################################################################################################
#retrieve current student comments ##############################################################################
$sql = "SELECT comment_id FROM progress_comment WHERE progress_id = :progress_id";
$variables = array('progress_id' => $progress_id['progress_id']);
$student_comments = array_prepare_select($sql, $pdo, $variables);
#################################################################################################################
echo "<form name='comment' id='ProgressForm' action = '/php/progress_report_update.php' method = 'POST'>";
#PRINT OUT LEVEL DROPLIST########################################################################################
form_level($student_progress['level_id'], $pdo);
#################################################################################################################
echo "<p class='mobileProgress'><b>PROGRESS COMMENT</b></p>";
#PRINT OUT COMMENT LIST##########################################################################################
$comment_list = comment_display($student_comments, $pdo);
#################################################################################################################
?>
<script>
$(document).ready(function(){
var max = 3;
var checkboxes = $('input[type="checkbox"]');
var current = checkboxes.filter(':checked').length;
checkboxes.filter(':not(:checked)').prop('disabled', current >= max);
checkboxes.filter(':not(:checked)').prop('disabled', current >= max);
});
</script>
<br><div class='mobileProgress' id = "parent_teacher_interview">
Parent Teacher Interview:<br>
<?php
$interview_request_no = "<label id ='yes_no' for ='yes_no'><input style='width:25px; height:25px;' id = 'yes_no' type='radio' name='interview_request' value='0' required";
$interview_request_yes = "<label id ='yes_no' for ='no_yes'><input style='width:25px; height:25px;' id = 'no_yes' type='radio' name='interview_request' value='1' required";
if ($student_progress['interview_request'] == 0) {
$interview_request_no .= " checked";
}
$interview_request_no .= ">No</label><br>";
if ($student_progress['interview_request'] == 1) {
$interview_request_yes .= " checked";
}
$interview_request_yes .= ">Yes</label><br>";
echo $interview_request_yes . $interview_request_no;
?>
</div>
<!--Hidden Input********************************************************************************************-->
<input type = 'hidden' name = 'progress_report' value = <?php echo "$progress_id[progress_id]"; ?>>
<input type = 'hidden' name = 'class_id' value = <?php echo "$class_id"; ?>>
<!--Hidden Input********************************************************************************************-->
<input class='mobileProgress' id="progSub" type = 'submit' value = 'submit'>
</form>
</p>
<?php }
else {
echo "You do not have permission to edit students in this class";
}
?>
</div>
</div>
<?php
?>
</center>
</p>
</body>
</html>
<?php
}
?>