507e993ce498001c144ec8c9591a8e1d
来自「一个超市管理系统,提供一些基本简单的操作,JSP+APACHE+ORCALE实现」· 代码 · 共 57 行
TXT
57 行
<%@ page language="java" contentType="text/html; charset=gb2312"
pageEncoding="gb2312"%>
<%@ page import="java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>结算</title>
</head>
<body>
<jsp:useBean id="dbcon" scope="page" class="bb.Dbcon" />
<jsp:useBean id="login" scope="session" class="bb.login" />
<%if(login.loginsuccess==false||login.dept!=4)
{
%>
<jsp:forward page="index.jsp"/>
<%
}
%>
<div align="center"><span class="style3">结算</span><BR>
</div>
<BR>
<%String year=request.getParameter("year");
String month=request.getParameter("month");
ResultSet rs=null;
float income1=0f,payout1=0f,profit=0f;
Connection con=dbcon.getConn();
String sql="select * from tpb.income where time like '"+year+"-"+month+"'";
Statement stmt=con.createStatement();
rs=stmt.executeQuery(sql);
while(rs.next())
{
income1+=rs.getFloat("amount");
}
String sql1="select * from tpb.payout where time like '"+year+"-"+month+"'";
Statement stmt1=con.createStatement();
rs=stmt1.executeQuery(sql1);
while(rs.next())
{
payout1+=rs.getFloat("amount");
}
profit=income1+payout1;
%>
<%=request.getParameter("year")%>年<%=request.getParameter("month")%>月盈利:
<%=profit %>元
<%
rs.close();
stmt.close();
dbcon.Close();
%>
<hr>
<a href="finance_51.jsp">返回</a>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?