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

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_Inc/Function.asp" -->
  5. <!--#include file="../../FS_Inc/Func_Page.asp" -->
  6. <%
  7. dim Conn,User_Conn,rs,str_c_isp,str_c_user,str_c_pass,str_c_url,str_domain,rs_param,str_c_gurl,strShowErr
  8. MF_Default_Conn
  9. MF_User_Conn
  10. MF_Session_TF
  11. if not MF_Check_Pop_TF("ME_Log") then Err_Show 
  12. if not MF_Check_Pop_TF("ME039") then Err_Show 
  13. Function GetFriendName(f_strNumber)
  14. Dim RsGetFriendName
  15. Set RsGetFriendName = User_Conn.Execute("Select UserName From FS_ME_Users Where UserNumber = '"& f_strNumber &"'")
  16. If  Not RsGetFriendName.eof  Then 
  17. GetFriendName = RsGetFriendName("UserName")
  18. Else
  19. GetFriendName = 0
  20. End If 
  21. set RsGetFriendName = nothing
  22. End Function 
  23. if Request("Action")="Del" then
  24. if trim(Request("Id"))="" then
  25. strShowErr = "<li>请选择至少一项</li>"
  26. Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  27. Response.end
  28. end if
  29. User_Conn.execute("Delete From FS_ME_Infoilog where iLogID in ("&Request("Id")&")")
  30. strShowErr = "<li>删除日志成功</li>"
  31. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=User/iLog.asp")
  32. Response.end
  33. end if
  34. if Request("Action")="DelAll" then
  35. User_Conn.execute("Delete From FS_ME_Infoilog")
  36. Call MF_Insert_oper_Log("删除日志","删除了所有日志",now,session("admin_name"),"ME")
  37. strShowErr = "<li>删除所有日志成功</li>"
  38. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=User/iLog.asp")
  39. Response.end
  40. end if
  41. if Request("Action")="UnLock" then
  42. if trim(Request("Id"))="" then
  43. strShowErr = "<li>请选择至少一项</li>"
  44. Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  45. Response.end
  46. end if
  47. User_Conn.execute("Update FS_ME_Infoilog set AdminLock=0 where IsLock=0 and iLogID in ("&Request("Id")&")")
  48. strShowErr = "<li>解锁成功</li>"
  49. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=User/iLog.asp")
  50. Response.end
  51. end if
  52. if Request("Action")="Lock" then
  53. if trim(Request("Id"))="" then
  54. strShowErr = "<li>请选择至少一项</li>"
  55. Response.Redirect("../Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  56. Response.end
  57. end if
  58. User_Conn.execute("Update FS_ME_Infoilog set AdminLock=1 where iLogID in ("&Request("Id")&")")
  59. strShowErr = "<li>锁定成功</li>"
  60. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=User/iLog.asp")
  61. Response.end
  62. end if
  63. Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo,strpage,i
  64. int_RPP=25 '设置每页显示数目
  65. int_showNumberLink_=8 '数字导航显示数目
  66. showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
  67. str_nonLinkColor_="#999999" '非热链接颜色
  68. toF_="<font face=webdings title=""首页"">9</font>"   '首页 
  69. toP10_=" <font face=webdings title=""上十页"">7</font>" '上十
  70. toP1_=" <font face=webdings title=""上一页"">3</font>" '上一
  71. toN1_=" <font face=webdings title=""下一页"">4</font>" '下一
  72. toN10_=" <font face=webdings title=""下十页"">8</font>" '下十
  73. toL_="<font face=webdings title=""最后一页"">:</font>"
  74. strpage=request("page")
  75. if len(strpage)=0 Or strpage<1 or trim(strpage)=""Then:strpage="1":end if
  76. %>
  77. </HEAD>
  78. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  79. <BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 scroll=yes>
  80.   
  81. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  82.     <tr> 
  83.       <td width="100%" class="xingmu">日志网摘管理</td>
  84.     </tr>
  85.     <tr> 
  86.       
  87.     <td class="hback"><a href="iLog.asp">日志管理</a>┆<a href="iLog_Templet.asp">模板设置</a>┆<a href="iLog_Class.asp">系统栏目</a>┆<a href="iLog_SetParam.asp">参数设置</a></td>
  88.     </tr>
  89. </table>
  90. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  91.   <form action="iLog.asp"  method="post" name="form1" id="form1">
  92.     <tr class="hback"> 
  93.       <td width="31%" class="xingmu"><div align="left"><strong> 标题</strong></div></td>
  94.       <td width="13%" class="xingmu"><div align="center"><strong>类型</strong></div></td>
  95.       <td width="12%" class="xingmu"><div align="center"><strong>发表人</strong></div></td>
  96.       <td width="15%" class="xingmu"><div align="center"><strong>日期</strong></div></td>
  97.       <td width="13%" class="xingmu"><div align="center"><strong>状态(用户)</strong></div></td>
  98.       <td width="13%" class="xingmu"><div align="center"><strong>状态(管理员)</strong></div></td>
  99.       <td width="3%" class="xingmu">&nbsp;</td>
  100.     </tr>
  101.     <%
  102. dim rs_ilogsql,rs_ilog,str_type,str_isLock,iLogStyle,AdminLock
  103. strpage=request("page")
  104. if len(strpage)=0 Or strpage<1 or trim(strpage)=""  Then strpage="1"
  105. if trim(Request.QueryString("iLogStyle"))<>"" then:iLogStyle=" and iLogStyle="&clng(NoSqlHack(Request.QueryString("iLogStyle")))&"":else:iLogStyle="":end if
  106. if trim(Request.QueryString("AdminLock"))<>"" then:AdminLock=" and AdminLock="&clng(NoSqlHack(Request.QueryString("AdminLock")))&"":else:AdminLock="":end if
  107. Set rs_ilog = Server.CreateObject(G_FS_RS)
  108. rs_ilogsql = "Select * From FS_ME_Infoilog  where 1=1 "& iLogStyle & AdminLock &" order by  isTop desc, Addtime desc, iLogID desc"
  109. rs_ilog.Open rs_ilogsql,User_Conn,1,1
  110. if rs_ilog.eof then
  111.    rs_ilog.close
  112.    set rs_ilog=nothing
  113.    Response.Write"<tr  class=""hback""><td colspan=""7""  class=""hback"" height=""40"">没有记录。</td></tr>"
  114. else
  115. rs_ilog.PageSize=int_RPP
  116. cPageNo=NoSqlHack(Request.QueryString("Page"))
  117. If cPageNo="" Then cPageNo = 1
  118. If not isnumeric(cPageNo) Then cPageNo = 1
  119. cPageNo = Clng(cPageNo)
  120. If cPageNo>rs_ilog.PageCount Then cPageNo=rs_ilog.PageCount 
  121. If cPageNo<=0 Then cPageNo=1
  122. rs_ilog.AbsolutePage=cPageNo
  123. for i=1 to int_RPP
  124. if rs_ilog.eof Then exit For 
  125. %>
  126.     <tr class="hback"> 
  127.       <td class="hback"><div align="left" id=item$pval[CatID]) style="CURSOR: hand"  onmouseup="opencat(rid<%=rs_ilog("iLogID")%>);" language=javascript> 
  128.           <a href="#"> 
  129.           <% = rs_ilog("Title")%>
  130.           </a></div></td>
  131.       <td class="hback"><div align="center">
  132.          <a href="iLog.asp?iLogStyle=<%=rs_ilog("iLogStyle")%>"><%
  133.   if rs_ilog("iLogStyle")=0 then:response.Write"日记":else:response.Write"网摘":end if
  134.   %></a>
  135.         </div></td>
  136.       <td class="hback"><div align="center"><a href="../../<%=G_USER_DIR%>/ShowUser.asp?UserNumber=<% = rs_ilog("UserNumber")%>" target="_blank"> 
  137.           <% = GetFriendName(rs_ilog("UserNumber"))%>
  138.           </a> </div></td>
  139.       <td class="hback"><div align="center"> 
  140.           <% = rs_ilog("addtime")%>
  141.         </div></td>
  142.       <td class="hback"><div align="center"> <%if rs_ilog("isLock")=0 then:response.Write"开放":else:response.Write"锁定":end if%>
  143.         </div></td>
  144.       <td class="hback"><div align="center"> 
  145.           <%
  146.   if rs_ilog("adminLock")=0 then
  147.   response.Write"<a href=iLog.asp?id="&rs_iLog("iLogId")&"&Action=Lock>开放</a>"
  148.   elseif rs_ilog("adminLock")=1 then
  149.   response.Write"<a href=iLog.asp?id="&rs_iLog("iLogId")&"&Action=UnLock><span class=""tx"">锁定</span></a>"
  150.   end if
  151.   %>
  152.         </div></td>
  153.       <td class="hback"><div align="center"> 
  154.           <input name="ID" type="checkbox" id="ID" value="<% = rs_ilog("iLogID")%>">
  155.         </div></td>
  156.     </tr>
  157.     <tr class="hback" id="rid<%=rs_ilog("iLogID")%>" style="display:none"> 
  158.       <td height="31" colspan="7" class="hback"> <strong>日志内容:</strong> 
  159.         <% = rs_ilog("Content")%>
  160.       </td>
  161.     </tr>
  162.     <%
  163.   rs_ilog.MoveNext
  164.   Next
  165.   %>
  166.     <tr class="hback"> 
  167.       <td colspan="7" class="hback"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
  168.           <tr> 
  169.             <td width="80%"> <span class="top_navi"> 
  170.               <%
  171. response.Write "<p>"&  fPageCount(rs_ilog,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)
  172. %>
  173.               <input type="checkbox" name="chkall" value="checkbox" onClick="CheckAll(this.form)">
  174.               全选 
  175.               <input name="Action" type="hidden" id="Action" value="">
  176.               <input type="button" name="Submit2" value="删除"  onClick="document.form1.Action.value='Del';{if(confirm('确定清除您所选择的记录吗?')){this.document.form1.submit();return true;}return false;}">
  177.               <input type="button" name="Submit22" value="批量解锁"  onClick="document.form1.Action.value='UnLock';{if(confirm('您确定要批量解锁吗?')){this.document.form1.submit();return true;}return false;}">
  178.               <input type="button" name="Submit23" value="批量锁定"  onClick="document.form1.Action.value='Lock';{if(confirm('您确定要锁定?')){this.document.form1.submit();return true;}return false;}">
  179.               <input type="button" name="Submit232" value="删除所有"  onClick="document.form1.Action.value='DelAll';{if(confirm('您确定要删除所有日志吗?n   删除后将不能恢复!!!')){this.document.form1.submit();return true;}return false;}">
  180.               </SPAN></td>
  181.           </tr>
  182.           <%end if%>
  183.         </table></td>
  184.     </tr>
  185.   </FORM>
  186. </table>
  187. </body>
  188. </html>
  189. <%
  190. Conn.close:set conn=nothing
  191. User_Conn.close:set User_Conn=nothing
  192. %><script language="JavaScript" type="text/JavaScript">
  193. function CheckAll(form)  
  194.   {  
  195.   for (var i=0;i<form1.elements.length;i++)  
  196.     {  
  197.     var e = form1.elements[i];  
  198.     if (e.name != 'chkall')  
  199.        e.checked = form1.chkall.checked;  
  200.     }  
  201.   }
  202. function opencat(cat)
  203. {
  204.   if(cat.style.display=="none"){
  205.      cat.style.display="";
  206.   } else {
  207.      cat.style.display="none"; 
  208.   }
  209. }
  210. </script>