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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jul 9 05:08:57 EDT 2008


Author: verenadiewald
Date: 2008-07-09 05:08:57 -0400 (Wed, 09 Jul 2008)
New Revision: 2629

Modified:
   trunk/mapbender/http/php/mod_wfs_conf.php
Log:
current version with all new fields like f_operator, f_min_input etc.

Modified: trunk/mapbender/http/php/mod_wfs_conf.php
===================================================================
--- trunk/mapbender/http/php/mod_wfs_conf.php	2008-07-09 09:04:03 UTC (rev 2628)
+++ trunk/mapbender/http/php/mod_wfs_conf.php	2008-07-09 09:08:57 UTC (rev 2629)
@@ -60,6 +60,40 @@
 function validate(){
 	return true;
 }
+
+function removeChildNodes(node) {
+	while (node.childNodes.length > 0) {
+		var childNode = node.firstChild;
+		node.removeChild(childNode);
+	}
+}
+
+function controlOperators(checkVal,operatorField,valType){
+	var opSelect = document.getElementById(operatorField);
+	removeChildNodes(opSelect);
+	option1 = new Option("-----","0");
+	opSelect.options[opSelect.length] = option1;
+	if(checkVal==true){
+		opSelect.disabled = '';
+		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;
+		option7 = new Option(">=","greater_equal_than");
+		opSelect.options[opSelect.length] = option7;
+		option8 = new Option("<=","less_equal_than");
+		opSelect.options[opSelect.length] = option8;
+	}
+	else{
+		opSelect.disabled = 'disabled';
+	}
+}
 </script>
 
 </head>
