很垃圾了
能看懂的看看吧

<%
'检测是否有管理标签选项的权限
If Not ChkFlag("selectcata") Then
Call WriteSystemLog("标签选项类别管理","权限不够。")
Call ShowJsMsg("权限不够","history.back();") : Response.End()
End If
'权限管理没有写完
%>




标签选项类别管理

当前位置 &gt;&gt; 标签选项管理 &gt;&gt; 标签选项分类管理
<%
Select Case GetRequest("action","GET",1,0)
Case "del"
Call Del()
Case "edit"
Call Edit()
Case "save"
Call Save()
Case Else
Call Main()
End Select
%>

<%
Sub Del()
Dim Sql,Rs,ID
ID = GetRequest("ID","GET",0,0)
Sql = "select top 1 * from "&Table_Name&"_SelectCata where ID=" & ID
If IsNull(ID) or Not IsNumeric(ID) Then Sql = ""
If Sql <> "" Then
Set Rs = ExecuteSql(Sql)
If Not Rs.Eof Then
If ExecuteSql("select count(*) from "&Table_Name&"_SelectValue where SelectCata="&ID)(0)>0 Then
ShowAlertMsg "系统提示","删除失败,存在日志正在使用该分类。","",450
Else
ExecuteSql "delete from "&Table_Name&"_SelectCata where ID=" & ID
ShowAlertMsg "系统提示","删除成功。","",450
Call WriteSystemLog("标签选项类别管理","删除成功,ID:"&ID&"。")
End IF
Else
ShowAlertMsg "系统提示","删除失败找不到指定的记录。","",450
End IF
Rs.Close
Set Rs = Nothing
Else
ShowAlertMsg "系统提示","删除失败找不到指定的记录。","",450
End If
End Sub

Sub Main()
Call WriteSystemLog("标签选项类别管理","标签选项类别管理。")
'display the list
Dim RsArr,Sql,sPage,sKey,sPageSize,sSearch,sCount,sPageCount,i
sPageSize = 25
sPage = CLng(Request.QueryString("page"))
sKey = Trim(Request("sKey"))
sSearch = ""
If sKey <> "" Then
sSearch = " and Title like '%"&SafeSql(sKey)&"%'"
End If
sCount = ExecuteSql("select count(*) from "&Table_Name&"_SelectCata where 1=1 "&sSearch&"")(0)
sPageCount = Fix(sCount / sPageSize)
If sCount Mod sPageSize <> 0 Then sPageCount = sPageCount + 1
If sPage>sPageCount Then sPage = sPageCount
Sql = "select top "&sPageSize&" ID,Title,SelectType from "&Table_Name&"_SelectCata where 1=1 "&sSearch&" order by id desc"
If sPage > 1 Then
Sql = "select top "&sPageSize&" ID,Title,SelectType from "&Table_Name&"_SelectCata where 1=1 "&sSearch&" and id not in(select top "&(sPage-1)*sPageSize&" id from "&Table_Name&"_SelectCata where 1=1 "&sSearch&" order by id desc) order by id desc"
End If
RsArr = RsResult(Sql)
%>

标题关键字
    <%=GetSelectCataList(CataID)%>

<%
If IsArray(RsArr) Then
For i = 0 To UBOUND(RsArr,2)
%>

<%
Next
Erase RsArr
End If
%>

编号 名称 选项类别 管 理
<%=RsArr(0,i)%> <%=RsArr(1,i)%> <%if RsArr(2,i)=1 then%>单选<%else%>多选<%end if%> &action=edit">编辑 &action=del" onClick="return Confirm('是否删除');">删除

<%
Response.Write "

    "
    Response.Write GetPageBar(sPage,sPageCount,"Admin_SelectCata.asp?page={i}&sKey=" & sKey)
    Response.Write "

"
End Sub

Sub Save()
Dim ID,Title,SelectType
ID = GetRequest("ID","GET",0,0)
Title = SafeSql(GetRequest("Title","",1,20))
SelectType = GetRequest("SelectType","GET",0,0)
If Not IsNumeric(ID) Then ID = 0
If Title = "" Then ShowAlertMsg "系统错误","分类名称不能为空!","",450:Exit Sub
Dim Sql,iCount
Sql = "select count(*) from "&Table_Name&"_SelectCata where Title='"&Title&"' and id<>" & ID
If ID = 0 Then Sql = "select count(*) from "&Table_Name&"_SelectCata where Title='"&Title&"'"
iCount = ExecuteSql(Sql)(0)
If iCount = 0 Then '可编辑,添加和修改
Sql = "update "&Table_Name&"_SelectCata set Title='"&Title&"',SelectType="&SelectType&" where ID=" & ID
If ID = 0 Then Sql = "insert into "&Table_Name&"_SelectCata(Title,SelectType) values('"&Title&"',"&SelectType&")"
ExecuteSql Sql
Call WriteSystemLog("标签选项类别管理","添加、编辑标签选项类别,&#
39;"&Title&"
'。")
Else
ShowAlertMsg "系统错误","已经存在该分类!","",450:Exit Sub
End If
Response.Redirect "Admin_SelectCata.asp"
End Sub

Sub Edit()
Dim Sql,Rs,ID
ID = GetRequest("ID","GET",0,0)
Call WriteSystemLog("标签选项类别管理","添加、编辑标签选项类别,ID:"&ID&"。")
Sql = "select top 1 * from "&Table_Name&"_SelectCata where ID=" & ID
If IsNull(ID) or Not IsNumeric(ID) or ID = 0 Then Sql = ""
Dim Title,SelectType
Title = "" : SelectType = 1
If Not Sql = "" Then
Set Rs = ExecuteSql(Sql)
If Not Rs.Eof Then
Title = Rs("Title")
SelectType = Rs("SelectType")
Else
ID = 0
End If
Rs.Close
Set Rs = Nothing
Else
ID = 0
End If
%>

&action=save">

标签选项分类管理
分类名称 " />" />
选项类型 checked="checked"<%End If%> id="IsLock1" /> checked="checked"<%End If%> id="IsLock2" />

<%
End Sub
%>

<%
Call PageBottom()
%>