标题:关于下拉框选择项目,内容显示所有,页面刷新,但不归类。
取消只看楼主
天蝎风
Rank: 1
来 自:广西
等 级:新手上路
帖 子:64
专家分:5
注 册:2010-11-7
结帖率:100%
已结贴  问题点数:7 回复次数:3 
关于下拉框选择项目,内容显示所有,页面刷新,但不归类。
选择下拉框内项目时页面刷新,但是依旧显示所有内容,没有刷出分类效果。高手看一下哪里没改好。
页面图片

源代码如下:
程序代码:
<%if request.Cookies("shiwei_username")="" then%>
<script language="javascript">top.location.href="../index.asp"</script>
<% 
  response.end
end if
%>
<!-- #include file="../conn2.asp" -->
<!-- #include file="../const.asp" -->
<!-- #include file="../inc/function.asp" -->
<html>
<head>
<title>水费到期提醒</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style/style.css" rel="stylesheet" type="text/css">
<style>body {background-color:#FFFFFF;}</style>
<script>
function CheckAll(form) {
  for (var i=0;i<form.elements.length;i++) {
    var e = form.elements[i];
    if (e.name != 'chkall')  e.checked = form.chkall.checked;
  }
}
</script>
</HEAD>

<BODY>
<%if fla25="0" and request.Cookies("shiwei_id")<>"1" then%>
<br><center><img src="../images/note.gif" align="absmiddle">&nbsp;<font color="#FF0000">你不具备此权限,请与管理员联系!</font></center>
<%
  response.end
end if
if request("hid")="ok" then
  conn.execute("update yezhu set wenhou=#"&date()&"# where id="&request("id"))
end if
nowxiaoqu=request("xiaoqu")
%>

<table width="100%" border="0" cellpadding="0" cellspacing="2" align="center">

 <form name="form2">
   <tr>
     <td width="1%" height="30">&nbsp;</td>
       <td width="99%" align="left">
        <%
    sql="select * from xiaoqu order by id"
    set rs_qu=conn.execute(sql)
    %>
    请选择小区:
    <select name="xiaoqu" onChange="form2.submit()">
        <option value="">所有小区</option>
        <%do while rs_qu.eof=false%>
        <option value="<%=rs_qu("id")%>"<%if trim(cstr(rs_qu("id")))=nowxiaoqu then%> selected="selected"<%end if%>><%=rs_qu("xiaoqu")%></option>
        <%
    rs_qu.movenext
    loop
    %>
      </select></td></tr></form></table>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
  <tr><td><img src="../images/r_1.gif" alt="" /></td>
<td width="100%" background="../images/r_0.gif">
  <table cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td>&nbsp;水费到期提醒</td>
    <td align="right">&nbsp;</td>
      </tr>
    </table>
  </td>
<td><img src="../images/r_2.gif" alt="" /></td>
</tr>
<tr>
<td></td>
<td>
<form name="form1" >
<table align="center" cellpadding="4" cellspacing="1" class="toptable grid" border="1" width="100%">
  <tr align="center">
    <td class="category" height="30">所在小区</td>
      <td class="category">楼宇单元</td>
        <td class="category">房号</td>
    <td class="category">业主姓名</td>
    <td class="category">电话</td>
    <td class="category">缴费日期</td>
    <td class="category">操作</td>
      </tr>
    <%
    if nowxiaoqu="" then
    sql="select * from yezhu order by xiaoqu,id"
    else
    sql="select * from yezhu where xiaoqu="&nowxiaoqu&" order by id"
    end if

sql="select * from yezhu where ((month(shui)>="&month(date())&" and month(shui)<="&month(date()+5)&" and (shui)>="&day(date())&" and day(shui)<="&day(date()+5)&") and year(wenhou)<>"&year(date())&")"
'sql="select * from yezhu where (datediff('y','"&date()&"',shengri)>=0 and datediff('y','"&date()+tiqian&"',shengri)<=0 and yinyang='阳') or (datediff('y','"&WDateToEDate(now(),"1")&"',shengri)>=0 and datediff('y','"&WDateToEDate(now(),"1")+tiqian&"',shenri)<=0 and yinyang='阴')"
set rs_yezhu=conn.execute(sql)
do while rs_yezhu.eof=false

    %>
    <tr onMouseOver="this.className='highlight'" onMouseOut="this.className=''">
    <td align=center height=25><%set rs_qu=conn.execute("select * from xiaoqu where id="&rs_yezhu("xiaoqu"))%><%if rs_qu.eof then%><%else%><%=rs_qu("xiaoqu")%><%end if%></td>
        <td align=center><%=rs_yezhu("louyu")%></td>
    <td align=center><%=rs_yezhu("fanghao")%></td>
    <td align=center><%=rs_yezhu("username")%></td>
    <td align=center><%=rs_yezhu("tel")%></td>
    <td align=center><%=rs_yezhu("shui")%></td>
    <td align=center><input type=button value='开始收费' onClick=window.open("/1/produit/produit_sell.asp") class="button">&nbsp;&nbsp;<input type=button value='已经缴费,取消提醒' onclick=window.location.href='?hid=ok&id=<%=rs_yezhu("id")%>' class="button"></td>
    </tr>
<%
  nowbaojing1=nowbaojing1&"ok"
  rs_yezhu.movenext
loop
%>
<%if nowbaojing1="" then%>
  <tr onMouseOver="this.className='highlight'" onMouseOut="this.className=''">
    <td align=center height=25 colspan="6" style="color:#ff0000">目前没有缴费提醒</td>
      </tr>
        <%end if%>    
        </table>
      </form>
    </td>
  <td></td>
</tr>
<tr><td><img src="../images/r_4.gif" alt="" /></td>
<td></td>
<td><img src="../images/r_3.gif" alt="" /></td>
</tr></table></body></html>


[ 本帖最后由 天蝎风 于 2010-11-20 12:33 编辑 ]
搜索更多相关主题的帖子: 源代码 
2010-11-20 12:31
天蝎风
Rank: 1
来 自:广西
等 级:新手上路
帖 子:64
专家分:5
注 册:2010-11-7
得分:0 
以下是引用dzt0001在2010-11-20 13:26:58的发言:

    if nowxiaoqu="" then
    sql="select * from yezhu order by xiaoqu,id"
    else
sql="select * from yezhu where ((month(shui)>="&month(date())&" and month(shui)<="&month(date()+5)&" and (shui)>="&day(date())&" and day(shui)<="&day(date()+5)&") and year(wenhou)<>"&year(date())&")"
在if语句后,sql语句又重写了
  已经去掉了这句  sql="select * from yezhu where xiaoqu="&nowxiaoqu&" order by id"
    end if
但是还是不能按小区显示啊,依然显示所有小区。
 

南宁信息网http://www.
2010-11-20 13:36
天蝎风
Rank: 1
来 自:广西
等 级:新手上路
帖 子:64
专家分:5
注 册:2010-11-7
得分:0 
以下是引用wangjy500在2010-11-20 18:20:30的发言:

 
不行啊这样

南宁信息网http://www.
2010-11-23 14:07
天蝎风
Rank: 1
来 自:广西
等 级:新手上路
帖 子:64
专家分:5
注 册:2010-11-7
得分:0 
以下是引用wangjy500在2010-11-20 18:20:30的发言:
最后那句不要的话,列表会显示所有业主,当然也可以选择下拉框小区,但是我想的是只显示即将或已经到期缴费的业主。

南宁信息网http://www.
2010-11-26 11:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-326317-1-1.html




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

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