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

VBScript

  1. <!--#include file="dbconn.asp"-->
  2. <% 'if session("admuser")="" then
  3.    'response.redirect "admlogin.asp"
  4.    'end if
  5. %>   
  6. <html>
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  9. <title>海脉管理员工作室</title>
  10. <link rel="stylesheet" type="text/css" href="../style.css">
  11. <script language="javascript">
  12. <!--
  13. function openwin1(id)
  14. {
  15. window.open("moreinfo.asp?eventid="+id,"info","width=550,height=470,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,left=15,top=20");
  16. }
  17. function openwin3(id)
  18. {
  19. window.open("feedback.asp?eventid="+id,"view","width=700,height=470,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,left=15,top=20");
  20. }
  21. function poppub(url){
  22. window.open(url,"pub","width=650,height=470,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,left=0,top=0");
  23. }
  24. //-->
  25. </script>
  26. </head>
  27. <%
  28.    response.buffer=true
  29.    const MaxPerPage=36
  30.    dim totalPut   
  31.    dim CurrentPage
  32.    dim TotalPages
  33.    dim i,j
  34.    if not isempty(request("page")) then
  35.       currentPage=cint(request("page"))
  36.    else
  37.       currentPage=1
  38.    end if
  39.    
  40. %>
  41. <body leftmargin=0 topmargin=3>
  42. <center><big><b>海脉管理员工作室</b></big></center><br>
  43. <%
  44. eventtype=trim(request("eventtype"))
  45. beginmon=trim(request("beginmon"))
  46. city=trim(request("city"))
  47. companyid=trim(request("companyname"))
  48. sql="select * from companyevent where 1=1"
  49. if eventtype<>"0" then
  50.  sql=sql+" and eventtype="&eventtype
  51. end if 
  52. if beginmon<>"0" then
  53.  sql=sql+" and beginmon="&beginmon
  54. end if 
  55. if city<>"0" then
  56.  sql=sql+" and eventcity='"&city&"'"
  57. end if 
  58. if companyid<>"0" then
  59.  sql=sql+" and companyid="&companyid
  60. end if 
  61. sql=sql+" order by eventtime desc" 
  62. Set rs= Server.CreateObject("ADODB.Recordset")
  63. rs.open sql,conn,1,1
  64.   if rs.eof and rs.bof then
  65.  
  66.        response.write "<p align='center'>   还 没 有 任 何 活 动 信 息</p>"
  67.    
  68.    else
  69.  
  70.       totalPut=rs.recordcount
  71.       if currentpage<1 then
  72.           currentpage=1
  73.       end if
  74.       if (currentpage-1)*MaxPerPage>totalput then
  75.    if (totalPut mod MaxPerPage)=0 then
  76.      currentpage= totalPut  MaxPerPage
  77.    else
  78.       currentpage= totalPut  MaxPerPage + 1
  79.    end if
  80.       end if
  81.                if currentPage=1 then
  82.                     showpages
  83.                     showContent
  84. showpages
  85.            else
  86.          if (currentPage-1)*MaxPerPage<totalPut then
  87.             rs.move  (currentPage-1)*MaxPerPage
  88.             dim bookmark
  89.             bookmark=rs.bookmark
  90.                     showpages
  91.                     showContent
  92. showpages
  93.                   else
  94.         currentPage=1
  95.                    showpages
  96.                     showContent
  97.                    showpages
  98.       end if
  99.    end if
  100.    rs.close
  101.    end if
  102.         
  103.    set rs=nothing  
  104.    conn.close
  105.    set conn=nothing
  106.   
  107.    sub showContent
  108.        dim i
  109.    i=0
  110.   
  111. %>
  112. <div align="center"><center>
  113. <table border="1" cellspacing="0" width="768" bgcolor="#F0F8FF" bordercolorlight="#4DA6FF"
  114. bordercolordark="#ECF5FF">
  115.   <tr bgcolor="#0080C0">
  116.   <td  align="center"><font color="#ffffff">活动名称</font></td>
  117.     <td width="45" align="center"><font color="#ffffff">活动类型</font> </td>
  118.     <td  width="95" align="center"><font color="#ffffff">开始日期</font></td>
  119.     <td  width="95"align="center"><font color="#ffffff">结束日期</font></td>
  120.     <td width="40"  align="center"><font color="#ffffff">地点</strong></td>
  121. <td width="30"  align="center"><font color="#ffffff">详情</font></td>
  122. <td width="45"  align="center"><font color="#ffffff">发布者</font></td>
  123.  <td width="30"   align="center"><font color="#ffffff">修改</font></td>
  124.  <td width="30"  align="center"><font color="#ffffff">删除</font></td>
  125.   <td width="60"  align="center"><font color="#ffffff">查看反馈</font></td>
  126.  <td width="30"  align="center"><font color="#ffffff">验证</font></td>
  127.  <td width="30"  align="center"><font color="#ffffff">推荐</font></td>
  128.  <td width="30" align="center"><font color="#ffffff">设定</font></td>
  129.   <td width="30" align="center"><font color="#ffffff">排序</font></td>
  130. </tr>
  131. <%do while not rs.eof
  132. dim typename
  133. select case rs("eventtype")
  134.   case 1 
  135.     typename="展会信息"
  136.   case 2 
  137.     typename="在线研讨"
  138.   case 3 
  139.     typename="产品推广"
  140.   case 4 
  141.     typename="新闻发布"
  142.   case 5 
  143.     typename="培训讲座"
  144.   case 6 
  145.     typename="其他"
  146. end select  
  147. %>
  148.   <tr>
  149.     <td ><p align="center"><%=rs("eventname")%></td>
  150.     <td ><p align="center"><%=typename %></td>
  151.     <td > <%=rs("beginyear")%>年<%=rs("beginmon")%>月<%=rs("beginday")%>日</td>
  152.     <td > <%=rs("endyear")%>年<%=rs("endmon")%>月<%=rs("endday")%>日</td>
  153.     <td > <%=rs("eventcity")%></td>
  154.   <td align="center">
  155.     <a href='javascript:openwin1(<%=rs("eventid")%>)'>详情</a></td>
  156.  
  157.   <td  align="center">
  158.     <a href='userinfo.asp?userid=<%=rs("companyid")%>' target=bland>发布者</a></td>
  159.     <td  align="center">
  160.     <a href="eventedit.asp?eventid=<%=rs("eventid")%>&eventtype=<%=eventtype%>&beginmon=<%=beginmon%>&city=<%=city%>&companyname=<%=companyid%>&page=<%=currentpage%>">修改</a></td>
  161.     <td  align="center">
  162.     <a href="eventdel.asp?eventid=<%=rs("eventid")%>&eventtype=<%=eventtype%>&beginmon=<%=beginmon%>&city=<%=city%>&companyname=<%=companyid%>&page=<%=currentpage%>">删除</a></td>
  163.      <td  align="center">
  164.   <% if rs("blnjoin")="True" then %>
  165.     <a href='javascript:openwin3(<%=rs("eventid")%>)'>查看反馈</a>
  166.    <%else%>
  167.       仅做通告
  168.   <%end if%>
  169.  </td>
  170.      <td align="center" > <% if rs("blnctr")=0 then
  171.               response.write"没有"
  172.               else
  173.               response.write"<font color=red>通过</font>"
  174.               end if%></td>
  175.         <td align="center"> <% if rs("blnsuggest")=0 then
  176.               response.write"否"
  177.               else
  178.               response.write"<font color=red>推荐</font>"
  179.               end if%></td>
  180.    <td  align="center">
  181.   
  182.     <a href="verify.asp?eventid=<%=rs("eventid")%>&eventtype=<%=eventtype%>&beginmon=<%=beginmon%>&city=<%=city%>&companyname=<%=companyid%>&page=<%=currentpage%>">设定</a></td>
  183.    <td ><p align="center"><%=rs("ctrposition")%>&nbsp</td>
  184.   </tr>
  185. <% i=i+1
  186.       if i>=MaxPerPage then exit do
  187.       rs.movenext
  188.    loop
  189.   %>
  190.   </table>
  191. </center></div>
  192. <%
  193.    end sub 
  194.    sub showpages()
  195.           dim n
  196.    if (totalPut mod MaxPerPage)=0 then
  197.       n= totalPut  MaxPerPage
  198.    else
  199.       n= totalPut  MaxPerPage + 1
  200.    end if
  201.    if n=1 then 
  202.      
  203.         exit sub
  204.        end if
  205.    dim k
  206.    response.write "<p align='left'> 分页: "
  207.    for k=1 to n
  208.        if k=currentPage then
  209.           response.write "<font color=red>[<b>"+Cstr(k)+"</b>]</font> "
  210.    else
  211.     response.write "[<b>"+"<a href='eventadm.asp?eventtype="+eventtype+"&beginmon="+beginmon+"&city="+city+"&companyname="+companyid+"&page="+Cstr(k)+"'>"+Cstr(k)+"</a></b>] "
  212.    end if
  213.    next
  214.      
  215.    end sub
  216. %>
  217. </body>
  218. </html>