dmail.asp
上传用户:btntkt
上传日期:2021-04-16
资源大小:5296k
文件大小:6k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

DOS

  1. <!--#include file="conn.asp"-->
  2. <%if session("admin")="" then
  3. response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='login.asp';</script>"
  4. response.End
  5.  
  6. end if
  7. %>
  8. <%
  9.  if request.QueryString("action")="del" then
  10. conn.execute "delete from dyemail where id in ("&request("selectdel")&")"
  11. response.Redirect  "dmail.asp"
  12. end if %>
  13. <html>
  14. <head>
  15. <title>Untitled Document</title>
  16. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  17. <link href="../images/css.css" rel="stylesheet" type="text/css">
  18. </head>
  19. <body>
  20. <table cellpadding="3" cellspacing="1" border="0" width="100%" class="tableBorder" align=center>
  21.   <tr > 
  22.     <th height=25  background="../images/admin_bg_1.gif" colspan=6 class="tableHeaderText">邮件订阅管理</th>
  23.   </tr>
  24.   <%'开始分页
  25. Const MaxPerPage=20 
  26.     dim totalPut   
  27.     dim CurrentPage
  28.     dim TotalPages
  29.     dim j
  30.     dim sql
  31.      if Not isempty(request("page")) then
  32.        currentPage=Cint(request("page"))
  33.     else
  34.        currentPage=1
  35.     end if 
  36.  set rs=server.createobject("adodb.recordset")
  37. rs.open "select * from dyemail order by id desc",conn,1,1
  38.   
  39. if err.number<>0 then
  40. response.write "数据库中无数据"
  41. end if
  42.    if rs.eof And rs.bof then
  43.         Response.Write "<p align='center' class='contents'> 您还没有添加邮件!</p>"
  44.     else
  45.    totalPut=rs.recordcount
  46.        if currentpage<1 then
  47.            currentpage=1
  48.        end if
  49.        if (currentpage-1)*MaxPerPage>totalput then
  50.     if (totalPut mod MaxPerPage)=0 then
  51.       currentpage= totalPut  MaxPerPage
  52.     else
  53.        currentpage= totalPut  MaxPerPage + 1
  54.     end if
  55.        end if
  56.         if currentPage=1 then
  57.              showContent
  58.              showpage totalput,MaxPerPage,"dmail.asp"
  59.         else
  60.            if (currentPage-1)*MaxPerPage<totalPut then
  61.              rs.move  (currentPage-1)*MaxPerPage
  62.              dim bookmark
  63.              bookmark=rs.bookmark
  64.              showContent
  65.               showpage totalput,MaxPerPage,"dmail.asp"
  66.          else
  67.          currentPage=1
  68.             showContent
  69.             showpage totalput,MaxPerPage,"dmail.asp"
  70.        end if
  71.     end if
  72.         end if
  73.     sub showContent
  74.         dim i
  75.     i=0
  76. %>
  77.   <form name="form1" method="post" action="dmail.asp?action=del">
  78.     <tr> 
  79.       <td class="forumRowHighlight"> <div align="center">ID号</div></td>
  80.       <td class="forumRowHighlight"> <div align="center">订阅邮址(点击发送邮件)</div></td>
  81.       <td class="forumRowHighlight"> <div align="center">订阅时间</div></td>
  82.       <td class="forumRowHighlight"> <div align="center">选 择</div></td>
  83.     </tr>
  84.     <%do while not rs.eof%>
  85.     <tr> 
  86.       <td class="forumRowHighlight"><div align="center"><%=rs("id")%></div></td>
  87.       <td class="forumRowHighlight"> <div align="center"><a href="sendmail.asp?<%=rs("email")%>"><%=rs("email")%></a></div></td>
  88.       <td class="forumRowHighlight"> <div align="center"><%=rs("dingdate")%></div></td>
  89.       <td class="forumRowHighlight"> <div align="center"> 
  90.           <input name="selectdel" type="checkbox" id="selectdel" value=<%=rs("id")%>>
  91.         </div></td>
  92.     </tr>
  93.     <%i=i+1
  94. if i>=MaxPerPage then Exit Do
  95. rs.movenext
  96.   loop
  97.   rs.close
  98.   set rs=nothing%>
  99.     <tr> 
  100.       <td height="30" colspan="4" class="forumRowHighlight"> <div align="center"> 
  101.           <input   type="submit" name="Submit" value="删除所选邮件">
  102.             全选 
  103.           <input type="checkbox" name="checkbox" value="Check All" onClick="mm()">
  104.         </div></td>
  105.     </tr>
  106.   </form>
  107. </table>
  108. <%  
  109. End Sub     
  110. Function showpage(totalnumber,maxperpage,filename)  
  111.    Dim n
  112.   
  113. If totalnumber Mod maxperpage=0 Then  
  114. n= totalnumber  maxperpage  
  115. Else
  116. n= totalnumber  maxperpage+1  
  117. End If
  118. Response.Write "<form method=Post action="&filename&">"  
  119. Response.Write "<p align='center' class='contents'> "  
  120. If CurrentPage<2 Then  
  121. Response.Write "<font class='contents'>首页 上一页</font> "  
  122. Else  
  123. Response.Write "<a href="&filename&"?page=1 class='contents'>首页</a> "  
  124. Response.Write "<a href="&filename&"?page="&CurrentPage-1&" class='contents'>上一页</a> "  
  125. End If
  126. If n-currentpage<1 Then  
  127. Response.Write "<font class='contents'>下一页 尾页</font>"  
  128. Else  
  129. Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&" class='contents'>"  
  130. Response.Write "下一页</a> <a href="&filename&"?page="&n&" class='contents'>尾页</a>"  
  131. End If  
  132. Response.Write "<font class='contents'> 页次:</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"页</font> "  
  133. Response.Write "<font class='contents'> 共有"&totalnumber&"条邮件 " 
  134. Response.Write "<font class='contents'>转到:</font><input type='text' name='page' size=2 maxlength=10 class=smallInput value="&currentpage&">"  
  135. Response.Write "&nbsp;<input type='submit'  class='button' value='GO' name='cndok'></form>"  
  136. End Function  
  137. %>
  138. <br>
  139. </body>
  140. </html>
  141. <script language=javascript>
  142. function mm()
  143. {
  144.    var a = document.getElementsByTagName("input");
  145.    if(a[0].checked==true){
  146.    for (var i=0; i<a.length; i++)
  147.       if (a[i].type == "checkbox") a[i].checked = false;
  148.    }
  149.    else
  150.    {
  151.    for (var i=0; i<a.length; i++)
  152.       if (a[i].type == "checkbox") a[i].checked = true;
  153.    }
  154. }
  155. </script>