admin/item/list.jsp
페이지 정보
본문
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/admin/include/header.jsp" %>
<style>
.ca_id {
width:70px;
border:0px;
}
.td_title{
text-align:center;
font-weight:bold;
}
</style>
<table width=100% height=50 border=0>
<tr>
<td align=center style="color:#777;font-size:14px;font-weight:bold;">[상품관리]</td>
</tr>
</table>
<center>
<table width=700 border=0 align=center>
<tr>
<td>Total : ${count }</td>
<td align="right">
<form method="get">
<table border=0>
<tr>
<td>
<select name="field">
<option value="it_uid" <c:if test="${field == 'it_uid' }">selected</c:if>>상품코드</option>
<option value="it_name" <c:if test="${field == 'it_name' }">selected</c:if>>상품명</option>
</select>
<input name="search" value="${search }">
<button>검색</button>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<table width=700 border=0>
<tr bgcolor="#e5ecef" height="30">
<td class="td_title">No</td>
<td class="td_title">상품코드</td>
<td class="td_title">이미지</td>
<td class="td_title">상품명</td>
<td class="td_title">가격(세일)</td>
<td class="td_title">판매가능</td>
<td class="td_title">관리</td>
</tr>
<c:set var="number" value="${number }" />
<c:forEach var="i" items="${v }">
<jsp:useBean id="now" class="java.util.Date"/>
<fmt:parseNumber value="${now.time / (1000*60)}" var="nowfmtTime"/><!-- 현재날짜 > 1000*60 : 1분 -->
<fmt:parseDate value = "${i.it_date}" pattern = "yyyy-MM-dd HH:mm:ss" var = "insertDate"/><!-- 작성일 문자열 > 날짜형 변경 -->
<fmt:parseNumber value="${insertDate.time / (1000*60)}" var="datefmtTime"/><!-- 작성날짜 > 1000*60 : 1분 -->
<form action="modify" method="post">
<input type="hidden" name="number" value="${number }">
<tr height="24">
<td width=40 align="center">${number }</td>
<td align="center">${i.it_uid }</td>
<td align="center" style="padding-top:4px;">
<c:if test="${i.file1_thumb ne ''}"><img src="/upload_item/${i.file1_thumb }" width=40></c:if>
<c:if test="${i.file1_thumb eq ''}"><img src="/upload_item/${i.file1 }" width=40></c:if>
</td>
<td align="center">
${i.it_name }
<c:set var="timeDefference" value="${nowfmtTime - datefmtTime}"/><!-- 현재날짜 - 작성날짜 -->
<c:choose>
<c:when test="${timeDefference <= 10}"><!-- 10분 이하 -->
방금 전
</c:when>
<c:when test="${timeDefference > 10 && timeDefference <= 60}"><!-- 1시간 이하 -->
<fmt:parseNumber value="${timeDefference}" integerOnly="true" var="timeDefference"/>
${timeDefference }분 전
</c:when>
<c:when test="${timeDefference > 60 && timeDefference <= 60*24}"><!-- 24시간 이하 -->
<fmt:parseNumber value="${timeDefference / 60}" integerOnly="true" var="timeDefference"/>
${timeDefference }시간 전
</c:when>
<c:when test="${timeDefference > 60*24 && timeDefference <= 60*24*30}"><!-- 30일 이하 -->
<fmt:parseNumber value="${timeDefference / (60*24)}" integerOnly="true" var="timeDefference"/>
${timeDefference }일 전
</c:when>
<c:when test="${timeDefference > 60*24*30 && timeDefference <= 60*24*365}"><!-- 1년 이하 -->
<fmt:parseNumber value="${timeDefference / (60*24*30)}" integerOnly="true" var="timeDefference"/>
${timeDefference }월 전
</c:when>
<c:when test="${timeDefference > 60*24*365}">
<fmt:parseNumber value="${timeDefference / (60*24*365)}" integerOnly="true" var="timeDefference"/>
${timeDefference }년 전
</c:when>
</c:choose>
</td>
<td align="center">${i.it_price }<br>( ${i.it_sale } )</td>
<td align="center">${i.it_use }</td>
<td width=130 align="center">
<a href="view?it_uid=${i.it_uid }&pageNum=${pageNum }&field=${field}&search=${search}">[보기]</a>
<a href="modify?it_uid=${i.it_uid }&pageNum=${pageNum }&field=${field}&search=${search}">[수정]</a>
<a href="delete?it_uid=${i.it_uid }">[삭제]</a>
</td>
</tr>
<tr><td colspan=7 height=1 bgcolor="#e5ecef"></td></tr>
</form>
<c:set var="number" value="${number - 1 }" />
</c:forEach>
</table>
<br>
<!-- 페이징 처리 -->
<style>
.page_on {
padding:0px 5px;
color:red;
border:1px solid red;
font-weight:bold;
}
.page_off {
padding:0px 5px;
color:black;
border:1px solid black;
}
</style>
<table width=700 border=0>
<tr>
<td>
<c:if test="${count>0 }">
<c:set var="pageCount" value="${count / pageSize + (count % pageSize == 0 ? 0 : 1) }" />
<fmt:parseNumber var="pageCount" value="${pageCount }" integerOnly="true" />
<!-- fmt:parseNumber : 문자열을 숫자로 변환해 주는 기능을 제공하는 태그 -->
<!-- integerOnly : true , false 정수만 출력할 것인지를 묻는 속성 -->
<!-- 2개의 변수 초기화 -->
- 이전글● JSTL fmt - 현재시간에서 작성시간의 차이 구하기 24.11.28
- 다음글● Error 404 24.11.28
댓글목록
등록된 댓글이 없습니다.