Fixed changing area in existing address.
[readifood.git] / lib / contact.php
index 8ba1fcd..d83e101 100644 (file)
     echo "<tr>\n";
     echo "  <td>Family unit</td>\n";
     echo "  <td><select name=\"parcel_size\">\n";
-    $mask = 1 << (count($parcel_sizes) + 1);
+    $mask = 1 << count($parcel_sizes);
     for ($i = 0; $i < count($parcel_sizes); $i++) {
-      option("parcel_size", $i << 1, $parcel_sizes[$i], $contact->getParcel() % $mask);
+      option("parcel_size", 1 << $i, $parcel_sizes[$i], $contact->getParcel() % $mask);
     }
     echo "</select></td>\n";
     echo "</tr>\n";
     }
 
     /* Get address. */
+    $area_id = $_POST['area_id'];
     $line = $_POST['address'];
     $postcode = $_POST['postcode'];
     $q = new AddressQuery;