eventshow.asp
Upload User: jinglin
Upload Date: 2021-12-20
Package Size: 545k
Code Size: 6k
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.  
  33. </head>
  34. <%
  35.    response.buffer=true
  36.    const MaxPerPage=30
  37.    dim totalPut   
  38.    dim CurrentPage
  39.    dim TotalPages
  40.    dim i,j
  41.    if not isempty(request("page")) then
  42.       currentPage=cint(request("page"))
  43.    else
  44.       currentPage=1
  45.    end if
  46.    
  47. %>
  48. <body>
  49. <%
  50. dim sql
  51. dim rs
  52. dim eventtype,typename
  53. eventtype=request.querystring("eventtype")
  54. select case eventtype
  55.   case 1 
  56.     typename="展会信息"
  57.   case 2 
  58.     typename="在线研讨"
  59.   case 3 
  60.     typename="产品推广"
  61.   case 4 
  62.     typename="新闻发布"
  63.   case 5 
  64.     typename="培训讲座"
  65.   case 6 
  66.     typename="其他"
  67. end select  
  68. %>
  69. <p align=center><img src="../images/come2e.gif" width=468 height=60 border=0></p>
  70. <table width=600 cellspacing=0 cellpadding=0 border=0 align=center>
  71. <tr><td align=left valign=top>
  72. <h5><font color=red><%=typename%></font>信息如下:<h5>
  73. </td>
  74. <td align=right valign=top>
  75. <a href="javascript:self.close()"><b>关闭窗口</b></a>
  76. </td></tr>
  77. </table>
  78. <%
  79. sql="select * from companyevent where eventtype="&eventtype&" and endtime>convert(datetime,getdate()) and blnctr=1 order by eventtime"
  80. Set rs= Server.CreateObject("ADODB.Recordset")
  81. rs.open sql,conn,1,1
  82.   if rs.eof and rs.bof then
  83.  
  84.        response.write "<p align='center'>   还 没  任 何 活 动 信 息</p>"
  85.      
  86.    else
  87.  
  88.       totalPut=rs.recordcount
  89.       if currentpage<1 then
  90.           currentpage=1
  91.       end if
  92.       if (currentpage-1)*MaxPerPage>totalput then
  93.    if (totalPut mod MaxPerPage)=0 then
  94.      currentpage= totalPut  MaxPerPage
  95.    else
  96.       currentpage= totalPut  MaxPerPage + 1
  97.    end if
  98.       end if
  99.                if currentPage=1 then
  100.                     showpages
  101.                     showContent
  102. showpages
  103.            else
  104.          if (currentPage-1)*MaxPerPage<totalPut then
  105.             rs.move  (currentPage-1)*MaxPerPage
  106.             dim bookmark
  107.             bookmark=rs.bookmark
  108.                     showpages
  109.                     showContent
  110. showpages
  111.                   else
  112.         currentPage=1
  113.                    showpages
  114.                     showContent
  115.                    showpages
  116.       end if
  117.    end if
  118.    rs.close
  119.    end if
  120.         
  121.    set rs=nothing  
  122.    conn.close
  123.    set conn=nothing
  124.   
  125.    sub showContent
  126.        dim i
  127.    i=0
  128.   
  129. %>
  130. <div align="center"><center>
  131. <table border="1" cellspacing="0" width="600" bgcolor="#F0F8FF" bordercolorlight="#4DA6FF"
  132. bordercolordark="#ECF5FF">
  133.   <tr bgcolor="#0080C0">
  134.   <td  align="center"><font color="#ffffff">活动名称</font></td>
  135.    
  136.     <td  align="center" width=100><font color="#ffffff">开始日期</font></td>
  137.     <td  align="center" width=100><font color="#ffffff">结束日期</font></td>
  138.     <td  align="center" width=45><font color="#ffffff">地点</strong></td>
  139. <td  align="center" width=30><font color="#ffffff">详情</font></td>
  140.  <td  align="center" width=60><font color="#ffffff">我要参加</font></td> 
  141. </tr>
  142. <%do while not rs.eof
  143. %>
  144.   <tr>
  145.     <td ><p align="center"><a onclick="return openwin1(this.href)" href='moreinfo.asp?eventid=<%=rs("eventid")%>'><%=rs("eventname")%></a></td>
  146.     <td ><p align="center"> <%=rs("beginyear")%>年<%=rs("beginmon")%>月<%=rs("beginday")%>日</td>
  147.     <td ><p align="center"> <%=rs("endyear")%>年<%=rs("endmon")%>月<%=rs("endday")%>日</td>
  148.     <td ><p align="center"> <%=rs("eventcity")%></td>
  149.   <td  align="center">
  150.     <a onclick="return openwin1(this.href)" href='moreinfo.asp?eventid=<%=rs("eventid")%>'>详情</a></td>
  151.  
  152.   <td  align="center">
  153.  
  154.   <% if rs("blnjoin")="True" then %>
  155.     
  156. <% if session("username")="" then %>
  157. <a onclick="return popleftmenu(this.href)" href="../registration/prereg.asp"><font color=red>我要参加</font></a>
  158. <% else %>
  159. <a onclick="return openwin2(this.href)" href='eventjoin.asp?eventid=<%=rs("eventid")%>'><font color=red>我要参加</font></a>
  160. <% end if %>
  161.  <%else%>
  162.       仅做通告
  163.  <%end if%>
  164.     
  165.     
  166.     </td>
  167.   
  168.   </tr>
  169. <% i=i+1
  170.       if i>=MaxPerPage then exit do
  171.       rs.movenext
  172.    loop
  173.   %>
  174.   </table>
  175. </center></div>
  176. <%
  177.    end sub 
  178.    sub showpages()
  179.           dim n
  180.    if (totalPut mod MaxPerPage)=0 then
  181.       n= totalPut  MaxPerPage
  182.    else
  183.       n= totalPut  MaxPerPage + 1
  184.    end if
  185.    if n=1 then 
  186.       
  187.         exit sub
  188.        end if
  189.    dim k
  190.    response.write "<p align='left'>&gt;&gt; 分页 "
  191.    for k=1 to n
  192.        if k=currentPage then
  193.           response.write "<font color=red>[<b>"+Cstr(k)+"</b>]</font>"
  194.    else
  195.     response.write "[<b>"+"<a href='eventshow.asp?eventtype="+eventtype+"&page="+Cstr(k)+"'>"+Cstr(k)+"</a></b>] "
  196.    end if
  197.    next
  198.      
  199.    end sub
  200.  
  201. %>
  202. <br><br><br>
  203. <script language="javascript">
  204. <!--
  205. bottoms()
  206. //-->
  207. </script>     
  208. </body>
  209. </html>