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

数据库编程

开发平台:

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="../../FS_InterFace/HS_Function.asp" -->
  7. <!--#include file="../../FS_InterFace/AP_Function.asp" -->
  8. <%
  9. Response.Buffer = True
  10. Response.Expires = -1
  11. Response.ExpiresAbsolute = Now() - 1
  12. Response.Expires = 0
  13. Response.CacheControl = "no-cache"
  14. Dim Conn,obj_Label_Rs,SQL,strShowErr
  15. MF_Default_Conn
  16. 'session判断
  17. MF_Session_TF 
  18. Dim str_StyleName,txt_Content,Labelclass_SQL,obj_Labelclass_rs,obj_Count_rs
  19. if Request.QueryString("action")="del" then
  20. Conn.execute("Delete From FS_MF_LableClass where id="& Request.QueryString("id")&"")
  21. Conn.execute("Update FS_MF_Lable set LableClassID=0 where LableClassID="&Request.QueryString("id"))
  22. strShowErr = "<li>删除成功</li>"
  23. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=Label/Label_Class.asp")
  24. Response.end
  25. end if
  26. %>
  27. <html>
  28. <head>
  29. <title>标签管理</title>
  30. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  31. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  32. </head>
  33. <script language="JavaScript" src="../../editer/editer.js" type="text/JavaScript"></script>
  34. <script language="JavaScript" src="../../FS_Inc/PublicJS.js" type="text/JavaScript"></script>
  35. <body>
  36. <table width="98%" height="76" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
  37.   <tr class="hback" > 
  38.     <td width="100%" height="20"  align="Left" class="xingmu">标签库</td>
  39.   </tr>
  40.   <tr class="hback" > 
  41.     <td height="27" align="center" class="hback"><div align="left"><a href="All_Label_Stock.asp">所有标签</a>┆<a href="All_Label_Stock.asp?isDel=1">备份库</a>┆<a href="label_creat.asp">创建标签</a>┆<a href="Label_Class.asp" target="_self">标签分类</a>&nbsp;┆<a href="All_label_style.asp">样式管理</a>&nbsp;<a href="../../help?Label=MF_Label_Stock" target="_blank" style="cursor:help;"><img src="../Images/_help.gif" width="50" height="17" border="0"></a></div></td>
  42.   </tr>
  43.   <tr class="hback" > 
  44.     <td align="center" class="hback">
  45. <div align="left">
  46. <%
  47. dim rs_class,i
  48. set rs_class=Conn.execute("select id,ClassName,ClassContent,ParentID From FS_MF_LableClass where ParentID=0 order by id desc")
  49. do while not rs_class.EOF
  50. response.Write "├"&rs_class("ClassName")&"&nbsp;&nbsp;<a href=Label_Class.asp?id="&rs_class("id")&"&action=edit>[修改]</a><a href=Label_Class.asp?id="&rs_class("id")&"&action=del onClick=""{if(confirm('确定清除您所选择的记录吗?n删除后,此栏目下的标签将放到根目录下!')){return true;}return false;}"">[删除]</a><br />"
  51. response.Write get_childList1(rs_class("id"),"")
  52. rs_class.movenext
  53. loop
  54. rs_class.close:set rs_class=nothing
  55. %>
  56. </div>
  57. </td>
  58.   </tr>
  59.   <form name="form1" method="post" action="">
  60.   </form>
  61. </table>
  62. <%
  63. dim str_action,str_id,str_ClassName,str_ClassContent,rs_edit
  64. if Request.QueryString("Action")="edit" then
  65. str_action = "Edit_Save"
  66. str_id= Request.QueryString("id")
  67. if not isnumeric(str_id) then
  68. strShowErr = "<li>错误的参数</li>"
  69. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  70. Response.end
  71. end if
  72. set rs_edit = Conn.execute("select ClassName,ClassContent,id from FS_MF_LableClass where id="&cint(request.QueryString("id")))
  73. if rs_edit.eof then
  74. rs_edit.close:set rs_edit = nothing
  75. strShowErr = "<li>错误的参数</li>"
  76. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  77. Response.end
  78. else
  79. str_ClassName = rs_edit("ClassName")
  80. str_ClassContent = rs_edit("ClassContent")
  81. rs_edit.close:set rs_edit = nothing
  82. end if
  83. else
  84. str_action = "Add_Save"
  85. str_id = ""
  86. end if
  87. %>
  88. <table width="98%" height="76" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  89.   <tr class="hback" >
  90.     <td colspan="2" align="center" class="xingmu"><div align="left">创建/修改分类</div></td>
  91.   </tr>
  92.   <form name="form1" method="post" action=""><tr class="hback" >
  93.     <td width="16%" align="center" class="hback">
  94.       标签分类名称</td>
  95.       <td width="84%" align="center" class="hback"><div align="left">
  96.         <label>
  97.         <input name="ClassName" type="text" id="ClassName" value="<%=str_ClassName%>">
  98.         </label>
  99.       </div> </td>
  100.   </tr>
  101.     <tr class="hback" >
  102.       <td align="center" class="hback">所属栏目</td>
  103.       <td align="center" class="hback"><div align="left">
  104.         <label>
  105.         <select name="ParentID" id="ParentID">
  106.           <option value="0">选择所属栏目</option>
  107.   <%
  108.   dim class_rs_obj,tmp_obj,tmp_ParentId
  109.   set tmp_obj = Conn.execute("select ParentID From FS_MF_LableClass where id="&clng(Request.QueryString("id")))
  110.   if tmp_obj.eof then
  111.   tmp_ParentId = 0
  112.   tmp_obj.close:set tmp_obj = nothing
  113.   else
  114.   tmp_ParentId = tmp_obj(0)
  115.   tmp_obj.close:set tmp_obj = nothing
  116.   end if
  117.   set class_rs_obj=Conn.execute("select id,ParentID,ClassName From FS_MF_LableClass where ParentID=0 order by id desc")
  118.   do while not class_rs_obj.eof 
  119.    if tmp_ParentId = class_rs_obj("id") then
  120. response.Write "<option value="""&class_rs_obj("id")&""" selected>"&class_rs_obj("ClassName")&"</option>"
  121. else
  122. response.Write "<option value="""&class_rs_obj("id")&""">"&class_rs_obj("ClassName")&"</option>"
  123. end if
  124. response.Write get_childList(class_rs_obj("id"),"",tmp_ParentId)
  125.    class_rs_obj.movenext
  126.   loop
  127.   class_rs_obj.close:set class_rs_obj=nothing
  128.   %>
  129.         </select>
  130.         </label>
  131.       </div></td>
  132.     </tr>
  133.     <tr class="hback" >
  134.     <td align="center" class="hback">说明</td>
  135.     <td align="center" class="hback"><div align="left">
  136.       <label>
  137.       <textarea name="ClassContent" cols="50" rows="6" id="ClassContent"><%=str_ClassContent%></textarea>
  138.       </label>
  139.     </div></td>
  140.   </tr>
  141.   <tr class="hback" >
  142.     <td align="center" class="hback">&nbsp;</td>
  143.     <td align="center" class="hback"><div align="left">
  144.       <label>
  145.       <input type="submit" name="Submit" value="创建标签分类">
  146.       </label>
  147.       <label>
  148.       <input type="reset" name="Submit2" value="重新填写">
  149.       </label>
  150.       <input name="Action" type="hidden" id="Action" value="<%=str_action%>">
  151.       <input name="ID" type="hidden" id="ID" value="<%=str_id%>">
  152.     </div></td>
  153.   </tr>
  154.   </form>
  155. </table>
  156. </body>
  157. <% 
  158. If request.Form("Action")<>"" then
  159. dim rs,wheresql
  160. if Request.Form("Action")="Add_Save" then
  161. wheresql = " where 1=0"
  162. strShowErr = "<li>创建分类成功</li><li><a href=Label/Label_Class.asp>继续创建</a></li><li><a href=Label/All_Label_Stock.asp>返回管理</A></li>"
  163. elseif Request.Form("Action")="Edit_Save" then
  164. strShowErr = "<li>修改分类成功</li><li><a href=Label/Label_Class.asp?id="&Request.Form("Id")&"&action=edit>继续修改</a></li><li><a href=Label/All_Label_Stock.asp>返回管理</A></li>"
  165. wheresql = " where id="&clng(Request.Form("Id"))&""
  166. end if
  167. set rs = Server.CreateObject(G_FS_RS)
  168. rs.open "select ClassName,ClassContent,ParentID From FS_MF_LableClass "& wheresql &"",Conn,1,3
  169. if Request.Form("Action")="Add_Save" then
  170. rs.addnew
  171. end if
  172. rs("ClassName")=Request.Form("ClassName")
  173. rs("ClassContent")=Request.Form("ClassContent")
  174. rs("ParentID")=Request.Form("ParentID")
  175. rs.update
  176. rs.close
  177. set rs = nothing
  178. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=Label/All_Label_Stock.asp")
  179. Response.end
  180. End if
  181. Function get_childList(TypeID,f_CompatStr,tmp_ParentId)  
  182. Dim f_ChildNewsRs,ChildTypeListStr,f_TempStr,f_isUrlStr,lng_GetCount
  183. Set f_ChildNewsRs = Conn.Execute("Select id,ParentID,ClassName from FS_MF_LableClass where ParentID=" & TypeID & " order by id desc" )
  184. f_TempStr =f_CompatStr & "┄"
  185. do while Not f_ChildNewsRs.Eof
  186. if tmp_ParentId = f_ChildNewsRs("id") then
  187. get_childList = get_childList & "<option value="""& f_ChildNewsRs("id") &""" selected>"
  188. else
  189. get_childList = get_childList & "<option value="""& f_ChildNewsRs("id") &""">"
  190. end if
  191. get_childList = get_childList & "├" &  f_TempStr & f_ChildNewsRs("ClassName") 
  192. get_childList = get_childList & "</option>" & Chr(13) & Chr(10)
  193. get_childList = get_childList &get_childList(f_ChildNewsRs("id"),f_TempStr,tmp_ParentId)
  194. f_ChildNewsRs.MoveNext
  195. loop
  196. f_ChildNewsRs.Close
  197. Set f_ChildNewsRs = Nothing
  198. End Function
  199. Function get_childList1(TypeID,f_CompatStr)  
  200. Dim f_ChildNewsRs,ChildTypeListStr,f_TempStr,f_isUrlStr,lng_GetCount
  201. Set f_ChildNewsRs = Conn.Execute("Select id,ParentID,ClassName from FS_MF_LableClass where ParentID=" & TypeID & " order by id desc" )
  202. f_TempStr =f_CompatStr & "┄"
  203. do while Not f_ChildNewsRs.Eof
  204. get_childList1 = get_childList1 & "├" &  f_TempStr &f_ChildNewsRs("ClassName") &"&nbsp;&nbsp;<a href=Label_Class.asp?id="&f_ChildNewsRs("id")&"&action=edit>[修改]</a><a href=Label_Class.asp?id="&f_ChildNewsRs("id")&"&action=del onClick=""{if(confirm('确定清除您所选择的记录吗?n删除后,此栏目下的标签将放到根目录下!')){return true;}return false;}"">[删除]</a><br />"
  205. get_childList1 = get_childList1 &get_childList1(f_ChildNewsRs("id"),f_TempStr)
  206. f_ChildNewsRs.MoveNext
  207. loop
  208. f_ChildNewsRs.Close
  209. Set f_ChildNewsRs = Nothing
  210. End Function
  211. Set Conn=nothing
  212. %>
  213. </html>
  214. <script language="JavaScript" type="text/JavaScript">
  215. function insert(insertContent)
  216. {
  217. obj=window.frames.item('NewsContent').EditArea.document.body;
  218. obj.focus();
  219. if(document.selection==null)
  220. {
  221. var iStart = obj.selectionStart
  222. var iEnd = obj.selectionEnd;
  223. obj.value = obj.value.substring(0, iEnd) +insertContent+ obj.value.substring(iEnd, obj.value.length);
  224. }else
  225. {
  226. var range = document.selection.createRange();
  227. range.text=insertContent;
  228. }
  229. }
  230. function opencat(cat)
  231. {
  232.   if(cat.style.display=="none"){
  233.      cat.style.display="";
  234.   } else {
  235.      cat.style.display="none"; 
  236.   }
  237. }
  238. </script>
  239. <!-- Powered by: FoosunCMS4.0系列,Company:Foosun Inc. -->