-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreport3.php.bak
68 lines (61 loc) · 1.87 KB
/
report3.php.bak
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
<?php
session_start();
require_once("config.php");
include("db.php");
include("functions.php");
$pageTitle = "ผลการสอบแต่ละรายวิชา - " . $cfg['title'];
include("head.php");
include("sidebar.php");
echo '<div id="content" class="large-8 medium-8 medium-pull-4 columns">';
echo '<h1><span>ผลการสอบแต่ละรายวิชา</span></h1>';
$sub_id = "";
$top_id = "";
$stu_id = "";
$db->Table = "Subject";
$db->Where = "1";
$Sub_Data = $db->Select();
if ($Sub_Data) {
// Subjects
echo '<ul>';
foreach ($Sub_Data as $value) {
// Each subject
$sub_id = $value['Sub_id'];
echo '<li><b>' . $value['Sub_id'] . '</b> ' . $value['Sub_name'] . '</li>';
$db->Table = "Topics";
$db->Where = "Sub_id = '$sub_id'";
$Top_Data = $db->Select();
if ($Top_Data) {
// Topics
echo '<ul>';
foreach ($Top_Data as $value) {
// Each topic
$top_id = $value['Top_id'];
echo '<li><b>' . $value['Top_name'] . '</b></li>';
$db->Table = "Student";
$db->Where = "1";
$Stu_Data = $db->Select();
if ($Stu_Data) {
// Students
echo '<ul>';
foreach ($Stu_Data as $value) {
// Each student
$stu_id = $value['Stu_id'];
$db->Table = "Scoreboard";
$db->Where = "Sub_id = '$sub_id' and Top_id = '$top_id' and Stu_id = '$stu_id'";
//echo $db->Where;
$score_Data = $db->Select1();
if ($score_Data) {
echo '<li>' . $value['Stu_id'] . ' ' . $value['Stu_name'] . ' [ ' . $score_Data['Score'] . ' / 5' . ' ]</li>';
} else {
echo '<li>' . $value['Stu_id'] . ' ' . $value['Stu_name'] . ' [ ไมได้สอบ ]</li>';
}
}
echo '</ul>';
}
}
echo '</ul>';
}
}
echo '</ul>';
}
?> </div>