the same function that is defined as the onlick event for refresh map. armin
Chris Beaart wrote: > I have created a new tool. After running this tool, I want to refresh > (reload) the map automatically just like pressing the "Refresh Map" button. > Which code do I have to use in the code below to refresh the map. > > > > Thanks, > Chris Beaart. > > > > <?php > > require_once ("C:/ms4w/Apache/php/PEAR/DB.php"); > > session_start(); > > require_once("common.php"); > > > > function DB_addPoint($imgxy, $soort, $waarneming, $datum) > > { > > $db_host = "localhost"; > > $db_type = "mysql"; > > $db_name = "dop"; > > $db_user = "root"; > > $db_pwd = "password"; > > > > $dsn = "$db_type://$db_user:[EMAIL PROTECTED]/$db_name"; > > #error_log ($dsn); > > #mysql://root:[EMAIL PROTECTED]/dop > > > > // CONVERT PIXEL X/Y TO MAP UNITS > > $imgxy_arr = explode(" ", $imgxy); > > $x_pix = $imgxy_arr[0]; > > $y_pix = $imgxy_arr[1]; > > $GEOEXT = $_SESSION["GEOEXT"]; > > $geoDeltaX = $GEOEXT["maxx"] - $GEOEXT["minx"]; > > $geoDeltaY = $GEOEXT["maxy"] - $GEOEXT["miny"]; > > $mapW = $_SESSION["mapwidth"]; > > $mapH = $_SESSION["mapheight"]; > > $x_geo = round($GEOEXT["minx"] + (($x_pix/$mapW)*$geoDeltaX)); > > $y_geo = round($GEOEXT["maxy"] - (($y_pix/$mapH)*$geoDeltaY)); > > > > // CONNECT TO DB AND RUN QUERY > > //$geometry = "GeomFromText('POINT($x_geo $y_geo)',26591)"; > > $sql = "INSERT INTO waarnemingen(x,y,soort,waarneming,datum) > VALUES($x_geo,$y_geo,'$soort','$waarneming','$datum')"; > > #error_log ($sql); > > > > $dbh = dbConnect($dsn); > > $result = $dbh->query($sql); > > > > #Closing the current form > > ?> > > <script language=JavaScript> > > window.close(); > > </script> > > <? > > > > #CODE TO REFRESH MAP > > > > if (DB::isError($result)) { > > error_log($result->getDebugInfo()); > > } > > > > // Check that $result is not an error > > if (DB::isError($result)) { > > $dbh->disconnect(); > > return ($result->getMessage()); > > } else { > > $dbh->disconnect(); > > return 1; > > } > > } > > > > function dbConnect($dsn) > > { > > $dbh = DB::connect($dsn); > > > > if (DB::isError($dbh)) { > > error_log($dbh->getDebugInfo()); > > } > > > > if (DB::isError($dbh)) { > > die ($dbh->getMessage()); > > return NULL; > > } else { > > return $dbh; > > } > > } > > > > ?> > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > pmapper-users mailing list > pmapper-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pmapper-users > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ pmapper-users mailing list pmapper-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pmapper-users