Mercurial > hg > lukkari
diff beta.php @ 7:2bb40c5945bc
Remove useless variable.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 11 Jan 2011 22:04:18 +0200 |
parents | 3d6a83eaa2ba |
children | fe5b563eaae5 |
line wrap: on
line diff
--- a/beta.php Tue Jan 11 21:58:52 2011 +0200 +++ b/beta.php Tue Jan 11 22:04:18 2011 +0200 @@ -9,8 +9,6 @@ $cacheFile = "coursecache.txt"; $baseURI = "http://tnsp.org/luk/beta.php"; $infoURI = "http://www.oamk.fi/opiskelijalle/rakenne/opinto-opas/koulutusohjelmat/?sivu=oj&kieli=FI&opas=2010-2011&vuosi=10S11K&koodi1="; - -$showDays = 6; $dayNames = array("Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai", "Sunnuntai"); // Include framework @@ -150,7 +148,8 @@ $totalHours = 0; $totalGrouped = 0; $dayHours = array(); - for ($day = 0; $day < $showDays; $day++) + + for ($day = 0; $day < $classInfo["maxdays"]; $day++) $dayHours[$day]["total"] = $dayHours[$day]["grouped"] = 0; foreach ($classDefs as $id => $data) { @@ -165,9 +164,9 @@ } } - for ($day = $showDays - 1; $day >= 0; $day--) { + for ($day = $classInfo["maxdays"] - 1; $day >= 0; $day--) { if ($dayHours[$day]["total"] == 0) - $showDays--; + $classInfo["maxdays"]--; else break; } @@ -178,7 +177,7 @@ "<p>".join("; ", $classInfo["general"])."</p>\n". "<table class=\"timetable\">". " <tr>\n <th></th>\n"; - for ($day = 0; $day < $showDays; $day++) { + for ($day = 0; $day < $classInfo["maxdays"]; $day++) { $out .= " <th class=\"days\">".$dayNames[$day]."</th>\n"; } $out .= " </tr>\n"; @@ -186,7 +185,7 @@ for ($hour = 0; $hour < $classInfo["maxhours"]; $hour++) { $out .= " <tr>\n". " <th class=\"hours\">".getHour($hour)."</th>\n"; - for ($day = 0; $day < $showDays; $day++) { + for ($day = 0; $day < $classInfo["maxdays"]; $day++) { if (isset($classHourTable[$hour][$day])) { $h = $classHourTable[$hour][$day]; @@ -234,7 +233,7 @@ $out .= " </tr>\n"; } - $out .= printHourInfo($dayHours, $showDays). + $out .= printHourInfo($dayHours, $classInfo["maxdays"]). "</table>"; } // haveData