From d38ececa64cec676367c348bc795cd1158dd723b Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 8 Oct 2012 13:57:09 +0200 Subject: [PATCH] ... --- admin/blackboard.php | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/admin/blackboard.php b/admin/blackboard.php index 139abe9..814a879 100644 --- a/admin/blackboard.php +++ b/admin/blackboard.php @@ -3,9 +3,12 @@ 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) { @@ -13,18 +16,8 @@ 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 ""; -- 2.39.5