@@ -110,7 +144,7 @@
         $wfsID = db_insert_id($con,'wfs_conf','wfs_conf_id');
 
         for ($i = 0; $i < $_REQUEST["num"]; $i++){
-                $sql = "INSERT INTO wfs_conf_element (fkey_wfs_conf_id,f_id,f_search,f_pos,f_style_id,f_toupper,f_label,f_label_id,f_show,f_respos,f_edit,f_form_element_html,f_mandatory,f_auth_varname) VALUES(";
+                $sql = "INSERT INTO wfs_conf_element (fkey_wfs_conf_id,f_id,f_search,f_pos,f_min_input,f_style_id,f_toupper,f_label,f_label_id,f_show,f_respos,f_edit,f_form_element_html,f_mandatory,f_auth_varname,f_show_detail,f_detailpos,f_operator) VALUES(";
                 $sql .= "$1, $2, ";
                 if (!empty($_REQUEST["f_search".$i])) {
                 	$sql .= "'1'";
@@ -118,39 +152,46 @@
                 else {
                 	$sql .= "'0'";
                 }
-                $sql .= ", $3, $4, ";
+                $sql .= ", $3, $4, $5, ";
 				if (!empty($_REQUEST["f_toupper".$i])) {
                 	$sql .= "'1'";
                 }
                 else {
                 	$sql .= "'0'";
                 }				
-                $sql .= ",$5, $6, ";
+                $sql .= ",$6, $7, ";
                 if (!empty($_REQUEST["f_show".$i])) {
                 	$sql .= "'1'";
                 }
                 else {
                 	$sql .= "'0'";
                 }
-                $sql .= ", $7, ";
+                $sql .= ", $8, ";
                 if (!empty($_REQUEST["f_edit".$i])) {
                 	$sql .= "'1'";
                 } 
                 else {
                 	$sql .= "'0'";
                 }
-                $sql .= ",$8, ";
+                $sql .= ",$9, ";
                 if (!empty($_REQUEST["f_mandatory".$i])) {
                 	$sql .= "'1'";
                 }
                 else {
                 	$sql .= "'0'";
                 }
-                $sql .= ",$9";
+                $sql .= ",$10,";
+                if(!empty($_REQUEST["f_show_detail".$i])){
+                	$sql .= "'1'";
+                }
+                else {
+                	$sql .= "'0'";
+                }
+                $sql .= ",$11,$12";
  				$sql .= "); ";
 
-				$v = array($wfsID, $_REQUEST["f_id".$i], $_REQUEST["f_pos".$i], $_REQUEST["f_style_id".$i], $_REQUEST["f_label".$i], $_REQUEST["f_label_id".$i], $_REQUEST["f_respos".$i], stripslashes($_REQUEST["f_form_element_html".$i]), $_REQUEST["f_auth_varname".$i]);
-				$t = array("i", "s", "s", "s", "s", "s", "i", "s", "s");
+				$v = array($wfsID, $_REQUEST["f_id".$i], $_REQUEST["f_pos".$i], $_REQUEST["f_min_input".$i], $_REQUEST["f_style_id".$i], $_REQUEST["f_label".$i], $_REQUEST["f_label_id".$i], $_REQUEST["f_respos".$i], stripslashes($_REQUEST["f_form_element_html".$i]), $_REQUEST["f_auth_varname".$i], $_REQUEST["f_detailpos".$i], $_REQUEST["f_operator".$i]);
+				$t = array("i", "s", "s", "i", "s", "s", "s", "i", "s", "s", "i", "s");
                 $res = db_prep_query($sql, $v, $t);
         }
         if (isset($_REQUEST["f_geom"])) {
@@ -245,7 +286,7 @@
         echo "<tr><td>Style:</td><td><textarea cols=50 rows=5 name='g_style'></textarea></td></tr>" ;
         echo "<tr><td>Buffer:</td><td><input type='text' size='4' name='g_buffer' value='1'></td></tr>" ;
         echo "<tr><td>ResultStyle:</td><td><textarea cols=50 rows=5 name='g_res_style'></textarea></td></tr>" ;
-        echo "<tr><td>WZ-Graphics:</td><td><input name='g_use_wzgraphics' type='checkbox'></td></tr>";
+//        echo "<tr><td>WZ-Graphics:</td><td><input name='g_use_wzgraphics' type='checkbox'></td></tr>";
         echo "</table>";
 
 
@@ -258,16 +299,21 @@
                 echo "<td>" . toImage('geom') . "</td>";
                 echo "<td>" . toImage('search') . "</td>";
                 echo "<td>" . toImage('pos') . "</td>";
+                echo "<td>" . toImage('minimum_input') . "</td>";
                 echo "<td>" . toImage('style_id') . "</td>";
                 echo "<td>" . toImage('upper') . "</td>";
                 echo "<td>" . toImage('label') . "</td>";
                 echo "<td>" . toImage('label_id') . "</td>";
                 echo "<td>" . toImage('show') . "</td>";
                 echo "<td>" . toImage('position') . "</td>";
+                echo "<td>" . toImage('show_detail') . "</td>";
+                echo "<td>" . toImage('detail_position') . "</td>";
                 echo "<td>" . toImage('mandatory') . "</td>";
                 echo "<td>" . toImage('edit') . "</td>";
                 echo "<td>" . toImage('html') . "</td>";
-//                echo "<td>" . toImage('auth') . "</td>";
+                echo "<td>" . toImage('auth') . "</td>";
+                echo "<td>" . toImage('operator') . "</td>";
+                
         echo "</tr>";
 
         for($i=0; $i<count($aWFS->elements->element_id); $i++){
@@ -275,17 +321,31 @@
                 echo "<td>".$aWFS->elements->element_id[$i]."<input type='hidden' name='f_id".$i."' value='".$aWFS->elements->element_id[$i]."'></td>";
                 echo "<td>".$aWFS->elements->element_name[$i]."<br><div style='font-size:10'>".$aWFS->elements->element_type[$i]."</div></td>";
                 echo "<td><input name='f_geom' type='radio' value='".$aWFS->elements->element_id[$i]."'></td>";
-                echo "<td><input name='f_search".$i."' type='checkbox'></td>";
+                echo "<td><input name='f_search".$i."' type='checkbox' onclick='controlOperators(document.forms[0].f_search".$i.".checked,\"f_operator".$i."\",\"".$aWFS->elements->element_type[$i]."\");'></td>";
                 echo "<td><input name='f_pos".$i."' type='text' size='1' value='0'></td>";
+                echo "<td><select name='f_min_input".$i."' id='f_min_input".$i."'>";
+                echo "<option value='0'>-----</option>";
+                echo "<option value='1'>1</option>";
+                echo "<option value='2'>2</option>";
+                echo "<option value='3'>3</option>";
+                echo "<option value='4'>4</option>";
+                echo "<option value='5'>5</option>";
+                echo "</select></td>";
                 echo "<td><input name='f_style_id".$i."' type='text' size='2' value='0'></td>";
                 echo "<td><input name='f_toupper".$i."' type='checkbox'></td>";
                 echo "<td><input name='f_label".$i."' type='text' size='4'></td>";
                 echo "<td><input name='f_label_id".$i."' type='text' size='2'  value='0'></td>";
                 echo "<td><input name='f_show".$i."' type='checkbox'></td>";
                 echo "<td><input name='f_respos".$i."' type='text' size='1' value='0'></td>";
+                echo "<td><input name='f_show_detail".$i."' type='checkbox'></td>";
+                echo "<td><input name='f_detailpos".$i."' type='text' size='1' value='0'></td>";
                 echo "<td><input name='f_mandatory".$i."' type='checkbox'></td>";
                 echo "<td><input name='f_edit".$i."' type='checkbox'></td>";
                 echo "<td><textarea name='f_form_element_html".$i."' cols='15' rows='1' ></textarea></td>";
+                echo "<td><input name='f_auth_varname".$i."' type='text' size='8' value=''></td>";
+                echo "<td><select name='f_operator".$i."' id='f_operator".$i."' disabled>";
+                echo "<option value='0'>-----</option>";
+                echo "</select></td>";
                 echo "</tr>";
         }
         echo "</table>";



More information about the Mapbender_commits mailing list