--- a/betweenpoint.php +++ b/betweenpoint.php @@ -76,7 +76,7 @@ '; } ?> -var timeicon = new OpenLayers.Icon("http://maps.google.com/mapfiles/kml/pushpin/grn-pushpin.png",new OpenLayers.Size(32,32)); +var timeicon = new OpenLayers.Icon("icong.png",new OpenLayers.Size(32,32)); var timepoints = new OpenLayers.Layer.GeoRSS("Timing Points", "displaytimepoints.georss.php", { icon: timeicon }); map.addLayers([osmtiles, markers,timepoints]); @@ -88,13 +88,28 @@ function submitBetween () { $.post("betweenpoint.submit.php", $("#inputform").serialize(), function(html){ $("#response").html(html); - //clearForms(); + clearForms(); return false; }); }; function submitMove () { $.post("betweenpoint.move.php", $("#moveform").serialize(), function(html){ $("#response").html(html); + clearForms(); + return false; + }); +}; +function submitDelete () { + $.post("betweenpoint.delete.php", $("#moveform").serialize(), function(html){ + $("#response").html(html); + clearForms(); + return false; + }); +}; +function submitAdd () { + $.post("betweenpoint.add.php", $("#moveform").serialize(), function(html){ + $("#response").html(html); + clearForms(); return false; }); }; @@ -188,10 +203,11 @@ } - + $processed = 0; foreach ($paths as $path => $routes) { if (!in_array($path, array_keys($completedPaths))) { - echo "<option value=\"$routes:$path\">" . sizeof(explode(";", $routes)) . " $path</option>\n"; + echo "<option value=\"$routes:$path\"> $path ($routes) </option>\n"; + $processed++; } else { $completedRoutes = explode(";", $completedPaths[$path]); $incompleteRoutes = ""; @@ -203,13 +219,14 @@ } if ($incompleteRoutes != "") { - echo "<option value=\"$incompleteRoutes:$path\">" . sizeof(explode(";", $incompleteRoutes)) . " $path</option>\n"; + echo "<option value=\"$incompleteRoutes:$path\"> $path ($incompleteRoutes) </option>\n"; + $processed++; } } } + echo "</select>$processed"; ?> -</select> from <input type="text" name="from" id="from"/> to <input type="text" name="to" id="to"/> <br> @@ -224,7 +241,8 @@ oldgeopo <input type="text" name="oldgeopo" id="oldgeopo"/> newlatlng <input type="text" name="newlatlng" id="newlatlng" size="60"/> <input type="button" onclick="javascript:submitMove()" value="Move!"> - + <input type="button" onclick="javascript:submitAdd()" value="Add!"> + <input type="button" onclick="javascript:submitDelete()" value="Delete!"> </form> <div id="response"> <!-- Our message will be echoed out here -->