<%@ page contentType="text/html;charset=euc-kr" %> <%@ include file="/admin/import.jsp" %> <%@ include file="/include/function.jsp" %> <% Connection conn = null; Statement stmt = null; ResultSet rs = null; ResultSet rs1 = null; String sql = ""; String cate1 = request.getParameter("cate1") == null ? "01" : request.getParameter("cate1"); String cate2 = request.getParameter("cate2") == null ? "00" : request.getParameter("cate2"); String cate3 = request.getParameter("cate3") == null ? "00" : request.getParameter("cate3"); String prd_no = request.getParameter("prd_no") == null ? "" : request.getParameter("prd_no"); //String flag = request.getParameter("flag") == null ? "N" : request.getParameter("flag"); String sPage = request.getParameter("sPage") == null ? "1" : request.getParameter("sPage"); String brand = request.getParameter("brand") == null ? "" : request.getParameter("brand"); String flag = request.getParameter("flag"); if (flag == null) { if ((cate1.equals("01") && cate2.equals("01")) || (cate1.equals("01") && cate2.equals("04")) || (cate1.equals("01") && cate2.equals("06"))) { flag = "S"; } else { flag = "N"; } } //out.println (flag); String sub_sql = ""; int loop_cnt = 0; if (cate1.equals("null")) { cate1 = "00"; } if (cate2.equals("null")) { cate2 = "00"; } if (cate3.equals("null")) { cate3 = "00"; } //out.println (cate1+"/"+cate2+"/"+cate3); float tot_point = 0; float tot_cnt = 0; float value = 0; String val = ""; try { Class.forName("oracle.jdbc.driver.OracleDriver"); conn = DriverManager.getConnection ("jdbc:oracle:thin:@10.1.1.7:1621:EBPPTEST", "testpub", "testpub"); %> Untitled Document
<%@ include file = "/include/top.jsp" %>
<%@ 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"); } %> <% } 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"); } %> <% } 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%>Ȩ > <%=cate1_nm%> > <%=cate2_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++; %> <% 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++; %> <% 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++; %> <% if (loop % 4 == 0) { %> <% } } while (true) { if (loop % 4 != 0) { %> <% loop++; } else { break; } } %>
ÇǺΰǰ­  "><%=rs.getString("brand_name")%>
   
»ýÈ°°Ç°­  "><%=rs.getString("brand_name")%>
   
Â÷/ Ä¿ÇÇ  "><%=rs.getString("brand_name")%>
   
<% } 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++; %> <% 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++; %> <% 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++; %> <% if (loop % 4 == 0) { %> <% } } while (true) { if (loop % 4 != 0) { %> <% loop++; } else { break; } } %>
½ºÅ²ÄÉ¾î  "><%=rs.getString("brand_name")%>
   
¹ÙµðÄÉ¾î  "><%=rs.getString("brand_name")%>
   
¾ÆÅäÇÇÄÉ¾î  "><%=rs.getString("brand_name")%>
   
<% } 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++; %> <% 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++; %> <% 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++; %> <% if (loop % 4 == 0) { %> <% } } while (true) { if (loop % 4 != 0) { %> <% loop++; } else { break; } } %>
»ýÈ°¿ëÇ°  "><%=rs.getString("brand_name")%>
   
»ýÈ°¼ÒÇ°  "><%=rs.getString("brand_name")%>
   
Çãºê/±âŸ  "><%=rs.getString("brand_name")%>
   
<% } 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++; %> <% if (loop % 4 == 0) { %> <% } } while (true) { if (loop % 4 != 0) { %> <% loop++; } else { break; } } %>
Â÷/Ä¿ÇÇ  "><%=rs.getString("brand_name")%>
   
<% } } else if (!cate1.equals("00") && !cate2.equals("00") && !cate3.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='"+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++; %> <% if (loop % 4 == 0) { %> <% } } while (true) { if (loop % 4 != 0) { %> <% loop++; } else { break; } } %>
<%=cate3_nm%>  "><%=rs.getString("brand_name")%>
   
<% } %>
<%if (flag.equals("N")) {%><%}%>½Å»óÇ°¼ø<%if (flag.equals("N")) {%><%}%> <%if (flag.equals("H")) {%><%}%>ÆǸŷ®¼ø<%if (flag.equals("H")) {%><%}%> <%if (flag.equals("AA")) {%><%}%>³·Àº°¡°Ý¼ø<%if (flag.equals("AA")) {%><%}%> <%if (flag.equals("AD")) {%><%}%>³ôÀº°¡°Ý¼ø<%if (flag.equals("AD")) {%><%}%>  
<% //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; %> <% } else { %> <% } else { %>
<% int prd_cnt = 0; while (rs.next()) { prd_cnt++; %> <% } 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 { %> [Ç°Àý] <% } %> <% } %>
&cate2=<%=rs.getString("code2")%>&cate3=<%=rs.getString("code3")%>&prd_no=<%=rs.getString("prd_no")%>">" width="120" height="120" border="0">
&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"))%>¿ø
<% if (prd_cnt % 5 == 0) { if (curPage_cnt == prd_cnt) { %>
 
 
 
 
<% } } else { %> <% } } for (int i = 0 ; i < 5 ; i++) { prd_cnt++; if (prd_cnt % 5 == 1) { break; } else { %>
 
 
<% if (prd_cnt % 5 == 0) { %>
 
 
<% } } } %>
 
<% 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 { %> <% } %>

<% if ( rs1 != null ) rs1.close(); if ( rs != null ) rs.close(); if ( stmt != null ) stmt.close(); if ( conn != null ) conn.close(); } catch (Exception e) { if ( rs1 != null ) rs1.close(); if ( rs != null ) rs.close(); if ( stmt != null ) stmt.close(); if ( conn != null ) conn.close(); // ¿¡·¯ÆäÀÌÁö·Î À̵¿............ out.println("JSP >> " + e.toString()); e.printStackTrace(); } %>