--- /dev/null
+<?php\r
+require_once("../../path_index.php");\r
+if (@$_REQUEST['ajax']) \r
+{\r
+\r
+ $conn = pg_connect(POSTGIS_CS);\r
+if (pg_ErrorMessage($conn)) \r
+ { \r
+ echo "<p><b>Ocurrio un error conectando a la base de datos: .</b></p>"; \r
+ }\r
+ \r
+ else \r
+ { \r
+\r
+ \r
+ $q="select name,code from edit_crs where area='".$_REQUEST['area']."' and crs_type='".$_REQUEST['type']."'";\r
+\r
+\r
+ $postgis_result=pg_query($q);\r
+ \r
+ //"select extent(astext(the_geom)) from scarabeidos where species='".pg_escape_string(strip_tags($_REQUEST['species']))."'");\r
+ $json = array();\r
+ //echo '[' . implode(',', $json) . ']';\r
+ $s='';\r
+ while ($row = pg_fetch_array($postgis_result, NULL, PGSQL_ASSOC)) {\r
+ //$json[] = $row['astext'];\r
+ // $json[] = $row[$field];\r
+ \r
+ $s.="<option value='EPSG:".$row['code']."'>".$row['name']."</option>";\r
+ // $json[] = $row['name'];\r
+// $json[] = $row['code'];\r
+ \r
+ //$json[] = $row['family'];\r
+\r
+}\r
+echo $s;\r
+ \r
+ // die(); // filthy exit, but does fine for our example.\r
+ }\r
+}\r
+\r
+?>\r