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

数据库编程

开发平台:

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. <!--#include file="../../FS_Inc/Func_page.asp" -->
  8. <%'Copyright (c) 2006 Foosun Inc. Code by awen ueuo.cn网络收藏夹
  9. response.buffer=true
  10. Response.CacheControl = "no-cache"
  11. Dim Conn,User_Conn
  12. MF_Default_Conn
  13. MF_User_Conn
  14. 'session判断
  15. MF_Session_TF
  16. '权限判断
  17. Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo
  18. int_RPP=15 '设置每页显示数目
  19. int_showNumberLink_=10 '数字导航显示数目
  20. showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
  21. str_nonLinkColor_="#999999" '非热链接颜色
  22. toF_="<font face=webdings>9</font>"    '首页 
  23. toP10_=" <font face=webdings>7</font>" '上十
  24. toP1_=" <font face=webdings>3</font>" '上一
  25. toN1_=" <font face=webdings>4</font>" '下一
  26. toN10_=" <font face=webdings>8</font>" '下十
  27. toL_="<font face=webdings>:</font>" '尾页
  28. Dim  DelIDList,strShowErr
  29. ''=====================
  30. If request.QueryString("Action")="del" Then 
  31. if not Get_SubPop_TF("","NS027","NS","specail") then Err_Show
  32. IF request.QueryString("SpecialID")<>"" then 
  33. Conn.execute("delete from FS_NS_Special where SpecialID = "&request.QueryString("SpecialID"))
  34. Else
  35. DelIDList=replace(request.Form("Cid")," ","")
  36. if DelIDList="" then 
  37. strShowErr = "<li>你必须至少选择一项才能删除。</li>"
  38. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  39. Response.end
  40. end if
  41. Conn.execute("delete from FS_NS_Special where SpecialID in ("& DelIDList &")")
  42. Call MF_Insert_oper_Log("专题","批量删除了专题,专题ID:"& replace(request.Form("Cid")," ","") &"",now,session("admin_name"),"NS")
  43. strShowErr = "<li>恭喜,删除成功。</li>"
  44. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  45. Response.end
  46. End If
  47. End If
  48. ''=====================
  49. if request.QueryString("Act") = "OtherEdit" then
  50. if not Get_SubPop_TF("","NS027","NS","specail") then Err_Show
  51.  
  52. if request.QueryString("EditSql")<>"" then 
  53. Conn.execute(Decrypt(request.QueryString("EditSql")))
  54. end if
  55. if request.QueryString("Red_Url")<>"" then 
  56. response.Redirect(request.QueryString("Red_Url"))
  57. else
  58. response.Redirect("Special_Manage.asp")
  59. end if
  60. end if
  61. dim Fs_news
  62. set Fs_news = new Cls_News
  63. %>
  64. <html>
  65. <head>
  66. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  67. <title>专题管理___Powered by foosun Inc.</title>
  68. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  69. <script language="JavaScript">
  70. //点击标题排序
  71. /////////////////////////////////////////////////////////
  72. var Old_Sql = document.URL;
  73. function OrderByName(FildName)
  74. {
  75. var New_Sql='';
  76. var oldFildName="";
  77. if (Old_Sql.indexOf("&filterorderby=")==-1&&Old_Sql.indexOf("?filterorderby=")==-1)
  78. {
  79. if (Old_Sql.indexOf("=")>-1)
  80. New_Sql = Old_Sql+"&filterorderby=" + FildName + "csed";
  81. else
  82. New_Sql = Old_Sql+"?filterorderby=" + FildName + "csed";
  83. }
  84. else
  85. {
  86. var tmp_arr_ = Old_Sql.split('?')[1].split('&');
  87. for(var ii=0;ii<tmp_arr_.length;ii++)
  88. {
  89. if (tmp_arr_[ii].indexOf("filterorderby=")>-1)
  90. {
  91. oldFildName = tmp_arr_[ii].substring(tmp_arr_[ii].indexOf("filterorderby=") + "filterorderby=".length , tmp_arr_[ii].length);
  92. break;
  93. }
  94. }
  95. oldFildName.indexOf("csed")>-1?New_Sql = Old_Sql.replace('='+oldFildName,'='+FildName):New_Sql = Old_Sql.replace('='+oldFildName,'='+FildName+"csed");
  96. }
  97. //alert(New_Sql);
  98. location = New_Sql;
  99. }
  100. /////////////////////////////////////////////////////////
  101. </script>
  102. </head>
  103. <body>
  104. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  105.   <tr class="hback"> 
  106.     <td class="xingmu"><a href="#" onMouseOver="this.T_BGCOLOR='#404040';this.T_FONTCOLOR='#FFFFFF';return escape('<div align='center'>FoosunCMS4.0<br> Code by 谢赖堂 <BR>Copyright (c) 2006 Foosun Inc</div>')" class="sd"><strong>专题管理</strong></a></td>
  107.   </tr>
  108.   <tr> 
  109.     <td height="18" class="hback"><a href="Special_Manage.asp">管理首页</a> 
  110. | <a href="Special_Add.asp?Action=add">新增专题</a> 
  111. | <a href="../../help?Lable=Special_Add" target="_blank" style="cursor:help;">帮助</a></td>
  112.   </tr>
  113. </table>
  114. <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
  115.   <form name="MainForm" method="post" action="Special_Manage.asp?Action=del">
  116.     <tr class="xingmu"> 
  117.       <td width="6%" align="center" class="xingmu" ><a href="javascript:OrderByName('SpecialID')" class="sd"><b>〖ID〗</b></a> 
  118.         <span id="Show_Oder_SpecialID"></span></td>
  119.       <td colspan="2" align="center" class="xingmu" ><a href="javascript:OrderByName('SpecialCName')" class="sd"><b>栏目中文[栏目英文]</b></a> 
  120.         <span id="Show_Oder_SpecialCName"></span></td>
  121.       <td width="18%" align="center" class="xingmu"><a href="javascript:OrderByName('AddTime')" class="sd"><b>添加时间</b></a> 
  122.         <span id="Show_Oder_AddTime"></span></td>
  123.       <td width="12%" align="center" class="xingmu"><a href="javascript:OrderByName('isLock')" class="sd"><b>属性</b></a> 
  124.         <span id="Show_Oder_isLock"></span></td>
  125.       <td width="20%" class="xingmu"> <div align="center">操作</div></td>
  126.     </tr>
  127.     <%
  128. Dim obj_special_rs,obj_special_rs_1,isUrlStr,This_Fun_Sql,orderby
  129. orderby = request.QueryString("filterorderby")
  130. This_Fun_Sql = "Select SpecialID,SpecialCName,SpecialEName,SpecialSize,SpecialContent,SavePath,Templet,ExtName,isLock,Addtime,GroupID,sPoint From FS_NS_Special "
  131. if orderby<>"" then This_Fun_Sql = This_Fun_Sql &"  Order By "& replace(orderby,"csed"," Desc")
  132. ''response.Write(This_Fun_Sql)
  133. Set obj_special_rs = server.CreateObject(G_FS_RS)
  134. obj_special_rs.Open This_Fun_Sql,Conn,1,1
  135. IF obj_special_rs.eof THEN
  136.   response.Write("<tr class=""hback""><td colspan=15>暂无数据.</td></tr>") 
  137. else
  138. obj_special_rs.PageSize=int_RPP
  139. cPageNo=NoSqlHack(Request.QueryString("Page"))
  140. If cPageNo="" Then cPageNo = 1
  141. If not isnumeric(cPageNo) Then cPageNo = 1
  142. cPageNo = Clng(cPageNo)
  143. If cPageNo>obj_special_rs.PageCount Then cPageNo=obj_special_rs.PageCount 
  144. If cPageNo<=0 Then cPageNo=1
  145. obj_special_rs.AbsolutePage=cPageNo
  146.   FOR int_Start=1 TO int_RPP 
  147. %>
  148.     <tr class="hback"> 
  149.       <td height="22" class="hback"> <div align="center">
  150.           <% = obj_special_rs("SpecialID")%>
  151.         </div></td>
  152.       <td width="26%" height="22" class="hback"> <% 
  153. Response.Write  "<a href=Special_add.asp?SpecialID="&obj_special_rs("SpecialID")&"&Action=edit>"&obj_special_rs("SpecialCName")&"</a>&nbsp;<font style=""font-size:9px;"">["& obj_special_rs("SpecialEName") &"]</font>"
  154. %> </td>
  155.       <td width="18%" class="hback"><div align="center"><a href="News_Manage.asp?SpecialEName=<% = obj_special_rs("SpecialEName") %>&SpecialCName=<%=server.URLEncode(obj_special_rs("SpecialCName"))%>">查看此专题下新闻</a></div></td>
  156.       <td class="hback" align="center"><% = obj_special_rs("Addtime")%></td>
  157.       <td class="hback" align="center"> <%
  158. if obj_special_rs("isLock")=1 then 
  159. ''锁定,需要解锁
  160. response.Write  "<input type=button value=""锁 定"" onclick=""javascript:location='Special_Manage.asp?Act=OtherEdit&EditSql="&server.URLEncode( Encrypt("Update FS_NS_Special set isLock=0 where SpecialID="&obj_special_rs("SpecialID")) )&"&Red_Url='"" title=""点击解锁"" style=""color:red"">" & vbcrlf
  161. else
  162. response.Write  "<input type=button value=""正 常"" onclick=""javascript:location='Special_Manage.asp?Act=OtherEdit&EditSql="&server.URLEncode( Encrypt("Update FS_NS_Special set isLock=1 where SpecialID="&obj_special_rs("SpecialID")) )&"&Red_Url='"" title=""点击锁定"">" & vbcrlf
  163. end if
  164.   %> </td>
  165.       <td class="hback"><div align="center"> <a href="Special_add.asp?SpecialID=<% = obj_special_rs("SpecialID")%>&Action=edit">修改</a>  
  166.           | <a href="Special_Manage.asp?SpecialID=<% = obj_special_rs("SpecialID")%>&Action=del"  onClick="{if(confirm('确定删除您所选择的专题吗?nn此专题下的新闻也将被删除!!')){return true;}return false;}">删除</a>&nbsp;&nbsp; 
  167.           <input name="Cid" type="checkbox" id="Cid" value="<% = obj_special_rs("SpecialID")%>">
  168.         </div></td>
  169.     </tr>
  170.     <%
  171. obj_special_rs.MoveNext
  172.   if obj_special_rs.eof then exit for
  173.       NEXT
  174. End IF  
  175. %>
  176.     <tr> 
  177.       <td height="30" colspan="5" align="left" class="hback"> 
  178. <%=fPageCount(obj_special_rs,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)  & vbcrlf%>       </td>
  179.       <td height="30" class="hback"><input type="checkbox" name="chkall" value="checkbox" onClick="CheckAll(this.form)">
  180.         选择所有 
  181.         <input name="Submit" type="submit" id="Submit"  onClick="{if(confirm('确实要进行删除吗?')){this.document.MainForm.submit();return true;}return false;}" value=" 删除 "></td>
  182.     </tr>
  183.   </form>
  184. </table>
  185. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  186.   <tr> 
  187.     <td height="18" class="hback"><div align="left"> 
  188.         <p><span class="tx"><strong>说明</strong></span>:点击标题排序<br>
  189.         </p>
  190.         </div></td>
  191.   </tr>
  192. </table>
  193. <script language="javascript" type="text/javascript" src="../../FS_Inc/wz_tooltip.js"></script>
  194. </body>
  195. </html>
  196. <%
  197. obj_special_rs.close
  198. set obj_special_rs =nothing
  199. set Fs_news = nothing
  200. %>
  201. <script language="JavaScript" type="text/JavaScript">
  202. function CheckAll(form)  
  203.   {  
  204.   for (var i=0;i<form.elements.length;i++)  
  205.     {  
  206.     var e = MainForm.elements[i];  
  207.     if (e.name != 'chkall')  
  208.        e.checked = MainForm.chkall.checked;  
  209.     }  
  210.   }
  211. //打开后根据规则显示箭头
  212. var Req_FildName;
  213. if (Old_Sql.indexOf("filterorderby=")>-1)
  214. {
  215. var tmp_arr_ = Old_Sql.split('?')[1].split('&');
  216. for(var ii=0;ii<tmp_arr_.length;ii++)
  217. {
  218. if (tmp_arr_[ii].indexOf("filterorderby=")>-1)
  219. {
  220. if(Old_Sql.indexOf("csed")>-1)
  221. {Req_FildName = tmp_arr_[ii].substring(tmp_arr_[ii].indexOf("filterorderby=") + "filterorderby=".length , tmp_arr_[ii].indexOf("csed"));break;}
  222. else
  223. {Req_FildName = tmp_arr_[ii].substring(tmp_arr_[ii].indexOf("filterorderby=") + "filterorderby=".length , tmp_arr_[ii].length);break;}
  224. }
  225. }
  226. if (document.getElementById('Show_Oder_'+Req_FildName)!=null)  
  227. {
  228. if(Old_Sql.indexOf(Req_FildName + "csed")>-1)
  229. {
  230. eval('Show_Oder_'+Req_FildName).innerText = '↓';
  231. }
  232. else
  233. {
  234. eval('Show_Oder_'+Req_FildName).innerText = '↑';
  235. }
  236. }
  237. }
  238. ///////////////////////////////////////////////////////// 
  239. </script>
  240. <!-- Powered by: FoosunCMS4.0系列,Company:Foosun Inc. -->