?? cartmanager.jsp
字號:
<%@ page contentType="text/html; charset=GBK" language="java"%>
<%@ taglib prefix="c" uri="/WEB-INF/c.tld" %>
<%@ taglib prefix="fmt" uri="/WEB-INF/fmt.tld" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
<meta http-equiv="expires" content="Wed, 26 Feb 1970 08:21:57 GMT" />
<title>購物車</title>
</head>
<script language="javascript" type="text/javascript">
function shopping(){
location.href="/lmhshop/font/show.jsp";
}
function clearCart(){
location.href="/lmhshop/servlet/CartManager?action=clear";
}
function delCart(nid){
location.href="/lmhshop/servlet/CartManager?action=delete&mcID="+nid;
}
function updateCart(nid,oldCount){
var countObj=document.getElementById("newCount_"+nid);
var newCount=countObj.value;
var str=countObj.value.replace(/[0-9]/g,"");
if(countObj.value<1||str.length!=0){
alert("所輸字符含有非法字符,請輸入大于等于1的數字");
countObj.value=oldCount;
}else if(confirm("確認要修改該商品的數量?")){
location.href="/lmhshop/servlet/CartManager?action=update&mcID="+nid+"&newCount="+newCount;
}
}
function checkOut(){
location.href="/lmhshop/font/user/checkOut.jsp";
}
function exitSys(obj){
location.href="/lmhshop/servlet/ExitSysServlet?tag="+obj;
}
</script>
<body><table width="100%" border="1">
<tr>
<th height="97" scope="row">
<a href="/lmhshop/font/show.jsp">首頁</a>
<a href="/lmhshop/font/user/userInfo.jsp">會員中心</a>
<a href="/lmhshop/font/cartManager.jsp" >進入購物車</a>
<c:if test="${empty userBean}" >
<a href="<c:url value='/font/login.jsp' />">登錄</a>
</c:if>
<c:if test="${!empty userBean}" >
<a href="#" onClick="exitSys('Font');">退出</a>
</c:if>
<a href="/lmhshop/font/reguser.jsp">注冊</a>
<a href="<c:url value='/font/adminLogin.jsp'/>">后臺管理</a>
</th>
</tr>
</table>
<form method="get" action="/lmhshop/servlet/ShowMcServlet" name="showForm">
<table width="100%" border="1">
<tr>
<th scope="row"><table width="93%" border="1">
<tr>
<th width="10%" scope="row">圖片</th>
<th width="17%" scope="row">商品編號</th>
<th width="29%" scope="row">商品名稱</th>
<th width="14%" scope="row">單價</th>
<th width="10%" scope="row">數量</th>
<th width="16%" scope="row">小計</th>
<th width="4%" scope="row">操作</th>
</tr>
<c:forEach items="${cart.mcMaps}" var="mcMaps">
<c:set value="${mcMaps.value}" var="oib" />
<tr>
<th scope="row"><img name="mcImage" src="../mcimg/${oib.simg}" width="60" height="60" alt=""></th>
<th scope="row">${oib.nmcid}</th>
<th scope="row">${oib.smcname}</th>
<th scope="row">${oib.nprice}</th>
<th align="left" scope="row">
<input name="newCount_${oib.nmcid}" type="text" id="newCount_${oib.nmcid}" value="${oib.ncount}" size="5" maxlength="5" />
<a href="#" onClick="updateCart(${oib.nmcid},${oib.ncount});return false;">修改</a></th>
<th scope="row">${oib.ntotalprice}</th>
<th scope="row">
<a href="#" onClick="delCart(${oib.nmcid});return false;">刪除</a></th>
</tr>
</c:forEach>
<tr>
<th colspan="7" align="right" scope="row">合計:${cart.totalPrice} </th>
</tr>
<tr align="right">
<th colspan="7" scope="row"><a href="#" onClick=shopping() >繼續購物</a>
<a href="#" onClick="clearCart();return false;">清空購物車</a> <a href="#" onClick="checkOut();">結賬</a>
</th>
</tr>
</table> </th>
</tr>
</table><table width="100%" border="1">
<tr>
<th scope="row">
</th>
</tr>
</table></body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -