changeset 18:e0f1a5861f28

Fixes, cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 12 Jan 2011 02:54:52 +0200
parents 611452d30bd4
children 777791321149
files index.php luk.css
diffstat 2 files changed, 27 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/index.php	Wed Jan 12 01:32:13 2011 +0200
+++ b/index.php	Wed Jan 12 02:54:52 2011 +0200
@@ -37,7 +37,7 @@
 {
   global $luokkaDefault;
   if (!preg_match("#^[A-Z]{3}\d\S+|ccr#", $id)) {
-    errorMsg("Virhe! Luokan täytyy olla muotoa <b>XXXnXXX</b>, käytetään vakioavoa <b>".$luokkaDefault."</b>.");
+    errorMsg("Virhe! Luokan täytyy olla muotoa <b>XXXnXXX</b>, käytetään vakioarvoa <b>".$luokkaDefault."</b>.");
     $id = $luokkaDefault;
     return FALSE;
   } else
@@ -239,7 +239,8 @@
 
   $chk = $classHourTable[$hour][$day];
 
-  $out = "<h2>".$dayNames[$day]." ".$aika["mday"].".".$aika["mon"].".".$aika["year"]." - klo ".$aika["hours"].":".$aika["minutes"]."</h2>\n".
+  $out = "<div class=\"content\">\n".
+  "<h2>".$dayNames[$day]." ".$aika["mday"].".".$aika["mon"].".".$aika["year"]." - klo ".$aika["hours"].":".$aika["minutes"]."</h2>\n".
   getHourInfo($chk)."\n";
   
 //  $out .= "hour=".$hour."/day=".$day."<br />\n";
@@ -269,7 +270,8 @@
     $day = $aika["wday"] - 1;
     if ($day < 0) $day = 7;
     $out .= "<h2>Seuraavaksi: ".$dayNames[$nday]." ".date("d.n.Y", $stamp)." - klo ".date("H:i", $stamp)."</h2>\n".
-    getHourInfo($found)."\n";
+    getHourInfo($found)."\n".
+    "</div>\n";
   }
 }
 else
@@ -303,7 +305,8 @@
   "<table class=\"timetable\">".
   " <tr>\n  <th></th>\n";
   for ($day = 0; $day < $classInfo["maxdays"]; $day++) {
-    $out .=  "  <th class=\"days\">".$dayNames[$day]."</th>\n";
+    $out .=  "  <th style=\"width: ".(100 / $classInfo["maxdays"]).
+      "%;\" class=\"days\">".$dayNames[$day]."</th>\n";
   }
   $out .= " </tr>\n";
 
@@ -365,9 +368,11 @@
 
 $pageTitle = $haveData ? $luokka." / ".join("; ", $classInfo["info"]) : $luokka;
 printPageHeader($pageTitle);
-echo "<h1>".$pageTitle."</h1>\n";
+
+if ($miniMode) echo "<div id=\"mini\">\n";
 
-echo "<form action=\"".$baseURI."\" method=\"get\">\n".
+echo
+"<form id=\"controls\" action=\"".$baseURI."\" method=\"get\">\n".
 " <table>\n".
 "  <tr>\n".
 "   <td>\n".
@@ -393,6 +398,7 @@
 " </table>\n".
 "</form>\n";
 
+echo "<h1>".$pageTitle."</h1>\n";
 
 // Show error messages
 if ($errorSet) {
@@ -405,6 +411,8 @@
 echo $out;
 
 echo "<div style=\"position: relative; top: 5em; font-size: 5pt;\"><hr />Yhteydenotot <b>ccr @ IRCNet</b> tai <b>ccr at tnsp.org</b>, en vastaa mahdollisista virheistä tiedoissa.</div>\n";
+
+if ($miniMode) echo "</div>\n";
 printPageFooter();
 
 
--- a/luk.css	Wed Jan 12 01:32:13 2011 +0200
+++ b/luk.css	Wed Jan 12 02:54:52 2011 +0200
@@ -42,3 +42,16 @@
 	padding: 2pt;
 	border: 1px solid gray;
 }
+
+#controls {
+	padding: 0px;
+	margin: 0px;
+}
+
+#controls table * {
+	padding: 0px;
+	margin: 0px;
+}
+
+#mini {
+}