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.php
108 lines (81 loc) · 2.47 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
<?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) {
$teach_id = $_SESSION['id'];
include ($_SERVER['DOCUMENT_ROOT'] . "/php/progress_functions.php");
include ($_SERVER['DOCUMENT_ROOT'] . "/php/prepare_sql.php");
$student_id = $_GET['stud_id'];
?>
<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>
iframe {
width: 70%;
height: 100%;
border:none;
}
</style>
</head>
<body>
<p>
<?php
include('includes/toolbar.php');
include('includes/optionsTab.php');
?>
<center>
<div class="subtitle">
<p class="subtitle_title">
<?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' => $student_id]);
################################################################################
echo $student['last_name'] . ", " . $student['first_name'];
?>
</p>
<form name ="print" action="/php/pdf/student_pdf_report_card.php" method = "GET">
<input type = "hidden" name = 'stud_id' value = '<?php echo $_GET['stud_id']; ?>'>
<button type="submit" class="studProg" id="printButton"></button>
</form>
</div>
<div class="content">
<p id="home">
<?php
if (empty($student)) {
echo "ERROR: STUDENT DOES NOT EXIST";
exit();
}
else {
include ($_SERVER['DOCUMENT_ROOT'] . "/php/student_report_cards.php"); //fetches a student class id for all of their classes
if ($class_valid == 1) {?>
<iframe src = "/php/pdf/student_pdf_report_card.php?stud_id=<?php echo $student_id; ?>" scrolling="auto"></iframe>
<?php
}
else {
echo "STUDENT IS NOT REGISTERED IN ANY CLASSES";
}
?>
</p>
</div>
</center>
</p>
</body>
</html>
<?php
}
?>
<?php
}
?>