Mercurial > hg > lukkari
comparison beta.php @ 10:6272ca0cacea
Make editing of custom timetable easier.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 11 Jan 2011 22:30:59 +0200 |
parents | fe5b563eaae5 |
children | 03c393c347c7 |
comparison
equal
deleted
inserted
replaced
9:fe5b563eaae5 | 10:6272ca0cacea |
---|---|
18 | 18 |
19 // Helper functions | 19 // Helper functions |
20 function checkClassID(&$id) | 20 function checkClassID(&$id) |
21 { | 21 { |
22 global $luokkaDefault; | 22 global $luokkaDefault; |
23 if (!preg_match("#^[A-Z]{3}\d\S+#", $id)) { | 23 if (!preg_match("#^[A-Z]{3}\d\S+|ccr#", $id)) { |
24 errorMsg("Virhe! Luokan täytyy olla muotoa <b>XXXnXXX</b>, käytetään vakioavoa <b>".$luokkaDefault."</b>."); | 24 errorMsg("Virhe! Luokan täytyy olla muotoa <b>XXXnXXX</b>, käytetään vakioavoa <b>".$luokkaDefault."</b>."); |
25 $id = $luokkaDefault; | 25 $id = $luokkaDefault; |
26 return FALSE; | 26 return FALSE; |
27 } else | 27 } else |
28 return TRUE; | 28 return TRUE; |
180 for ($day = 0; $day < $classInfo["maxdays"]; $day++) { | 180 for ($day = 0; $day < $classInfo["maxdays"]; $day++) { |
181 if (isset($classHourTable[$hour][$day])) { | 181 if (isset($classHourTable[$hour][$day])) { |
182 $h = $classHourTable[$hour][$day]; | 182 $h = $classHourTable[$hour][$day]; |
183 | 183 |
184 if ($h < 1) { | 184 if ($h < 1) { |
185 if ($h == 0) { | 185 if ($h > -9999) { |
186 $n = 0; | 186 $n = 0; |
187 for ($i = $hour; $i < $classInfo["maxhours"]; $i++) | 187 for ($i = $hour; $i < $classInfo["maxhours"]; $i++) |
188 if ($classHourTable[$i][$day] == $h) { | 188 if ($classHourTable[$i][$day] == $h) { |
189 $classHourTable[$i][$day] = -1; | 189 $classHourTable[$i][$day] = -9999; |
190 $n++; | 190 $n++; |
191 } else | 191 } else |
192 break; | 192 break; |
193 $out .= " <td rowspan=\"".$n."\" class=\"clnothing\"></td>\n"; | 193 $out .= " <td rowspan=\"".$n."\" class=\"clnothing\"></td>\n"; |
194 } | 194 } |