adminMSG.asp
上传用户:qyswxdl
上传日期:2013-06-01
资源大小:1373k
文件大小:9k
源码类别:

家庭/个人应用

开发平台:

ASP/ASPX

  1. <!--#include file="articleconn.asp"-->
  2. <!--#include file="security.asp"-->
  3. <%
  4. if session("flag")>1 then
  5. response.write "<br><p align=center>您没有操作的权限</p>"
  6. response.end
  7. end if
  8. %>
  9. <%dim action,infoID
  10. action=chkcookie(request.QueryString("action"))
  11. infoID=(request("infoID"))
  12. if action<>"" then%>
  13. <% select case action
  14.   case "del"
  15.    if infoID<>"" then conn.execute "delete from adminMsg where msgID in ("&infoID&")"
  16.  end select
  17. end if
  18. %>
  19. <html>
  20. <head>
  21. <title>短消息管理</title>
  22. <link rel="stylesheet" type="text/css" href="inc/Admin_STYLE.CSS">
  23. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  24. <style type="text/css">
  25. <!--
  26. .样式1 {
  27. color: #000000;
  28. font-weight: bold;
  29. }
  30. -->
  31. </style>
  32. </head>
  33. <body>
  34. <TABLE class=tableBorder height=1 cellSpacing=1 cellPadding=5 width="100%" 
  35. align=center border=0>
  36.   <TBODY>
  37. <TR>
  38.     <TH height=25 style="background-image: url('images/admin_bg_1.gif')">&nbsp;</TH>
  39. </TR></tbody></table>
  40. <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  41.   <tr> 
  42.     <td> 
  43.       <table width="100%" border="0" cellspacing="0" cellpadding="0">
  44.         <tr> 
  45.           <td width="9" rowspan="2"></td>
  46.           <td class="12v"> 
  47.             <table width="100%" border="0" cellspacing="0" cellpadding="0" class="12v">
  48.               <tr> 
  49.                 <td class="12v" > 
  50.                   <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber3" height="0" width="100%">
  51.                     <tr> 
  52.                       <td height="273"> 
  53.                    <table class="border" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  54.   <tr class="title"> 
  55.                           
  56.                             <td height="22" class="title"><div align="center" class="样式1">收到的信息</div></td>
  57.                           </tr>
  58.                           <tr bgcolor="#E8F1FF"> 
  59.                             <form name="form1" method="post" action="adminMSG.asp?action=del">
  60.                               <td height="90" class="tdbg"> 
  61.                                 <%'开始分页
  62. Const MaxPerPage=40 
  63.     dim totalPut,admininfoRS  
  64.     dim CurrentPage
  65.     dim TotalPages
  66.     dim j
  67.      if Not isempty(request("page")) then
  68.        currentPage=Cint(request("page"))
  69.     else
  70.        currentPage=1
  71.     end if 
  72.                 set admininfoRS=server.createobject("adodb.recordset")
  73.                 userinfoSQL="select * from adminMsg order by sendDay DESC" 
  74.                 admininfoRS.open userinfoSQL,conn,1,1 
  75.   if err.number<>0 then
  76. response.write "数据库中无数据"
  77. end if
  78. if admininfoRS.eof And admininfoRS.bof then
  79.         Response.Write "<p align='center' class='contents'> 目前还没有任何信息!</p>"
  80.     else
  81.    totalPut=admininfoRS.recordcount
  82.        if currentpage<1 then
  83.            currentpage=1
  84.        end if
  85.        if (currentpage-1)*MaxPerPage>totalput then
  86.     if (totalPut mod MaxPerPage)=0 then
  87.       currentpage= totalPut  MaxPerPage
  88.     else
  89.        currentpage= totalPut  MaxPerPage + 1
  90.     end if
  91.        end if
  92.         if currentPage=1 then
  93.              showContent
  94.              showpage totalput,MaxPerPage,"adminMSG.asp"
  95.         else
  96.            if (currentPage-1)*MaxPerPage<totalPut then
  97.              admininfoRS.move  (currentPage-1)*MaxPerPage
  98.              dim bookmark
  99.              bookmark=admininfoRS.bookmark
  100.              showContent
  101.               showpage totalput,MaxPerPage,"adminMSG.asp"
  102.          else
  103.          currentPage=1
  104.             showContent
  105.             showpage totalput,MaxPerPage,"adminMSG.asp"
  106.        end if
  107.     end if
  108.         end if
  109.     sub showContent
  110.         dim i
  111.     i=0
  112. response.write "<table width=12 height=7 border=0 cellpadding=0 cellspacing=0><tr><td height=7></td></tr></table>"
  113. %>
  114.                                 <table width="95%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
  115.                                   <tr align="center" bgcolor="#E8F1FF" class="tdbg"> 
  116.                                     <td width="7%" height="22" ><font color="#FF0000">状 态</font></td>
  117.                                     <td width="7%" height="22" ><font color="#FF0000">操 作</font></td>
  118.                                     <td width="25%" height="22" ><font color="#FF0000">来 自</font></td>
  119.                                     <td width="31%" height="22"><font color="#FF0000">主 题</font></td>
  120.                                     <td width="30%" height="22" ><font color="#FF0000">日 期</font></td>
  121.                                   </tr>
  122.                                   <%admininfoRS.movefirst
  123.   do while not admininfoRS.eof%>
  124.                                   <tr align="center" class="tdbg"> 
  125.                                     <td> 
  126.                                       <% if not admininfoRS("readle") then
  127. response.write("<img src='../img/new.gif'>") 
  128. end if%>
  129.                                     </td>
  130.                                     <td><input type="checkbox" name="infoID" id="infoID" value="<%=admininfoRS("MsgId")%>"></td>
  131.                                     <td><%=admininfoRS("sendBy")%></td>
  132.                                     <td><a href="#" onClick="javascript:window.open('detailMSG.asp?msgID=<%=admininfoRS("msgID")%>','adminMsg','width=432,height=288,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes')"><%=admininfoRS("msgTitile")%></a></td>
  133.                                     <td> <%=admininfoRS("sendDay")%> </td>
  134.                                   </tr>
  135.                                   <%i=i+1
  136.   if i>=MaxPerPage then Exit Do
  137.   admininfoRS.movenext
  138.   loop
  139.   admininfoRS.close
  140.   set admininfoRS=nothing
  141.   set conn=nothing
  142.   %>
  143.                                   <tr bgcolor="#E8F1FF" align="center"> 
  144.                                     <td height="30" colspan="5" class="tdbg"> 选中所显示消息 
  145.                                       <input type="checkbox" name="checkbox" value="Check All" onClick="CheckAll(this.form);"> 
  146.                                     &nbsp;&nbsp; <input type="submit" name="Submit2" value="删 除">                                    </td>
  147.                                   </tr>
  148.                                 </table>
  149.                               <%  
  150. End Sub   
  151.   
  152. Function showpage(totalnumber,maxperpage,filename)  
  153.    Dim n
  154.   
  155. If totalnumber Mod maxperpage=0 Then  
  156. n= totalnumber  maxperpage  
  157. Else
  158. n= totalnumber  maxperpage+1  
  159. End If
  160. Response.Write "<form method=Post action="&filename&">"  
  161. Response.Write "<p align='center' class='contents'> "  
  162. If CurrentPage<2 Then  
  163. Response.Write "<font class='contents'>首页 上一页</font> "  
  164. Else  
  165. Response.Write "<a href="&filename&"?page=1 class='contents'>首页</a> "  
  166. Response.Write "<a href="&filename&"?page="&CurrentPage-1&" class='contents'>上一页</a> "  
  167. End If
  168. If n-currentpage<1 Then  
  169. Response.Write "<font class='contents'>下一页 尾页</font>"  
  170. Else  
  171. Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&" class='contents'>"  
  172. Response.Write "下一页</a> <a href="&filename&"?page="&n&" class='contents'>尾页</a>"  
  173. End If  
  174. Response.Write "<font class='contents'> 页次:</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"页</font> "  
  175. Response.Write "<font class='contents'> 共有"&totalnumber&"条记录 " 
  176. Response.Write "<font class='contents'>" 
  177. Response.Write "</form>"  
  178. End Function  
  179. %>                              </td>
  180.                             </form>
  181.                           </tr>
  182.                           <tr bgcolor="#E8F1FF" align="center"> 
  183.                             <td class="tdbg" ><br>
  184.                               <br>
  185. <input type="button" name="senduser0" id="senduser0" value="给所有游客会员发信息" onClick="javascript:window.open('senduser.asp?userName=allusers','sendback','width=550,height=400')">
  186.                                   &nbsp;&nbsp;&nbsp;<input type="button" name="senduser" id="senduser" value="给所有普通会员发信息" onClick="javascript:window.open('senduser.asp?userName=alluser','sendback','width=550,height=400')"><br><br>
  187.                               <input type="button" name="senduser2" id="senduser2" value="给所有黄金会员发信息" onClick="javascript:window.open('senduser.asp?userName=moneyuser','sendback','width=550,height=400')">&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" name="senduser3" id="senduser3" value="给所有钻石会员发信息" onClick="javascript:window.open('senduser.asp?userName=vipuser','sendback','width=550,height=400')">
  188.   <br><br> </td>
  189.                           </tr>
  190.                         </table>                      </td>
  191.                     </tr>
  192.                   </table>
  193.                 </td>
  194.               </tr>
  195.             </table>
  196.           </td>
  197.           <td class="12v" width="9" rowspan="2"></td>
  198.         </tr>
  199.       </table>
  200.     </td>
  201.   </tr>
  202. </table>
  203. </body>
  204. </html>
  205. <script language=javascript>
  206. function CheckAll(form)
  207.   {
  208.   for (var i=0;i<form.elements.length;i++)
  209.     {
  210.     var e = form.elements[i];
  211.     if (e.name != 'checkbox')
  212.        e.checked = form.checkbox.checked;
  213.     }
  214.   }
  215. </script>