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']; $sumDistance = $item['DISTANCE']; $sumHeat = $item['HEAT']; } if ($sumRunTime == null) { $sumRunTime = 0; } if ($sumDistance == null) { $sumDistance = 0; } if ($sumHeat == null) { $sumHeat = 0; } ?>