From: Alexander Schmidt Date: Mon, 8 Oct 2012 18:16:33 +0000 (+0200) Subject: ... X-Git-Url: https://git.treefish.org/banana.git/commitdiff_plain/10fa45cd744a59490f4a7e4cb047589d9a8314c0?hp=fcea930220d4896e30baa93ee1603b08df1ff4d7 ... --- diff --git a/admin/blackboard.php b/admin/blackboard.php index a28d8dc..6571f39 100644 --- a/admin/blackboard.php +++ b/admin/blackboard.php @@ -3,7 +3,7 @@ require 'include/db.inc'; require 'include/common.inc'; - if($_GET['mnumber']!="" && + if( isset($_GET['mnumber']) && $db->query("SELECT COUNT(*) FROM students WHERE mnumber=" . trim($_GET['mnumber']) . " AND lastblackboard=" . trim($_GET['tstamp']))->fetch(PDO::FETCH_NUM)[0] == 0) { if( $_GET['sign'] == 0 ) { diff --git a/admin/sessionoverview.php b/admin/sessionoverview.php index 570f59b..77b29b6 100644 --- a/admin/sessionoverview.php +++ b/admin/sessionoverview.php @@ -34,8 +34,8 @@ print ""; } print ""; diff --git a/admin/summary.php b/admin/summary.php index 68c026f..b467157 100644 --- a/admin/summary.php +++ b/admin/summary.php @@ -16,9 +16,11 @@ print ""; print ""; while ($student = $result->fetch(PDO::FETCH_ASSOC)) { - $exdone = $db->query("SELECT manydone FROM workdone WHERE mnumber=" . $student['mnumber'])->fetch(PDO::FETCH_NUM); $totexdone = 0; - foreach($exdone as $subdone) { $totexdone += $subdone; } + if( $db->query("SELECT COUNT(*) FROM workdone WHERE mnumber=" . $student['mnumber'])->fetch(PDO::FETCH_NUM)[0] > 0 ) { + $exdone = $db->query("SELECT manydone FROM workdone WHERE mnumber=" . $student['mnumber'])->fetch(PDO::FETCH_NUM); + foreach($exdone as $subdone) { $totexdone += $subdone; } + } print ""; print ""; print ""; diff --git a/include/session.inc b/include/session.inc index 288c798..46802f4 100644 --- a/include/session.inc +++ b/include/session.inc @@ -23,18 +23,14 @@ if($SESSIONS_actual == -1) unset($SESSIONS_actual); $SESSIONS_totex = 0; + $SESSIONS_totex_nextinc = 0; if(isset($SESSIONS)) { foreach ($SESSIONS as $session) { - if($session['id'] < $SESSIONS_next || (! isset($SESSIONS_next)) ) { $SESSIONS_totex += $session['nexamples']; } - if( $session['id'] != $SESSIONS_actual ) { $SESSIONS_last = $session['id']; } + if( (! isset($SESSIONS_next)) || $session['id'] < $SESSIONS_next ) { $SESSIONS_totex += $session['nexamples']; } + if( (! isset($SESSIONS_actual)) || $session['id'] != $SESSIONS_actual ) { $SESSIONS_last = $session['id']; } + if( (! isset($SESSIONS_next)) || $session['id'] <= $SESSIONS_next ) { $SESSIONS_totex_nextinc += $session['nexamples']; } } } - $SESSIONS_totex_nextinc = 0; - if( isset($SESSIONS) && isset($SESSIONS_next) ) { - foreach ($SESSIONS as $session) { - if($session['id'] <= $SESSIONS_next) { $SESSIONS_totex_nextinc += $session['nexamples']; } - } - } } ?>
First name Last name Matr.nummer Examples Blackboard 
" . $student['firstname'] . "" . $student['lastname'] . "