| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 275 人关注过本帖
标题:帮忙看看程序那里错了----ASP程序
只看楼主 加入收藏
celebrity
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-7-18
收藏
 问题点数:0 回复次数:0 
帮忙看看程序那里错了----ASP程序
<%
dim action
    action=request.QueryString("action")
%>
<table width="100%" height="287" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr class="STYLE1">
    <td height="18" colspan="3" align="left" bgcolor="#FFCCFF">&nbsp;<a href="manageorders.asp?action=yes">已处理订单</a>&nbsp;|&nbsp;<a href="manageorders.asp?action=no">未处理订单</a>&nbsp;|&nbsp;<a href="manageorders.asp?action=all">全部</a></td>
  </tr>
  <tr>
    <td height="2" colspan="3" align="center"><hr align="center" width="100%" size="1"></td>
  </tr>
  <tr><td width="1238" height="20">&nbsp;</td>
  </tr>
  <tr><form name="form1" method="post" action="">
    <td height="150" colspan="3" align="center" valign="top">
    <%
    
     Const maxperpage=8
     dim totalput
     dim currentpage
     if not isempty(request("page")) then
     currentpage=Cint(request("page"))
     else
     currentpage=1
     end if
     set rs=server.CreateObject("adodb.recordset")
     'rs.open "select * from orders",conn,1,1
    
     select case action
     case "all"
        rs.open "select * from orders  order by date desc",conn,1,1
     case "yes"
        rs.open "select * from orders where deal=1 order by date desc",conn,1,1
     case "no"
        rs.open "select * from orders where deal=0 order by date desc",conn,1,1
     end select
    
    if err.number<>0 then
    response.Write("<div align=center>数据库中没有数据...</div>")
    end if
    if rs.eof And rs.bof then
    
      response.Write("<div align=center>数据库中没有数据...</div>")
     else
       totalput=rs.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,"manageorders.asp"
      else
       if (currentpage-1)* maxperpage < totalput then
       rs.move (currentpage-1)* maxperpage
       dim bookmark
       bookmark=rs.bookmark
       showContent
       showPage totalput,maxperpage,"manageorders.asp"
        else
        currentpage=1
        showContent
        showPage totalput,maxperpage,"manageorders.asp"
        end if
      end if
    end if
    
    sub showContent
    dim i
    i=0
    %>
    <table width="100%" height="85" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
      <tr align="center" class="STYLE2">
        <td width="68" height="30" bgcolor="#FFFFFF">订单号</td>
        <td width="101" bgcolor="#FFFFFF">产品</td>
        <td width="68" bgcolor="#FFFFFF">数量(吨)</td>
        <td width="168" bgcolor="#FFFFFF">公司名称</td>
        <td width="92" bgcolor="#FFFFFF">联系人</td>
        <td width="114" bgcolor="#FFFFFF">电话</td>
        <td width="201" bgcolor="#FFFFFF">地址</td>
        <td width="150" bgcolor="#FFFFFF">E-Mail</td>
        <td  bgcolor="#FFFFFF">下定日期</td>
        <td colspan="2" align="left" bgcolor="#FFFFFF">&nbsp;&nbsp;状态</td>
      </tr>
      <%
     do while not  rs.eof  
     'response.Write("<div align=center>数据库中没数据</div>")
     'else
    
       %>
      <tr class="STYLE1" align="center">
        <td height="24" bgcolor="#FFFFFF"><%=rs("orderid")%></td>
        <td bgcolor="#FFFFFF"><%=rs("product")%></td>
        <td bgcolor="#FFFFFF"><%=rs("num")%></td>
        <td bgcolor="#FFFFFF"><%=rs("company")%></td>
        <td bgcolor="#FFFFFF"><%=rs("username")%><%=rs("sex")%></td>
        <td bgcolor="#FFFFFF"><%=rs("tel")%></td>
        <td bgcolor="#FFFFFF"><%=rs("address")%></td>
        <td bgcolor="#FFFFFF"><%=rs("email")%></td>
        <td width="133" bgcolor="#FFFFFF"><%=rs("date")%></td>
        <td width="54" bgcolor="#FFFFFF"><font color="#999999"><%if action="yes" then
                                           response.Write("已处理")
                                           end if
                                           if action="no" then
                                           response.Write("未处理")
                                           end if
                                           if action="all" then
                                            if rs("deal")=0 then  
                                                    response.Write("未处理")
                                              else  
                                                   response.Write("已处理")
                                              end if
                                           end if
                                                                   
                                             %></font></td>
        <td width="53" bgcolor="#FFFFFF"><input type="checkbox" name="orderid" value="<%=rs("orderid")%>"></td>
      </tr>
      <%
      i=i+1
      'if i>=maxperpage then exit do
      rs.movenext
      loop
      'rs.close
      'set rs=nothing
    
      %>
      <tr>
        <td height="27" colspan="11" bgcolor="#FFFFFF"><div align="right"><%if action="no" then%><input type="submit" name="deal" value="已处理"  onclick="this.form.action='saveorders.asp?action=deal'"><%end if%>&nbsp;&nbsp;<input type="submit" name="del" value="删 除" onclick="this.form.action='saveorders.asp?action=del'">&nbsp;&nbsp;全选&nbsp;<input type="checkbox" name="all" value=" all" onclick="mm()" >&nbsp;&nbsp;</div></td>
        </tr>
    </table>
    <%
    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
       if n< 1 then
       n=1
       end if
       
    %>
    <form name="form2" method="post"  action="<%=filename%>?action=<%=action%>"><div align="center" class="STYLE1">
    共有<%=totalnumber%>条记录&nbsp;页次:<%=currentpage%>/<%=n%>&nbsp;
    <%
    if currentpage<2 then
    %>首页&nbsp;上一页&nbsp;
    <%else%>
    <a href="<%=filename%>?page=1&action=<%=action%>">首页</a>&nbsp;<a href="<%=filename%>?page=<%=currentpage-1%>&action=<%=action%>">上一页</a>&nbsp;
    <%end if%>
    <%
    if n-currentpage <1 then
    
    %>下一页&nbsp;尾页&nbsp;
    <%else%>
    <a href="<%=filename%>?page=<%=currentpage+1%>&action=<%=action%>">下一页</a>&nbsp;<a href="<%=filename%>?page=<%=n%>&action=<%=action%>">尾页</a>&nbsp;
    <%end if%>
    转到&nbsp;<select name="cndok" onchange="javascript:location=this.options[this.selectedIndex].value;">
    <%
    for i=1 to n
    if n=currentpage then
    %>
    <option value="<%=filename%>?page=<%=i%>" selected="selected">第<%=i%>页</option>
    <%else%>
    <option value="<%=filename%>?page=<%=i%>">第<%=i%>页</option>
    <%
    end if
    next
    %>
    </select></div></form>
    <%
    
    end function
    
    %>
    </td></form>   
  </tr>
  <tr>
    <td height="97" colspan="3" align="center">&nbsp;</td>
  </tr>
</table>
</body>
</html>
<script language="javascript">
<!--
function mm()
{
 var a=document.getElementsByTagName("input");
 if(a[0].checked==true){
  for(var i=0;i< a.length;i++)
  
   if (a[i].type=="checkbox")
       a[i].checked=false;
 }
 else
  {
   for (var i=0;i< a.length;i++)
     if(a[i].type=="checkbox")
      a[i].checked=true;
  }
}

-->
</script>
搜索更多相关主题的帖子: ASP 
2008-07-18 13:48
快速回复:帮忙看看程序那里错了----ASP程序
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.037582 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved