⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showbook.jsp

📁 还是超市系统
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>显示定购商品</title>
<style type="text/css">
<!--
.STYLE2 {font-size: large}
-->
</style>
</head>
<%!
    int i;
%>
<%
    String l = (String)request.getAttribute("count");
	System.out.println("asdfasdfasdfasdf"+l);
	i = Integer.parseInt(l);
%>
<body bgcolor="#FFCC99"><h1 align="center">显示定购商品</h1><a href="/SMarket/b" class="STYLE2">返回</a>
<hr>
<%
	ResultSet rs = (ResultSet)session.getAttribute("rs");//从showbookgood.java传过来的结果集(查询的是所定商品的信息)
	rs.next();
	session.getAttribute("dept_id");
%>
<form name="form1" method="post" action="">
  <table width="378" border="1" align="center" bgcolor="#0099FF">
    <tr>
      <td width="173" height="39" align="center"><span class="STYLE2">商品 编号:</span></td>
      <td width="195"><%=rs.getInt("good_id")%></td>
    </tr>
    <tr>
      <td height="35" align="center"><span class="STYLE2">商品 名称:</span></td>
      <td>*<%=rs.getString("good_name")%>*</td>
    </tr>
    <tr>
      <td height="38" align="center"><span class="STYLE2">供货商编号:</span></td>
      <td><%=rs.getInt("vender_id")%></td>
    </tr>
    <tr>
      <td height="36" align="center"><span class="STYLE2">商品 单价: </span></td>
      <td><%=rs.getInt("good_price")%>元</td>
    </tr>
    <tr>
      <td height="42" align="center"><span class="STYLE2">商品 单位:</span></td>
      <td><%=rs.getString("good_unit")%></td>
    </tr>
    <tr>
      <td height="37" align="center"><span class="STYLE2">商品 信息:</span></td>
      <td><%=rs.getString("good_message")%></td>
    </tr>
    <tr>
      <td height="28" align="center"><span class="STYLE2">商品 数量:</span></td>
      <td><%=request.getAttribute("count")%><%=rs.getString("good_unit")%></td><!--从showbookgood.java传过来的商品订购数量-->
    </tr>
	<tr>
      <td height="28" align="center"><span class="STYLE2">订货 金额:</span></td>
      <td><%=rs.getInt("good_price")*i%>元</td><!--从showbookgood.java传过来的商品订购数量-->
    </tr>
  </table>
  <%
  	
	session.setAttribute("counts",""+rs.getInt("good_price")*i);
	session.setAttribute("dept_id",dept_id);
  %>
  <p><a href="/SMarket/k?id<%=rs.getInt("good_id")%>"><h3 align="center">订 购</h3></a></p>  <!--连接到servlet,来计算所定商品的总金额,再将数据插入到table_bill中-->
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -