<%
HashMap hm1=new HashMap();
query = "SELECT category_1, count(*) FROM recipe WHERE del is not true AND start_date <= current_timestamp GROUP BY category_1";
cnt = db.select(query);
while (cnt.next()) {
hm1.put(cnt.getString("category_1"), cnt.getString("count"));
}
query = "SELECT * FROM recipe_category WHERE del is not true AND id = 1 ORDER BY number";
rs = db.select(query);
while (rs.next()) {
String number = rs.getString("number");
String option = rs.getString("option");
String count = (String)hm1.get(rs.getString("number"));
out.println ("" + option + "(" + NumConv(count) + ") ");
}
%>
|
<%
HashMap hm2=new HashMap();
query = "SELECT category_2, count(*) FROM recipe WHERE del is not true AND start_date <= current_timestamp GROUP BY category_2";
cnt = db.select(query);
while (cnt.next()) {
hm2.put(cnt.getString("category_2"), cnt.getString("count"));
}
query = "SELECT * FROM recipe_category WHERE del is not true AND id = 2 ORDER BY number";
rs = db.select(query);
while (rs.next()) {
String number = rs.getString("number");
String option = rs.getString("option");
String count = (String)hm2.get(rs.getString("number"));
out.println ("" + option + "(" + NumConv(count) + ") ");
}
%>
|
<%
HashMap hm3=new HashMap();
query = "SELECT category_3, count(*) FROM recipe WHERE del is not true AND start_date <= current_timestamp GROUP BY category_3";
cnt = db.select(query);
while (cnt.next()) {
hm3.put(cnt.getString("category_3"), cnt.getString("count"));
}
query = "SELECT * FROM recipe_category WHERE del is not true AND id = 3 ORDER BY number";
rs = db.select(query);
while (rs.next()) {
String number = rs.getString("number");
String option = rs.getString("option");
String count = (String)hm3.get(rs.getString("number"));
out.println ("" + option + "(" + NumConv(count) + ") ");
}
%>
|
<%
HashMap hm4=new HashMap();
query = "SELECT category_4, count(*) FROM recipe WHERE del is not true AND start_date <= current_timestamp GROUP BY category_4";
cnt = db.select(query);
while (cnt.next()) {
hm4.put(cnt.getString("category_4"), cnt.getString("count"));
}
query = "SELECT * FROM recipe_category WHERE del is not true AND id = 4 ORDER BY number";
rs = db.select(query);
while (rs.next()) {
String number = rs.getString("number");
String option = rs.getString("option");
String count = (String)hm4.get(rs.getString("number"));
out.println ("" + option + "(" + NumConv(count) + ") ");
}
%>
|