svn commit: r95 - trunk/mapbender/http/php/mod_wfs.php

christoph at osgeo.org christoph at osgeo.org
Wed Apr 19 09:23:25 EDT 2006


Author: christoph
Date: 2006-04-19 13:23:25+0000
New Revision: 95

Modified:
   trunk/mapbender/http/php/mod_wfs.php

Log:
wfs featuretype namespace

Modified: trunk/mapbender/http/php/mod_wfs.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_wfs.php?view=diff&rev=95&p1=trunk/mapbender/http/php/mod_wfs.php&p2=trunk/mapbender/http/php/mod_wfs.php&r1=94&r2=95
==============================================================================
--- trunk/mapbender/http/php/mod_wfs.php	(original)
+++ trunk/mapbender/http/php/mod_wfs.php	2006-04-19 13:23:25+0000
@@ -1,152 +1,165 @@
-<?php
-# $Id: mod_wfs.php,v 1.5 2006/03/09 12:11:07 uli_rothstein Exp $
-# $Header: /cvsroot/mapbender/mapbender/http/php/mod_wfs.php,v 1.5 2006/03/09 12:11:07 uli_rothstein Exp $
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-# session_start();
-require_once("../../conf/mapbender.conf");
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
-<html>
-<head>
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
-?>
-<title>mod_wfs</title>
-<script language='JavaScript' type='text/javascript'>
-var wfs_conf = new Array();
-function register(){
-	var isReg = false;
-	for(var i=0; i<parent.mb_InitFunctions.length; i++){
-		if(parent.mb_InitFunctions[i] == (window.name+".fetchInf()")){
-			isReg = true;
-		}
-	}
-	if(isReg == false){
-		parent.mb_registerInitFunctions(window.name+".fetchInf()");
-	}
-}
-function fetchInf(){
-	var wfs = new Array();
-	var l;
-	var ind = parent.getMapObjIndexByName('mapframe1');
-	for(var i=0; i<parent.mb_mapObj[ind].wms.length; i++){
-		for(var j=0; j<parent.mb_mapObj[ind].wms[i].objLayer.length; j++){
-			l = parent.mb_mapObj[ind].wms[i].objLayer[j];			
-			if(l.gui_layer_wfs_featuretype != ""){
-				wfs[wfs.length] = l.gui_layer_wfs_featuretype; 
-			}
-		}	
-	}	
-	document.location.href = "../php/mod_wfs.php?id=" + wfs.join(",");
-	
-}
-function get_wfs_conf(){
-	return wfs_conf;
-}
-var iamready = false;
-</script>
-<?php
-echo "<script language='JavaScript' type='text/javascript'>";
-if(isset($_REQUEST['id'])){
-	$wfs = split(",",$_REQUEST['id']);
-	
-	$con = db_connect($DBSERVER,$OWNER,$PW);
-	db_select_db($DB,$con);
-	
-	for($i=0; $i<count($wfs); $i++){	
-		
-		/* wfs_conf */
-	
-		
-		$sql = "SELECT * FROM wfs_conf ";
-		$sql .= "JOIN wfs ON wfs_conf.fkey_wfs_id = wfs.wfs_id ";
-		$sql .= "WHERE wfs_conf.wfs_conf_id = ".$wfs[$i];
-		
-		$res = db_query($sql);
-	
-		if($row = db_fetch_array($res)){
-			$wfs_id  = $row["fkey_wfs_id"];
-			$featuretype_id  = $row["fkey_featuretype_id"];
-			echo "var len = wfs_conf.length;";
-			echo "wfs_conf[".$i."] = new Array();";
-			echo "wfs_conf[".$i."]['wfs_conf_id']  = '".$row["wfs_conf_id"]."';";
-			echo "wfs_conf[".$i."]['wfs_conf_abstract']  = '".$row["wfs_conf_abstract"]."';";
-			echo "wfs_conf[".$i."]['g_label']  = '".$row["g_label"]."';";
-			echo "wfs_conf[".$i."]['g_label_id']  = '".$row["g_label_id"]."';";
-//			echo "wfs_conf[".$i."]['g_style']  = '".$row["g_style"]."';";
-			echo "wfs_conf[".$i."]['g_button']  = '".$row["g_button"]."';";
-			echo "wfs_conf[".$i."]['g_button_id']  = '".$row["g_button_id"]."';";
-			echo "wfs_conf[".$i."]['g_buffer']  = '".$row["g_buffer"]."';";
-//			echo "wfs_conf[".$i."]['g_res_style']  = '".$row["g_res_style"]."';";
-			echo "wfs_conf[".$i."]['g_use_wzgraphics']  = '".$row["g_use_wzgraphics"]."';";
-			echo "wfs_conf[".$i."]['fkey_featuretype_id']  = '".$row["fkey_featuretype_id"]."';";
-			echo "wfs_conf[".$i."]['wfs_getfeature']  = '".$row["wfs_getfeature"]."';";
-			echo "wfs_conf[".$i."]['wfs_transaction']  = '".$row["wfs_transaction"]."';";
-			
-		}else{die("wfs_conf data not available");}
-		
-		$sql = "SELECT * FROM wfs_featuretype ";
-		$sql .= "WHERE fkey_wfs_id = ".$wfs_id." AND featuretype_id = ".$featuretype_id;
-		$res = db_query($sql);
-		if($row = db_fetch_array($res)){
-			echo "wfs_conf[".$i."]['featuretype_name']  = '".$row["featuretype_name"]."';";
-			echo "wfs_conf[".$i."]['featuretype_srs']  = '".$row["featuretype_srs"]."';";
-		}else{die("wfs_featuretype data not available");}
-		
-		/* wfs_conf_element */
-		$sql = "SELECT * FROM wfs_conf_element ";
-		$sql .= "JOIN wfs_element ON wfs_conf_element.f_id = wfs_element.element_id ";
-		$sql .= "WHERE wfs_conf_element.fkey_wfs_conf_id = ".$wfs[$i]." ";
-		$sql .= " ORDER BY wfs_conf_element.f_respos";
-		#$sql .= "AND wfs_conf_element.f_search = 1 ORDER BY wfs_conf_element.f_search;";
-				
-		$res = db_query($sql);
-		
-		echo "wfs_conf[".$i."]['element']  = new Array();";
-		$cnt = 0;
-		
-		while($row = db_fetch_array($res)){
-			echo "wfs_conf[".$i."]['element'][".$cnt."] = new Array();";
-			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_search'] = ".$row["f_search"].";";
-			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_style_id'] = '".$row["f_style_id"]."';";
-			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_toupper'] = '".$row["f_toupper"]."';";
-			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_label'] = '".$row["f_label"]."';";
-			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_label_id'] = '".$row["f_label_id"]."';";
-			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_show'] = '".$row["f_show"]."';";
-			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_respos'] = '".$row["f_respos"]."';";
-			echo "wfs_conf[".$i."]['element'][".$cnt."]['element_name'] = '".$row["element_name"]."';";
-			echo "wfs_conf[".$i."]['element'][".$cnt."]['element_type'] = '".$row["element_type"]."';";
-			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_geom'] = '".$row["f_geom"]."';";
-			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_gid'] = '".$row["f_gid"]."';";
-			$cnt++;
-		}
-		if($cnt == 0){die("wfs_conf data not available");}		
-	}
-	echo "iamready = true;";
-}
-
-?>
-if(iamready){
-	
-}
-
-</script>
-</head>
-<body leftmargin='0' topmargin='10'  bgcolor='#ffffff' onload='register()'>
-</body>
+<?php
+# $Id: mod_wfs.php,v 1.5 2006/03/09 12:11:07 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_wfs.php,v 1.5 2006/03/09 12:11:07 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# session_start();
+require_once("../../conf/mapbender.conf");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>mod_wfs</title>
+<script language='JavaScript' type='text/javascript'>
+var wfs_conf = new Array();
+function register(){
+	var isReg = false;
+	for(var i=0; i<parent.mb_InitFunctions.length; i++){
+		if(parent.mb_InitFunctions[i] == (window.name+".fetchInf()")){
+			isReg = true;
+		}
+	}
+	if(isReg == false){
+		parent.mb_registerInitFunctions(window.name+".fetchInf()");
+	}
+}
+function fetchInf(){
+	var wfs = new Array();
+	var l;
+	var ind = parent.getMapObjIndexByName('mapframe1');
+	for(var i=0; i<parent.mb_mapObj[ind].wms.length; i++){
+		for(var j=0; j<parent.mb_mapObj[ind].wms[i].objLayer.length; j++){
+			l = parent.mb_mapObj[ind].wms[i].objLayer[j];			
+			if(l.gui_layer_wfs_featuretype != ""){
+				wfs[wfs.length] = l.gui_layer_wfs_featuretype; 
+			}
+		}	
+	}	
+	document.location.href = "../php/mod_wfs.php?id=" + wfs.join(",");
+	
+}
+function get_wfs_conf(){
+	return wfs_conf;
+}
+var iamready = false;
+</script>
+<?php
+echo "<script language='JavaScript' type='text/javascript'>";
+if(isset($_REQUEST['id'])){
+	$wfs = split(",",$_REQUEST['id']);
+	
+	$con = db_connect($DBSERVER,$OWNER,$PW);
+	db_select_db($DB,$con);
+	
+	for($i=0; $i<count($wfs); $i++){	
+		
+		/* wfs_conf */
+	
+		
+		$sql = "SELECT * FROM wfs_conf ";
+		$sql .= "JOIN wfs ON wfs_conf.fkey_wfs_id = wfs.wfs_id ";
+		$sql .= "WHERE wfs_conf.wfs_conf_id = ".$wfs[$i];
+		
+		$res = db_query($sql);
+	
+		if($row = db_fetch_array($res)){
+			$wfs_id  = $row["fkey_wfs_id"];
+			$featuretype_id  = $row["fkey_featuretype_id"];
+			echo "var len = wfs_conf.length;";
+			echo "wfs_conf[".$i."] = new Array();";
+			echo "wfs_conf[".$i."]['wfs_conf_id']  = '".$row["wfs_conf_id"]."';";
+			echo "wfs_conf[".$i."]['wfs_conf_abstract']  = '".$row["wfs_conf_abstract"]."';";
+			echo "wfs_conf[".$i."]['g_label']  = '".$row["g_label"]."';";
+			echo "wfs_conf[".$i."]['g_label_id']  = '".$row["g_label_id"]."';";
+//			echo "wfs_conf[".$i."]['g_style']  = '".$row["g_style"]."';";
+			echo "wfs_conf[".$i."]['g_button']  = '".$row["g_button"]."';";
+			echo "wfs_conf[".$i."]['g_button_id']  = '".$row["g_button_id"]."';";
+			echo "wfs_conf[".$i."]['g_buffer']  = '".$row["g_buffer"]."';";
+//			echo "wfs_conf[".$i."]['g_res_style']  = '".$row["g_res_style"]."';";
+			echo "wfs_conf[".$i."]['g_use_wzgraphics']  = '".$row["g_use_wzgraphics"]."';";
+			echo "wfs_conf[".$i."]['fkey_featuretype_id']  = '".$row["fkey_featuretype_id"]."';";
+			echo "wfs_conf[".$i."]['wfs_getfeature']  = '".$row["wfs_getfeature"]."';";
+			echo "wfs_conf[".$i."]['wfs_transaction']  = '".$row["wfs_transaction"]."';";
+			
+		}else{die("wfs_conf data not available");}
+		
+		$sql = "SELECT * FROM wfs_featuretype_namespace";
+		$sql .= " WHERE fkey_wfs_id = ".$wfs_id." AND fkey_featuretype_id = ".$featuretype_id;
+		$res = db_query($sql);
+		echo "wfs_conf[".$i."]['namespaces'] = new Array();";
+		$counter = 0;
+		while($row = db_fetch_array($res)){
+			echo "wfs_conf[".$i."]['namespaces'][".$counter."] = new Array();";
+			echo "wfs_conf[".$i."]['namespaces'][".$counter."]['name']  = '".$row["namespace"]."';";
+			echo "wfs_conf[".$i."]['namespaces'][".$counter."]['location']  = '".$row["namespace_location"]."';";
+			$counter++;
+		}
+		
+		
+		$sql = "SELECT * FROM wfs_featuretype ";
+		$sql .= "WHERE fkey_wfs_id = ".$wfs_id." AND featuretype_id = ".$featuretype_id;
+		$res = db_query($sql);
+		if($row = db_fetch_array($res)){
+			echo "wfs_conf[".$i."]['featuretype_name']  = '".$row["featuretype_name"]."';";
+			echo "wfs_conf[".$i."]['featuretype_srs']  = '".$row["featuretype_srs"]."';";
+		}else{die("wfs_featuretype data not available");}
+		
+		/* wfs_conf_element */
+		$sql = "SELECT * FROM wfs_conf_element ";
+		$sql .= "JOIN wfs_element ON wfs_conf_element.f_id = wfs_element.element_id ";
+		$sql .= "WHERE wfs_conf_element.fkey_wfs_conf_id = ".$wfs[$i]." ";
+		$sql .= " ORDER BY wfs_conf_element.f_respos";
+		#$sql .= "AND wfs_conf_element.f_search = 1 ORDER BY wfs_conf_element.f_search;";
+				
+		$res = db_query($sql);
+		
+		echo "wfs_conf[".$i."]['element']  = new Array();";
+		$cnt = 0;
+		
+		while($row = db_fetch_array($res)){
+			echo "wfs_conf[".$i."]['element'][".$cnt."] = new Array();";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_search'] = ".$row["f_search"].";";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_style_id'] = '".$row["f_style_id"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_toupper'] = '".$row["f_toupper"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_label'] = '".$row["f_label"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_label_id'] = '".$row["f_label_id"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_show'] = '".$row["f_show"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_respos'] = '".$row["f_respos"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['element_name'] = '".$row["element_name"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['element_type'] = '".$row["element_type"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_geom'] = '".$row["f_geom"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_gid'] = '".$row["f_gid"]."';";
+			$cnt++;
+		}
+		if($cnt == 0){die("wfs_conf data not available");}		
+	}
+	echo "iamready = true;";
+}
+
+?>
+if(iamready){
+	
+}
+
+</script>
+</head>
+<body leftmargin='0' topmargin='10'  bgcolor='#ffffff' onload='register()'>
+</body>
 </html>
\ No newline at end of file




More information about the Mapbender_commits mailing list