📄 js_main.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!--#include file="../../Conn.asp"-->
<!--#include file="../../SysCls/KS_CommonCls.asp"-->
<!--#include file="../Inc/Session.asp"-->
<%
'===================================================================================================================
'软件名称:科汛网站管理系统
'当前版本:科汛网站管理系统 V2.2 SP2 Free
'Copyright (C) 2006-2008 Kesion.Com All rights reserved.
'产品咨询QQ:9537636,41904294
'技术支持QQ:111394,54004407
'程序版权:科汛网络
'程序开发:科汛网络开发组(总策划:林文仲)
'E-Mail :kesioncms@hotmail.com webmaster@kesion.com
'官方网站:http://www.kesion.com
'演示站点:http://test.kesion.com
'郑重声明:
' ①、免费版本请在程序首页保留版权信息,并做上本站LOGO友情连接,商业版本无此要求;
' ②、任何个人或组织不得在授权允许的情况下删除、修改、拷贝本软件及其他副本上一切关于版权的信息;
' ③、科汛网络保留此软件的法律追究权利
'===================================================================================================================
Dim KSCls
Set KSCls = New JS_Main
KSCls.Execute()
Set KSCls = Nothing
Class JS_Main
Private KSCMS
'========================================================================
Private JSSql, JSRS, FolderID, JSID, ChannelID, Channel, Action
Private i, totalPut, CurrentPage, JSType
Private KeyWord, SearchType, StartDate, EndDate
'搜索参数集合
Private SearchParam
Private MaxPerPage
Private Row
'========================================================================
Private Sub Class_Initialize()
MaxPerPage = 96
Row = 8
Set KSCMS=New CommonCls
End Sub
Private Sub Class_Terminate()
Call KSCMS.CloseConn()
Set KSCMS=Nothing
End Sub
'主体部分
Public Sub Execute()
'采集搜索信息
KeyWord = KSCMS.G("KeyWord")
SearchType = KSCMS.G("SearchType")
StartDate = KSCMS.G("StartDate")
EndDate = KSCMS.G("EndDate")
SearchParam = "KeyWord=" & KeyWord & "&SearchType=" & SearchType & "&StartDate=" & StartDate & "&EndDate=" & EndDate
JSType = KSCMS.G("JSType")
If JSType = "" Then JSType = 0
If JSType = 0 Then
If Not KSCMS.ReturnPowerResult(0, "KMTL10003") Then '系统JS管理的权限检查
Call KSCMS.ReturnErr(1, "")
Response.End
End If
ElseIf JSType = 1 Then
If Not KSCMS.ReturnPowerResult(0, "KMTL10004") Then '自由JS管理的权限检查
Call KSCMS.ReturnErr(1, "")
Response.End
End If
End If
If Not IsEmpty(KSCMS.G("page")) And KSCMS.G("page") <> "" Then
CurrentPage = CInt(KSCMS.G("page"))
Else
CurrentPage = 1
End If
Action = KSCMS.G("Action")
FolderID = Trim(KSCMS.G("FolderID"))
If FolderID = "" Then FolderID = "0"
Dim UPFolderRS, ParentID
Set UPFolderRS = Conn.Execute("select * from [KS_LabelFolder] where ID ='" & FolderID & "'")
If Not UPFolderRS.EOF Then
ParentID = UPFolderRS("ParentID")
End If
UPFolderRS.Close
Set UPFolderRS = Nothing
Response.Write "<html>"
Response.Write "<head>"
Response.Write "<meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312"">"
Response.Write "<title>JS列表</title>"
Response.Write "<link href=""../Inc/Admin_Style.CSS"" rel=""stylesheet"">"
Response.Write "<script language=""JavaScript"">"
Response.Write "var FolderID='" & FolderID & "'; //目录ID" & vbCrLf
Response.Write "var ParentID='" & ParentID & "'; //父栏目ID" & vbCrLf
Response.Write "var Page='" & CurrentPage & "'; //当前页码" & vbCrLf
Response.Write "var KeyWord='" & KeyWord & "'; //关键字" & vbCrLf
Response.Write "var SearchParam='" & SearchParam & "'; //搜索参数集合" & vbCrLf
Response.Write "var Action='" & Action & "';" & vbCrLf
Response.Write "var JSID='" & JSID & "';" & vbCrLf
Response.Write "var JSType=" & JSType & ";" & vbCrLf
Response.Write "</script>" & vbCrLf
Response.Write "<script language=""JavaScript"" src=""../JS/Common.js""></script>"
Response.Write "<script language=""JavaScript"" src=""../JS/ContextMenu.js""></script>"
Response.Write "<script language=""JavaScript"" src=""../JS/SelectElement.js""></script>"
Response.Write "<script language=""JavaScript"" src=""../Common/JSFunction.JS""></script>"
Response.Write "</head>"
Response.Write "<body scroll=no topmargin=""0"" leftmargin=""0"" onclick=""SelectElement();"" onkeydown=""GetKeyDown();"" onselectstart=""return false;"">"
Response.Write "<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"" class=""sortbutton"">"
Response.Write " <tr>"
Response.Write " <td height=""23"" align=""left"">"
If KeyWord = "" Then
Response.Write " <input class=""buttonstyle"" name=""button1"" title=""添加目录"" type=""button"" value=""添加目录"" onClick=""CreateFolder();"" >"
Response.Write " <input class=""buttonstyle"" name=""button2"" title=""编辑目录"" type=""button"" value=""编辑目录"" onClick=""Edit('Folder');"" >"
Response.Write " <input class=""buttonstyle"" name=""button3"" title=""删除目录"" type=""button"" value=""删除目录"" onClick=""Delete('Folder')"">"
Response.Write " <input class=""buttonstyle"" type=""button"" title=""搜索小助理"" name=""Submit"" value=""搜索助理"" onClick=""parent.frames['LeftFrame'].initializeSearch("
If JSType = 0 Then Response.Write ("'SysJS'") Else Response.Write ("'FreeJS'")
Response.Write ")"">"
Response.Write " <input class=""buttonstyle"" "
If FolderID = "0" Then Response.Write ("Disabled=Ture")
Response.Write "name=""button4"" title=""返回到上一级栏目"" type=""button"" value=""回上一级"" onClick=""ChangeUp();"" >"
Else
If JSType = 0 Then
Response.Write ("<img src='../Images/home.gif' align='absmiddle'><span style='cursor:hand' onclick=""SendFrameInfo('JS_Main.asp?JSType=0','Template_Left.asp','../Split.asp?ButtonSymbol=SysJSList&OpStr=JS管理 >> <font color=red>系统JS管理</font>')"">系统JS首页</span>")
Else
Response.Write ("<img src='../Images/home.gif' align='absmiddle'><span style='cursor:hand' onclick=""SendFrameInfo('JS_Main.asp?JSType=1','Template_Left.asp','../Split.asp?ButtonSymbol=FreeJSList&OpStr=JS管理 >> <font color=red>自由JS管理</font>')"">自由JS首页</span>")
End If
Response.Write (">>> 搜索结果: ")
If StartDate <> "" And EndDate <> "" Then
Response.Write ("JS更新日期在 <font color=red>" & StartDate & "</font> 至 <font color=red> " & EndDate & "</font> ")
End If
Select Case SearchType
Case 0
Response.Write ("名称含有 <font color=red>" & KeyWord & "</font> 的JS")
Case 1
Response.Write ("描述中含有 <font color=red>" & KeyWord & "</font> 的JS")
Case 2
Response.Write ("文件名中含有 <font color=red>" & KeyWord & "</font> 的JS")
End Select
End If
Response.Write " </td>"
Response.Write " </tr>"
Response.Write "</table>"
Response.Write "<div style="" height:98%; overflow: auto; width:100%"" align=""center"">"
Response.Write "<table width=""100%"" height=""100%"" border=""0"" cellpadding=""0"" cellspacing=""0"">"
Response.Write " <tr>"
Response.Write " <td valign=""top"">"
Response.Write " <table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""0"">"
Response.Write " <tr>"
Response.Write " <td height=""8"" align=""center""></td>"
Response.Write " </tr>"
Dim FolderSql, Param
Param = " Where JsType=" & JSType
If KeyWord <> "" Then
FolderSql = "SELECT ID,FolderName,Description,OrderID FROM [KS_LabelFolder] Where 1=0"
Select Case SearchType
Case 0
Param = Param & " AND JSName like '%" & KeyWord & "%'"
Case 1
Param = Param & " AND Description like '%" & KeyWord & "%'"
Case 2
Param = Param & " AND JSFileName like '%" & KeyWord & "%'"
End Select
If StartDate <> "" And EndDate <> "" Then
If CInt(Application("DataBaseType")) = 1 Then 'Sql
Param = Param & " And (AddDate>= '" & StartDate & "' And AddDate<= '" & DateAdd("d", 1, EndDate) & "')"
Else 'Access
Param = Param & " And (AddDate>=#" & StartDate & "# And AddDate<=#" & DateAdd("d", 1, EndDate) & "#)"
End If
End If
Else
Param = Param & " AND FolderID='" & FolderID & "'"
FolderSql = "SELECT ID,FolderName,Description,OrderID FROM [KS_LabelFolder] Where FolderType=" & JSType + 2 & " And ParentID='" & FolderID & "'"
End If
Param = Param & " ORDER BY OrderID"
Set JSRS = Server.CreateObject("ADODB.recordset")
JSRS.Open FolderSql & " UNION Select JSID,JSName,Description,OrderID From KS_JSFile " & Param, Conn, 1, 1
If JSRS.EOF And JSRS.BOF Then
Else
totalPut = JSRS.RecordCount
If CurrentPage < 1 Then
CurrentPage = 1
End If
If (CurrentPage - 1) * MaxPerPage > totalPut Then
If (totalPut Mod MaxPerPage) = 0 Then
CurrentPage = totalPut \ MaxPerPage
Else
CurrentPage = totalPut \ MaxPerPage + 1
End If
End If
If CurrentPage = 1 Then
Call showContent
Else
If (CurrentPage - 1) * MaxPerPage < totalPut Then
JSRS.Move (CurrentPage - 1) * MaxPerPage
Call showContent
Else
CurrentPage = 1
Call showContent
End If
End If
End If
Response.Write " </table>"
Response.Write " </td>"
Response.Write " </tr>"
Response.Write " </table>"
Response.Write " </di>"
Response.Write " </body>"
Response.Write " </html>"
Set JSRS = Nothing
Set Conn = Nothing
End Sub
Sub showContent()
Do While Not JSRS.EOF
Response.Write " <tr>"
Response.Write " <td>"
Response.Write " <table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""0"">"
Response.Write " <tr>"
Dim T, TitleStr, JSName, ShortName, LabelTypeStr
For T = 1 To Row
If Not JSRS.EOF Then
JSName = JSRS(1)
ShortName = KSCMS.ListTitle(Replace(Replace(JSName, "{JS_", ""), "}", ""), 24)
If JSType = 1 Then
LabelTypeStr = "自由JS"
Else
LabelTypeStr = "系统JS"
End If
TitleStr = " TITLE='名 称:" & JSName & " 类 型:" & LabelTypeStr & " 描 述:" & JSRS("Description") & "'"
Response.Write ("<td width=""" & CInt(100 / Row) & "%"" Style=""cursor:default"" align=""center""" & TitleStr & ">")
If JSRS(3) = 0 Then
Response.Write ("<span onmousedown=""mousedown(this);"" FolderID=""" & JSRS(0) & """ style=""POSITION:relative;"" onDblClick=""OpenFolder(this.FolderID);""> ")
Else
Response.Write ("<span onmousedown=""mousedown(this);"" JSID=""" & JSRS(0) & """ style=""POSITION:relative;"" onDblClick=""Edit('');""> ")
End If
If JSRS(3) = 0 Then
Response.Write ("<img src=""../Images/Folder/folder.gif""> ")
Else
Response.Write ("<img src=""../Images/Label/JS" & JSType & ".gif"">")
End If
Response.Write ("<span style=""display:block;height:16;padding:0px 0px 0px 0px;margin:1px;width:80%;cursor:default"">" & ShortName & "</span>")
Response.Write ("</span>")
Response.Write ("</td>")
i = i + 1
If JSRS.EOF Or i >= MaxPerPage Then Exit For
JSRS.MoveNext
Else
Exit For
End If
Next
'不到7个单元格,则进行补空
Do While T <= Row
Response.Write ("<td width=70> </td>")
T = T + 1
Loop
Response.Write " </tr>"
Response.Write " <tr><td colspan=" & Row & " height=10></td></tr>"
Response.Write " </table></td>"
Response.Write " </tr>"
If i >= MaxPerPage Then Exit Do
If JSRS.EOF Then Exit Do
Loop
JSRS.Close
Conn.Close
Response.Write " <td align=""right"">"
Call KSCMS.ShowPageParamter(totalPut, MaxPerPage, "JS_Main.asp", True, "个", CurrentPage, "JSType=" & JSType & "&" & SearchParam)
Response.Write ("</td>")
Response.Write "</tr>"
End Sub
End Class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -