<%@ page contentType="text/html; charset=euc-jp" %> <%@ page import = "java.util.*, java.io.*, java.text.*, java.sql.*, java.net.*" %> <%@ page errorPage="/syserror.jsp" %> <%! private String NumFormat(String num) { int n = Integer.valueOf(num).intValue(); DecimalFormat NumFormat = new DecimalFormat("###,###"); return NumFormat.format(n); } private String StrConv(String val) throws UnsupportedEncodingException { if(val!=null){ StringBuffer sb = new StringBuffer(); StringCharacterIterator sci = new StringCharacterIterator(val); for(char c = sci.current(); c != StringCharacterIterator.DONE; c = sci.next()){ if(c == '\n') { sb.append("
"); } else if(c == '\r') { sb.append(""); } else { sb.append(c); } } return sb.toString(); } else { return ""; } } %> <% String query; String[] id = new String[10]; String[] title = new String[10]; String[] img = new String[10]; String[] comment = new String[10]; db.open(); query = "SELECT count(*) FROM category WHERE del is not true"; ResultSet cnt = db.select(query); cnt.next(); int count = cnt.getInt("count"); %> <% String uriQuery = "", tmpStr; Enumeration queryList = request.getParameterNames(); while(queryList.hasMoreElements()) { String key = (String) (queryList.nextElement()); if (key.equals("offset") || key.equals("submit")) { continue; } tmpStr = new String(request.getParameter(key).getBytes("8859_1"), "EUC-JP"); uriQuery += key + "=" + URLEncoder.encode(tmpStr, "Shift_JIS") + "&"; } int offset, limit = 10, max; String uri = request.getRequestURI() + "?" + uriQuery; String prev = "", next = "", box = ""; if(request.getParameter("offset") != null) { offset = Integer.parseInt(request.getParameter("offset")); } else { offset = 0; } int l = 10; String[] defDspCount = new String[]{"1","2","3","4","5","6","7","8","9"}; int pagecount = 0; String dspcount = null; for(int i=0; i pagecount) { dspcount = defDspCount[pagecount-1]; } else { dspcount = new Integer(pagecount).toString(); } if(offset>i) { box += "" + dspcount + " "; prev = "<前ページ"; } else if(offset+l<=i) { box += "" + dspcount + " "; next = "次ページ>"; } else { box += dspcount + " "; } } String PageNavi = prev + "[" + box + "]" + next; if ((offset + limit) 〜本当のおいしさを〜いかりスーパー
トップページ>ショッピング
詳細検索へ
ショッピングをお楽しみください
全カテゴリは<%=count%>種類あります <%=PageNavi%>
<% if(id[0] != null) { %>
<%if(img[0].length()>0){%>食材写真<%}%><%if(title[0].length()>0){%><%}%>
<%=comment[0]%> 全商品はこちらから
<% } %> 空白 <% if(id[2] != null) { %>
<%if(img[2].length()>0){%>食材写真<%}%><%if(title[2].length()>0){%><%}%>
<%=comment[2]%> 全商品はこちらから
<% } %> 空白 <% if(id[4] != null) { %>
<%if(img[4].length()>0){%>食材写真<%}%><%if(title[4].length()>0){%><%}%>
<%=comment[4]%> 全商品はこちらから
<% } %> 空白 <% if(id[6] != null) { %>
<%if(img[6].length()>0){%>食材写真<%}%><%if(title[6].length()>0){%><%}%>
<%=comment[6]%> 全商品はこちらから
<% } %> 空白 <% if(id[8] != null) { %>
<%if(img[8].length()>0){%>食材写真<%}%><%if(title[8].length()>0){%><%}%>
<%=comment[8]%> 全商品はこちらから
<% } %>
<% if(id[1] != null) { %>
<%if(img[1].length()>0){%>食材写真<%}%><%if(title[1].length()>0){%><%}%>
<%=comment[1]%> 全商品はこちらから
<% } %> 空白 <% if(id[3] != null) { %>
<%if(img[3].length()>0){%>食材写真<%}%><%if(title[3].length()>0){%><%}%>
<%=comment[3]%> 全商品はこちらから
<% } %> 空白 <% if(id[5] != null) { %>
<%if(img[5].length()>0){%>食材写真<%}%><%if(title[5].length()>0){%><%}%>
<%=comment[5]%> 全商品はこちらから
<% } %> 空白 <% if(id[7] != null) { %>
<%if(img[7].length()>0){%>食材写真<%}%><%if(title[7].length()>0){%><%}%>
<%=comment[7]%> 全商品はこちらから
<% } %> 空白 <% if(id[9] != null) { %>
<%if(img[9].length()>0){%>食材写真<%}%><%if(title[9].length()>0){%><%}%>
<%=comment[9]%> 全商品はこちらから
<% } %>
全カテゴリは<%=count%>種類あります <%=PageNavi%>


 
<% db.close (); %>