⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mail.asp

📁 一个ASP做的政府网站的全站程序
💻 ASP
字号:
<%@ Language=VBScript %>
<!--#include file="connect.asp"-->
<%
if session("adminok")="" then
  response.redirect "login.asp"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>玉环人大</title>
<script language=javascript src="../yuhuan.js"></script>
<link rel="stylesheet" type="text/css" href="../yuhuan.css">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style></head>
<%
   const MaxPerPage=13
   dim totalPut   
   dim CurrentPage
   dim TotalPages
   dim i,j
   if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
   
   if trim(request("type"))<>"" then
      fldtype=request("type")
   else
      fldtype=1
   end if 
   
%>

<body bgcolor="#FFFFFF" >
<div align="center"><center>
    <font face="Verdana, Arial, Helvetica">
    <table width="771" height="90" border="0" align="center" cellpadding="0" cellspacing="0" background="../images/top.gif" class="9v">
      <tr> 
        <td width="26%" height="51" align="right" valign="bottom" ><img src="../images/log1.gif" width="124" height="28" vspace="3"> 
        </td>
        <td width="74%" align="center" >&nbsp;</td>
      </tr>
      <tr> 
        <td width="26%" align="right" class="white11v" ><font face="Verdana, Arial, Helvetica">www.yuhuanrd.gov.cn&nbsp;</font></td>
          <td align="center" class="white11v" ><a href="http://www.yuhuanrd.gov.cn"><font color="#ffffff">本站首页</font></a> | <a href="mail.asp"><font color="#ffffff">文章管理</font></a> | <a href="column.asp"><font color="#ffffff">栏目管理</font></a> | <a href="javascript:popupload()"><font color="#ffffff">文件上传</font></a> | <a href="javascript:popchangepass()"><font color="#ffffff">修改密码</font></a> | <font color="#ffffff">留言管理</font> | FAQ </td>
      </tr>
      <tr> 
        <td valign="top" colspan="2" height="1" ></td>
      </tr>
    </table>
    <br>
    </font>
    <table width="771" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="right" class="9V">话题类别:
          <select name="type" id="type" onChange="top.location=this.options[selectedIndex].value">
            <option value="mail.asp?type=1" <%if request("type")=1 then response.write "selected" end if%>>民主政治</option>
            <option value="mail.asp?type=2" <%if request("type")=2 then response.write "selected" end if%>>文教卫体</option>
            <option value="mail.asp?type=3" <%if request("type")=3 then response.write "selected" end if%>>工业经济</option>
            <option value="mail.asp?type=4" <%if request("type")=4 then response.write "selected" end if%>>社会保障</option>
            <option value="mail.asp?type=5" <%if request("type")=5 then response.write "selected" end if%>>农林水利</option>
            <option value="mail.asp?type=6" <%if request("type")=6 then response.write "selected" end if%>>环境保护</option>
            <option value="mail.asp?type=7" <%if request("type")=7 then response.write "selected" end if%>>其它</option>
            </select>
        &nbsp;&nbsp;&nbsp;&nbsp;</td>
      </tr>
      <tr>
        <td class="9V"><table border="0" width="755" cellspacing="0" cellpadding="0">
          <tr>
            <td width="100%" bgcolor="#000000" >
              <div align="center">
                <%                      
sqlStr="select id,fldtopic,fldsender,fldphone,fldcheck,flddate from tblMail where fldtype=" & fldtype & " order by flddate desc"

Set rs_message = Server.CreateObject("ADODB.Recordset")

rs_message.open sqlStr,dataConn,1,1
'if rs_message.eof and rs_message.bof then
'response.write "<span class=white9v> 还 没 有 任 何 内 容</span>"	
'else

	totalPut=rs_message.recordcount
		
	if currentpage<1 then
		currentpage=1
	end if
	if (currentpage-1)*MaxPerPage>totalput then
		if (totalPut mod MaxPerPage)=0 then
			currentpage= totalPut \ MaxPerPage
		else
			currentpage= totalPut \ MaxPerPage + 1
		end if
	end if

	if currentPage=1 then		
		showContent
		showpage totalput,MaxPerPage,"mail.asp"
	else
		if (currentPage-1)*MaxPerPage<totalPut then
			rs_message.move  (currentPage-1)*MaxPerPage
			dim bookmark
			bookmark=rs_message.bookmark		
			showContent
			showpage totalput,MaxPerPage,"mail.asp"
		else
			currentPage=1
			showContent
			showpage totalput,MaxPerPage,"mail.asp"
		end if
	end if

rs_message.close
'end if
        
set rs_message=nothing  
dataConn.close
set dataConn=nothing
  

sub showContent
	dim i
	i=0

