X-Git-Url: https://git.treefish.org/banana.git/blobdiff_plain/78533c089d9413327f981cb2b20090a28f25e5e5..b1667cd8e037e2b0da80fa63644f4fbce5cf5abe:/summary.php diff --git a/summary.php b/summary.php index b59c7bb..d63c765 100644 --- a/summary.php +++ b/summary.php @@ -12,25 +12,47 @@ block("black", "summary for " . $_POST['mnumber']); - print "Examples Submitted"; + if ( isset($SESSIONS_next) ) { + print "Submitted for next session on " . $SESSIONS[$SESSIONS_next]['timestr'] . ""; + + print ""; + + if($db->query("SELECT COUNT(*) FROM workdone WHERE mnumber = $mnumber AND session = $SESSIONS_next")->fetch(PDO::FETCH_NUM)[0] == 0) { + print ""; + } + else { + $wdone = $db->query("SELECT thisdone,manydone FROM workdone WHERE mnumber = $mnumber AND session = $SESSIONS_next")->fetch(PDO::FETCH_NUM); + print "
"; + } + + print "
0 (0/" . $SESSIONS[$SESSIONS_next]['nexamples'] . ")
" . $wdone[0] . " (" . $wdone[1] . "/" . $SESSIONS[$SESSIONS_next]['nexamples'] . ")
"; + + print "
"; + } + + print "Examples submitted so far"; print ""; $tot_done = 0; - foreach ($SESSIONS as $session) { - if ($session['id'] == $SESSIONS_next) { break; } + if( isset($SESSIONS) ) { + foreach ($SESSIONS as $session) { + if ( isset($SESSIONS_next) ) { + 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 ""; - print ""; - print ""; - print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + } } print ""; print ""; @@ -53,7 +75,7 @@
" . $session['timestr'] . "  " . $session['examples'] . "(" . $session['nexamples'] . ")" . "  " . $exdone[1] . "/" . $session['nexamples'] . "(" . $exdone[0] . ")" . "  
" . $session['timestr'] . "  " . $session['examples'] . "(" . $session['nexamples'] . ")" . "  " . $exdone[1] . "/" . $session['nexamples'] . "(" . $exdone[0] . ")" . "  
" . $tot_done . "/" . $SESSIONS_totex . "
- +
Last submission
Summary