Lable_manage.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:8k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_Inc/Function.asp"-->
  4. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  5. <!--#include file="../../FS_InterFace/NS_Function.asp" -->
  6. <!--#include file="lib/cls_main.asp" -->
  7. <%'CopyRight (c) 2006 Fooun Inc. Code by Simpwind.Xie
  8. response.buffer=true
  9. Response.CacheControl = "no-cache"
  10. Dim Conn,User_Conn
  11. MF_Default_Conn
  12. MF_User_Conn
  13. 'session判断
  14. MF_Session_TF 
  15. '权限判断
  16. 'Call MF_Check_Pop_TF("NS_Class_000001")
  17. '得到会员组列表
  18. dim Fs_news,strShowErr
  19. set Fs_news = new Cls_News
  20. Fs_News.GetSysParam()
  21. if Request.QueryString("Action") = "del_Ls" then
  22. Conn.execute("Delete From FS_NS_Lable where id="&NoSQLHack(Request.QueryString("id")))
  23. strShowErr = "<li>标签删除成功</li>"
  24. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=../Lable_Manage.asp")
  25. Response.end
  26. End if
  27. if Request.QueryString("Action") = "del_lable" then
  28. Conn.execute("Delete From FS_NS_Lable")
  29. strShowErr = "<li>所有的标签已经置空</li>"
  30. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=../Lable_style.asp")
  31. Response.end
  32. Elseif Request.QueryString("Action") = "del_lable_dir" then
  33. Dim obj_all_rs
  34. set obj_all_rs = Conn.execute("select ID from FS_NS_LableClass order by id desc")
  35. do while not obj_all_rs.eof 
  36. Conn.execute("Delete From FS_NS_LableClass where ID="&obj_all_rs("Id"))
  37. Conn.execute("Update  FS_NS_Lable set LableClassID=0 where LableClassID="&obj_all_rs("Id"))
  38. obj_all_rs.movenext
  39. Loop
  40. strShowErr = "<li>所有标签分类已经删除</li><li>标签分类下的标签已经归位到根目录</li>"
  41. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=../Lable_style.asp")
  42. Response.end
  43. End if
  44. %>
  45. <html>
  46. <head>
  47. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  48. <title>标签管理___Powered by foosun Inc.</title>
  49. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  50. </head>
  51. <body>
  52. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  53.   <tr class="hback"> 
  54.     <td class="xingmu">标签管理<a href="../../help?Lable=NS_Lable_Manage" target="_blank" style="cursor:help;'" class="sd"><img src="../Images/_help.gif" border="0"></a></td>
  55.   </tr>
  56.   <tr> 
  57.     <td height="18" class="hback"><div align="left"><a href="Lable_Manage.asp">管理首页</a> 
  58.         &nbsp;|&nbsp; <a href="Lable_Create.asp?ClassID=<%=Request.QueryString("ClassID")%>">创建标签</a> 
  59.         &nbsp;|&nbsp; <a href="Lable_Dir_add.asp#Add">添加标签栏目</a> &nbsp;|&nbsp; 
  60.         <a href="Lable_style.asp">标签样式管理</a> &nbsp;|&nbsp; <a href="Lable_Manage.asp?Action=del_lable"  onClick="{if(confirm('确认删除吗!')){return true;}return false;}">删除所有标签</a> 
  61.         &nbsp;|&nbsp; <a href="Lable_Manage.asp?Action=del_lable_dir"  onClick="{if(confirm('确认删除吗!')){return true;}return false;}">删除所有标签目录</a> 
  62.         | <a href="../../help?Lable=NS_Lable_Manage_1" target="_blank" style="cursor:help;'" class="sd"><img src="../Images/_help.gif" border="0"></a></div></td>
  63.   </tr>
  64. </table>
  65. <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
  66.   <tr class="hback"> 
  67.     <td> 
  68.       <%
  69.    Dim Lableclass_SQL,obj_Lableclass_rs,icNum,news_count,obj_Lableclass_rs_1
  70. Lableclass_SQL = "Select ID,ClassName from FS_NS_LableClass   Order by id desc"
  71. Set obj_Lableclass_rs = server.CreateObject(G_FS_RS)
  72. obj_Lableclass_rs.Open Lableclass_SQL,Conn,1,3
  73. Response.Write("<table width=""100%"" border=""0"" align=""center"" cellpadding=""3"" cellspacing=""1"" >")
  74. Response.Write("<tr>")
  75. icNum = 0
  76. if Not obj_Lableclass_rs.eof then
  77. Do while Not obj_Lableclass_rs.eof 
  78. Set obj_Lableclass_rs_1 = server.CreateObject(G_FS_RS)
  79. obj_Lableclass_rs_1.Open "Select ID from FS_NS_Lable where LableClassID="& obj_Lableclass_rs("ID") &"",Conn,1,3
  80. news_count = "("&obj_Lableclass_rs_1.recordcount&")"
  81. obj_Lableclass_rs_1.close:set obj_Lableclass_rs_1 = nothing
  82. Response.Write"<td height=""22"">"
  83. Response.Write "<a href=Lable_Manage.asp?ClassID="&obj_Lableclass_rs("id")&">"&obj_Lableclass_rs("ClassName")&news_count&"</a>"
  84. Response.Write "</td>"
  85. obj_Lableclass_rs.MoveNext
  86. icNum = icNum + 1
  87. if icNum mod 6 = 0 then
  88. Response.Write("</tr><tr>")
  89. End if
  90. loop
  91. Else
  92. Response.Write("<td>没有目录</td>")
  93. End if
  94. Response.Write("</tr>")
  95. Response.Write("</table>")
  96. set obj_Lableclass_rs = nothing
  97. %>
  98.     </td>
  99.   </tr>
  100. </table>
  101. <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
  102.   <tr class="xingmu"> 
  103.     <td width="42%" class="xingmu">标签名称</td>
  104.     <td width="16%" class="xingmu">栏目</td>
  105.     <td width="28%" class="xingmu">说明</td>
  106.     <td width="14%" class="xingmu">操作</td>
  107.   </tr>
  108.   <%
  109.    Dim strpage,i,obj_lable_rs,select_count,select_pagecount,tmp_classid
  110. strpage=request("page")
  111. if len(strpage)=0 Or strpage<1 or trim(strpage)=""Then:strpage="1":end if
  112. Set obj_lable_rs = server.CreateObject(G_FS_RS)
  113. if Request.QueryString("ClassID")<>"" then:tmp_classid = " and LableClassID="& clng(Request.QueryString("ClassID"))&"":Else:tmp_classid = "":End if
  114. obj_lable_rs.Open "Select ID,LableName,LableDesc,LableContent,AddDate,LablelType,LableClassID,isDel from FS_NS_Lable where isDel=0 "& tmp_classid &" order by id desc",Conn,1,3
  115. if obj_lable_rs.eof then
  116.    obj_lable_rs.close
  117.    set obj_lable_rs=nothing
  118.    Response.Write"<TR  class=""hback""><TD colspan=""4""  class=""hback"" height=""40"">没有标签。</TD></TR>"
  119. Else
  120. obj_lable_rs.pagesize = 20
  121. obj_lable_rs.absolutepage=cint(strpage)
  122. select_count=obj_lable_rs.recordcount
  123. select_pagecount=obj_lable_rs.pagecount
  124. for i=1 to obj_lable_rs.pagesize
  125. if obj_lable_rs.eof Then exit For 
  126.   %>
  127.   <tr> 
  128.     <td class="hback">·<a href="Lable_Manage.asp?ClassID=<%=obj_lable_rs("LableClassID")%>&Action=edit&ID=<%=obj_lable_rs("ID")%>"> 
  129.       <% = obj_lable_rs("LableName") %>
  130.       </a></td>
  131.     <td class="hback"> <%
  132. if obj_lable_rs("LableClassID")=0 then
  133. Response.Write("根目录")
  134. Else
  135. Dim obj_tmp_rs
  136. set obj_tmp_rs = Conn.execute("select classname from FS_NS_LableClass where id="&obj_lable_rs("LableClassID"))
  137. Response.Write "<a href=Lable_Manage.asp?ClassID="& obj_lable_rs("LableClassID") &">"& obj_tmp_rs("classname") &"</a>"
  138. obj_tmp_rs.close:set obj_tmp_rs = nothing
  139. End if
  140. %></td>
  141.     <td class="hback"> 
  142.       <% = obj_lable_rs("LableDesc") %> </td>
  143.     <td class="hback"><a href="Lable_Create.asp?ClassID=<%=obj_lable_rs("LableClassID")%>&Action=edit&ID=<%=obj_lable_rs("ID")%>">修改</a>|<a href="Lable_Manage.asp?ClassID=<%=obj_lable_rs("LableClassID")%>&Action=del_Ls&ID=<%=obj_lable_rs("ID")%>" onClick="{if(confirm('确定删除标签吗!')){return true;}return false;}">删除</a></td>
  144.   </tr>
  145.   <%
  146.    obj_lable_rs.MoveNext
  147.   Next
  148.   %>
  149.   <tr> 
  150.     <td height="35" colspan="4" class="hback"> <%
  151.  Response.Write("每页:&nbsp;<b>"& obj_lable_rs.pagesize &"</b>&nbsp;个标签,")
  152. Response.write"&nbsp;共<b>"& select_pagecount &"</b>页&nbsp;<b>" & select_count &"</b>&nbsp;个"& Fs_news.allInfotitle &",本页是第&nbsp;<b>"& strpage &"</b>&nbsp;页。"
  153. if int(strpage)>1 then
  154. Response.Write"&nbsp;<a href=""Lable_Manage.asp?page=1&Classid="&Request("Classid")&""">第一页</a>&nbsp;&nbsp;"
  155. Response.Write"&nbsp;<a href=""Lable_Manage.asp?page="&cstr(cint(strpage)-1)&"&Classid="&Request("Classid")&""">上一页</a>&nbsp;&nbsp;"
  156. End if
  157. If int(strpage)<select_pagecount then
  158. Response.Write"&nbsp;<a href=""Lable_Manage.asp?page="&cstr(cint(strpage)+1)&"&Classid="&Request("Classid")&""">下一页</a>&nbsp;"
  159. Response.Write"&nbsp;<a href=""Lable_Manage.asp?page="& select_pagecount &"&Classid="&Request("Classid")&""">最后一页</a>&nbsp;&nbsp;"
  160. End if
  161. %> </td>
  162.   </tr>
  163.   <%
  164.   End if
  165.   set obj_lable_rs = nothing
  166.   %>
  167. </table>
  168. </body>
  169. </html>
  170. <%
  171. set Fs_news = nothing
  172. %>
  173. <script language="JavaScript" type="text/JavaScript">
  174. function CheckAll(form)  
  175.   {  
  176.   for (var i=0;i<form.elements.length;i++)  
  177.     {  
  178.     var e = ClassForm.elements[i];  
  179.     if (e.name != 'chkall')  
  180.        e.checked = ClassForm.chkall.checked;  
  181.     }  
  182.   }
  183. </script>
  184. <!-- Powered by: FoosunCMS4.0系列,Company:Foosun Inc. -->