📄 wm.skin_label_sort.asp
字号:
<!--#include file="WM.Sys_Cook.asp"-->
<%
If CheckAdminFlag("Label") = False Then Call WRMPS.ErrView("·您没有权限进行此操作",0)
Call WM_Content()
Sub WM_Content()
Dim Action,i,ID,N,eID,e_ID,eType
Dim WM_ParentID, WM_Name, WM_ParentPath, WM_Depth, ClassID, WM_ClassID, Del, WM_Taxis, WM_ID
Dim WM_TaxisID,TypeSql,WM_ClassBig,WM_ClassSmall,OldName,NewName
Dim Parent
Parent = WRMPS.CheckStr(Request("Parent"), 1)
Action = WRMPS.CheckStr(Request("Action"), 0)
WM_ID = WRMPS.CheckStr(Request("WM_ID"), 1)
eType = WRMPS.CheckStr(Request("eType"), 1)
If eType = "" Then eType = WRMPS.CheckStr(Request("Type"), 1)
If eType = "" Then Call WRMPS.ErrView("·操作错误", 0)
TypeSql = " And WM_Type = " & eType
eID = WRMPS.CheckStr(Request("eID"), 1)
If Action = "" Then Action = "View"
Content = Content & "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
Content = Content & "<tr class=td2><td colspan=2><a href=?Action=View&eType=" & eType & ">管理首页</a> | <a href=?Action=Add&eID="&eID&"&WM_ID="&eID&"&eType=" & eType & ">添加分类</a> | <a href=?Action=Taxis&eID="&eID&"&eType=" & eType & ">分类排序</a> | <a href=?Action=Coalition&eID="&eID&"&eType=" & eType & ">分类合并</a> | <a href=WM.Skin_Label.asp?Type=" & eType & ">返回标签/Js管理</a></td></tr>" & vbCrLf
Content = Content & "</table>" & vbCrLf
Call DBConnBegin()
Set Rs = server.createobject("adodb.recordset")
Set Rso = server.createobject("adodb.recordset")
Select Case Action
Case "Coalition" '分类合并
Content = Content & "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
Content = Content & "<form name='addform' method='post' Action='?Coalition=Save&eID="&eID&"&eType=" & eType & "'>" & vbCrLf
Content = Content & "<input name='Action' type='hidden' value='Del'>" & vbCrLf
Content = Content & " <tr class=td4><td><strong>分类合并</strong></td></tr>" & vbCrLf
Content = Content & "<tr class=td2><td> <strong>将分类</strong><select name='ClassID'>" & vbCrLf
Content = Content & "<option value=''>== 请选择 ==</option>" & vbCrLf
Rs.Open "Select * From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"'"&TypeSql&" Order By WM_ClassID,WM_Taxis", Conn, 1, 1
If Rs.EOF Then
Content = Content & "<option value=''>请先添加分类</option>"
Else
Content = Content & "<option value=0>未分类标签</option>"
Do While Not Rs.EOF
Content = Content & "<option value='" & Rs("WM_ID") & "'"
If WM_ID <> "" Then
If Int(WM_ID) = Rs("WM_ID") Then Content = Content & " selected"
End If
Content = Content & ">"
If Rs("WM_Depth") > 0 Then
For i = 1 To Rs("WM_Depth")
Content = Content & " "
Next
End If
If Rs("WM_Child") > 0 Then Content = Content & "+ " Else Content = Content & "- "
Content = Content & Rs("WM_Name")
Content = Content & "</option>" & vbCrLf
Rs.MoveNext
Loop
End If
Rs.Close
Content = Content & "</select> <strong>移动到</strong> <select name='WM_ClassID'>" & vbCrLf
Content = Content & "<option value=''>== 请选择 ==</option>" & vbCrLf
Rs.Open "Select * From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"'"&TypeSql&" Order By WM_ClassID,WM_Taxis", Conn, 1, 1
If Rs.EOF Then
Content = Content & "<option value=''>请先添加分类</option>"
Else
Content = Content & "<option value=0>未分类标签</option>"
Do While Not Rs.EOF
Content = Content & "<option value='" & Rs("WM_ID") & "'"
If WM_ID <> "" Then
If Int(WM_ID) = Rs("WM_ID") Then Content = Content & " selected"
End If
Content = Content & ">"
If Rs("WM_Depth") > 0 Then
For i = 1 To Rs("WM_Depth")
Content = Content & " "
Next
End If
If Rs("WM_Child") > 0 Then Content = Content & "+ " Else Content = Content & "- "
Content = Content & Rs("WM_Name")
Content = Content & "</option>" & vbCrLf
Rs.MoveNext
Loop
End If
Rs.Close
Content = Content & "</select></td></tr>" & vbCrLf
Content = Content & "<tr class=td2><td> <input type='checkbox' name='Del' value=1 Class=radio> 删除被移动的分类及子分类</td></tr>" & vbCrLf
Content = Content & "<tr class=td2><td> <input type=submit name='submit' value='确定移动'></td></tr>" & vbCrLf
Content = Content & "<tr><td class=td2><strong>注意事项:</strong><br>"
Content = Content & "① 所有操作不可逆,请慎重操作<br>"
Content = Content & "② 选择“删除被移动的分类及子分类”则不能在同一个分类内进行操作、不能将一个版面合并到其下属分类中<br>"
Content = Content & "③ 选择“删除被移动的分类及子分类”则被移动分类及其下属分类所有内容都将移动到您所指定的目标分类<br>"
Content = Content & "</td></tr>" & vbCrLf
Content = Content & "</form></table>"
Case "View" '查看分类
If eID <> "" Then e_ID = " WM_ParentID="&eID Else e_ID = " WM_ParentID=0"
Content = Content & "<table width='100%' border=0 align=center cellpadding=5 cellspacing=1 class=td1>" & vbCrLf
Content = Content & " <tr class=td4><td colspan=7><strong>分类管理</strong></td></tr>" & vbCrLf
Rs.Open "Select * From WM_LabelSort Where"&e_ID&TypeSql&" and WM_SkinDir = '"&WR_Setting(5)&"' Order By WM_ClassID,WM_Taxis", Conn, 1, 1
If Rs.EOF Then
Content = Content & "<tr class=td2><td align=center colspan=7>还没有任何分类或分类,<a href=?Action=Add&eType="&eType&"&eID="&eID&"&WM_ID=" & eID & " class=red>现在添加?</a></td></tr>" & vbCrLf
Else
Content = Content & " <tr class=td3 align=center> " & vbCrLf
Content = Content & " <td width='4%'>ID</td>" & vbCrLf
Content = Content & " <td>分类名称</td>" & vbCrLf
Content = Content & " <td width='30%'>操作</td>" & vbCrLf
Content = Content & " </tr>" & vbCrLf
Do While Not Rs.EOF
Content = Content & " <tr class=td2 align=center> " & vbCrLf
Content = Content & " <td>"&Rs(0)&"</td>" & vbCrLf
Content = Content & " <td align=left>" & vbCrLf
Content = Content & "<b>" & Rs("WM_Name") & "</b>"
If Rs("WM_Child") <> 0 Then Content = Content & " <font class=font3>(" & Rs("WM_Child") & ")</font>"
Content = Content & "</td>"
Content = Content & "<td>"
Content = Content & "<a href=?eType="&eType&"&eID=" & Rs("WM_ID") & ">子分类管理</a> | <a href=?Action=Add&eID="&eID&"&eType="&eType&"&WM_ID=" & Rs("WM_ID") & ">添加子分类</a> | "
Content = Content & "<a href=?Action=Edit&eID="&eID&"&eType="&eType&"&WM_ID=" & Rs("WM_ID") & ">修改</a> | <a href=?Action=Del&eID="&eID&"&eType="&eType&"&WM_ID=" & Rs("WM_ID") & " onclick=""return confirm('确定删除?');"">删除</a>" & vbCrLf
Content = Content & "</td></tr>" & vbCrLf
Rs.MoveNext
Loop
End If
Content = Content & "</form></table>" & vbCrLf
Case "Add" '添加分类
Content = Content & "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
Content = Content & "<form name='addform' method='post' Action='WM.Skin_Label_Sort.asp?eID="&eID&"'>" & vbCrLf
Content = Content & "<input name='Action' type='hidden' value='ClassSave'>" & vbCrLf
Content = Content & "<input name='WM_ID' type='hidden' value='" & WM_ID & "'>" & vbCrLf
Content = Content & "<input name=eType type=hidden value=" & eType & ">" & vbCrLf
Content = Content & " <tr class=td4><td colspan=2><strong>添加新分类</strong></td></tr>" & vbCrLf
Content = Content & " <tr class=td2> " & vbCrLf
Content = Content & " <td width='35%'><strong>所属分类</strong><br><Font Color=red>添加后将不能修改</Font></td>" & vbCrLf
Content = Content & " <td width='65%'><select name='WM_ParentID'>" & vbCrLf
Content = Content & "<option value=0>做为一级分类</option>" & vbCrLf
Rs.Open "Select * From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"'"&TypeSql&" Order By WM_ClassID,WM_Taxis", Conn, 1, 1
If Rs.EOF Then
Content = Content & "<option value=0>请先添加分类</option>"
Else
Do While Not Rs.EOF
Content = Content & "<option value='" & Rs("WM_ID") & "'"
If WM_ID <> "" Then
If Int(WM_ID) = Rs("WM_ID") Then Content = Content & " selected"
End If
Content = Content & ">"
If Rs("WM_Depth") > 0 Then
For i = 1 To Rs("WM_Depth")
Content = Content & " "
Next
End If
If Rs("WM_Child") > 0 Then Content = Content & "+ " Else Content = Content & "- "
Content = Content & Rs("WM_Name")
Content = Content & "</option>" & vbCrLf
Rs.MoveNext
Loop
End If
Rs.Close
Content = Content & "</select></td></tr>" & vbCrLf
Content = Content & " <tr class=td2>" & vbCrLf
Content = Content & " <td><strong>分类名称</strong></td>" & vbCrLf
Content = Content & " <td><input name='WM_Name' type='text' size=20 style='width:150' maxlength='50'></td>" & vbCrLf
Content = Content & " </tr>" & vbCrLf
Content = Content & " <tr class=td3><td></td><td><input type=submit name='Submit' value=' 提 交 '></td></tr>" & vbCrLf
Content = Content & "</form></table><script>document.addform.WM_Name.focus()</script>"
Case "Edit" '修改分类
Rs.Open "Select * From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ID=" & WM_ID & TypeSql, Conn, 1, 1
Content = Content & "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
Content = Content & "<form name='addform' method='post' Action='WM.Skin_Label_Sort.asp?eID="&eID&"'>" & vbCrLf
Content = Content & "<input name='Action' type='hidden' value='ClassEditSave'>" & vbCrLf
Content = Content & "<input name='WM_ID' type='hidden' value='" & WM_ID & "'>" & vbCrLf
Content = Content & "<input name='OLDName' type='hidden' value='" & Rs("WM_Name") & "'>" & vbCrLf
Content = Content & "<input name=eType type=hidden value=" & eType & ">" & vbCrLf
Content = Content & " <tr class=td4><td colspan=2><strong>修改分类</strong></td></tr>" & vbCrLf
Content = Content & " <tr class=td2>" & vbCrLf
Content = Content & " <td width='35%'><strong>所属分类</strong></td>" & vbCrLf
Content = Content & " <td width='65%'><strong>"
If Rs("WM_ParentID") > 0 Then
Rso.Open "Select WM_Name From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ID = "&Rs("WM_ParentID")&TypeSql,Conn,1,1
If Not Rso.Eof Then
Content = Content & Rso(0)
End If
Rso.Close
Else
Content = Content & "一级分类"
End If
Content = Content & "</strong></td>" & vbCrLf
Content = Content & " </tr>" & vbCrLf
Content = Content & " <tr class=td2>" & vbCrLf
Content = Content & " <td><strong>分类名称</strong></td>" & vbCrLf
Content = Content & " <td><input name='WM_Name' type='text' size=20 style='width:150' maxlength='50' value='" & Rs("WM_Name") & "'></td>" & vbCrLf
Content = Content & " </tr>" & vbCrLf
Content = Content & " <tr class=td3><td></td><td><input type=submit name='Submit' value=' 提 交 '></td></tr>" & vbCrLf
Content = Content & "</form></table><script>document.addform.WM_Name.focus()</script>"
Rs.Close
Case "ClassSave" '添加保存
WM_ParentID = WRMPS.CheckStr(Request.Form("WM_ParentID"), 1)
WM_Name = WRMPS.CheckStr(Request.Form("WM_Name"), 0)
If WM_Name = "" Then Call WRMPS.ErrView("·请输入分类名称", 0): Exit Sub
If WM_ParentID > 0 Then
Rs.Open "Select WM_ParentPath,WM_ClassID,WM_Taxis From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"' and WM_ID=" & WM_ParentID & TypeSql, Conn, 1, 1
If Not Rs.Eof Then
WM_ParentPath = Rs(0) & "," & WM_ParentID
WM_Depth = UBound(Split(WM_ParentPath, ","))
WM_ClassID = Rs(1)
WM_Taxis = Rs(2) + 1
End If
Rs.Close
Else
Rs.Open "Select WM_ClassID From WM_LabelSort Where WM_SkinDir = '"&WR_Setting(5)&"'"&TypeSql&" Order By WM_ClassID Desc", Conn, 1, 1
If Rs.EOF Then
WM_ClassID = 1
Else
WM_ClassID = Rs(0) + 1
End If
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -