while ($session = $result->fetch(PDO::FETCH_ASSOC)) {
$SESSIONS[$session['id']] = array("id" => $session['id'], "timestr" => date("d.m.Y H:i", $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']),
if ( strtotime("now") < $session['id'] + 3600 && ( $SESSIONS_actual==-1 || $SESSIONS_actual > $session['id'] ) ) {
$SESSIONS_actual = $session['id'];
}
if ( strtotime("now") < $session['id'] + 3600 && ( $SESSIONS_actual==-1 || $SESSIONS_actual > $session['id'] ) ) {
$SESSIONS_actual = $session['id'];
}
- foreach ($SESSIONS as $session) {
- if($session['id'] < $SESSIONS_next) { $SESSIONS_totex += $session['nexamples']; }
+ 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']; }
+ }
- foreach ($SESSIONS as $session) {
- if($session['id'] <= $SESSIONS_next) { $SESSIONS_totex_nextinc += $session['nexamples']; }
+ if( isset($SESSIONS) && isset($SESSIONS_next) ) {
+ foreach ($SESSIONS as $session) {
+ if($session['id'] <= $SESSIONS_next) { $SESSIONS_totex_nextinc += $session['nexamples']; }
+ }