▣ admin/item/view.jsp - ▶▶ 장바구니 , 바로구매 추가 ◀◀
페이지 정보
작성자 관리자 작성일 23-03-24 10:41 조회 555 댓글 0본문
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/admin/include/header.jsp" %>
<script>
function cate_2(cate,cate2){
$.ajax({
url: "category_ok",
type: "post",
dataType: "text",
data: "ca_id="+cate+"&ca_id2="+cate2, //데이터 변수 전달
error:function(){ //실패일 경우
alert("실패");
},
success:function(text){ //성공일 경우
$("#category2_result").html(text);
}
});
}
cate_2(${item.category1},${item.category2}); //중분류 한번 실행
</script>
<table width=100% height=50 border=0>
<tr>
<td align=center style="color:#777;font-size:14px;font-weight:bold;">[상품관리]</td>
</tr>
</table>
<center>
<form name="cart_insert" action="/admin/cart/write" method="post">
<input type="hidden" name="it_uid" value="${item.it_uid }">
<table width=480 border=0>
<tr>
<td width=160>상품코드</td>
<td height=24><font color=red>${item.it_uid }</font></td>
</tr>
<tr>
<td>카테고리</td>
<td>
<select id="category1" name="category1" onchange="cate_2(this.value)">
<option value="">=대분류 선택=</option>
<c:forEach var="c" items="${v }">
<option value="${c.ca_id }" <c:if test="${item.category1 == c.ca_id }">selected</c:if>>${c.ca_name }</option>
</c:forEach>
</select>
<span id="category2_result">
<select id="category2" name="category2">
<option value="">=대분류를 먼저 선택하세요=</option>
</select>
</span>
</td>
</tr>
<tr>
<td>상품명</td>
<td><input name="it_name" value="${item.it_name }"></td>
</tr>
<tr>
<td>업체 아이디</td>
<td><input name="mb_id" value="${item.mb_id }"></td>
</tr>
<tr>
<td>세일가격</td>
<td><input name="it_sale" value="${item.it_sale }"></td>
</tr>
<tr>
<td>판매가격</td>
<td><input name="it_price" value="${item.it_price }"></td>
</tr>
<tr>
<td>상품 포인트</td>
<td><input id="it_point" name="it_point" value="${item.it_point }"></td>
</tr>
<tr>
<td>상품 수량</td>
<td><input type="number" name="it_qty" value="${item.it_qty }"></td>
</tr>
<tr>
<td>상품 옵션</td>
<td><input name="it_option" value="${item.it_option }"></td>
</tr>
<tr>
<td>판매가능</td>
<td>
<input type="radio" name="it_use" value="Y" <c:if test="${item.it_use == 'Y' }">checked</c:if>>Y
<input type="radio" name="it_use" value="N" <c:if test="${item.it_use == 'N' }">checked</c:if>>N
</td>
</tr>
<tr>
<td>상품 유형</td>
<td>
<input type="checkbox" name="it_type1" value="Y" <c:if test="${item.it_type1 == 'Y' }">checked</c:if>>히트
<input type="checkbox" name="it_type2" value="Y" <c:if test="${item.it_type2 == 'Y' }">checked</c:if>>추천
<input type="checkbox" name="it_type3" value="Y" <c:if test="${item.it_type3 == 'Y' }">checked</c:if>>신상
<input type="checkbox" name="it_type4" value="Y" <c:if test="${item.it_type4 == 'Y' }">checked</c:if>>인기
<input type="checkbox" name="it_type5" value="Y" <c:if test="${item.it_type5 == 'Y' }">checked</c:if>>할인
</td>
</tr>
<tr>
<td>상품 이미지 1</td>
<td><c:if test="${item.file1 != ''}"><img src="/upload_item/${item.file1 }" width=50></c:if></td>
</tr>
<tr>
<td>상품 이미지 2</td>
<td><c:if test="${item.file2 != ''}"><img src="/upload_item/${item.file2 }" width=50></c:if></td>
</tr>
<tr>
<td>상품 이미지 3</td>
<td><c:if test="${item.file3 != ''}"><img src="/upload_item/${item.file3 }" width=50></c:if></td>
</tr>
<tr>
<td>상품 이미지 4</td>
<td><c:if test="${item.file4 != ''}"><img src="/upload_item/${item.file4 }" width=50></c:if></td>
</tr>
<tr>
<td>상품 이미지 5</td>
<td><c:if test="${item.file5 != ''}"><img src="/upload_item/${item.file5 }" width=50></c:if></td>
</tr>
</table>
<br>
<hr>
<br>
<table width=480 border=0>
<tr>
<td width=160>수량</td>
<td>
<input type="button" value="-" onclick="qty_num('-')" style="width:22px;height:22px;">
<input id="qty" name="qty" value="1" style="width:20px;height:20px;border:1px solid blue;text-align:center">
<input type="button" value="+" onclick="qty_num('+')" style="width:22px;height:22px;">
</td>
<td>
<input type="button" value="장바구니" onclick="cart_order('c')">
<input type="button" value="바로구매" onclick="cart_order('o')">
<input type="hidden" id="order" name="order" value="">
</td>
</tr>
</table>
</form>
<br>
</center>
<script>
//수량 증가,감소 처리
function qty_num(str){
var num = parseInt(cart_insert.qty.value);
if(str == "-"){ //차감
if(num == 1){
alert("주문 최소 수량은 1개입니다.");
}else{
cart_insert.qty.value = num - 1;
}
}else{ //증가
cart_insert.qty.value = num + 1;
}
}
//장바구니 , 바로구매 버튼 처리
function cart_order(str){
order.value = str;
document.cart_insert.submit();
}
</script>
<%@ include file="/admin/include/footer.jsp" %>
- 이전글 ▣ admin/include/header.jsp - ▶▶ 장바구니 세션 처리 추가 ◀◀
- 다음글 admin.item/ItemWriteCategory.java ( category - .ajax() 처리 ) - 수정
댓글목록 0
등록된 댓글이 없습니다.