📄 search_s.jsp
字号:
<html>
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>销售管理信息系统</title>
</head>
<jsp:useBean id="db" scope="page" class="sale.dbBean" />
<body>
<p align="center"><font size="7" color="#000080">销售管理信息系统</font></p>
<hr>
<p align="center">
<%
String s_id=new String();
String price=new String();
String c_id=new String();
String cuid=new String();
String date=new String();
String total=new String();
String d_id=new String();
String num=new String();
String key=new String(request.getParameter("key").getBytes("8859_1"),"gb2312");
String key1=new String(request.getParameter("key").getBytes("8859_1"),"gb2312");
String sql=new String();
ResultSet rs=null;
int pageLine=10;//每页显示记录数
int totalRec=0;//总记录数
int totalSub=0;
int intPage=1;//初使页
if(request.getParameter("page")!=null)
intPage=Integer.parseInt(request.getParameter("page"));
if(!key.equals(""))
{
sql="select count(*) as cnt from sell where id like '%"+key+"%' or cid like '%"+key1+"%'";
rs=db.executeQuery(sql);
if(rs.next())
totalRec=rs.getInt("cnt");
rs.close();
}
//取得总页数
int intPageCount=0;
intPageCount=(totalRec+pageLine-1)/pageLine;
int i;
int serial;
%>
<form action="delete_s.jsp" method=get name=form>
<font size="5" color="#000080">
客户信息</font>
<table align="center" border="1" width="">
<tr align="center">
<td width="80">销售编号</td>
<td width="80">商品编号</td>
<td width="60">单价</td>
<td width="80">数量</td>
<td width="80">总金额</td>
<td width="80">日期</td>
<td width="80">片区编号</td>
<td width="80">客户编号</td>
<td width="40">修改</td>
<td width="30" bgcolor="#99A6BF"><input type="submit" value="删除" name=submit></td>
</tr>
<%
if(!key.equals(""))
{
sql="select * from sell where id like '%"+key+"%' or cid like '%"+key1+"%'order by id";
rs=db.executeQuery(sql);
if(intPageCount>0)
{
for(i=1;i<=(intPage-1)*pageLine;i++)
rs.next();
for(i=1;i<=pageLine;i++)
{
if(rs.next())
{
s_id=rs.getString(1);
c_id=rs.getString(2);
price=rs.getString(3);
num=rs.getString(4);
total=rs.getString(5);
date=rs.getString(6);
d_id=rs.getString(7);
cuid=rs.getString(8);
%>
<tr>
<td width="80" align="center"><%=s_id%></td>
<td width="80" align="center"><%=c_id%></td>
<td width="60" align="center"><%=price%></td>
<td width="80" align="center"><%=num%></td>
<td width="80" align="center"><%=total%></td>
<td width="80" align="center"><%=date%></td>
<td width="80" align="center"><%=d_id%></td>
<td width="80" align="center"><%=cuid%></td>
<td width="40" align="center"><a href="update_s.jsp?s_id=<%=s_id%>"><font color="#000080">修改</font></a></td>
<td width="30" align="center" bgcolor="#ffffff"><input type="checkbox" name="s_id" value="<%=s_id%>"></td>
</tr>
<%
}
}
rs.next();
}
rs.close();
db.close();
}
%>
</form>
<%--分页显示贴子--%>
<%
if(intPageCount*pageLine<totalRec)
intPageCount++;
if(intPage>intPageCount)
intPage=intPageCount;
if(intPage<1)
intPage=1;
out.println("<form method=\"post\" name=fPageNum action=\"search_s.jsp?key="+key+"\">");
out.println(" 分页 ");
if(intPage<2)
out.println("首页 上一页");
else
{
out.println("<a href=\"search_s.jsp?page=1&key="+key+"\">首页</a> ");
out.println("<a href=\"search_s.jsp?page="+(intPage-1)+"&key="+key+"\">上一页</a> ");
}
if(intPage-intPageCount>=0)
out.println("下一页 尾页");
else
out.println("<a href=\"search_s.jsp?page="+(intPage+1)+"&key="+key+"\">下一页</a> <a href=\"search_s.jsp?page="+intPageCount+"&key="+key+"\">尾页</a>");
out.print(" 页次:<strong>"+intPage+"/"+intPageCount+"</strong>页");
out.print(" 共<b>"+totalRec+"</b>个<b>"+pageLine+"</b>个/页");
out.print(" 转到第<input type=\"text\" name=\"page\" size=\"2\" class=smallInput value=\""+intPage+"\">");
out.print("页<input class=bottonface type=\"submit\" value=\"GO\" name=\"cndok\" ></span></p></form>");
out.print("</td>");
out.print("</td>");
%>
</table>
<form method="POST" action="sell.jsp">
<p align="center">
<input type="submit" value="返回">
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -