$distance = 0; $heat = 0; $sumRunTime = 0; $sumDistance = 0; $sumHeat = 0; require '../model/healthService.class.php'; $res = HealthService::findExercise($username); if ($item = $res->fetchArray(SQLITE3_ASSOC)) { $runTime = $item['RUNTIME']; $distance = $item['DISTANCE']; $heat = $item['HEAT']; } if (is_array($_GET) && count($_GET) > 0) { if (isset($_GET["date"])) { if ($_GET['date'] != "") { $res = HealthService::findExerciseByDate($username, $_GET['date']); if ($item = $res->fetchArray(SQLITE3_ASSOC)) { $runTime = $item['RUNTIME']; $distance = $item['DISTANCE']; $heat = $item['HEAT']; } else { $runTime = 0; $distance = 0; $heat = 0; } } } } $res = HealthService::findAllExercise($username); if ($item = $res->fetchArray(SQLITE3_ASSOC)) { $sumRunTime = $item['RUNTIME'];