<?php include "../include/functions.php"; include "../include/db.php"; ?> <?php include "../include/params.php"; include "../include/dictionary2.php"; session_start(); header("Expires: Mon, 20 Jul 2000 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", FALSE); header("Pragma: no-cache"); set_time_limit(0); $_lon1 = str_replace("'", "''", NNull($_GET['lon1'], '')); $_lat1 = str_replace("'", "''", NNull($_GET['lat1'], '')); $_lon2 = str_replace("'", "''", NNull($_GET['lon2'], '')); $_lat2 = str_replace("'", "''", NNull($_GET['lat2'], '')); /*$_lon1 = "21.424884"; $_lat1 = "41.995976"; $_lon2 = "21.42207"; $_lat2 = "42.002685";*/ $lonlat = getLineCoords($_lon1, $_lat1, $_lon2, $_lat2); print $lonlat; //Response.Write(" ")
<?php include "../include/functions.php"; include "../include/db.php"; ?> <?php include "../include/params.php"; include "../include/dictionary2.php"; $_lon1 = getQUERY("lon1"); $_lat1 = getQUERY("lat1"); $_lon2 = getQUERY("lon2"); $_lat2 = getQUERY("lat2"); opendb(); $cntItem = dlookup("select count(*) from line_history_short where lon1='" . $_lon1 . "' and lat1='" . $_lat1 . "' and lon2='" . $_lon2 . "' and lat2='" . $_lat2 . "'"); if ($cntItem > 0) { $dsLine = query("select id, linestr from line_history_short where lon1='" . $_lon1 . "' and lat1='" . $_lat1 . "' and lon2='" . $_lon2 . "' and lat2='" . $_lat2 . "'"); print pg_fetch_result($dsLine, 0, "linestr") . '^$' . pg_fetch_result($dsLine, 0, "id"); } else { $line = getLineCoords($_lon1, $_lat1, $_lon2, $_lat2); $_id = dlookup("insert into line_history_short (lon1, lat1, lon2, lat2, linestr) values ('" . $_lon1 . "','" . $_lat1 . "','" . $_lon2 . "','" . $_lat2 . "','" . $line . "') RETURNING id;"); print $line . '^$' . $_id; } closedb();