📄 delchanpin.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="shop.productDAO"%>
<%@ page import="shop.productBean"%>
<%@ page import="shop.breedBean"%>
<%@ include file="/TongYong.jsp" %>
<%
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 'delchanpin.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">
-->
<SCRIPT language="javascript" type="text/javascript">
function allquanxuan()
{
var frm = window.document.form1;
for(var i = 0 ; i<frm.checkbox.length ; i++)
{
frm.checkbox[i].checked = true;
}
}
function afanxuan()
{
var frm = window.document.form1;
for(var i = 0 ; i<frm.checkbox.length ; i++)
{
if(frm.checkbox[i].checked == true)
{
frm.checkbox[i].checked = false;
}
else
{
frm.checkbox[i].checked = true;
}
}
}
function deleteOne()
{
var frm = window.document.form1;
var flag = false;
for(var i = 0 ; i<frm.checkbox.length ; i++)
{
if(frm.checkbox[i].checked == true)
{
flag = true;
}
}
if(flag ==true)
{
form1.submit();
}
else
{
alert("请选择要删除的选项!");
return false;
}
}
</SCRIPT>
</head>
<body>
<FORM name="form1" action="ation/ationdelAllchanpin.jsp" method="post">
<INPUT type="button" name="quanxuan" value="全选" onclick="return allquanxuan()">
<INPUT type="button" name="fanxuan" value="反选" onclick="return afanxuan()">
<INPUT type="button" name="del" value="删除" onclick="return deleteOne()">
<A href="newindex/shopAdmin.jsp">返回首页</A>
<TABLE align="center" border="1">
<CAPTION><FONT size="+2" color="blue">所有商品</FONT></CAPTION>
<TR>
<TH>选项</TH>
<TH>产品名称</TH>
<TH>出厂商</TH>
<TH>价格</TH>
<TH>数量</TH>
<TH>备注</TH>
</TR>
<%
request.setCharacterEncoding("UTF-8");
productDAO cDAO = new productDAO();
Collection c = cDAO.getAllShanpin();
Iterator itr = c.iterator();
while(itr.hasNext())
{
productBean s = (productBean)itr.next();
String ProductID = String.valueOf(s.getProductID());
String name = s.getProductName();
String Factory = s.getFactory();
String Price = String.valueOf(s.getPrice());
String amout = String.valueOf(s.getAmout());
String remark = s.getRemark();
%>
<TR>
<TD><INPUT type="checkbox" name="checkbox" value="<%=ProductID%>"></TD>
<TD><%=name%></TD>
<TD><%=Factory%></TD>
<TD><%=Price%></TD>
<TD><%=amout%></TD>
<TD><%=remark%></TD>
</TR>
<%
}
%>
</TABLE>
</FORM>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -