<%@ include file = "/include/mall_left.jsp" %>
<%@ include file = "mall_best.jsp" %>
<%@ include file = "mall_md_choice.jsp" %>
|
<%
String cate1_nm = "", cate2_nm = "", cate3_nm = "";
if (!cate1.equals("00") && cate2.equals("00")) {
sql = " select cate_nm from ecokiri_cate where cate1='" + cate1 + "' and cate2='00' and cate3='00' ";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
if (rs.next()) {
cate1_nm = rs.getString("cate_nm");
}
%>
Ȩ > <%=cate1_nm%> |
<%
} else if (!cate1.equals("00") && !cate2.equals("00") && cate3.equals("00")) {
sql = " select cate_nm from ecokiri_cate where cate1='" + cate1 + "' and cate2='00' and cate3='00' ";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
if (rs.next()) {
cate1_nm = rs.getString("cate_nm");
}
sql = " select cate_nm from ecokiri_cate where cate1='" + cate1 + "' and cate2='"+ cate2 +"' and cate3='00' ";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
if (rs.next()) {
cate2_nm = rs.getString("cate_nm");
}
%>
Ȩ > <%=cate1_nm%> > <%=cate2_nm%> |
<%
} else if (!cate1.equals("00") && !cate2.equals("00") && !cate3.equals("00")) {
sql = " select cate_nm from ecokiri_cate where cate1='" + cate1 + "' and cate2='00' and cate3='00' ";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
if (rs.next()) {
cate1_nm = rs.getString("cate_nm");
}
sql = " select cate_nm from ecokiri_cate where cate1='" + cate1 + "' and cate2='"+ cate2 +"' and cate3='00' ";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
if (rs.next()) {
cate2_nm = rs.getString("cate_nm");
}
sql = " select cate_nm from ecokiri_cate where cate1='" + cate1 + "' and cate2='"+ cate2 +"' and cate3='"+ cate3 +"' ";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
if (rs.next()) {
cate3_nm = rs.getString("cate_nm");
}
%>
Ȩ > <%=cate1_nm%> > <%=cate2_nm%> > <%=cate3_nm%> |
<%
}
%>
|
 |
<%
if (!cate1.equals("00") && cate2.equals("00")) {
%>
ÇǺΰǰ |
<%
sql = " select brand, (select name from ecokiri_brand where gubun='02' and code=brand) brand_name ";
sql = sql + " from (select brand from ecokiri_product_n where display='1' and code1='02' and code2='01' group by brand order by brand asc) ";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
int loop = 0;
while (rs.next()) {
loop++;
%>
 |
"><%=rs.getString("brand_name")%> |
<%
if (loop % 4 == 0) {
%>
|
<%
}
}
while (true) {
if (loop % 4 != 0) {
%>
|
|
<%
loop++;
} else {
break;
}
}
%>
|
»ýÈ°°Ç° |
<%
sql = " select brand, (select name from ecokiri_brand where gubun='02' and code=brand) brand_name ";
sql = sql + " from (select brand from ecokiri_product_n where display='1' and code1='02' and code2='02' group by brand order by brand asc) ";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
loop = 0;
while (rs.next()) {
loop++;
%>
 |
"><%=rs.getString("brand_name")%> |
<%
if (loop % 4 == 0) {
%>
|
<%
}
}
while (true) {
if (loop % 4 != 0) {
%>
|
|
<%
loop++;
} else {
break;
}
}
%>
|
Â÷/ Ä¿ÇÇ |
<%
sql = " select brand, (select name from ecokiri_brand where gubun='02' and code=brand) brand_name ";
sql = sql + " from (select brand from ecokiri_product_n where display='1' and code1='02' and code2='03' group by brand order by brand asc) ";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
loop = 0;
while (rs.next()) {
loop++;
%>
 |
"><%=rs.getString("brand_name")%> |
<%
if (loop % 4 == 0) {
%>
|
<%
}
}
while (true) {
if (loop % 4 != 0) {
%>
|
|
<%
loop++;
} else {
break;
}
}
%>
<%
} else if (!cate1.equals("00") && !cate2.equals("00") && cate3.equals("00")) {
if (cate2.equals("01")) {
%>
½ºÅ²Äɾî |
<%
sql = " select brand, (select name from ecokiri_brand where gubun='02' and code=brand) brand_name ";
sql = sql + " from (select brand from ecokiri_product_n where display='1' and code1='02' and code2='01' and code3='01' group by brand order by brand asc) ";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
int loop = 0;
while (rs.next()) {
loop++;
%>
 |
"><%=rs.getString("brand_name")%> |
<%
if (loop % 4 == 0) {
%>
|
<%
}
}
while (true) {
if (loop % 4 != 0) {
%>
|
|
<%
loop++;
} else {
break;
}
}
%>
|
¹ÙµðÄɾî |
<%
sql = " select brand, (select name from ecokiri_brand where gubun='02' and code=brand) brand_name ";
sql = sql + " from (select brand from ecokiri_product_n where display='1' and code1='02' and code2='01' and code3='03' group by brand order by brand asc) ";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
loop = 0;
while (rs.next()) {
loop++;
%>
 |
"><%=rs.getString("brand_name")%> |
<%
if (loop % 4 == 0) {
%>
|
<%
}
}
while (true) {
if (loop % 4 != 0) {
%>
|
|
<%
loop++;
} else {
break;
}
}
%>
|
¾ÆÅäÇÇÄɾî |
<%
sql = " select brand, (select name from ecokiri_brand where gubun='02' and code=brand) brand_name ";
sql = sql + " from (select brand from ecokiri_product_n where display='1' and code1='02' and code2='01' and code3='04' group by brand order by brand asc) ";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
loop = 0;
while (rs.next()) {
loop++;
%>
 |
"><%=rs.getString("brand_name")%> |
<%
if (loop % 4 == 0) {
%>
|
<%
}
}
while (true) {
if (loop % 4 != 0) {
%>
|
|
<%
loop++;
} else {
break;
}
}
%>
<%
} else if (cate2.equals("02")) {
%>
»ýÈ°¿ëÇ° |
<%
sql = " select brand, (select name from ecokiri_brand where gubun='02' and code=brand) brand_name ";
sql = sql + " from (select brand from ecokiri_product_n where display='1' and code1='02' and code2='02' and code3='01' group by brand order by brand asc) ";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
int loop = 0;
while (rs.next()) {
loop++;
%>
 |
"><%=rs.getString("brand_name")%> |
<%
if (loop % 4 == 0) {
%>
|
<%
}
}
while (true) {
if (loop % 4 != 0) {
%>
|
|
<%
loop++;
} else {
break;
}
}
%>
|
»ýÈ°¼ÒÇ° |
<%
sql = " select brand, (select name from ecokiri_brand where gubun='02' and code=brand) brand_name ";
sql = sql + " from (select brand from ecokiri_product_n where display='1' and code1='02' and code2='02' and code3='02' group by brand order by brand asc) ";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
loop = 0;
while (rs.next()) {
loop++;
%>
 |
"><%=rs.getString("brand_name")%> |
<%
if (loop % 4 == 0) {
%>
|
<%
}
}
while (true) {
if (loop % 4 != 0) {
%>
|
|
<%
loop++;
} else {
break;
}
}
%>
|
Çãºê/±âŸ |
<%
sql = " select brand, (select name from ecokiri_brand where gubun='02' and code=brand) brand_name ";
sql = sql + " from (select brand from ecokiri_product_n where display='1' and code1='02' and code2='02' and code3='04' group by brand order by brand asc) ";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
loop = 0;
while (rs.next()) {
loop++;
%>
 |
"><%=rs.getString("brand_name")%> |
<%
if (loop % 4 == 0) {
%>
|
<%
}
}
while (true) {
if (loop % 4 != 0) {
%>
|
|
<%
loop++;
} else {
break;
}
}
%>
<%
} else if (cate2.equals("03")) {
%>
Â÷/Ä¿ÇÇ |
<%
sql = " select brand, (select name from ecokiri_brand where gubun='02' and code=brand) brand_name ";
sql = sql + " from (select brand from ecokiri_product_n where display='1' and code1='02' and code2='03' group by brand order by brand asc) ";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
int loop = 0;
while (rs.next()) {
loop++;
%>
 |
"><%=rs.getString("brand_name")%> |
<%
if (loop % 4 == 0) {
%>
|
<%
}
}
while (true) {
if (loop % 4 != 0) {
%>
|
|
<%
loop++;
} else {
break;
}
}
%>
<%
}
} else if (!cate1.equals("00") && !cate2.equals("00") && !cate3.equals("00")) {
%>
<%=cate3_nm%> |
<%
sql = " select brand, (select name from ecokiri_brand where gubun='02' and code=brand) brand_name ";
sql = sql + " from (select brand from ecokiri_product_n where display='1' and code1='"+cate1+"' and code2='"+cate2+"' and code3='"+cate3+"' group by brand order by brand asc) ";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
int loop = 0;
while (rs.next()) {
loop++;
%>
 |
"><%=rs.getString("brand_name")%> |
<%
if (loop % 4 == 0) {
%>
|
<%
}
}
while (true) {
if (loop % 4 != 0) {
%>
|
|
<%
loop++;
} else {
break;
}
}
%>
<%
}
%>
|
 |
|
<%
//out.println ("sql : " + sql +"
");
int iPage = Integer.parseInt(sPage);
int totalCnt = 0; //±ÛÀÇ ÃÑ °¹¼ö
int totalPage = 0; //ÃÑ ÆäÀÌÁö °¹¼ö
int pageSize = 20; //ÇÑÆäÀÌÁö¿¡ º¸¿©ÁÙ ±ÛÀÇ ÃÖ´ë °¹¼ö
int blockSize = 10; //ÇÑ È¸é¿¡ º¸¿©ÁÙ ÃÖ´ë ÆäÀÌÁö °¹¼ö
int blockPage = 1; //ÇÑ È¸é¿¡ º¸¿©Áö´Â ÆäÀÌÁö Áß Ã¹¹ø° ÆäÀÌÁö ¹øÈ£
int bound = 20; //ÃÖ´ë ¸ñ·Ï Ãâ·Â¼ö
sql = " select count(*) cnt from ecokiri_product_n ";
sql = sql + " where display='1' and code1='"+cate1+"' " ;
if (!cate2.equals("00")) {
sql = sql + " and code2='"+cate2+"' ";
}
if (!cate3.equals("00")) {
sql = sql + " and code3='"+cate3+"' ";
}
if (!brand.equals("")) {
sql = sql + " and brand='"+brand+"' ";
}
//out.println ("sql : " + sql +"
");
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
if (rs.next()) {
totalCnt = rs.getInt("cnt");
}
//out.println ("totalCnt : " + totalCnt +"
");
int curPage_cnt = 0;
sql = " select count(*) cnt from ( ";
sql = sql + " select rownum no, temp.* from ";
sql = sql + " ( select ep.code1, ep.code2, ep.code3, ep.prd_no, ep.prd_photo3, ep.title, ep.sale_amount, ep.dc_amount, rate_company, rate_local, rate_common, chk_sale, ep.display_seq, ";
sql = sql + " (select sum(opt_cnt) from ecokiri_order_detail where prd_no=ep.prd_no ) buy_cnt ";
sql = sql + " from ecokiri_product_n ep ";
sql = sql + " where ep.display='1' and ep.code1='"+cate1+"' and ep.prd_no is not null ";
if (!cate2.equals("00")) {
sql = sql + " and ep.code2='"+cate2+"' ";
}
if (!cate3.equals("00")) {
sql = sql + " and ep.code3='"+cate3+"' ";
}
if (!brand.equals("")) {
sql = sql + " and ep.brand='"+brand+"' ";
}
if (flag.equals("S")) {
sql = sql + " order by ep.display_seq asc, ep.title asc ";
} else if (flag.equals("H")) {
sql = sql + " order by buy_cnt desc ";
} else if (flag.equals("N")) {
sql = sql + " order by ep.seq desc ";
} else if (flag.equals("AA")) {
sql = sql + " order by to_number(ep.sale_amount) asc ";
} else if (flag.equals("AD")) {
sql = sql + " order by to_number(ep.sale_amount) desc ";
}
sql = sql + " )temp ";
sql = sql + " ) data where no >= " +((iPage-1)*pageSize+1)+ " and no <= " +(iPage*pageSize)+ " ";
//out.println ("sql : " + sql +"
");
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
if (rs.next()) {
curPage_cnt = rs.getInt("cnt");
}
//out.println ("curPage_cnt : " + curPage_cnt +"
");
sql = " select * from ( ";
sql = sql + " select rownum no, temp.* from ";
sql = sql + " ( select ep.code1, ep.code2, ep.code3, ep.prd_no, ep.prd_photo3, ep.title, ep.sale_amount, ep.dc_amount, rate_company, rate_local, rate_common, chk_sale, chk_newsale, ep.display_seq, ep.no_cnt, ";
sql = sql + " (select sum(opt_cnt) from ecokiri_order_detail where prd_no=ep.prd_no ) buy_cnt ";
sql = sql + " from ecokiri_product_n ep ";
sql = sql + " where ep.display='1' and ep.code1='"+cate1+"' and ep.prd_no is not null ";
if (!cate2.equals("00")) {
sql = sql + " and ep.code2='"+cate2+"' ";
}
if (!cate3.equals("00")) {
sql = sql + " and ep.code3='"+cate3+"' ";
}
if (!brand.equals("")) {
sql = sql + " and ep.brand='"+brand+"' ";
}
if (flag.equals("S")) {
sql = sql + " order by ep.display_seq asc, ep.title asc ";
} else if (flag.equals("H")) {
sql = sql + " order by buy_cnt desc ";
} else if (flag.equals("N")) {
sql = sql + " order by ep.seq desc ";
} else if (flag.equals("AA")) {
sql = sql + " order by to_number(ep.sale_amount) asc ";
} else if (flag.equals("AD")) {
sql = sql + " order by to_number(ep.sale_amount) desc ";
}
sql = sql + " )temp ";
sql = sql + " ) data where no >= " +((iPage-1)*pageSize+1)+ " and no <= " +(iPage*pageSize)+ " ";
//out.println ("sql : " + sql +"
");
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
totalPage = ( (int) (totalCnt - 1)/pageSize ) + 1;
blockPage = ( (int) (iPage -1)/blockSize ) * blockSize + 1;
%>
<%
int prd_cnt = 0;
while (rs.next()) {
prd_cnt++;
%>
|
&cate2=<%=rs.getString("code2")%>&cate3=<%=rs.getString("code3")%>&prd_no=<%=rs.getString("prd_no")%>"> <%=convertDBtoWEB3(rs.getString("title"))%>
<% if (rs.getString("chk_newsale") == null) {%>
<% if (rs.getString("no_cnt").equals("1")) {%>
<%=getStringWon(getDisCountAmtNew(rs.getString("sale_amount"),rs.getString("dc_amount"),rs.getString("rate_company"),rs.getString("rate_local"),rs.getString("rate_common"),rs.getString("chk_sale"),ss_level))%>¿ø
<% } else { %>
[Ç°Àý]
<% } %>
<% } else if (rs.getString("chk_newsale").equals("1")) {%>
<%=getStringWon(rs.getString("SALE_AMOUNT"))%>¿ø
<%=getStringWon(rs.getString("DC_AMOUNT"))%>¿ø |
<% } else { %>
<% if (rs.getString("no_cnt").equals("1")) {%>
<%=getStringWon(getDisCountAmtNew(rs.getString("sale_amount"),rs.getString("dc_amount"),rs.getString("rate_company"),rs.getString("rate_local"),rs.getString("rate_common"),rs.getString("chk_sale"),ss_level))%>¿ø
<% } else { %>
[Ç°Àý]
<% } %>
<% } %>
<%
if (prd_cnt % 5 == 0) {
if (curPage_cnt == prd_cnt) {
%>
|
|
|
|
<%
} else {
%>
|
|
|
<%
}
} else {
%>
|
<%
}
}
for (int i = 0 ; i < 5 ; i++) {
prd_cnt++;
if (prd_cnt % 5 == 1) {
break;
} else {
%>
<%
if (prd_cnt % 5 == 0) {
%>
|
|
|
|
<%
} else {
%>
<%
}
}
}
%>
|
  |
<% if (blockPage == 1) { %>
<% } else { %>
<% } %>
<%
int loopSize = Math.min (blockPage + blockSize, totalPage + 1);
for ( int i = blockPage; i < loopSize ; i++ ) {
%>
<%if (i == iPage) {%>[<%=i%>]<% } else { %><%=i%><% } %>
<%
}
%>
<% if (blockPage + blockSize > totalPage){ %>
<% } else { %>
<% } %>
|
|
|