diff www/loc.php @ 622:6d2c28904660

Synchronized.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 27 Jun 2008 12:43:40 +0000
parents 537fae9ebf1d
children a8832a6e5dd9
line wrap: on
line diff
--- a/www/loc.php	Thu Jun 26 20:43:23 2008 +0000
+++ b/www/loc.php	Fri Jun 27 12:43:40 2008 +0000
@@ -2,10 +2,10 @@
 require "config.inc.php";
 require "common.inc.php";
 
-function makeURL($pcities, $coders, $name, $desc, $class)
+function makeURL($afilter, $filter, $coders, $name, $desc, $class)
 {
   $s = "";
-  if ($pcities) $s = "c";
+  if ($afilter) $s = "f=".$filter;
 
   if (!$coders) {
     if ($s != "") $s .= "&amp;";
@@ -30,7 +30,7 @@
  */
 printPageHeader($pageTitle." - Locations",
   "<script type=\"text/javascript\" src=\"tooltip.js\"></script>");
-//echo "<div><b>DEVELOPMENT VERSION</b></div>";
+echo "<div><b>DEVELOPMENT VERSION</b></div>";
 
 
 $onlyPCities = isset($_GET["c"]);
@@ -38,7 +38,7 @@
   $filter = "C";
   $applyFilter = TRUE;
 } else {
-  if (isset($_GET["f"])) {
+  if (isset($_GET["f"]) && $_GET["f"] != "") {
     $filter = $_GET["f"];
     $applyFilter = TRUE;
   } else {
@@ -76,7 +76,7 @@
   if (array_key_exists($filter, $locationTypes)) {
     echo $locationTypes[$filter][2];
   } else {
-    echo "lol?";
+    echo "?";
   }
 } else
   echo "Locations";
@@ -93,35 +93,44 @@
   echo " by ".$coderName;
 echo "</h1>\n";
 
-echo "<div class=\"selbar\">\n <table>\n  <tr>\n";
-makeURL(FALSE, TRUE, null, "EVERYTHING", "sel1");
-
-if (!$onlyPCities) {
-  makeURL(TRUE, $showCoders, $setName, "PCities", "sel2");
-  
-  if (!$showCoders)
-    makeURL($onlyPCities, TRUE, $setName, "Show Coders", "sel3");
-  else
-    makeURL($onlyPCities, FALSE, $setName, "Hide Coders", "sel3");
-} else {
-  makeURL(FALSE, $showCoders, $setName, "Locations", "sel2");
-
-  if (!$showCoders)
-    makeURL($onlyPCities, TRUE, $setName, "Show SS", "sel3");
-  else
-    makeURL($onlyPCities, FALSE, $setName, "Hide SS", "sel3");
+?>
+<div class="selbar">
+ <form action="<? echo $GLOBALS["SCRIPT_NAME"]; ?>" method="get">
+<?
+if (isset($setName))
+  echo "<input type=\"hidden\" name=\"n\" value=\"".htmlentities($setName)."\" />\n";
+?>
+ <table>
+  <tr>
+   <td>
+    <select name="f">
+<?
+reset($locationTypes);
+while (list($iKey, $iValue) = each($locationTypes)) {
+  echo "    <option value=\"".$iKey."\"";
+  if ($applyFilter && $filter == $iKey)
+    echo " selected=\"selected\"";
+  echo ">".$iValue[3]."</option>\n";
 }
+?>
+    </select>
+   </td>
+   <td>
+    <input type="submit" value=" Update " class="isubmit" />
+   </td>
+<?
 
 echo "   <td></td>\n";
 
 reset($continentList);
 while (list($iKey, $iValue) = each($continentList)) {
-  makeURL($onlyPCities, $showCoders, $iKey, $iValue, $iKey);
+  makeURL($applyFilter, $filter, $showCoders, $iKey, $iValue, $iKey);
 }
 ?>
    <td><a href="<? echo $pageIndex ?>">Back to main page</a></td>
   </tr>
  </table>
+ </form>
 </div>
 
 <?
@@ -244,7 +253,7 @@
           while (list($fKey, $fVal) = each($iv["coders"])) {
             if ($fs != "") $fs .= ", ";
             if (!$onlyPCities)
-              $fs .= "<a href=\"loc.php?a=".$fVal."\">".$fVal."</a>";
+              $fs .= "<a href=\"".$GLOBALS["SCRIPT_NAME"]."?a=".$fVal."\">".$fVal."</a>";
             else
               $fs .= $fVal;
           }