# HG changeset patch # User Matti Hamalainen # Date 1318723246 -10800 # Node ID dbe7ff545293dd6bcc93523e879262ea09ac77d8 # Parent 6148ce4a83edcae87d61e51cb5deaa5e146ff93c Add support for fetching and showing data for next/upcoming period. diff -r 6148ce4a83ed -r dbe7ff545293 index.php --- a/index.php Tue Sep 27 10:56:50 2011 +0300 +++ b/index.php Sun Oct 16 03:00:46 2011 +0300 @@ -159,12 +159,16 @@ errorMsg("Luokkien listaa ei löytynyt. Kokeile ladata sivu uudelleen hetken kuluttua."); } +if (isset($_GET["next"])) + $dataFile = "cache-next/".$luokka.".data"; +else + $dataFile = "cache/".$luokka.".data"; -if (!file_exists($dataDir.$luokka.".data")) { +if (!file_exists($dataFile)) { errorMsg("Luokan ".htmlentities($luokka)." tietoja ei löytynyt! Jos luokkakoodi on uusi, ilmestyy se järjestelmään seuraavan päivityksen aikana. Luokkatiedot päivitetään 2 kertaa vuorokaudessa."); $haveData = FALSE; } else { - require($dataDir.$luokka.".data"); + require($dataFile); $haveData = isset($classDefs); } @@ -412,6 +416,7 @@ echo "] [Alkuperäinen] + [Seuraava periodi] diff -r 6148ce4a83ed -r dbe7ff545293 update.sh --- a/update.sh Tue Sep 27 10:56:50 2011 +0300 +++ b/update.sh Sun Oct 16 03:00:46 2011 +0300 @@ -58,3 +58,5 @@ #parse "http://www.oamk.fi/tyojarjestykset/otek/luokat/" "luokat.txt" "" parse "http://www.oamk.fi/~heikkim/Luhti1/Ryhm%84t/" "luokat.txt" "Ryh._" +CACHEDIR="cache-next/" +parse "http://www.oamk.fi/~heikkim/Luhti2/Ryhm%84t/" "luokat.txt" "Ryh._"