📄 goodsinfoupdate.jsp
字号:
<%@ page contentType="text/html;charset=GBK"%>
<%
if(session.getAttribute("midentity")==null)
{
// request.setAttribute("result","您没有权力进入此页");
// getServletContext().getRequestDispatcher("display.jsp").forward(request,response);
response.sendRedirect("FlowerIndex.jsp");
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>untitled</title>
<link href="css/jdeveloper.css" rel="stylesheet" media="screen"/>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" width="760" align="center">
<tr>
<td>
<H1 align="center">商品信息更新</H1>
<form action="goodsinfoservlet" method="post">
<table cellspacing="0" cellpadding="0" border="1" width="60%" align="center">
<%
Connection conn=null;
PreparedStatement pstmtt=null;
ResultSet rst=null;
String goodsid1=request.getParameter("goodsid1");
if(goodsid1==null)
{
goodsid1="";
}
conn=DBConnect.getConnection();
pstmtt=conn.prepareStatement("select * from GoodsInfo where Goodsid=?");
pstmtt.setString(1,goodsid1);
rst=pstmtt.executeQuery();
while(rst.next())
{
%>
<tr>
<td>
<FONT color="#ff9966">商品编号:</FONT>
</td>
<td>
<input type="text" name="goodsid" value="<%=rst.getString(1)%>"/>
</td>
</tr>
<tr>
<td>
<FONT color="#ff9966">花卉编号:</FONT>
</td>
<td>
<select name="flowerid">
<%
Connection con=null;
PreparedStatement pstmt=null;
ResultSet rs=null;
con=DBConnect.getConnection();
String flowerid1=request.getParameter("flowerid1");
if(flowerid1==null)
{
flowerid1="";
}
pstmt=con.prepareStatement("select * from FlowerInfo");
rs=pstmt.executeQuery();
while(rs.next())
{
String flowerid2=rs.getString(1);
String flowername2=rs.getString(2);
%>
<option value="<%=flowerid2%>" selected="selected">
<%=flowername2%>
</option>
<%
}
rs.close();
pstmt.close();
con.close();
%>
</select>
</td>
</tr>
<tr>
<td>
<FONT color="#ff9966">零售价:</FONT>
</td>
<td>
<input type="text" name="rprice" value="<%=rst.getDouble(3)%>"/>
</td>
</tr>
<tr>
<td>
<FONT color="#ff9966">成本价:</FONT>
</td>
<td>
<input type="text" name="cprice" value="<%=rst.getDouble(4)%>"/>
</td>
</tr>
<tr>
<td>
<FONT color="#ff9966">供应商编号:</FONT>
</td>
<td>
<select name="supid">
<%
Connection con1=null;
PreparedStatement pstmt1=null;
ResultSet rs1=null;
con1=DBConnect.getConnection();
String supid1=request.getParameter("supid1");
if(supid1==null)
{
supid1="";
}
pstmt1=con1.prepareStatement("select * from ProviderINfo11");
rs1=pstmt1.executeQuery();
while(rs1.next())
{
String supid2=rs1.getString(1);
String supname2=rs1.getString(2);
%>
<option value="<%=supid2%>" selected="selected">
<%=supname2%>
</option>
<%
}
rs1.close();
pstmt1.close();
con1.close();
%>
</select>
</td>
</tr>
<tr>
<td>
<FONT color="#ff9966">属性:</FONT>
</td>
<td>
<textarea name="attr"><%=rst.getString(6)%></textarea>
</td>
</tr>
<%
}
rst.close();
pstmtt.close();
conn.close();
%>
<tr>
<td>
<FONT color="#0033cc">系统提示:</FONT>
</td>
<td>
<%
String result="请注意系统提示";
if(request.getAttribute("result")!=null)
{
result=request.getAttribute("result").toString();
}
%>
<font color="red"><%=result%></font>
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="submit" value="提交"/>
<input type="reset" value="重置"/>
<a href="ManagerMain.jsp">返回管理员主页</a>
<input type="hidden" name="action" value="update"/>
</td>
</tr>
</table>
<P>
<%@ page import="java.sql.*"%>
<%@ page import="Flower.model.DBConnect"%>
</P>
</form>
<P> </P>
<P> </P>
<P> </P>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -