2 require 'include/head.inc';
3 require 'include/db.inc';
4 require 'include/session.inc';
5 require 'include/common.inc';
7 if ($db->query("SELECT COUNT(*) FROM students")->fetch(PDO::FETCH_NUM)[0] == 0) {
8 block("red", "no students registered");
12 block("black", "summary of everything for " . date("d.m.Y H:i"));
14 $result = $db->query("SELECT firstname, lastname, mnumber, blackboard FROM students ORDER BY LOWER(lastname)");
17 print "<td><b>First name </b></td><td><b>Last name </b></td><td><b>Matr.nummer </b></td><td><b>Examples </b></td><td><b>Blackboard </b></td>";
18 while ($student = $result->fetch(PDO::FETCH_ASSOC)) {
20 if( $db->query("SELECT COUNT(*) FROM workdone WHERE mnumber=" . $student['mnumber'])->fetch(PDO::FETCH_NUM)[0] > 0 ) {
21 $exdone = $db->query("SELECT manydone FROM workdone WHERE mnumber=" . $student['mnumber']);
22 while ( $subdone = $exdone->fetch(PDO::FETCH_NUM) ) { $totexdone += $subdone[0]; }
25 print "<td>" . $student['firstname'] . "</td>";
26 print "<td>" . $student['lastname'] . "</td>";
27 print "<td>" . $student['mnumber'] . "</td>";
28 print "<td>" . $totexdone . "/" . $SESSIONS_totex_nextinc . "</td>";
29 print "<td>" . $student['blackboard'] . "</td>";