<%@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="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
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")
Dim IsError,Err
IsError = False
Err = False
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 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

'=================================================
'小类循环名称
'=================================================
Function MENU2LST(aaa)
	If aaa ="" Then
else
	Dim oRsme,sqlme
	sqlme= "Select Id,MenuTitle,MenuId,MenuType FROM [LstMenuSmall] where MenuId= "&aaa&" order by id asc"
	Set oRsme= Server.CreateObject("ADODB.Recordset")
	oRsme.open sqlme,oconn,1,1
	if oRsme.eof and oRsme.bof Then
	Else
		do while not oRsme.eof
			If oRsme(3) = 0 Then
			Response.write "<li><a target=""main"" href=leftClass/LstMenuSmall.asp?gaozhen=eddinfo&Id="&oRsme(0)&">"&oRsme(1)&"</a></li>"

			Else 
			Response.write "<li><a target=""main"" href=leftClass/Lstnewsinfo.asp?gaozhen=mylist&TT="&oRsme(2)&"&SS="&oRsme(0)&">"&oRsme(1)&"</a></li>"
			End If
		oRsme.movenext
		loop
	End if
	oRsme.close
	set oRsme=Nothing
End If
end Function
'权限问题
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 w, o
'输出信息
Class clsResponse
	Sub w(s)'输入文字
		Response.Write s
	End Sub
	Sub b(s)'弹出提示
		Response.Write "<script language=javascript>alert('" & s & "');</script>"
	End Sub
	Sub a(s)'弹出提示
		Response.Write "<script language=javascript>alert('" & s & "');history.go(-1)</script>"
	End Sub
	Sub wc(w,c)'弹出提示 fanhui
		Response.Write "<script language=javascript>alert('" & w & "');location='" & c &"'</script>"
	End Sub
	Sub r(s)'转向某页
		Response.Redirect s
	End Sub
	Sub e'结束输入
		Response.End
	End Sub
End Class
'参数信息
Class clsRequest
	Function f(s)
		f = Request.Form(s)
	End Function
	Function q(s)
		q = Request.QueryString(s)
	End Function
	Function s(a)
		s = Request.ServerVariables(a)
	End Function
	Function t(s)
		t = Trim(Request(s))
	End Function
End Class
'创建新类
Set w = New clsResponse
Set o = New clsRequest
%>
<%If sSafe=1 Then%> 
<!--#include file="safe.asp"-->
<%End If%>