28,409
社区成员




<%@Language="VBScript" CodePage="65001"%>
<%Session.CodePage="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>计算距离</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA-9XCdVovUm991Ek1s6cgdxQxeZ2O7p53-bIxOKwikWnaEuG9JxS3SIpC7vSxeCQoW3L41AQrqZ-HdA &sensor=true_or_false" type="text/javascript"></script>
<!--#include file="../../../conn/conn.asp"-->
</script>
<%
set table=server.CreateObject("mzz.biao")
bianhao=request("bianhao")
name=request("name")
%>
<%
If Request.QueryString("name") = "" Then
'开始读取数据库中的经纬点
sql="select 当前地点,终点地点 from 业务订单 where 订单编号='"&bianhao&"'"
set startrs=conn.execute(sql)
startsql="select lon,lat from quxian where county='"&startrs("当前地点")&"'"
stopsql="select lon,lat from quxian where county='"&startrs("终点地点")&"'"
set startrs=conn.execute(startsql)
startlon=startrs("lon")
startlat=startrs("lat")
set stoprs=conn.execute(stopsql)
stoplon=stoprs("lon")
stoplat=stoprs("lat")
startrs.close
stoprs.close
'结束读取数据库中的经纬点
%>
<script type="text/javascript">
//调用Google Map Api的计算距离函数
var distance = new GLatLng(<%=startlat%>, <%=startlon%>).distanceFrom(new GLatLng(<%=stoplat%>, <%=stoplon%>));
distance=parseInt(distance/1000,10)
//通过地址栏把distance的结果传递给asp
window.location.href="<%=Request.ServerVariables("SCRIPT_NAME")%>?name=" + distance + "&dd="+<%=bianhao%>
</script>
<%
end If
'接收js的数据
juli= Request.QueryString("name")
ddbianhao= Request.QueryString("dd")
<!--#include file="../../../conn/conn.asp"-->
julisql="update 业务订单 set 终点距离="&juli&" where 订单编号='"&ddbianhao&"'"
conn.execute(julisql)
%>