?? statisticsobj.jsp
字號:
<%@ page contentType="text/html;charset=GBK" isELIgnored="false" import="java.util.*"%>
<%@page import="bean.StatisticsObjBean"%>
<%@page import="bean.GetChinaMoney"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'statisticsobj.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<jsp:useBean id="sta" scope="session" class="bean.StatisticsObjBean"></jsp:useBean>
<jsp:useBean id="getChina" class="bean.GetChinaMoney"></jsp:useBean>
<body>
<jsp:scriptlet>
sta.getPeople();
</jsp:scriptlet>
<%
String a=(String)sta.getNum().get(0);
float money=Float.parseFloat(session.getAttribute("allmoney").toString());
%>
<table width="80%" align="center" border="1">
<tr>
<td>項目名</td>
<td>人數</td>
<td>單價</td>
<td>總價</td>
</tr>
<%
int num=Integer.parseInt(a);
float allmoney=num*money;
String allmoney1=String.valueOf(allmoney);
String chinamoney=getChina.getNumber(allmoney1);
System.out.println(allmoney+" "+chinamoney);
Vector v=(Vector)session.getAttribute("staobj");
if(v==null){
out.println("暫無數據");
}else{
for(int i=0;i<v.size();i++){
StatisticsObjBean sta1=(StatisticsObjBean)v.get(i);
float fee=Float.parseFloat(sta1.getItemFee());
%>
<tr>
<td>
<%=sta1.getItemName() %>
</td>
<td>
<%=a %>
</td>
<td>
<%=sta1.getItemFee() %>
</td>
<td>
<%=num*fee %>
</td>
</tr>
<%
}}
%>
</c:forEach>
<tr>
<td colspan="4" align="right">
總計:RMB <%=allmoney %> 元
</td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -