<%@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 IsSqlDataBase   = 0  ''''''''''''数据库类型,0为AC,1为SQL
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
Dim i, j, k, x, y, z,gaozhen,ReUrl,action
Dim TT,SS,NewsId,PBId,PSID,PPGGEE,keyword
PBId = request("PBId")
PSID = request("PSID")
NewsId= request("NewsId")
PPGGEE= request("PPGGEE")
TT= request("TT")
SS= request("SS")
ReUrl= request("ReUrl")
gaozhen = request("gaozhen")
action = request("action")
keyword = request("keyword")
Id = Request("Id")
Set oConn = Server.CreateObject("ADODB.CONNECTION") 
Set oRs =server.createobject("adodb.recordset")
'=======修改这里数字,1为SQL数据库，0为Access数据库============
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
if session("adminuser")="" then
   response.write "<script language='javascript'>" 
   response.write "alert('对不起,您还没有登陆!');" 
   response.write "top.location.href='login.asp';"
   response.write "</script>" 
   response.End
end if
'读取网站的基本信息
Dim sWeb,sUrl
Set sWeb = oConn.Execute("SELECT top 1 Id,WebTitle,WebUrl,WebKeyWord,WebDescription,WebAuthor,WebCopyright,WebICP,WebTel,WebMob,WebFax,WebEmail,WebAddress,WebZip,WebRoad,WebQQ,WebCom,WebSafe,ishtml FROM [WebInfo] WHERE Id = 1")
sUrl = sWeb("WebUrl")
'菜单分类
Dim Cmenu
Set oRs = oConn.Execute("SELECT Id,MenuTitle FROM [LstMenuBig] where MenuType=1 ORDER BY Id ASC")
If Not oRs.EOF Then Cmenu= oRs.GetRows
Set oRs = Nothing
'菜单分类
Dim Cmenuall
Set oRs = oConn.Execute("SELECT Id,MenuTitle FROM [LstMenuBig] ORDER BY Id ASC")
If Not oRs.EOF Then Cmenuall= oRs.GetRows
Set oRs = Nothing
'读取列表条数
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 sQxb,sQxa,snNum,sxNum
Set sQxb = oConn.Execute("SELECT top 1 UsrCont,UsrNum FROM [LstAdmin] WHERE UsrAdmin = '"&session("adminuser")&"'")
sQxa = sQxb(0)
snNum  = oConn.Execute("SELECT count(id) FROM [LstNewsInfo] WHERE datediff('d',PAddtime,now())=0  and UsrAdmin = '"&session("adminuser")&"'")(0)
sxNum = sQxb(1)-snNum
Sub  limsss(bbb,aaa) 
    If aaa="" Then
	Response.Write ("<script language=javascript>alert('参数错误,请联系技术人员.');history.go(-1)</script>")
	Response.End()
	End If
	If InStr(bbb,aaa)>0 Then 

	Else 
	Response.Write ("<script language=javascript>alert('对不起,您没有该管理权限,请联系网站管理人员.');history.go(-1)</script>")
	Response.End()
	End If
End Sub
Dim sLabel
sLabel = Split("首页|热门","|")
Dim sSafe
sSafe = sWeb("WebSafe")
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),"|")
%>
<%If sSafe=1 Then%> 
<!--#include file="safe.asp"-->
<%End If%>