Revert "converting CRLF to LF"
[geo.git] / edit_wp5_web_folder / geo / queries / polygon_query_sld.php
diff --git a/edit_wp5_web_folder/geo/queries/polygon_query_sld.php b/edit_wp5_web_folder/geo/queries/polygon_query_sld.php
new file mode 100644 (file)
index 0000000..f8287e0
--- /dev/null
@@ -0,0 +1,75 @@
+<?php\r
+\r
+ //  $conn = pg_connect(POSTGIS_CS);\r
+       $conn = pg_connect('host=localhost port=5432  password=fv30714$A  user=postgres dbname=edit_geo_mirror');\r
+if (pg_ErrorMessage($conn)) { \r
+        echo "<p><b>Ocurrio un error conectando a la base de datos: .</b></p>"; \r
+        }\r
+       // 'POLYGON((-5.7107 41.43,-5.11 40.84,-5.7 40.8,-5.11 41.433,-5.7107 41.43))'\r
+       //$geom="POLYGON((".$_GET['point_params[0]']."))";\r
+       //\r
+       \r
+       $polygon= $_GET['param'];\r
+               $userid= $_GET['user'];\r
+\r
+       $query="SELECT genus,specie FROM user_points where user_points.userid='$userid' and user_points.the_geom && GeometryFromText('".$polygon."',4326)";\r
+\r
+       echo $query;\r
+       //      -5.7 41.4,-5.7 40.800000000000004,-5.1000000000000005 40.800000000000004,-5.1000000000000005 41.4,-5.7 41.4\r
+        $query_result=pg_query($query) or die ("algun errorrrr");\r
+        $count=pg_numrows($query_result);\r
+        if ($count==0)\r
+        {\r
+        print "<div id='content'> No info avaible. \r
+                                                          Use this tool only to query the Demo point data";\r
+        }\r
+        if ($count>180)\r
+        {\r
+        print "<div id='content'> Too much info ($count records)...";\r
+        }\r
+        else\r
+        {\r
+        \r
+         print "<div id='content'>\r
+            <h2>$count records </h2>\r
+               <table border='0' class='sortable paginated'>\r
+                        \r
+<thead>\r
+            <tr>\r
+              \r
+              <th class='sort-alpha'>Order data by Genus</th>\r
+           \r
+                              </th>\r
+                         <th class='sort-alpha'>Order data by Species</th>\r
+           \r
+                         </th>\r
+               \r
+          </thead>\r
+                 <tbody>\r
+                         ";\r
+     //          <th class='sort-alpha'>Order data by Province</th></th>       \r
+        while ($row = pg_fetch_array($query_result, NULL, PGSQL_ASSOC)) {\r
+\r
+                print "<tr class='even' style='display: table-row;'>";\r
+                /*\r
+        $numero=1;     \r
+               while ($numero<=$count)\r
+                {\r
+                print "<td><a id='repaginate'>".$numero."</a></td>\n"; \r
+               $numero++;               \r
+               }\r
+               */\r
+                print "<td><a id='repaginate'>".$row['genus']."</a></td>\n";\r
+                print "<td><a id='repaginate'>".$row['specie']."</a></td>\n";\r
+       //       print "<td><a id='repaginate'>".$row['provname']."</a></td>\n";\r
+                 print "</tr>";\r
+               \r
+                }\r
+               \r
+        //echo $result;\r
+               //} \r
+       print "</table>\r
+       </div>\r
+          </tbody>";\r
+          }\r
+       ?>\r