X-Git-Url: https://git.treefish.org/banana.git/blobdiff_plain/17d5ad30f747658451fae84fe65cb1f5b66d377c..719a15658a3577b6682bd8d2f96b66b6d6539bbc:/admin/blackboard.php?ds=inline diff --git a/admin/blackboard.php b/admin/blackboard.php index 4066f84..814a879 100644 --- a/admin/blackboard.php +++ b/admin/blackboard.php @@ -3,28 +3,21 @@ require 'include/db.inc'; require 'include/common.inc'; - if(isset($_POST['submit']) && $_POST['mnumber']!="") { - $db->query("UPDATE students SET blackboard=blackboard+1 WHERE mnumber=" . trim($_POST['mnumber'])); - block("lightgreen", "added blackboard"); + if($_GET['mnumber']!="") { + // would be better to store timestamp in blackboard db! + if( time()-$_GET['tstamp'] < 5 ) { + $db->query("UPDATE students SET blackboard=blackboard+1 WHERE mnumber=" . trim($_GET['mnumber'])); + block("lightgreen", "added blackboard"); + } } if ($db->query("SELECT COUNT(*) FROM students")->fetch(PDO::FETCH_NUM)[0] == 0) { block("red", "no students registered"); - break; + exit; } - block("black", "add blackboard"); ?> -
- - - - - -
Matr.nummer:
-
- " . $student['firstname'] . " "; print "" . $student['lastname'] . "  "; print "" . $student['mnumber'] . "  "; - print "" . $student['blackboard'] . ""; + print "" . $student['blackboard'] . "  "; + print "" . "+1" . ""; print ""; } print "";