页面提交,onchange事件,如何带上两个条件
<%@LANGUAGE="VBSCRIPT"CODEPAGE="936"%><%ifsession("users")=""thenresponse.Redirect"lo...
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
if session("users")="" then
response.Redirect "login.asp"
end if
%>
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>收入管理</title>
<style type="text/css">
<!--
body,td,th {
font-family: 宋体;
font-size: 12px;
}
body {
margin-top: 4px;
}
-->
</style></head>
<body>
<!--#include file="top.asp"-->
<br />
<%
dim sql,uid,mm
mm=request("mm")
uid=session("users")
select case mm
case 1
sql="select * from [income] where uid='"&uid&"' and imoney<=1000"
case 2
sql="select * from [income] where uid='"&uid&"' and imoney>1000 and imoney<=2000"
case 3
sql="select * from [income] where uid='"&uid&"' and imoney>2000 and imoney<=3000"
case 4
sql="select * from [income] where uid='"&uid&"' and imoney>3000 and imoney<=5000"
case 5
sql="select * from [income] where uid='"&uid&"' and imoney>5000"
end select
rs.open sql,conn,1,1
if rs.eof then
response.Write("<center><br>没有记录</center>")
response.End()
end if
rs.pagesize=8 '页的大小——每页有多少条数据
page=int(request("page")) '接收页数
if page="" then
page=1
end if
if page<=1 then
page=1
end if
if page>=rs.pagecount then '不能最大页数,
page=rs.pagecount
end if
rs.absolutepage=page '当前页 不如直接写<%=page
'//统计收入
set rsc=server.CreateObject("adodb.recordset")
sqlt="select imoney from [income] where uid='"&uid&"'"
rsc.open sqlt,conn,1,1
tc=0
for i=1 to rsc.recordcount
tc=rsc("imoney")+tc
rsc.movenext
next
rsc.close
set rsc=nothing
%>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#B6B5AE">
<tr>
<td height="24" align="center" bgcolor="#FBFCED"><a href="javascript:;" onClick="javascript:window.open('addincome.asp','','width=312 height=300')">添加收入</a> 总收入<%=tc%></td>
</tr>
</table>
<br />
<table width="760" height="55" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#B8B6B1">
<form action="saveincome.asp?action=del" method="post" name="form1" id="form1">
<tr>
<td width="133" height="26" align="center" bgcolor="#FBFCED">日期</td>
<td width="97" align="center" bgcolor="#FBFCED">金额</td>
<td width="132" align="center" bgcolor="#FBFCED">类型</td>
<td width="278" align="center" bgcolor="#FBFCED">说明</td>
<td width="67" align="center" bgcolor="#FBFCED">修改</td>
<td width="46" align="center" bgcolor="#FBFCED"><input type="submit" name="Submit" value="删除" style="border:none; background-color:#FBFCED; cursor:hand;" /></td>
</tr>
<%for i=1 to rs.pagesize%>
<tr>
<td height="26" align="center" bgcolor="#FFFFFF"><%=rs("idate")%></td>
<td align="center" bgcolor="#FFFFFF"><%=rs("imoney")%></td>
<td align="center" bgcolor="#FFFFFF"><%=rs("isort")%></td>
<td align="center" bgcolor="#FFFFFF"><%=rs("imark")%></td>
<form action="searchincome2.asp" method="post" name="form2" id="form2">
<td height="24" align="center" bgcolor="#FBFCED"><input name="mm" type="hidden"
id="mm" value="<%=mm%>">
共<%=rs.recordcount%> 条记录 每页<%=rs.pagesize%>条 共<%=rs.pagecount%>页
当前<%=page%>页 <a href="?page=1"><a href="?page=1&mm=<%=mm%>">首页</a> <a href="?
page=<%=page-1%>&mm=<%=mm%>">上一页</a> <a href="?page=<%=page+1%>&mm=<%=mm%>">下一页</a>
<a href="?page=<%=rs.pagecount%>&mm=<%=mm%>">尾页</a> 转到
<select name="select" onChange="location.href='?page=' +this.value;">
<%
for j=1 to rs.pagecount
%>
<option value="<%=j%>" <%if cint(page)=j then response.write("selected") end if%>>
第<%=j%>页</option>
<br />
<%
next
%>
</select>
</td>
</form> 展开
<%
if session("users")="" then
response.Redirect "login.asp"
end if
%>
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>收入管理</title>
<style type="text/css">
<!--
body,td,th {
font-family: 宋体;
font-size: 12px;
}
body {
margin-top: 4px;
}
-->
</style></head>
<body>
<!--#include file="top.asp"-->
<br />
<%
dim sql,uid,mm
mm=request("mm")
uid=session("users")
select case mm
case 1
sql="select * from [income] where uid='"&uid&"' and imoney<=1000"
case 2
sql="select * from [income] where uid='"&uid&"' and imoney>1000 and imoney<=2000"
case 3
sql="select * from [income] where uid='"&uid&"' and imoney>2000 and imoney<=3000"
case 4
sql="select * from [income] where uid='"&uid&"' and imoney>3000 and imoney<=5000"
case 5
sql="select * from [income] where uid='"&uid&"' and imoney>5000"
end select
rs.open sql,conn,1,1
if rs.eof then
response.Write("<center><br>没有记录</center>")
response.End()
end if
rs.pagesize=8 '页的大小——每页有多少条数据
page=int(request("page")) '接收页数
if page="" then
page=1
end if
if page<=1 then
page=1
end if
if page>=rs.pagecount then '不能最大页数,
page=rs.pagecount
end if
rs.absolutepage=page '当前页 不如直接写<%=page
'//统计收入
set rsc=server.CreateObject("adodb.recordset")
sqlt="select imoney from [income] where uid='"&uid&"'"
rsc.open sqlt,conn,1,1
tc=0
for i=1 to rsc.recordcount
tc=rsc("imoney")+tc
rsc.movenext
next
rsc.close
set rsc=nothing
%>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#B6B5AE">
<tr>
<td height="24" align="center" bgcolor="#FBFCED"><a href="javascript:;" onClick="javascript:window.open('addincome.asp','','width=312 height=300')">添加收入</a> 总收入<%=tc%></td>
</tr>
</table>
<br />
<table width="760" height="55" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#B8B6B1">
<form action="saveincome.asp?action=del" method="post" name="form1" id="form1">
<tr>
<td width="133" height="26" align="center" bgcolor="#FBFCED">日期</td>
<td width="97" align="center" bgcolor="#FBFCED">金额</td>
<td width="132" align="center" bgcolor="#FBFCED">类型</td>
<td width="278" align="center" bgcolor="#FBFCED">说明</td>
<td width="67" align="center" bgcolor="#FBFCED">修改</td>
<td width="46" align="center" bgcolor="#FBFCED"><input type="submit" name="Submit" value="删除" style="border:none; background-color:#FBFCED; cursor:hand;" /></td>
</tr>
<%for i=1 to rs.pagesize%>
<tr>
<td height="26" align="center" bgcolor="#FFFFFF"><%=rs("idate")%></td>
<td align="center" bgcolor="#FFFFFF"><%=rs("imoney")%></td>
<td align="center" bgcolor="#FFFFFF"><%=rs("isort")%></td>
<td align="center" bgcolor="#FFFFFF"><%=rs("imark")%></td>
<form action="searchincome2.asp" method="post" name="form2" id="form2">
<td height="24" align="center" bgcolor="#FBFCED"><input name="mm" type="hidden"
id="mm" value="<%=mm%>">
共<%=rs.recordcount%> 条记录 每页<%=rs.pagesize%>条 共<%=rs.pagecount%>页
当前<%=page%>页 <a href="?page=1"><a href="?page=1&mm=<%=mm%>">首页</a> <a href="?
page=<%=page-1%>&mm=<%=mm%>">上一页</a> <a href="?page=<%=page+1%>&mm=<%=mm%>">下一页</a>
<a href="?page=<%=rs.pagecount%>&mm=<%=mm%>">尾页</a> 转到
<select name="select" onChange="location.href='?page=' +this.value;">
<%
for j=1 to rs.pagecount
%>
<option value="<%=j%>" <%if cint(page)=j then response.write("selected") end if%>>
第<%=j%>页</option>
<br />
<%
next
%>
</select>
</td>
</form> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询