-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcleanup.php
More file actions
45 lines (35 loc) · 1.27 KB
/
cleanup.php
File metadata and controls
45 lines (35 loc) · 1.27 KB
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
<?php
include_once ("./lib/machine.config.php");
include_once ("./lib/config.inc");
include_once ("./lib/ez_sql.php");
include_once ("./lib/function.inc");
$repair = $_GET['repair'];
$sql = "SELECT *
FROM studentlevel
WHERE studentlevel.progress LIKE '%ERR%'";
//echo("<br>ERROR Student Query: $sql<br>");
if($repair == 'on') {
echo("<br>---- UPDATE EROORS ---- <br>");
$results = $db->get_results($sql);
foreach ($results as $res) {
$id = $res->studentid;
$sub = $res->subject;
$lvl = $res->level;
updateSingleLevelScore($id, $sub, $lvl);
echo "Student, Subject, Level ($id, $sub, $lvl) : " . $res->fname . " " . $res->lname . "<br>";
}
echo("<br>---- LEFT OVER EROORS ---- <br>");
} else {
echo("<br>---- CURENT STUDENTS WITH EROORS ---- <br>");
}
$results = $db->get_results($sql);
foreach ($results as $res) {
$id = $res->studentid;
$sub = $res->subject;
$lvl = $res->level;
// updateSingleLevelScore($id, $sub, $lvl);
echo "Student, Subject, Level ($id, $sub, $lvl) : " . $res->fname . " " . $res->lname . "<br>";
}
echo "<br><a href='cleanup.php?repair=on'>Click here to run updateon Errors</a>
<br><br><a href='cleanup.php'>Click here to see which students have Errors</a>"
?>