svn commit: r211 - trunk/mapbender/http/javascripts/mod_measure.php

vera_schulze at osgeo.org vera_schulze at osgeo.org
Tue May 9 09:44:02 EDT 2006


Author: vera_schulze
Date: 2006-05-09 13:44:02+0000
New Revision: 211

Modified:
   trunk/mapbender/http/javascripts/mod_measure.php   (contents, props changed)

Log:
Code cleaning ready, 1 db_prep_query

Modified: trunk/mapbender/http/javascripts/mod_measure.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_measure.php?view=diff&rev=211&p1=trunk/mapbender/http/javascripts/mod_measure.php&p2=trunk/mapbender/http/javascripts/mod_measure.php&r1=210&r2=211
==============================================================================
--- trunk/mapbender/http/javascripts/mod_measure.php	(original)
+++ trunk/mapbender/http/javascripts/mod_measure.php	2006-05-09 13:44:02+0000
@@ -1,6 +1,6 @@
 <?php
-#$Id: mod_measure.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
-#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_measure.php,v 1.9 2005/09/13 18:16:42 bjoern_heuser Exp $
+# $Id$
+# http://www.mapbender.org/index.php/mod_measure.php
 # Copyright (C) 2002 CCGIS 
 #
 # This program is free software; you can redistribute it and/or modify
@@ -16,20 +16,25 @@
 # 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.
+
 require_once("../../conf/mapbender.conf");
 
 $gui_id = $_REQUEST["gui_id"];
 $con = db_connect($DBSERVER,$OWNER,$PW);
 db_select_db(DB,$con);
-$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'measure' AND fkey_gui_id = '".$gui_id."'";
-$res = db_query($sql);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'measure' AND fkey_gui_id = $1";
+$v = array($gui_id);
+$t = array('s');
+$res = db_prep_query($sql, $v, $t);
 $cnt = 0;
 while($row = db_fetch_array($res)){ 
    $e_src = $row["e_src"];
    $e_target = $row["e_target"];
    $cnt++;
 }
-if($cnt > 1){ echo "alert('measure: ID not unique!');";}
+if($cnt > 1){
+	echo "alert('measure: ID not unique!');";
+}
 echo "var mod_measure_target = '".$e_target."';";
 ?>
 var mod_measure_color1 = "white";
@@ -78,7 +83,7 @@
 function register_measureSubFunctions(stringFunction){
 	mod_measureSubFunctions[mod_measureSubFunctions.length] = stringFunction;
 }
-function mod_measure_go(){   
+function mod_measure_go(){
 	var el = window.frames[mod_measure_target].document;
 	el.onmousedown = mod_measure_start;
 	el.onmousemove = mod_measure_run;
@@ -122,7 +127,7 @@
 	else{
 		mod_measure_Dist[mod_measure_Dist.length] = 0;
 		mod_measure_TotalDist[mod_measure_TotalDist.length] = 0;
-	}   
+	}
 	drawDashedLine();
 }
 function drawDashedLine(){




More information about the Mapbender_commits mailing list