2 require 'include/head.inc';
3 require 'include/db.inc';
4 require 'include/common.inc';
6 if(isset($_POST['submit']) && $_POST['mnumber']!="") {
7 $db->query("UPDATE students SET blackboard=blackboard+1 WHERE mnumber=" . trim($_POST['mnumber']));
8 block("lightgreen", "added blackboard");
11 block("black", "add blackboard");
14 <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
17 <th align="left">Matr.nummer:</th> <th><input type="text" name="mnumber"></th>
18 <th><input type="submit" name="submit" value="Add"></th>
24 block("black", "blackboard overview");
26 $result=$db->query("SELECT firstname, lastname, mnumber, blackboard FROM students");
29 while ($student = $result->fetch(PDO::FETCH_ASSOC)) {
31 print "<td>" . $student['firstname'] . " </td>";
32 print "<td>" . $student['lastname'] . " </td>";
33 print "<td>" . $student['mnumber'] . " </td>";
34 print "<td>" . $student['blackboard'] . "</td>";