forecast.asp
Upload User: jinglin
Upload Date: 2021-12-20
Package Size: 545k
Code Size: 5k
Development Platform:

VBScript

  1. <!--#include file="dbconn.asp"-->
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  5. <title>企业活动信息浏览区</title>
  6. <link rel="stylesheet" type="text/css" href="../style.css">
  7. <script language = JavaScript 1.1 src="../topmenu.js"></script>
  8. <script language="javascript">
  9. <!--
  10. function openwin1(url1)
  11. {
  12. var 
  13. popup1=window.open(url1,"info","width=550,height=470,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,left=15,top=20");
  14.   popup1.focus();
  15.   return false;
  16. }
  17. function openwin2(url2)
  18. {
  19. var 
  20. popup2=window.open(url2,"join","width=550,height=470,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,left=10,top=15");
  21.   popup2.focus();
  22.   return false;
  23. }
  24. function popleftmenu(url){
  25. var 
  26. popup3=window.open(url,"leftmenu1","width=650,height=500,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,left=0,top=0");
  27.   popup3.focus();
  28.   return false;
  29. }
  30. //-->
  31. </script>
  32. </head>
  33. <%
  34.    response.buffer=true
  35.    const MaxPerPage=20
  36.    dim totalPut   
  37.    dim CurrentPage
  38.    dim TotalPages
  39.    dim i,j
  40.    if not isempty(request("page")) then
  41.       currentPage=cint(request("page"))
  42.    else
  43.       currentPage=1
  44.    end if
  45.    
  46. %>
  47. <body>
  48. <%
  49. dim sql
  50. dim rs
  51. %>
  52. <p align=center><img src="../images/come2e.gif" width=468 height=60 border=0></p>
  53. <table width=600 cellspacing=0 cellpadding=0 border=0 align=center>
  54. <tr><td align=left valign=top>
  55. <h5>近期要举行的信息如下:<h5>
  56. </td>
  57. <td align=right valign=top>
  58. <a href="javascript:self.close()"><b>关闭窗口</b></a>
  59. </td></tr>
  60. </table>
  61. <%
  62. vmonth=month(date())
  63. if vmonth=12 then
  64. vmonth1=1
  65. else
  66. vmonth1=vmonth+1
  67. end if
  68. vday=day(date())
  69. if vday<"15" then
  70. sql="select * from companyevent where endtime>convert(datetime,getdate()) and blnctr=1 and beginmon="&vmonth&" order by eventtime"
  71. else
  72. sql="select * from companyevent where endtime>convert(datetime,getdate()) and blnctr=1 and (beginmon="&vmonth&" or beginmon="&vmonth1&") order by eventtime"
  73. end if
  74. Set rs= Server.CreateObject("ADODB.Recordset")
  75. rs.open sql,conn,1,1
  76.   if rs.eof and rs.bof then
  77.  
  78.        response.write "<p align='center'>   还 没  任 何 活 动 信 息</p>"
  79.      
  80.    else
  81.  
  82.       totalPut=rs.recordcount
  83.       if currentpage<1 then
  84.           currentpage=1
  85.       end if
  86.       if (currentpage-1)*MaxPerPage>totalput then
  87.    if (totalPut mod MaxPerPage)=0 then
  88.      currentpage= totalPut  MaxPerPage
  89.    else
  90.       currentpage= totalPut  MaxPerPage + 1
  91.    end if
  92.       end if
  93.                if currentPage=1 then
  94.                     showpages
  95.                     showContent
  96. showpages
  97.            else
  98.          if (currentPage-1)*MaxPerPage<totalPut then
  99.             rs.move  (currentPage-1)*MaxPerPage
  100.             dim bookmark
  101.             bookmark=rs.bookmark
  102.                     showpages
  103.                     showContent
  104. showpages
  105.                   else
  106.         currentPage=1
  107.                    showpages
  108.                     showContent
  109.                    showpages
  110.       end if
  111.    end if
  112.    rs.close
  113.    end if
  114.         
  115.    set rs=nothing  
  116.    conn.close
  117.    set conn=nothing
  118.   
  119.    sub showContent
  120.        dim i
  121.    i=0
  122.   
  123. %>
  124. <div align="center"><center>
  125. <table border="1" cellspacing="0" width="600" bgcolor="#F0F8FF" bordercolorlight="#4DA6FF"
  126. bordercolordark="#ECF5FF">
  127.   <tr bgcolor="#0080C0">
  128.   <td  align="center"><font color="#ffffff">活动名称</font></td>
  129.    
  130.     <td  align="center" width=100><font color="#ffffff">开始日期</font></td>
  131.     <td  align="center" width=100><font color="#ffffff">结束日期</font></td>
  132.     <td  align="center" width=45><font color="#ffffff">地点</strong></td>
  133. <td  align="center" width=30><font color="#ffffff">详情</font></td>
  134.  <td  align="center" width=60><font color="#ffffff">我要参加</font></td> 
  135. </tr>
  136. <%do while not rs.eof
  137. %>
  138.   <tr>
  139.     <td ><p align="center"><%=rs("eventname")%></td>
  140.     <td ><p align="center"> <%=rs("beginyear")%>年<%=rs("beginmon")%>月<%=rs("beginday")%>日</td>
  141.     <td ><p align="center"> <%=rs("endyear")%>年<%=rs("endmon")%>月<%=rs("endday")%>日</td>
  142.     <td ><p align="center"> <%=rs("eventcity")%></td>
  143.   <td  align="center">
  144.     <a onclick="return openwin1(this.href)" href='moreinfo.asp?eventid=<%=rs("eventid")%>'>详情</a></td>
  145.  
  146.   <td  align="center">
  147.   <% if rs("blnjoin")="True" then %>
  148.     
  149. <% if session("username")="" then %>
  150. <a onclick="return popleftmenu(this.href)" href="../registration/prereg.asp"><font color=red>我要参加</font></a>
  151. <% else %>
  152. <a onclick="return openwin2(this.href)" href='eventjoin.asp?eventid=<%=rs("eventid")%>'><font color=red>我要参加</font></a>
  153. <% end if %>
  154.  <%else%>
  155.       仅做通告
  156.  <%end if%>
  157.     </td>
  158.   
  159.   </tr>
  160. <% i=i+1
  161.       if i>=MaxPerPage then exit do
  162.       rs.movenext
  163.    loop
  164.   %>
  165.   </table>
  166. </center></div>
  167. <%
  168.    end sub 
  169.    sub showpages()
  170.           dim n
  171.    if (totalPut mod MaxPerPage)=0 then
  172.       n= totalPut  MaxPerPage
  173.    else
  174.       n= totalPut  MaxPerPage + 1
  175.    end if
  176.    if n=1 then 
  177.       
  178.         exit sub
  179.        end if
  180.    dim k
  181.    response.write "<p align='left'>&gt;&gt; 分页 "
  182.    for k=1 to n
  183.        if k=currentPage then
  184.           response.write "[<b>"+Cstr(k)+"</b>] "
  185.    else
  186.     response.write "[<b>"+"<a href='forecast.asp?page="+Cstr(k)+"'>"+Cstr(k)+"</a></b>] "
  187.    end if
  188.    next
  189.      
  190.    end sub
  191.  
  192. %>
  193. <br><br><br>
  194. <script language="javascript">
  195. <!--
  196. bottoms()
  197. //-->
  198. </script>  
  199. </body>
  200. </html>