⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_shoping.asp

📁 大型黄页系统,精美黄页flash演示,10m
💻 ASP
📖 第 1 页 / 共 3 页
字号:
<!--#include file="setup.asp"-->
<%
Dim Rs_c, srtSortingList, i
Dim NewFolderPath, NewFolderPath1, objFSO
Server.ScriptTimeout = 99999
NC_Admin.AdminChk = "62"
NC_Admin.Check
DownsysClass.admin_header

Response.Write "<table width=""96%"" border=""0"" cellspacing=""1"" cellpadding=""3"" align=center class=""tableBorder"">"
Response.Write "<tr>"
Response.Write "<th width=""100%"" class=""tableHeaderText"" colspan=2 height=25>信息分类管理"
Response.Write "</th>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td class=""forumrow"" colspan=2>"
Response.Write "<p><B>注意</B>:<BR>①删除分类同时将删除该分类下所有的信息信息及通讯方式!删除分类同时删除下属分类和所有信息! 操作时请完整填写表单信息。<BR>"
Response.Write " ②如果选择<B>复位所有分类</B>,则所有分类都将作为一级分类(分类),这时您需要重新对各个分类进行归属的基本设置,<B>不要轻易使用该功能</B>,仅在做出了错误的设置而无法复原分类之间的关系和排序的时候使用 </p>"
Response.Write "</td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td class=""forumrow"">"
Response.Write "<B>操作选项</B></td>"
Response.Write "<td class=""forumrow""><a href=""admin_Shoping.asp"">分类管理首页</a>|<a href=""admin_Shoping.asp?action=add"">新建信息分类</a>"
Response.Write "|<a href=""?action=orders"">一级分类排序</a>|<a href=""?action=boardorders"">N级分类排序</a>|<a href=""?action=move"">批量移动</a>"
Response.Write "|<a href=""?action=RestoreBoard"" onclick=""{if(confirm('复位所有分类将把所有分类恢复成为一级大分类,复位后要对所有分类重新进行归属的基本设置,请慎重操作,确定复位吗?')){return true;}return false;}"">复位所有分类</a>"
Response.Write "</td>"
Response.Write "</tr>"
Response.Write "</table>"
Response.Write "<p></p>"
Select Case Request("action")
	Case "add"
		Call Add
	Case "edit"
		Call edit
	Case "savenew"
		Call savenew
	Case "savedit"
		Call savedit
	Case "del"
		Call del
	Case "orders"
		Call orders
	Case "updatorders"
		Call updateorders
	Case "boardorders"
		Call boardorders
	Case "updatboardorders"
		Call updateboardorders
	Case "RestoreBoard"
		Call RestoreBoard
	Case Else
		Call SortInfo
End Select
If Founderr = True Then
	NC_Admin.Error_Msg (ErrMsg)
End If
DownsysClass.admin_footer
NothingObject

Private Sub SortInfo()
	Response.Write " <table width=""96%"" class=""tableBorder"" cellspacing=""1"" cellpadding=""2"" align=center>"
	Response.Write " <tr>"
	Response.Write " <th width=""35%""><strong>信息分类</strong> </th>"
	Response.Write " <th width=""35%""><strong>操作</strong> </th>"
	Response.Write "</tr>"
	SQL = "select * from NC_ShopSort order by rootid,orders"
	Set Rs = Server.CreateObject("adodb.recordset")
	Rs.Open SQL, Conn, 1, 1
	DownsysClass.SqlQueryNum = DownsysClass.SqlQueryNum + 1
	i = 1
	Do While Not Rs.EOF
		Response.Write " <tr class=""forumrow"">"
		Response.Write " <td width=35% class=""forumrow"">"
		Response.Write " "
		If Rs("depth") = 1 Then Response.Write "&nbsp;&nbsp;<font color=""#666666"">├</font>"
		If Rs("depth") > 1 Then
			For i = 2 To Rs("depth")
				Response.Write "&nbsp;&nbsp;<font color=""#666666"">│</font>"
			Next
			Response.Write "&nbsp;&nbsp;<font color=""#666666"">├</font> "
		End If
		If Rs("parentid") = 0 Then Response.Write ("<b>")
		Response.Write Rs("sortname")
		If Rs("child") > 0 Then Response.Write "(" & Rs("child") & ")"
		Response.Write " </td>"
		Response.Write " <td width=65% class=""forumrow"" align=right><a href=""admin_Shoping.asp?action=add&editid="
		Response.Write Rs("sortid")
		Response.Write """>添加分类</a>"
		Response.Write " | <a href=""admin_Shoping.asp?action=edit&editid="
		Response.Write Rs("sortid")
		Response.Write """>分类设置</a>"
		Response.Write " |"
		Response.Write " "
		If Rs("child") = 0 Then
			Response.Write " <a href=""admin_Shoping.asp?action=del&editid="
			Response.Write Rs("sortid")
			Response.Write """ onclick=""{if(confirm('删除将包括该分类的所有信息信息,确定删除吗?')){return true;}return false;}"">删除"
			Response.Write " "
		Else
			Response.Write "<a href=""#"" onclick=""{if(confirm('该分类含有下属分类,必须先删除其下属分类方能删除本分类!')){return true;}return false;}"">"
			Response.Write " 删除</a>"
			Response.Write " "
		End If
		Response.Write " </td>"
		Response.Write "</tr>"
		Rs.movenext
		i = i + 1
	Loop
	Rs.Close
	Set Rs = Nothing
	Response.Write "</table>"
End Sub

Private Sub Add()
	Dim SortNum
	Set Rs = CreateObject("Adodb.recordset")
	SQL = "select Max(sortid) from NC_ShopSort"
	Rs.Open SQL, Conn, 1, 1
	If Rs.bof And Rs.EOF Then
		SortNum = 1
	Else
		SortNum = Rs(0) + 1
	End If
	If IsNull(SortNum) Then SortNum = 1
	Rs.Close
	Response.Write "<form action =""admin_Shoping.asp?action=savenew"" method=post>"
	Response.Write "<input type=""hidden"" name=""newsortid"" value="""
	Response.Write SortNum
	Response.Write """>"
	Response.Write " <table width=""96%"" border=""0"" cellspacing=""1"" cellpadding=""3"" align=center class=""tableBorder"">"
	Response.Write " <tr>"
	Response.Write " <th colspan=2>添加新分类</th>"
	Response.Write "</tr>"
	Response.Write " <tr class=""forumrow"">"
	Response.Write " <td width=""30%"" class=""forumrow"" height=30><U>分类名称</U></td>"
	Response.Write " <td width=""70%"" class=""forumrow"">"
	Response.Write " <input type=""text"" name=""sortname"" size=""35"">"
	Response.Write "</td>"
	Response.Write "</tr>"
	Response.Write " <tr>"
	Response.Write " <td height=24 class=""forumrow""><U>分类说明</U></td>"
	Response.Write " <td class=""forumrow"">"
	Response.Write " <textarea name=""Readme"" cols=""50"" rows=""3""></textarea>"
	Response.Write "</td>"
	Response.Write "</tr>"
	Response.Write "<tr>"
	Response.Write "<td height=30 class=""forumrow""><U>使用设置模板样式</U></td>"
	Response.Write "<td class=""forumrow"">"
	Response.Write "<select name=skinid>"
	Response.Write "<option value=""0"">≡使用默认模板≡</option>"
	Set Rs_c = CreateObject("adodb.recordset")
	SQL = "select id,TempName from [NC_Template] order by id desc"
	Rs_c.Open SQL, Conn, 1, 1
	If Rs_c.bof And Rs_c.EOF Then
		Response.Write "<option value=>请先添加模板</option>"
	Else
		Do While Not Rs_c.EOF
			Response.Write "<option value="""
			Response.Write Rs_c("id")
			Response.Write """>"
			Response.Write Rs_c("tempname")
			Rs_c.movenext
		Loop
	End If
	Rs_c.Close
	Response.Write "</select>"
	Response.Write "</td>"
	Response.Write "</tr>"
	Response.Write " <tr>"
	Response.Write " <td height=30 class=""forumrow""><U>所属类别</U></td>"
	Response.Write " <td class=""forumrow"">"
	Response.Write " <select name=""class"">"
	Response.Write "<option value=""0"">做为信息分类</option>"
	SQL = "select * from NC_ShopSort order by rootid,orders"
	Rs.Open SQL, Conn, 1, 1
	Do While Not Rs.EOF
		Response.Write "<option value=""" & Rs("sortid") & """ "
		If Request("editid") <> "" And CLng(Request("editid")) = Rs("sortid") Then Response.Write "selected"
		Response.Write ">"
		If Rs("depth") = 1 Then Response.Write "&nbsp;&nbsp;├ "
		If Rs("depth") > 1 Then
			For i = 2 To Rs("depth")
				Response.Write "&nbsp;&nbsp;│"
			Next
			Response.Write "&nbsp;&nbsp;├ "
		End If
		Response.Write Rs("sortname") & "</option>" & vbCrLf
		Rs.movenext
	Loop
	Rs.Close
	Response.Write "</select>"
	Response.Write "</td>"
	Response.Write " <tr>"
	Response.Write " <td height=24 class=""forumrow"">&nbsp;</td>"
	Response.Write " <td class=""forumrow"">"
	Response.Write " <input type=""submit"" name=""Submit"" class=button value=""添加分类"">"
	Response.Write "</td>"
	Response.Write "</tr>"
	Response.Write "</table>"
	Response.Write "</form>"
	Set Rs = Nothing
End Sub


Private Sub edit()
	Dim Rs_e
	Set Rs = CreateObject("Adodb.recordset")
	SQL = "select * from NC_ShopSort where sortid=" & Request("editid")
	Set Rs_e = DownsysClass.Execute(SQL)
	Response.Write "<form action =""admin_Shoping.asp?action=savedit"" method=post>"
	Response.Write "<input type=""hidden"" name=editid value="""
	Response.Write Request("editid")
	Response.Write """>"
	Response.Write " <table width=""96%"" border=""0"" cellspacing=""1"" cellpadding=""3"" align=center class=""tableBorder"">"
	Response.Write " <tr>"
	Response.Write " <th height=24 colspan=2>编辑分类:"
	Response.Write Rs_e("sortname")
	Response.Write "</th>"
	Response.Write " </tr>"
	Response.Write " <tr class=""forumrow"">"
	Response.Write " <td width=""30%"" height=30 class=""forumrow""><U>分类名称</U></td>"
	Response.Write " <td width=""70%"" class=""forumrow"">"
	Response.Write " <input type=""text"" name=""sortname"" size=""35"" value="""
	Response.Write Rs_e("sortname")
	Response.Write """>"
	Response.Write " </td>"
	Response.Write " </tr>"
	Response.Write " <tr>"
	Response.Write " <td class=""forumrow""height=24><U>分类说明</U><BR>"
	Response.Write " 可以使用HTML代码</td>"
	Response.Write " <td class=""forumrow"">"
	Response.Write " <textarea name=""Readme"" cols=""50"" rows=""3"">"
	Response.Write Rs_e("readme")
	Response.Write "</textarea>"
	Response.Write " </td>"
	Response.Write " </tr>"
	Response.Write "<tr>"
	Response.Write "<td height=30 class=""forumrow""><U>使用设置模板样式</U></td>"
	Response.Write "<td class=""forumrow"">"
	Response.Write "<select name=skinid>"
	Response.Write "<option value=""0"">≡使用默认模板≡</option>"
	Set Rs_c = CreateObject("Adodb.recordset")
	SQL = "select id,TempName from [NC_Template] order by id desc"
	Rs_c.Open SQL, Conn, 1, 1
	If Rs_c.EOF And Rs_c.bof Then
		Response.Write "<option value=>请先添加模板</option>"
	Else
		Do While Not Rs_c.EOF
			If Rs_e("skinid") = Rs_c("id") Then
				Response.Write "<option value="""
				Response.Write Rs_c("id")
				Response.Write """ selected>"
				Response.Write Rs_c("TempName")
			Else
				Response.Write "<option value="""
				Response.Write Rs_c("id")
				Response.Write """>"
				Response.Write Rs_c("TempName")
			End If
			Rs_c.movenext
		Loop
	End If
	Rs_c.Close
	Response.Write "</select>"
	Response.Write "</td>"
	Response.Write "</tr>"
	Response.Write " <tr>"
	Response.Write " <td height=30 class=""forumrow""><U>所属类别</U></td>"
	Response.Write " <td class=""forumrow"">"
	Response.Write " <select name=""class"">"
	Response.Write " <option value=""0"">做为信息分类</option>"
	Response.Write " "
	SQL = "select * from NC_ShopSort order by rootid,orders"
	Rs.Open SQL, Conn, 1, 1
	Do While Not Rs.EOF
		Response.Write "<option value=""" & Rs("sortid") & """ "
		If Rs_e("parentid") = Rs("sortid") Then Response.Write "selected"
		Response.Write ">"
		If Rs("depth") = 1 Then Response.Write "&nbsp;&nbsp;├ "
		If Rs("depth") > 1 Then
			For i = 2 To Rs("depth")
				Response.Write "&nbsp;&nbsp;│"
			Next
			Response.Write "&nbsp;&nbsp;├ "
		End If
		Response.Write Rs("sortname") & "</option>" & vbCrLf
		Rs.movenext
	Loop
	Rs.Close
	Response.Write " </select> </td>"
	Response.Write " </tr>"
	Response.Write " <tr>"
	Response.Write " <td class=""forumrow""height=24>&nbsp;</td>"
	Response.Write " <td class=""forumrow"">"
	Response.Write " <input type=""submit"" name=""Submit"" class=button value=""保存修改"">"
	Response.Write " </td>"
	Response.Write " </tr>"
	Response.Write " </table>"
	Response.Write "</form>"
	Set Rs = Nothing
	Set Rs_e = Nothing
End Sub

Private Sub savenew()
	Dim sortid
	Dim rootid
	Dim ParentID
	Dim depth
	Dim orders
	Dim Maxrootid
	Dim strParent
	Dim neworders

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -