<%@language="vbscript" codepage="65001"%>
<%
Option Explicit
Session.CodePage = 65001
Response.Charset = "utf-8"
Session.Timeout  = 100
Server.ScriptTimeout = 90
''''''sql数据库请设置IP/用户名/密码;AC数据库只需要设置DB_BASE项'''''''''''''''''
Const DB_HOST         = "localhost" ''''''''''''数据库服务器地址
Const DB_BASE         = "ClassData/YN@TOUR#2015.mdb" ''''''''''''数据库名
Const DB_UID          = "" ''''''''''''数据库登陆用户名
Const DB_PASS	      = "" ''''''''''''数据库登陆密码
%>
<!--#include file="function.asp"-->
<!--#include file="md5.asp"-->
<%
'通用定义
Dim pagecount,page,pagcount,total,mypage 	'定义变量
Dim oConn,oRs,sSql,Id
Dim a,b,c,d,e,f,keyword,kk,errors
Dim i, j, k, x, y, z,action
Dim TT,SS,v,vv,vvv,TTT,SSS,OrderNum,orderid
Dim ProId,OrderFangId
a = Request("a"):Id = Request("Id"):keyword= request("keyword"):action = request("action"):orderid= request("orderid")
OrderFangId=Trim(request("OrderFangId")):errors=Trim(request("errors")):ProId=Trim(request("ProId"))
kk= request("kk"):TT= request("TT"):SS= request("SS"):TTT= request("TTT"):SSS= request("SSS"):OrderNum= request("OrderNum")
Set oConn = Server.CreateObject("ADODB.CONNECTION") 
Set oRs =server.createobject("adodb.recordset")
'=======修改这里数字,1为SQL数据库，0为Access数据库============
Const IsSqlDataBase   = 0  ''''''''''''数据库类型,0为AC,1为SQL
If IsSqlDataBase = 1 Then
oConn.Open "Driver={SQL Server}; Server=" & DB_HOST & "; UID=" & DB_UID & "; Pwd=" & DB_PASS &";database=" & DB_BASE & ";"
Else
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath(""&DB_BASE&"")
End If
'读取网站的基本信息
Dim sWeb,sHome,sJscode,sSafe,sLoad
Set sWeb = oConn.Execute("SELECT top 1 * FROM [WebInfo] WHERE Id = 1")
dim skey1,sKqqnn,skey3,skey4,sKqq
sKqq = split(sWeb("WebQQ"),"|"):skey1 = split(sWeb("WebKey1"),"|"):sKqqnn = split(sWeb("WebQQname"),"|"):sJscode = sWeb("WebJs"):sSafe = sWeb("WebSafe"):sLoad = sWeb("WebLoading")
'读取列表条数
Dim nm,nm1,nm2,nm3,nm4,nm5,nm6,nm7,nm8,ishtml,nroad
Set nm = oConn.Execute("SELECT top 1 Id,a1,a2,a3,a4,a5,a6,ishtml FROM [WebInfo] WHERE Id = 1")
nm1=nm(1):nm2=nm(2):nm3=nm(3):nm5=nm(5):nm4=nm(4):nm6=nm(6):ishtml=nm(7)
'支付宝是否开通
Dim sRZfb,sSzfb,sRWxin,sSweixin
Set sRZfb = oConn.Execute("SELECT top 1 * FROM [WebZFB] WHERE Id = 1")
Set sRWxin = oConn.Execute("SELECT top 1 * FROM [WebWEIXIN] WHERE Id = 1")
sSzfb=sRZfb("isoff")
sSweixin=sRWxin("isoff")
'QQ登录是否开通
Dim sRqq,sSqq
Set sRqq = oConn.Execute("SELECT top 1 * FROM [WebQQlogin] WHERE Id = 1")
sSqq=sRqq("APPSTATE")
'菜单分类
Dim Cmenu1
Set oRs = oConn.Execute("SELECT Id,MenuTitle,MenuType,MenuUrl,(select top 1 Id from [LstMenuSmall] where MenuId=LstMenuBig.id) FROM [LstMenuBig] where MenuLook=1 ORDER BY MenuIndex ASC")
If Not oRs.EOF Then Cmenu1= oRs.GetRows
Set oRs = Nothing
'菜单分类
Dim Cmenu0
Set oRs = oConn.Execute("SELECT Id,MenuTitle,MenuType,MenuUrl,(select top 1 Id from [LstMenuSmall] where MenuId=LstMenuBig.id) FROM [LstMenuBig] where MenuLook=0 ORDER BY MenuIndex DESC")
If Not oRs.EOF Then Cmenu0= oRs.GetRows
Set oRs = Nothing
'菜单分类地图
Dim Cmap
Set oRs = oConn.Execute("SELECT Id,MenuTitle,MenuType,MenuUrl,(select top 1 Id from [LstMenuSmall] where MenuId=LstMenuBig.id) FROM [LstMenuBig] ORDER BY MenuIndex ASC")
If Not oRs.EOF Then Cmap= oRs.GetRows
Set oRs = Nothing
Dim myus,myus2,aTel,aAdd,aQQ,aName
'如果用户登陆读取
Dim Uid
If session("userid")="" Then 
else
Set Uid = oConn.Execute("SELECT top 1 * FROM [LstUser] WHERE Id = "&session("userid")&"")
End If
'首页要显示的旅游版块
Dim Chome
Set oRs = oConn.Execute("SELECT Id,MenuTitle,MenuPic,MenuPicUrl FROM [LstMenuBig] where MenuHome=1 ORDER BY MenuIndex ASC,Id asc")
If Not oRs.EOF Then Chome= oRs.GetRows
Set oRs = Nothing
'首页要显示的资讯模块
Dim Cnews
Set oRs = oConn.Execute("SELECT Id,MenuTitle,MenuPic,MenuPicUrl FROM [LstMenuBig] where MenuNews=1 ORDER BY MenuIndex ASC,Id asc")
If Not oRs.EOF Then Cnews= oRs.GetRows
Set oRs = Nothing
Dim sMDD,sR1,sR2,sR3,sR4,sR5
Set sMDD = oConn.Execute("SELECT top 1 RoadMDD,RoadJING,RoadDAY,RoadFSHI,RoadMONEY FROM [WebRoad] WHERE Id=1")
sR1 = Split(sMDD(0),"|")
sR2 = Split(sMDD(1),"|")
sR3 = Split(sMDD(2),"|")
sR4 = Split(sMDD(3),"|")
sR5 = Split(sMDD(4),"|")
'发送短信
Dim sSms
Set sSms = oConn.Execute("SELECT top 1 * FROM [WebSMS] WHERE Id = 1")
Sub SendSMSsmscn(mobile,msg)
	dim userid,password,status
	dim xmlObj,httpsendurl
	userid = sSms("APPID")
	password = sSms("APPKEY")
	httpsendurl="http://api.cnsms.cn/?ac=send&encode=utf8&uid="&userid&"&pwd="&password&"&mobile="&mobile&"&content="&server.URLEncode(msg)
	Set xmlObj = server.CreateObject("Microsoft.XMLHTTP")
	xmlObj.Open "GET",httpsendurl,false
	xmlObj.send()
	'status = xmlObj.responseText
	Set xmlObj = nothing
End sub
%>
<%If sSafe=1 Then%> 
<!--#include file="safe.asp"-->
<%End If%>



