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

📄 index.asp

📁 一个ASP做的政府网站的全站程序
💻 ASP
字号:
<%@ Language=VBScript %>

<%
'限制非管理用户进入
if session("adminok")="" then
  response.redirect "login.asp"
end if
%>
<!--#include file="connect.asp"-->

<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">
<!--
.dateThin
{
    BORDER-BOTTOM: #ffffff solid 0px;
    BORDER-LEFT: #ffffff solid 0px;
    BORDER-RIGHT: #ffffff solid 0px;
    BORDER-TOP: #ffffff solid 0px;
    COLOR: #000000;
    FONT: 9pt "宋体";
    text-align: center;
    background-color: #EDEFEF
}
-->
</style>
</head>
<%
   const MaxPerPage=12
   dim totalPut   
   dim CurrentPage
   dim TotalPages
   dim i,j
   if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
   
   dim column
   if not isEmpty(request("column")) then
		column=request("column")
   else
		column="天气"
   end if
   
	
%>

<body bgcolor="#FFFFFF" onMouseMove=HideMenu();>
<div id=menuDiv style="HEIGHT: 0px; POSITION: absolute; VISIBILITY: hidden; WIDTH:7px; Z-INDEX: 2; left: 8px;top:8px"></div>
<div align="center"><center>
    <font face="Verdana, Arial, Helvetica">
    <table align="center" border="0" cellpadding="0" cellspacing="0" width="92%" class="9v">
      <tr> 
        <td valign="top" width="25%" ><a href="default.asp"><img src="../images/shuilong.gif" border="0" width="164" height="42"></a> 
        </td>
        <td align="center" colspan="2" > 
          <table border="0" cellpadding="2" cellspacing="0" align="right" class="9v">
            <tr> 
              <td align="center" height="21" valign="top">--- 网 站 在 线 管 理 指 南 
                ---</td>
            </tr>
            <tr> 
              <td align="center" height="20"><a href="http://www.yhonline.net">本站首页</a> 
                | <a href="manager.asp">文章管理</a> | <a href=# onMouseOver="ShowMenu('<table width=200 height=32 border=0 cellspacing=1 cellpadding=0 bgcolor=#000000 class=9v><tr bgcolor=ffffff> <td align=center valign=bottom><a href=download.asp>超级下载</a>&nbsp;&nbsp;<a href=bestsite.asp>酷站推荐</a>&nbsp;&nbsp;<a href=company.asp>企业名录</a>&nbsp;&nbsp;<br> <a href=weather.asp>天气预报</a>&nbsp;&nbsp;<a href=market.asp>证券行情</a></td></tr></table>');"> 
                另类管理</a> | <a href="javascript:popupload()">文件上传</a> | <a href="changepass.asp">修改密码</a> 
                | <a href="search.asp">数据检索</a> | <a href="faq.asp">FAQ</a> </td>
            </tr>           
          </table>
        </td>
      </tr>
      <tr> 
        <td valign="top" width="25%" >&nbsp;</td>
        <form >
          <td align="right" width="67%" >相关栏目: </td>
          <td align="right" valign="top" width="8%" > 
            <select name="column" size="1" onChange="top.location=this.options[selectedIndex].value" class="9v" >
              <option value="weather.asp" <%if column="天气" then response.write "selected" end if%>>天气预报</option>
              <option value="market.asp" <%if column="行情" then response.write "selected" end if%>>证券行情</option>
            </select>
          </td>
        </form>
      </tr>
      <tr> 
        <td valign="top" colspan="3" height="6" ><img src="../Images/space.gif" width="18" height="6"></td>
      </tr>
    </table>
    </font>
    <table border="0" width="92%" cellspacing="0" cellpadding="0">
      <tr> 
        <td width="100%" bgcolor="#000000" > 
          <div align="center"> 
            <%dim sqlStr
            dim ID
sqlStr="select id,flddate,fldmax,fldmin from tblweather order by flddate desc"
Set rs_weather = Server.CreateObject("ADODB.Recordset")
rs_weather.open sqlStr,dataConn,1,1
'if rs_weather.eof and rs_weather.bof then
'response.write "<span class=white9v> 还 没 有 任 何 内 容</span>"	

	totalPut=rs_weather.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,"weather.asp"
	else
		if (currentPage-1)*MaxPerPage<totalPut then
			rs_weather.move  (currentPage-1)*MaxPerPage
			dim bookmark
			bookmark=rs_weather.bookmark		
			showContent
			showpage totalput,MaxPerPage,"weather.asp"
		else
			currentPage=1
			showContent
			showpage totalput,MaxPerPage,"weather.asp"
		end if
	end if

rs_weather.close
'end if
        
