%@ page contentType="text/html; charset=euc-jp" %>
<%@ page import = "java.util.*, java.io.*, java.text.*, java.sql.*" %>
<%@ page errorPage="/syserror.jsp" %>
<%!
private String NumFormat(String num) {
int n = Integer.valueOf(num).intValue();
DecimalFormat NumFormat = new DecimalFormat("###,###");
return NumFormat.format(n);
}
%>
<%
String query;
String[] spid = new String[4];
String[] spn = new String[4];
String[] spimg = new String[4];
String[] cid = new String[11];
String[] cimg = new String[11];
String[] gid = new String[11];
String[] gimg = new String[11];
String[] gn = new String[11];
String[] gp = new String[11];
db.open();
query = "SELECT * FROM goods WHERE del is not true AND special = true ORDER BY priority ASC, product ASC";
ResultSet sp = db.select(query);
sp.next();
String sp_id = sp.getString("id");
String sp_img = sp.getString("image_m_1");
String sp_name = sp.getString("product");
String sp_comment = sp.getString("short_comment");
String sp_price = sp.getString("price");
for(int i=0; i<=3; i++) {
sp.next();
spid[i] = sp.getString("id");
spn[i] = sp.getString("product");
spimg[i] = sp.getString("image_s");
}
query = "SELECT * FROM category WHERE del is not true ORDER BY priority ASC, category ASC";
ResultSet crs = db.select(query);
for(int i=0; i<=10; i++) {
if (crs.next()) {
cid[i] = crs.getString("id");
cimg[i] = crs.getString("title_image_s");
}
}
for(int i=0; i<11; i++) {
query = "SELECT * FROM goods WHERE del is not true AND (category_id_1 = " + cid[i] + " OR category_id_2 = " + cid[i] + " OR category_id_3 = " + cid[i] + ") ORDER BY special DESC, priority ASC, product ASC LIMIT 1";
ResultSet rs = db.select(query);
while(rs.next()) {
gid[i] = rs.getString("id");
gimg[i] = rs.getString("image_m_1");
gn[i] = rs.getString("product");
gp[i] = "¥" + NumFormat(rs.getString("price"));
}
}
%>
ikarishopping_menu
〜本当のおいしさを〜いかりスーパー
<% db.close (); %>