if (!empty($track)) { foreach($track as $tra) { $hrs = round($tra["hours"], 2); $hrs = str_replace(".", ",", $hrs); $myArr = array($tra["pname"], $tra["tname"], $tra["comment"], $tra["daystring"], $tra["startstring"], $tra["endstring"], $hrs); $excel->writeLine($myArr); } $totaltime = $tracker->getTotalTrackTime($track); $totaltime = str_replace(".", ",", $totaltime); $line = array("Total:", "", "", "" , $totaltime); $excel->writeRow(); $excel->writeColspan("<b>Total:</b>", 6); $excel->writeCol("<b>$totaltime</b>"); } $excel->close(); $loc = $url . "files/" . CL_CONFIG . "/ics/user-$id-timetrack.xls"; header("Location: $loc"); } elseif ($action == "userpdf") { if (!empty($start) and !empty($end)) { $track = $tracker->getUserTrack($id, $fproject, $taski, $start, $end); } else { $track = $tracker->getUserTrack($id, $fproject, $taski, 0, 0, 1000); }