- while ($session = $result->fetch(PDO::FETCH_ASSOC)) {
- $SESSIONS[$session['id']] = array("id" => $session['id'], "timestr" => date("d.m.Y H:i", $session['id']),
- "workdone" => $db->query("SELECT COUNT(*) FROM workdone WHERE session=" . $session['id'])->fetch(PDO::FETCH_NUM)[0],
- "examples" => $session['examples'], "nexamples" => $session['nexamples']);
- if ( strtotime("now") < $session['id'] && ( $SESSIONS_next==-1 || $SESSIONS_next > $session['id'] ) ) {
- $SESSIONS_next = $session['id'];
- }
- if ( strtotime("now") < $session['id'] + 3600 && ( $SESSIONS_actual==-1 || $SESSIONS_actual > $session['id'] ) ) {
- $SESSIONS_actual = $session['id'];
+ while ($session = $result->fetch(PDO::FETCH_ASSOC)) {
+ $SESSIONS[$session['id']] = array("id" => $session['id'], "timestr" => date("d.m.Y H:i", $session['id']),
+ "workdone" => $db->query("SELECT COUNT(*) FROM workdone WHERE session=" . $session['id'])->fetch(PDO::FETCH_NUM)[0],
+ "examples" => $session['examples'], "nexamples" => $session['nexamples']);
+ if ( strtotime("now") < $session['id'] && ( $SESSIONS_next==-1 || $SESSIONS_next > $session['id'] ) ) {
+ $SESSIONS_next = $session['id'];
+ }
+ if ( strtotime("now") < $session['id'] + 3600 && ( $SESSIONS_actual==-1 || $SESSIONS_actual > $session['id'] ) ) {
+ $SESSIONS_actual = $session['id'];
+ }
+ $SESSIONS_n++;