📄 updatehair.jsp
字号:
<%@ page language="java" contentType="text/html; charset=gb2312"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ page import="barbershop.database.*,java.sql.*"%>
<html>
<head>
<title>update hair</title>
</head>
<body>
<%
String modifyFlag=request.getParameter("modifyHair");
if(modifyFlag.equals("0") && request.getParameter("hairID")==null)
{
%>
<div align="center">
<h1>添加新发型</h1>
<html:form action="/admin/updateHair.do" enctype="multipart/form-data">
<table>
<tr>
<td>发型编号:</td>
<td><html:text property="hairID"/></td>
<td><html:errors property="hairID"/></td>
</tr>
<tr>
<td>发型名称:</td>
<td><html:text property="hairName"/></td>
<td><html:errors property="hairName"/></td>
</tr>
<tr>
<td>适用性别:</td>
<td>
<html:select property="hairSex">
<html:option value="男">男</html:option>
<html:option value="女">女</html:option>
</html:select>
</td>
</tr>
<tr>
<td>发型价钱:</td>
<td><html:text property="hairPrice"/></td>
<td><html:errors property="hairPrice"/></td>
</tr>
<tr>
<td>发行类型:</td>
<td>
<html:select property="hairType">
<html:option value="短发">短发</html:option>
<html:option value="中长发">中长发</html:option>
<html:option value="长发">长发</html:option>
</html:select>
</td>
</tr>
<tr>
<td>发型展示图</td>
<td><html:file property="hairPic"/></td>
<td><html:errors property="hairPic"/></td>
</tr>
<tr>
<td>发型资源图</td>
<td><html:file property="hairSrc"/></td>
<td><html:errors property="hairSrc"/></td>
</tr>
<tr>
<td><html:submit value="添加" onclick="return confirm('确定要添加这条数据吗?');"/></td>
<td><html:reset value="重置"/><html:hidden property="modifyFlag" value="<%=modifyFlag %>"/></td>
<td><a href="hairlist.jsp">取消添加</a></td>
</tr>
</table>
</html:form>
</div>
<%
}
else
{
String hairID = request.getParameter("hairID");
DBSQLManager dbsm = new DBSQLManager();
String sql = "select * from tb_hair where HAIR_ID='"+hairID+"'";
dbsm.setSqlStr(sql);
dbsm.executeQuery();
ResultSet rs = dbsm.getRs();
if(rs.next())
{
%>
<div align="center">
<h1>修改发型信息</h1>
<html:form action="/admin/updateHair.do" enctype="multipart/form-data">
<table>
<tr>
<td>发型编号:</td>
<td><%=hairID %></td>
<td><html:hidden property="hairID" value="<%=hairID %>"/></td>
</tr>
<tr>
<td>发型名称:</td>
<td><html:text property="hairName" value="<%=rs.getString("HAIR_NAME") %>"/></td>
<td><html:errors property="hairName"/></td>
</tr>
<tr>
<td>适用性别:</td>
<td>
<html:select property="hairSex" value="<%=rs.getString("HAIR_SEX") %>">
<html:option value="男">男</html:option>
<html:option value="女">女</html:option>
</html:select>
</td>
</tr>
<tr>
<td>发型价钱:</td>
<td><html:text property="hairPrice" value="<%=rs.getString("HAIR_PRICE") %>"/></td>
<td><html:errors property="hairPrice"/></td>
</tr>
<tr>
<td>发行类型:</td>
<td>
<html:select property="hairType" value="<%=rs.getString("HAIR_TYPE") %>">
<html:option value="短发">短发</html:option>
<html:option value="中长发">中长发</html:option>
<html:option value="长发">长发</html:option>
</html:select>
</td>
</tr>
<tr>
<td>发型展示图</td>
<td><html:file property="hairPic"/></td>
<td><html:errors property="hairPic"/></td>
</tr>
<tr>
<td>发型资源图</td>
<td><html:file property="hairSrc"/></td>
<td><html:errors property="hairSrc"/></td>
</tr>
<tr>
<td><html:submit value="修改" onclick="return confirm('确定要修改这条数据吗?');"/></td>
<td><html:reset value="重置"/><html:hidden property="modifyFlag" value="<%=modifyFlag %>"/></td>
<td><a href="hairlist.jsp">取消修改</a></td>
</tr>
</table>
</html:form>
</div>
<%
}
}
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -