changeset 194:82803532a51c

Merged.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 11 Nov 2013 09:31:37 +0200
parents a14663f6497d (current diff) 1e4f530c8310 (diff)
children e65b2392fc0e
files
diffstat 3 files changed, 62 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/compos.inc.php	Sat Nov 09 14:58:24 2013 +0200
+++ b/compos.inc.php	Mon Nov 11 09:31:37 2013 +0200
@@ -52,6 +52,20 @@
   return $str;
 }
 
+
+$sql = "SELECT id,name FROM compos WHERE visible<>0 ORDER BY id ASC";
+
+if (($res = stExecSQL($sql)) !== FALSE)
+{
+  $list = array();
+  foreach ($res as $item)
+  {
+    $list[] = "<a href=\"#compo".$item["id"]."\">".chentities($item["name"])."</a>";
+  }
+  echo "<p>".join($list, " | ")."</p>";
+}
+
+
 $sql = "SELECT * FROM compos WHERE visible<>0 ORDER BY id ASC";
 
 if (($res = stExecSQL($sql)) !== FALSE)
--- a/desktop.css	Sat Nov 09 14:58:24 2013 +0200
+++ b/desktop.css	Mon Nov 11 09:31:37 2013 +0200
@@ -4,7 +4,7 @@
 
 a.logo, a.logo2 {
 	background: url(img/fap.png) no-repeat center;
-	height: 10em;
+	height: 13em;
 	display: block;
 }
 
@@ -45,7 +45,7 @@
 
 #menu {
 	position: fixed;
-	top: 10em;
+	top: 12em;
 	left: 0.5em;
 	right: 1em;
 	min-height: 10em;
@@ -109,7 +109,7 @@
 
 #infobox {
 	position: fixed;
-	top: 8.2em;
+	top: 9.5em;
 	left: 11em;
 	min-width: 10em;
 
@@ -161,7 +161,7 @@
 	position: fixed;
 	left: 13em;
 	right: 1em;
-	top: 12em;
+	top: 14em;
 	bottom: 1em;
 	padding: 1em;
 	margin: 0em;
--- a/register.inc.php	Sat Nov 09 14:58:24 2013 +0200
+++ b/register.inc.php	Mon Nov 11 09:31:37 2013 +0200
@@ -11,17 +11,31 @@
 $botCheckOPs = "bit";
 $botCheckROPs = "+-*";
 
+$formFields = array(
+  "name" => "Name", 
+  "groups" => "Group(s)",
+  "email" => "E-mail",
+  "oneliner" => "Oneliner",
+  "hash" => FALSE,
+  "botcheck" => FALSE,
+);
 
-function stPrintFormData($button, $mode = "start")
+
+function stPrintFormData($button, $mode = "start", $exclude = array())
 {
+  global $formFields;
+
   echo
-  stGetFormStart("register").
-  " ".stGetFormSubmitInput("continue", $button)."\n";
+    stGetFormStart("register").
+    " ".stGetFormSubmitInput("continue", $button)."\n";
 
   stPrintFormHiddenInput("mode", $mode);
-  
-  foreach (array("name", "groups", "email", "oneliner", "hash", "botcheck") as $name)
-    stPrintFormHiddenInput($name, stGetRequestItem($name));
+
+  foreach ($formFields as $name => $title)
+  {
+    if (!in_array($name, $exclude))
+      stPrintFormHiddenInput($name, stGetRequestItem($name));
+  }
 
   echo "</form>\n";
 }
@@ -138,7 +152,7 @@
   echo stGetSetting("registerInfoText");
 }
 else
-if ($mode == "check")
+if ($mode == "check" || $mode == "register")
 {
   //
   // Check the registrant's details
@@ -176,9 +190,10 @@
     echo
       "<p>Following errors occured:</p>\n".
       "<ul>\n".$errorMsg."</ul>\n";
-    stPrintFormData("Go back");
+    stPrintFormData("Go back", "start", array("botcheck"));
   }
   else
+  if ($mode == "register")
   {
     $sql = stPrepareSQL(
       "INSERT INTO attendees (regtime,name,groups,oneliner,email) VALUES (%d,%S,%S,%S,%S)",
@@ -198,5 +213,26 @@
         "<p>Oh noes! SQL error happenstance!</p>";
     }
   }
+  else
+  {
+    echo
+      "<h1>Verify your information</h1>\n".
+      "<p>Is the following information correct?</p>\n".
+      "<table class=\"register\">\n";
+    
+    foreach ($formFields as $name => $title)
+    {
+      if ($title !== FALSE)
+      {
+        echo
+          " <tr><td class=\"".$name."\">".chentities($title).":</td>".
+          "<td>".chentities(stGetRequestItem($name))."</td></tr>\n";
+      }
+    }
+    echo "</table>\n";
+
+    stPrintFormData("Go back", "start", array("botcheck"));
+    stPrintFormData("Register", "register");
+  }
 }
 ?>
\ No newline at end of file