-
Notifications
You must be signed in to change notification settings - Fork 0
/
studentreport.php
100 lines (72 loc) · 2.43 KB
/
studentreport.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
<?php include 'header.php' ?>
<div id = "content">
<h1>Barbados Community College - Web Portal</h1>
<div id="left" class="report">
<form method = "get" action = "studentfinalreport.php">
<?php
$rowNum = 0;
$rem = $i = 0;
$row = array( array("student_id"=>1, "name"=>"Khalil Greenidge", "grade"=>90 ), array("student_id"=>2, "name"=>"Scott Henry", "grade"=>60), array("student_id"=>3, "name"=>"Jeff Bezos", "grade"=>50 ), array("student_id"=>4, "name"=>"Elon Musk", "grade"=>90) );
echo "<table border = '1' style=\"position: relative; left: 100px;\">
<tr>
<th>Student Identification Number</th>
<th>First Name </th>
<th>Grade </th>
</tr>";
while($i < count($row)){
$rowNum++;
$rem = $rowNum % 2;
$id = $row[$i]["student_id"];
$name = $row[$i]["name"];
$grade = $row[$i]["grade"];
//CREATES AN ALTERNATING COLOUR
if($rem == 0){
echo "<tr style='background-color: #FA8258;'>";
echo "<td align=\"center\">" . $id . "</td>";
echo "<td>" . $name . "</td>";
echo "<td align=\"center\">" . $grade. "</td>";
echo "<tr>";
}
else {
echo "<tr>";
echo "<td align=\"center\">".$id."</td>";
echo "<td>".$name."</td>";
echo "<td align=\"center\">" . $grade. "</td>";
}
$i++;
}
echo "</table><br/><br/>";
?>
</div>
<div id="middle" class="report" >
<h3>Statistics for <?php if(isset($course)){ echo $course;} ?></h3>
<p>Below is a summary of the number of grades achieved by the class:</p>
<div id="chart_div" style="height: 500px;"></div>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load("current", {packages:["corechart"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
["Id", "Grade"],
[1, 90],
[2, 60],
[3, 50],
[4, 90]
]);
var options = {
title: 'Grades',
legend: { position: 'none' },
chart: {
title: 'Students\'s Grades'
},
hAxis: {title: 'Student'},
vAxis: {title: 'Grade', minValue: 0, maxValue: 100}
};
var chart = new google.visualization.ScatterChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</div>
</div>
<?php include 'footer.php';?>