%>
                <div align="center">
                  <center>
                    <table border="0" cellspacing="1" width="100%" cellpadding="5" class=9v height="100%" >
                      <tr bgcolor="#d10000">
                        <td width="100" height="21" align="center" class="white9v">日期</td>
                        <td width="200" height="21" align="center" class="white9v">留言标题</td>
                        <td width="100" height="21" align="center" class="white9v">留言人</td>
                        <td width="100" height="21" align="center" class="white9v">电话</td>
                        <td width="60" height="21" align="center" class="white9v">审核</td>
                        <td width="45" height="21" align="center" class="white9v">内容</td>
                        <td width="45" height="21" align="center" class="white9v">删除</td>
                      </tr>
                      <form name="updateForm" method="post" action="savemail.asp?type=<%=fldtype%>">
                        <%do while not rs_message.eof%>
                        <tr>
                          <td height="23" width="100"  align="center" bgcolor="#EDEFEF"><input type="text" name=<%="date" & i%> class="textboxface3" size="18" value='<%=Formatdatetime(rs_message("flddate"),vbshortdate)%>'></td>
                          <td width="200"  align="center" bgcolor="#FFFFFF">
                            <input type="text" name=<%="topic" & i%> class="textboxface" size="27" value='<%=trim(rs_message("fldtopic"))%>'>
                          </td>
                          <td width="100"  align="center" bgcolor="#FFFFFF">
                            <input name=<%="sender" & i%> type="text" class="textboxface" id="<%="sender" & i%>" value='<%=trim(rs_message("fldsender"))%>' size="12">
                          </td>
                          <td width="100"  align="center" bgcolor="#FFFFFF" >
                            <input type="text" name=<%="phone" & i%> class="textboxface" size="16" value='<%=trim(rs_message("fldphone"))%>'>
                          </td>
                          <td width="60"  align="center" bgcolor="#EDEFEF">
						  <input name=<%="check" & i%> type="checkbox"  id="<%="check" & i%>"     <%if Int(rs_message("fldcheck"))>0 then response.write "checked" end if%>> </td>
                          <td width="45"  align="center" bgcolor="#EDEFEF"> <a href="javascript:popmail(<%=rs_message("id")%>)"> <img src="../Images/modify.gif" width="13" height="14" border="0"></a></td>
                          <td width="45"  align="center" bgcolor="#FFFFFF"><a href="delete.asp?id=<%=rs_message("id")%>&dbname=mail&backpage=<%=currentPage%>&type=<%=request("type")%>">×</a></td>
                        </tr>
                        <% i=i+1
      if i>=MaxPerPage then 
      	exit do 
      end if
      rs_message.movenext
   loop
  %>
                        <tr>
                          <td height="23" width="100"  align="center" bgcolor="#EDEFEF">&nbsp;</td>
                          <td colspan="3"  align="center" bgcolor="#FFFFFF">请在下面的单元格中输入要添加的记录</td>
                          <td width="60"  align="center" bgcolor="#EDEFEF">&nbsp;</td>
                          <td width="45"  align="center" bgcolor="#EDEFEF">
                            <input type="reset" name="reset" value="恢复" class="button">
                          </td>
                          <td width="45"  align="center" bgcolor="#FFFFFF">
                            
                            <input type="submit" name="submit" value="确认" class="button">
                            <input type="hidden" name="number" value="<%=i%>">
                            <input type="hidden" name="page" value="<%=currentPage%>">
                          </td>
                        </tr>
                      </form>
                    </table>
                  </center>
                </div>
            </div></td>
          </tr>
          <tr>
            <td width="100%" align="center" >
              <%
   end sub 

function showpage(totalnumber,maxperpage,filename)
  dim n
  if totalnumber mod maxperpage=0 then
     n= totalnumber \ maxperpage
  else
     n= totalnumber \ maxperpage+1
  end if
  response.write "<form method=Post action="&filename&">"
   
  response.write "<p align='center'><a href=#><acronym title='修改后请按更改键,否则数据库不会被更新!'><font color='red' style='font-size:9pt'>重要说明</font></acronym></a>&nbsp;"
  if CurrentPage<2 then
    response.write "<font  style='font-size:9pt'>首页 上一页</font>&nbsp;"
  else
    response.write "<a href="&filename&"?page=1><font style='font-size:9pt'>首页</font></a>&nbsp;"
    response.write "<a href="&filename&"?page=" & CurrentPage-1 & "&fldtype=" & fldtype & "><font style='font-size:9pt'>上一页</font></a>&nbsp;"
  end if
  if n-currentpage<1 then
    response.write "<font  style='font-size:9pt'>下一页 尾页</font>"
  else
    response.write "<a href="&filename&"?page="&(CurrentPage+1)& "&fldtype=" & fldtype & ">"
    response.write "<font style='font-size:9pt'>下一页</font></a> <a href="&filename&"?page="&n&"&fldtype=" & fldtype &"><font style='font-size:9pt'>尾页</font></a>"
  end if
   response.write "<font  style='font-size:9pt'>&nbsp;页次:</font><strong><font color=red style='font-size:9pt'>"&CurrentPage&"</font><font  style='font-size:9pt'>/"&n&"</strong>页</font> "
   response.write "<font  style='font-size:9pt'>&nbsp;共<b>"&totalnumber&"</b>条记录 <b>"&maxperpage&"</b>条记录/页</font> "
   response.write " <font  style='font-size:9pt'>转到:</font><input type='text' name='page' size=4 maxlength=10 class=9v value="&currentpage&">"
   response.write "<input class=button type='submit' value='Go>>'  name='cndok'></span></p></form>"
end function
%>
            </td>
          </tr>
        </table>        
          <br>
          <br>
          <table width=755 height="21" border=0 cellpadding="0" cellspacing = "0" class="9v">
            <tr valign="middle">
              <td height="24" align=center nowrap bgcolor="#d10000" class="white9v">&copy;&nbsp;2004 版权所有 玉环人大 All Rights Reserved </td>
            </tr>
        </table>        </td>
      </tr>
    </table>
    </center>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -