📄 list.jsp
字号:
<%@ page language="java" import="java.util.*" contentType="text/html; charset=GBK"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String contextPath = request.getContextPath();
%>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<title>商品列表</title>
<link href="<%=contextPath%>/css/css.css" type="text/css" rel="stylesheet" />
<script>
function doQuery(){
var title = document.getElementById("title").value;
var startprice = document.getElementById("startprice").value;
var endprice = document.getElementById("endprice").value;
var classid = document.getElementById("classid").value;
var smalltypeid = document.getElementById("smalltypeid").value;
var url="${pageContext.request.contextPath}/adminItemServlet?title="+title+"&startprice="+startprice+"&endprice="+endprice;
url+="&classid="+classid+"&smalltypeid="+smalltypeid;
location.href=url;
}
function doallQuery(){
location.href="${pageContext.request.contextPath}/adminItemServlet";
}
function doedit(id){
location.href="${pageContext.request.contextPath}/adminItemServlet?task=edit&itemid="+id;
}
function dodel(id,filepath){
location.href="${pageContext.request.contextPath}/adminItemServlet?task=del&itemid="+id+"&filepath="+filepath;
}
</script>
<form action="" method="post" name="form1">
<table width=100% border=0 class="mytable">
<tr>
<td class="tableHead" colspan=4 align="left">商品信息查询</td>
</tr>
<tr>
<td class="text">商品名称:</td>
<td><input width="450" type="text" name="title" value="${param.title}" class="button"></td>
<td>价格:</td>
<td>
<select name="startprice" class="button">
<option value="">请选择</option>
<c:forEach begin="0" step="1" end="100" var="count" >
<option value="${count}">${count}</option>
</c:forEach>
</select> 至
<select name="endprice" class="button">
<option value="">请选择</option>
<c:forEach begin="100" step="10" end="100000" var="count" >
<option value="${count}">${count}</option>
</c:forEach>
</select>
</td>
</tr>
<tr>
<td>大类别:</td>
<td>
<select name="classid" class="button">
<option value="">请选择</option>
<c:forEach var="big" items="${requestScope.bclasslist}">
<option value="${big.classid}" ${param.classid==big.classid?'selected':''}>${big.classname}</option>
</c:forEach>
</select>
</td>
<td>小类别:</td>
<td>
<select name="smalltypeid" class="button">
<option value="">请选择</option>
<c:forEach var="sml" items="${requestScope.nclasslist}">
<option value="${sml.classid}" ${param.nclassid==sml.classid?'selected':''}>${sml.classname}</option>
</c:forEach>
</select>
</td>
</tr>
<tr>
<td class="tableHead" colspan=4 aligin="center"><input type="button" class="button" value="查询" onclick="doQuery()"> <input type="button" class="button" value="重置" onclick="doallQuery()"></td>
</tr>
</table>
</form>
<br><br><br>
<table width=100% border=0 class="mytable">
<tr class="tableHead">
<td>商品ID</td>
<td>大类别</td>
<td>小类别</td>
<td>名称</td>
<td>价格</td>
<td>图片</td>
<td>描述</td>
<td>备注</td>
<td>添加时间</td>
<td>维护</td>
</tr>
<c:if test="${requestScope.result==null||empty(requestScope.result)}">
<tr>
<td colspan="10" align="center" class="STYLE1">没有您查找的商品</td>
</tr>
</c:if>
<c:forEach var="item" items="${requestScope.result}">
<tr >
<td align ="center" >${item.itemid}</td>
<td>${item.classname}</td>
<td>${item.nclassname}</td>
<td>${item.title}</td>
<td>${item.price}</td>
<c:if test="${item.filepath!=null}">
<td width="60" height="40"><A href="${pageContext.request.contextPath}/${item.filepath}" target="_blank"><img name="ds" src="${pageContext.request.contextPath}/${item.filepath}" width="60" height="40" alt=""></A></td>
</c:if>
<c:if test="${item.filepath==null}">
<td width="60" height="40">暂无图片</td>
</c:if>
<td>${item.content}</td>
<td>${item.remark}</td>
<td>${item.addtime}</td>
<td align ="center" ><a href="javaScript:doedit('${item.itemid}')">编辑</a> <a href="javascript:dodel('${item.itemid}','${item.filepath}')" onclick="return confirm('确定删除吗?')">删除</a></td>
</tr>
</c:forEach>
<iframe width=174 height=189 name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="<%=contextPath%>/date/ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;">
</iframe>
</table>
${mpage.pageBar}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -