[Mapbender-commits] r2067 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Feb 7 07:37:20 EST 2008


Author: verenadiewald
Date: 2008-02-07 07:37:20 -0500 (Thu, 07 Feb 2008)
New Revision: 2067

Modified:
   trunk/mapbender/http/php/mod_wfs_edit.php
Log:
added field f_operator

Modified: trunk/mapbender/http/php/mod_wfs_edit.php
===================================================================
--- trunk/mapbender/http/php/mod_wfs_edit.php	2008-02-07 12:30:28 UTC (rev 2066)
+++ trunk/mapbender/http/php/mod_wfs_edit.php	2008-02-07 12:37:20 UTC (rev 2067)
@@ -41,6 +41,58 @@
 function validate(){	
 	return true;
 }
+function openwindow(Adresse) {
+	Fenster1 = window.open(Adresse, "GeoPortal Rheinland-Pfalz - Metadaten", "width=500,height=500,left=100,top=100,scrollbars=yes,resizable=no");
+	Fenster1.focus();
+}
+
+function removeChildNodes(node) {
+	while (node.childNodes.length > 0) {
+		var childNode = node.firstChild;
+		node.removeChild(childNode);
+	}
+}
+
+function controlOperators(checkVal,operator,valType,opValue){
+	var opSelect = document.getElementById(operator);
+	removeChildNodes(opSelect);
+	if(checkVal==true){
+		opSelect.disabled = '';
+		option1 = new Option("-----","0");
+		opSelect.options[opSelect.length] = option1;
+		if(valType=='string' || valType=='date'){
+			option2 = new Option("%...%","bothside");
+ 			opSelect.options[opSelect.length] = option2;
+ 			option3 = new Option("...%","rightside");
+ 			opSelect.options[opSelect.length] = option3;
+ 			option4 = new Option("equal","equal");
+ 			opSelect.options[opSelect.length] = option4;
+ 		}
+		else if(valType=='int' || valType=='float'){
+			option2 = new Option(">","greater_than");
+ 			opSelect.options[opSelect.length] = option2;
+ 			option3 = new Option("<","less_than");
+ 			opSelect.options[opSelect.length] = option3;
+ 			option4 = new Option("equal","equal");
+ 			opSelect.options[opSelect.length] = option4;
+		}
+		else{
+			option2 = new Option("%...%","bothside");
+ 			opSelect.options[opSelect.length] = option2;
+ 			option3 = new Option("...%","rightside");
+ 			opSelect.options[opSelect.length] = option3;
+ 			option4 = new Option("equal","equal");
+ 			opSelect.options[opSelect.length] = option4;
+ 			option5 = new Option(">","greater_than");
+ 			opSelect.options[opSelect.length] = option5;
+ 			option6 = new Option("<","less_than");
+ 			opSelect.options[opSelect.length] = option6;
+		}				
+	}
+	else{
+		opSelect.disabled = 'disabled';
+	}
+}
 </script>
 
 </head>
@@ -132,14 +184,25 @@
 				$sql .= "'";
                 $sql .= ", ";
                 $sql .= "f_auth_varname = '".$_REQUEST["f_auth_varname".$i];
-                $sql .= "',";
-                $sql .= "f_show_detail = '";
+				$sql .= "'";
+				$sql .= ", ";
+				$sql .= "f_show_detail = '";
                 if(!empty($_REQUEST["f_show_detail".$i])){
                 	$sql .= '1';
                 }else{$sql .= '0';}
-				$sql .= "' WHERE fkey_wfs_conf_id = ".$_REQUEST["gaz"]." AND f_id = ".$_REQUEST["f_id".$i].";";
-                $res = db_query($sql);
-        }
+                $sql .= "',";
+                $sql .= "f_operator = ";
+				if(empty($_REQUEST["f_operator".$i])){
+					$sql .= "0";
+				}
+				else{
+					$sql .= "'".$_REQUEST["f_operator".$i];
+					$sql .= "'";
+				}		
+				$sql .= " WHERE fkey_wfs_conf_id = ".$_REQUEST["gaz"]." AND f_id = ".$_REQUEST["f_id".$i].";";
+				
+				$res = db_query($sql);
+		}
 }
 
 /* end save wfs_conf properties */
@@ -221,6 +284,7 @@
                 echo "<td>" . toImage('edit') . "</td>";
                 echo "<td>" . toImage('html') . "</td>";
                 echo "<td>" . toImage('auth') . "</td>";
+                echo "<td>" . toImage('operator') . "</td>";
         echo "</tr>";
         $cnt = 0;
         while($row = db_fetch_array($res)){
@@ -236,7 +300,7 @@
 				echo "></td>";
                 echo "<td><input name='f_search".$cnt."' type='checkbox'";
                 if($row["f_search"] == 1){ echo " checked"; }
-                echo "></td>";
+                echo " onclick='controlOperators(document.forms[0].f_search".$cnt.".checked,\"f_operator".$cnt."\",\"".$row["element_type"]."\",\"".$row["f_operator"]."\");'></td>";
                 echo "<td><input name='f_pos".$cnt."' type='text' size='1' value='".$row["f_pos"]."'></td>";
                 echo "<td><input name='f_style_id".$cnt."' type='text' size='2' value='".$row["f_style_id"]."'></td>";
                 echo "<td><input name='f_toupper".$cnt."' type='checkbox'";
@@ -259,6 +323,54 @@
                 echo "></td>";
                 echo "<td><textarea name='f_form_element_html".$cnt."' cols='15' rows='1' >".stripslashes($row["f_form_element_html"])."</textarea></td>";
                 echo "<td><input name='f_auth_varname".$cnt."' type='text' size='8' value='".$row["f_auth_varname"]."'></td>";
+                echo "<td><select name='f_operator".$cnt."' id='f_operator".$cnt."' ";
+                if($row["f_search"] != 1){
+                	echo "disabled";
+                }
+                echo "<option value='0' ";
+                if($row["f_operator"] == 0){ echo " selected"; }
+				echo ">-----</option>";
+				if($row["element_type"]=='string' || $row["element_type"]=='date'){
+					echo "<option value='bothside' ";
+					if($row["f_operator"] == 'bothside'){ echo " selected"; }
+					echo ">%...%</option>";
+					echo "<option value='rightside' ";
+	                if($row["f_operator"] == 'rightside'){ echo " selected"; }
+					echo ">...%</option>";
+					echo "<option value='equal' ";
+	                if($row["f_operator"] == 'equal'){ echo " selected"; }
+					echo ">equal</option>";
+				}
+				else if($row["element_type"]=='int' || $row["element_type"]=='float'){
+					echo "<option value='greater_than' ";
+	                if($row["f_operator"] == 'greater_than'){ echo " selected"; }
+					echo ">></option>";
+					echo "<option value='less_than' ";
+	                if($row["f_operator"] == 'less_than'){ echo " selected"; }
+					echo "><</option>";
+					echo "<option value='equal' ";
+					if($row["f_operator"] == 'equal'){ echo " selected"; }
+					echo ">equal</option>";
+				}
+				else{
+					echo "<option value='bothside' ";
+	                if($row["f_operator"] == 'bothside'){ echo " selected"; }
+					echo ">%...%</option>";
+					echo "<option value='rightside' ";
+	                if($row["f_operator"] == 'rightside'){ echo " selected"; }
+					echo ">...%</option>";
+					echo "<option value='equal' ";
+	                if($row["f_operator"] == 'equal'){ echo " selected"; }
+					echo ">equal</option>";
+					echo "<option value='greater_than' ";
+	                if($row["f_operator"] == 'greater_than'){ echo " selected"; }
+					echo ">></option>";
+					echo "<option value='less_than' ";
+	                if($row["f_operator"] == 'less_than'){ echo " selected"; }
+					echo "><</option>";
+				}
+				
+     			echo "</select></td>";
                 echo "</tr>";
                 $cnt++;
         }



More information about the Mapbender_commits mailing list