set rs_weather=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> 
                    <td width="100" align="center" height="20" bgcolor="#517E9F"><font color="mintcream">日期</font></td>
                    <td align="center" bgcolor="#517E9F" width="160"><font color="mintcream">最高温</font></td>
                    <td align="center" bgcolor="#517E9F" width="160"><font color="mintcream">最低温</font></td>
                    <td align="center" bgcolor="#517E9F" width="80"><font color="mintcream">详细内容</font></td>
                    <td width="72" align="center" bgcolor="#517E9F"><font color="mintcream">删除</font></td>
                  </tr>
                  <form method="post" action="saveweather.asp?column=<%=column%>">
                    <%do while not rs_weather.eof%>
                    <tr> 
                      <td height="23" width="100"  align="center" bgcolor="#EDEFEF">
                        <input type="hidden" name=<%="date" & i%> value="<%=rs_weather("flddate")%>">                                   <%=Formatdatetime(rs_weather("flddate"),vbshortdate)%></td>
                      <td width="160"  align="center" bgcolor="#FFFFFF"> 
                        <input type="text" name=<%="max" & i%> class="textboxface" size="27" value='<%=rs_weather("fldmax")%>'>
                      </td>
                      <td width="160"  align="center" bgcolor="#FFFFFF"> 
                        <input type="text" name=<%="min" & i%> class="textboxface" size="27" value='<%=rs_weather("fldmin")%>'>
                      </td>
                      <td width="72"  align="center" bgcolor="#EDEFEF">
                       <a href="javascript:popwinother(<%=rs_weather("id")%>,'天气预报','weather')"> 
                        <img src="../Images/modify.gif" width="13" height="14" border="0"></a></td>
                      <td width="72"  align="center" bgcolor="#FFFFFF"><a href="delother.asp?id=<%=rs_weather("id")%>&dbname=weather&backpoint=<%=column%>">×</a></td>
                    </tr>
                    <% i=i+1
      if i>=MaxPerPage then 
      	exit do 
      end if
      rs_weather.movenext
   loop
  %>
                    <tr> 
                      <td height="23" width="100"  align="center" bgcolor="#EDEFEF">&nbsp;</td>
                      <td colspan="2"  align="center" bgcolor="#FFFFFF">请在下面的单元格中输入要添加的记录</td>
                      <td width="72"  align="center" bgcolor="#EDEFEF"> 
                        <input type="reset" name="reset" value="恢复" class=9v>
                      </td>
                      <td width="72"  align="center" bgcolor="#FFFFFF"> 
                        <input type="hidden" name="mode" value="修改">
                        <input type="submit" name="submit" value="修改" class="9v">
                        <input type="hidden" name="number" value="<%=i%>">
                        <input type="hidden" name="page" value="<%=currentPage%>">
                      </td>
                    </tr>
                  </form>
                  <form method="post" action="saveweather.asp?column=<%=column%>">
                  <tr> 
                    <td height="23" width="100"  align="center" bgcolor="#EDEFEF">
                        <input type="text" name="date" class=dateThin size="16" value="<%=FormatDateTime(Now(),VbShortDate)%>">
                    </td>                    
                      <td width="160"  align="center" bgcolor="#FFFFFF"> 
                        <input type="text" name="max" class="textboxface" size="27">
                      </td>
                      <td width="160"  align="center" bgcolor="#FFFFFF"> 
                        <input type="text" name="min" class="textboxface" size="27">
                      </td>
                      <td width="72"  align="center" bgcolor="#EDEFEF"> 
                        <input type="reset" name="Reset" value="清除" class="9v">
                      </td>
                      <td width="72"  align="center" bgcolor="#FFFFFF"> 
                        <input type="submit" name="submit" value="追加" class="9v">
                        <input type="hidden" name="mode" value="追加">
                        <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&"?column="&column&">"
   
  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&column="&column&"><font style='font-size:9pt'>首页</font></a>&nbsp;"
    response.write "<a href="&filename&"?page="&CurrentPage-1&"&column="&column&"><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)&"&column="&column&">"
    response.write "<font style='font-size:9pt'>下一页</font></a> <a href="&filename&"?page="&n&"&column="&column&"><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 category='text' name='page' size=4 maxlength=10 class=9v value="&currentpage&">"
   response.write "<input class=9v type='submit' value='Go>>'  name='cndok'></span></p></form>"
end function
%>
        </td>
      </tr>
    </table>
    <table width=92% border=0 cellpadding="0" cellspacing = "0" align="center" class="9v">
      <tr bgcolor="#EDEFEF" valign="middle"> 
        <td align=left nowrap height="24">&nbsp;网 站 在 线 管 理 指 南 『<a href="../index.htm">首页</a>』『<a href="../index.htm">留言簿</a>』</td>
        <td align=right nowrap height="24">&copy;<font size="2">&nbsp; </font>2001年6月 
          create by 颜勇刚 www.yhonline.net</td>
        <td width=10 nowrap height="24">&nbsp;</td>
      </tr>
    </table>
  </center></div>
</body>
</html>

⌨️ 快捷键说明

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