📄 customer_s1.jsp
字号:
<html>
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.lang.*"%>
<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>
<%
String id=new String();
id=(String)session.getAttribute("id");
if(id==null)
{
response.sendRedirect("index.htm");
}
%>
<%
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 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"));
sql="select count(*) as cnt from sell";
rs=db.executeQuery(sql);
if(rs.next())
totalRec=rs.getInt("cnt");
rs.close();
//取得总页数
int intPageCount=0;
intPageCount=(totalRec+pageLine-1)/pageLine;
%>
<p align="center"><font size="5" color="#000080">每季度销售信息统计</font></p>
<form action="delete_s.jsp" method=get name=form>
<table align="center" border="1" width="">
<tr align="center">
<td width="80">客户编号</td>
<td width="80">销售编号</td>
<td width="80">商品编号</td>
<td width="60">单价</td>
<td width="80">数量</td>
<td width="80">总金额</td>
<td width="120">日期</td>
<td width="80">片区编号</td>
</tr>
<%
//从数据库取得信息
int i;
int serial;
Calendar calendar=Calendar.getInstance();
calendar.setTime(new java.util.Date());
int month=calendar.get(Calendar.MONTH);
int year=calendar.get(Calendar.YEAR);
sql="select * from sell order by cuid";
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);
if(year==Integer.parseInt(date.substring(0,4)) && month/3==((Integer.parseInt(date.substring(5,7)))-1)/3)
{
%>
<tr>
<td width="80" align="center"><%=cuid%></td>
<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="120" align="center"><%=date%></td>
<td width="80" align="center"><%=d_id%></td>
</tr>
<%
}
}
}
rs.next();
}
rs.close();
db.close();
%>
</form>
<%--分页显示贴子--%>
<%
out.print("<TR>");
if(intPageCount*pageLine<totalRec)
intPageCount++;
if(intPage>intPageCount)
intPage=intPageCount;
if(intPage<1)
intPage=1;
out.println("<form method=\"post\" name=fPageNum action=\"customer_s1.jsp\">");
out.println("<center> 分页 ");
if(intPage<2)
out.println("首页 上一页");
else
{
out.println("<a href=\"customer_s1.jsp?page=1\">首页</a> ");
out.println("<a href=\"customer_s1.jsp?page="+(intPage-1)+"\">上一页</a> ");
}
if(intPage-intPageCount>=0)
out.println("下一页 尾页");
else
out.println("<a href=\"customer_s1.jsp?page="+(intPage+1)+"\">下一页</a> <a href=\"customer_s1.jsp?page="+intPageCount+"\">尾页</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>
<p align="center">
<form method="POST" action="customer_s.jsp">
<input type="submit" value="每月销售信息统计">
</form>
<form method="POST" action="customer.jsp">
<input type="submit" value="返回">
</form>
</body>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -