index.asp

来自「asp的新闻网站」· ASP 代码 · 共 588 行 · 第 1/3 页

ASP
588
字号
<%
'*********************************************************************************
'模块名称:财经新闻首页
'开发人:佟庆涛
'时间:2001年2月01日
'*********************************************************************************
%>
<%
dim rs          '数据访问对象
dim sql         'select 语句
dim i           '循环控制变量
dim stoptime    '外汇牌价截止日期
dim menuid      '轮换显示模块的menuid
dim flag        '文件头标志
%>
<%'数据库连接包含文件 %>
<!--#include file="../include/odbc.asp"-->
<!--#include file="../include/showbody.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../style.css">
<title>千夜网-&gt;新闻-&gt;财经新闻</title>
<!--#include file="../include/script.asp"-->
</head>
<%
'定义recordset对象
set rs=server.CreateObject ("adodb.recordset")
%>
<body topmargin="3" leftmargin="3">
<div align="center">
<% '网页头部包含文件 
flag="006000"%>
<!--#include file="../include/secondhead.asp"-->
<center>  
<table border="0" width="770" cellspacing="0" cellpadding="0">  
  <form name=add action="../include/search.asp" method=post" onsubmit="return check(this)" target="_blank">
  <tr>  
    <td width="30%"><img src="../images/pic-076.gif" ></td>  
    <td width="45%">关键字:&nbsp; <input type="text" name="newstitle" size="13"                
    style="background-color: rgb(196,196,255); border: 1px solid rgb(0,0,0)">&nbsp; 日&nbsp;                 
    期:&nbsp; <input type="text" name="year" size="4"         maxLength=4         
    style="background-color: rgb(196,196,255); border: 1px solid rgb(0,0,0)">-<input                
    type="text" name="month" size="2"                maxLength=2  
    style="background-color: rgb(196,196,255); border: 1px solid rgb(0,0,0)">-<input                
    type="text" name="day" size="2" onChange="daychange();"  maxLength=2              
    style="background-color: rgb(196,196,255); border: 1px solid rgb(0,0,0)"></td>                
    <td width="15%"><p align="right"><select name="menuid" size="1"                
    style="font-size: 9pt; background-color: rgb(232,222,104)">                
      <%set rs8=server.CreateObject ("adodb.recordset")      
               sql="select * from news2_menu where visible='1' order by menuindex "      
               rs8.Open sql,conn,3,1      
             %>      
             <%if not rs8.EOF  then        
               for i=1 to rs8.RecordCount         
               if left(rs8("menuid"),3)<>"012" then  
             %>        
                <option  value="<%=left(rs8("menuid"),3)%>"><%=rs8("menuname")%></option>         
             <%        
               end if 
               rs8.MoveNext         
               next        
               else        
               Response.Write "menu erro!"        
               end if        
               rs8.Close 
               set rs8=nothing%>
    </select></td>
    <td width="10%"><p align="center"><input type="image" name="Submit" value="ok" src="../images/pic-069.gif"
     width="33" height="16"></td>
  </tr>
</form>
</table>
</center></div><div align="center"><center>
<table border="0" width="770" cellspacing="0" cellpadding="0">
  <tr>
    <td width="80%" valign="top"><table border="0" width="100%" bgcolor="#F7F7F7" cellpadding="4">
      <tr>
            <%
            '取出轮换显示模块的menuid,
            sql="select * from news2_menu where visible='T'"  
            rs.Open sql,conn,3,1  
            if not rs.eof then 
              menuid=rs.fields("menuid").value
            else 
              menuid=""
            end if
            rs.close
            %>
           
         <% '由menuid判断图标文件名
           if menuid="006003" then 
            imagename="pic-081.gif"
           elseif menuid="006004" then
            imagename="pic-079.gif"
           end if
           %>
         <td width="30%" valign="top"><table border="0" width="100%" cellspacing="0"
        cellpadding="0">
          <tr>
            <td width="100%"><img src="../images/<%=imagename%>"  width="174" height="31"></td>
          </tr>
          <tr>
            <td width="100%"
            style="border-left: 1px solid rgb(0,128,192); border-bottom: 1px solid rgb(0,128,192)">
            
            <% '如果menuid不为空,输出相应记录
            if menuid<>"" then 
             sql="select * from news2_commend where menuid='"&menuid&"' and visible<>'0' order by infoindex "  
             'response.write sql
             'response.end
             rs.Open sql,conn,3,1  
             if not rs.EOF then  
            %>
            <table border="0" width="100%" cellspacing="4">
              <tr>
                <td width="100%"><p align="center"><font color="#800000"><span style="font-size: 14px"><%=rs("newstitle")%></span></font></td>
              </tr>
              <tr>
                <td width="100%"><span class="9p"></span><a class="l3" href="../looknews.asp?menuid=<%=rs("menuid")%>&infoid=<%=rs("infoid")%>"         
            target="_blank"><img src="<%=smallpicUrl%><%=rs("smallpic")%>"
                 align="left" width="74" height="109" border="0"></a><span class="9p">&nbsp;&nbsp;&nbsp;<% showbody(rs("introduction"))%></span><p        
                align="right"><a class="l3" href="../looknews.asp?menuid=<%=rs("menuid")%>&infoid=<%=rs("infoid")%>"         
            target="_blank"><span class="9p">详情&gt;&gt;&gt; </span></a></td>        
              </tr>        
            </table>        
             <%   
            end if    
            rs.Close    
           end if%>
            </td>
          </tr>
        </table>
        </td>     
        <td width="70%" bgcolor="#F7F7F7" valign="top"><br> 
           
       <% '输出热点推荐文章  %>    
       <%    
        sql="select * from news2_commend where menuid='006017' and visible<>'0' order by infoindex "    
        rs.Open sql,conn,3,1    
        if not rs.EOF then    
        for i=1 to rs.RecordCount     
        %>     
        <img src="../images/pic-083.gif"  width="12" height="12"> <a class="l1"        
        href="../looknews.asp?menuid=<%=rs("menuid")%>&infoid=<%=rs("infoid")%>"        
        target="_blank"><%=rs("newstitle")%></a> <%=" ["&rs("derivation")&"]"%><% showtime(rs("regtime"))%><br>        
        <%rs.MoveNext     
         next    
         end if    
         rs.Close             
        %>    
        </td>        
      </tr>        
    </table>        
    <table border="0" width="100%" cellpadding="0">        
      <tr>        
        <td width="35%" background="../images/bg-007.gif"        
        style="border-left: 5px solid rgb(167,223,222); border-right: 1px solid rgb(167,223,222); border-top: 1px solid rgb(167,223,222); border-bottom: 1px solid rgb(167,223,222)"        
        valign="top"><div align="center"><center><table border="0" width="96%"        
        background="../images/bg-007.gif">        
          <tr>        
            <td width="95%" colspan="5"> 沪A涨幅排名</td>        
          </tr>        
       
       <%  '输出沪A涨幅排名(前五名)
        sql="select top 5 * from news2_stock where area='01'  order by risepercent desc "    
        rs.Open sql,conn,3,1    
        if not rs.EOF then    
        for i=1 to rs.RecordCount     
        %>     
          
          
          <tr>        
            <td width="10%" align="center"><img src="../images/ord<%=i%>.gif"  width="12" height="13"></td>        
            <td width="30%"><%=rs("stockName")%></td>           
            <td width="25%" align="right"><%=rs("stockValue")%></td>           
            <td width="5%"><img src="../images/pic-200.gif"  width="9" height="11"></td>           
            <td width="25%" align="right"><font color="red"><%=rs("risePercent")%>%</font></td>           
          </tr>           
        <%rs.MoveNext     
         next    
         end if    
         rs.Close             
        %>        
        </table>           
        </center></div></td>           
        <td width="35%" background="../images/bg-007.gif"           
        style="border-left: 5px solid rgb(167,223,222); border-top: 1px solid rgb(167,223,222); border-bottom: 1px solid rgb(167,223,222)"           
        valign="top"><div align="center"><center><table border="0" width="98%"           
        background="../images/bg-007.gif">           
          <tr>           
            <td width="95%" colspan="5"> 深A涨幅排名</td>           
          </tr>           
       <%  '输出深A涨幅排名(前五名)
        sql="select top 5 * from news2_stock where area='02'  order by risepercent desc "    
        rs.Open sql,conn,3,1    

⌨️ 快捷键说明

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