From f0f8ed081a8af374676dea9f97b60e336f8b4ae7 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 27 Sep 2012 18:31:10 +0200 Subject: [PATCH] ... --- summary.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/summary.php b/summary.php index ee3d734..cfc0565 100644 --- a/summary.php +++ b/summary.php @@ -17,20 +17,22 @@ $tot_done = 0; - foreach ($SESSIONS as $session) { - if ($session['id'] == $SESSIONS_next) { break; } + if( isset($SESSIONS) ) { + foreach ($SESSIONS as $session) { + if ($session['id'] == $SESSIONS_next) { break; } - $exdone = $db->query("SELECT thisdone, manydone FROM workdone WHERE mnumber=" . $mnumber . " AND session=" . $session['id'])->fetch(PDO::FETCH_NUM); + $exdone = $db->query("SELECT thisdone, manydone FROM workdone WHERE mnumber=" . $mnumber . " AND session=" . $session['id'])->fetch(PDO::FETCH_NUM); - if ( $exdone[1] == "" ) { $exdone[1] = "0"; } + if ( $exdone[1] == "" ) { $exdone[1] = "0"; } - $tot_done = $tot_done + $exdone[1]; + $tot_done = $tot_done + $exdone[1]; - print ""; - print "" . $session['timestr'] . "  "; - print "" . $session['examples'] . "(" . $session['nexamples'] . ")" . "  "; - print "" . $exdone[1] . "/" . $session['nexamples'] . "(" . $exdone[0] . ")" . "  "; - print ""; + print ""; + print "" . $session['timestr'] . "  "; + print "" . $session['examples'] . "(" . $session['nexamples'] . ")" . "  "; + print "" . $exdone[1] . "/" . $session['nexamples'] . "(" . $exdone[0] . ")" . "  "; + print ""; + } } print ""; print "" . $tot_done . "/" . $SESSIONS_totex . ""; -- 2.39.5