Tidy up forms.
[readifood.git] / lib / area.php
index b2ac8c8..51f57d3 100644 (file)
@@ -53,7 +53,7 @@
       return;
     }
 
-    echo "<form method=\"POST\" action=\"" . $_SCRIPT['REQUEST_URI'] . "\">\n";
+    form("noprint standout");
     echo "<p>Show areas in\n";
     echo "<select name=\"city_id\">\n";
     foreach ($cities as $city) {
@@ -61,7 +61,7 @@
     }
     echo "</select>\n";
     echo "<input type=\"submit\" value=\"Show\">\n";
-    echo "</form>\n";
+    end_form();
   }
 
   function show_new_area_form($city_id = null) {
@@ -74,7 +74,7 @@
       return;
     }
 
-    echo "<form method=\"POST\" action=\"" . $_SERVER['REQUEST_URI'] . "\">\n";
+    form("noprint standout");
     echo "<p>Add a new area <input name=\"area_name\">\n";
     echo "in <select name=\"city_id\">\n";
 
@@ -83,7 +83,7 @@
     }
     echo "</select>\n";
     echo "<input type=\"submit\" value=\"Add\">\n";
-    echo "</form>\n";
+    end_form();
   }
 
   function add_area($name, $city_id) {
     $area = get_area_by_name($name);
     if (! $area) return;
 
-    echo "<form method=\"POST\" action=\"" . $_SERVER['REQUEST_URI'] . "\">\n";
+    form();
     echo "<p>Area: <span class=\"strong\">" . $area->getName() . "</span>";
     $n = $area->getName();
     $i = $area->getId();
       echo "<input type=\"submit\" name=\"update_area\" value=\"Update\">\n";
     }
     echo "</p>\n";
-    echo "</form>\n";
+    end_form();
   }
 
   /* /area/in/Cambridge/1 */