5 if(isset($_POST['submit']) && $_POST['mnumber']!="") {
6 require 'createdb.inc';
9 $mnumber = trim($_POST['mnumber']);
10 $password = trim($_POST['password']);
12 $sessionid = strtotime(end($sessions)[0]);
14 if (! ( $mnumber == 007 AND $password == 007 )) {
15 require 'usercheck.inc';
16 $result = $db->query("SELECT thisdone FROM workdone WHERE mnumber = $mnumber AND session = $sessionid")->fetch(PDO::FETCH_NUM)[0];
18 print "<table bgcolor=\"red\">";
19 print "<tr><th><b><font color=\"white\">no submit</font></b></th><tr>";
21 print "No results were submitted for " . end($sessions)[0] . ".";
25 print "<table bgcolor=\"lightgreen\">";
26 print "<tr><th><b><font color=\"white\">Last submit of $mnumber for " . end($sessions)[0] . "</font></b></th><tr>";
32 $result = $db->query("SELECT students.firstname, students.lastname, students.mnumber, workdone.manydone, workdone.thisdone FROM workdone, students WHERE workdone.session = $sessionid AND workdone.mnumber = students.mnumber");
34 print "<table bgcolor=\"lightgreen\">";
35 print "<tr><th><b><font color=\"white\">Last submits for " . end($sessions)[0] . "</font></b></th><tr>";
40 while ($row = $result->fetch(PDO::FETCH_NUM)) {
42 echo "<td>$row[0] $row[1] </td> <td>$row[2] </td> <td>$row[4] </td> <td>$row[3]/$lstsession_nex </td>";
53 <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
54 <table bgcolor="black">
55 <tr><th><b><font color="white">Last submission</font></b></th><tr>
60 <th align="left">Mat.nummer:</th> <th align="left"><input type="text" name="mnumber"></th>
63 <th align="left">Password:</th> <th align="left"><input type="text" name="password"></th>
65 <tr><th colspan=2></th></tr>
68 <th align="left"><input type="submit" name="submit" value="Show"></th> <th></th>