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

📄 addproduct.jsp

📁 大学JSP课程大作业
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312"%>
<%@ page import="java.util.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="my.shop.db.*"%>
<%@ page import="org.lxh.smart.*"%>
<%-- 会话过滤 --%>
<%@ include file="sessionfilter.jsp"%>



<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<title>添加产品</title>
		<style type="text/css">
<!--
.STYLE1 {
	font-size: 24px;
	font-weight: bold;
}

.STYLE3 {
	color: #FF0000
}
-->
</style>
	</head>

	<body>
		<jsp:include page="top.html"></jsp:include>
		<%
			List msg = (List)request.getAttribute("msg") ;
			if (null != msg && msg.size() > 0) {
				for (Iterator it = msg.iterator(); it.hasNext();) {
					String m = (String) it.next();
		%>
		<div align="center">
			<font color=red><%=m%></font>
		</div>
		<br>
		<%
			}
		}
		%>
		<form action="upload.jsp" method="post" enctype="multipart/form-data">
			<input type="hidden" name="action" value="addproduct">
			<table width="419" height="125" border="0" align="center">
				<tr>
					<td height="26" colspan="5" bgcolor="#3366CC">
						<div align="center">
							<span class="STYLE1">产品添加</span>
						</div>
					</td>
				</tr>
				<tr>
					<td width="105" height="24" bgcolor="#899BE4">
						产品类别:
					</td>
					<td colspan="2" bgcolor="#899BE4">
						<label>
							<select name="cateid">
								<option value="-1" selected>选择产品类别</option>
<%
Connection conn = DBConnection.getInstance().getConnection() ;
String sql = "select * from category" ;
Statement stmt = conn.createStatement() ;
ResultSet rs = stmt.executeQuery(sql) ;
while(rs.next()){

 %>								
								<option value="<%=rs.getInt(1) %>"><%=rs.getString(2) %></option>
<% }%>
							</select>
							<span class="STYLE3">* 必填</span>
						</label>
					</td>
				</tr>
				<tr>
					<td height="25" bgcolor="#899BE4">
						产品名称:
					</td>
					<td colspan="2" bgcolor="#899BE4">
						<input type="text" name="name" />
					</td>
				</tr>
				<tr>
					<td height="25" bgcolor="#899BE4">
						产品价格:
					</td>
					<td colspan="2" bgcolor="#899BE4">
						<input type="text" name="price" />
						<span class="STYLE3">价格只能是数字</span>
					</td>
				</tr>
				<tr>
					<td height="25" bgcolor="#899BE4">
						上传图片:
					</td>
					<td colspan="2" bgcolor="#899BE4">
						<input type="file" name="picture" />
						<span class="STYLE3">* 必填</span>
					</td>
				</tr>
				<tr>
					<td height="23" bgcolor="#899BE4" align="right">
						<input type="button" value="管理首页"
							onClick="javascript:location.href='admin.jsp'">
					</td>
					<td width="80" bgcolor="#899BE4">
						<input type="submit" value="添加" />
					</td>
					<td width="220" bgcolor="#899BE4">
						<input type="button" value="查看产品列表"
							onClick="javascript:location.href='mgrproduct.jsp'" />
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>

⌨️ 快捷键说明

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