📄 ranking_searchresult_cafe.jsp.svn-base
字号:
<%@ page import='java.io.*,java.text.*,java.util.*, java.util.Vector, java.sql.*, com.entaz.lib.db.*, com.entaz.relay.net.*' contentType='text/html;charset=euc-kr'%>
<%@ include file="../imgpath.jsp"%>
<%@ include file="../makeKOR.jsp"%>
<%//4焙 己龋
Connection con = null;
PreparedStatement pstmt=null;
Statement stmt = null;
ResultSet rs = null;
ResultSet pageset = null;
//String imageUrl= img_path+"images";
String mphone = request.getParameter("mphone");
String gphone = request.getParameter("gphone");
String serchCafename = null; //茫阑 墨其 捞抚
String sql=null, wheresql="",countsql=null;
//八祸狼 搬苞甫 淬阑 函荐甸
String linkStr = null;
int tmpCafe = 0;
String tmpCafename = null;
String tmpIntro = null;
int tmpCategory_idx = 0;
String boardname="GT_cafe";
// 其捞瘤 备泅 眠啊 函荐
int pagesize = 4; // 茄其捞瘤寸 10俺 免仿拱
int pageNUM=1; // 其捞瘤 锅龋
int pagecount=1 ; // 其捞瘤 肮荐 瘤沥 函荐
int absolutepage=1; // 例措 困摹 其捞瘤 锅龋
int dbcount=0 ; // DB 救俊 臂 肮荐 历厘 函荐
int isNoPage = 0; //茄俺档 绝蠢衬.. 绝栏搁0, 乐栏搁1
int useAnd = 1; //sql俊辑 and 贸府.
String nextPageParm=null;
String orderbyStr = "";
String serchTemp = "";
//Random myRandom = new Random( );
//int category_idx_2 = 0;
int cafe_back_img = 0;//捞固瘤 锅龋
//八祸俊 荤侩登绰 函荐甸..
if(!isNull(request.getParameter("cafename")).equals("") )
{
serchTemp = request.getParameter("cafename");
serchCafename = makeKOR(request.getParameter("cafename"));
}
else serchCafename="";
//促澜其捞瘤 逞辨锭.. 颇扼皋磐 逞败林扁
nextPageParm = "&cafename="+serchCafename;
//八祸 孽府
sql = "select top 100 cafe_idx, cafe_name, category_idx, cafe_back_img from GT_cafe where cafe_name LIKE '%"+serchCafename+"%'";
countsql = "select top 100 count(*) from GT_cafe where cafe_name LIKE '%"+serchCafename+"%'";
sql = sql + wheresql + orderbyStr; //沥焊甫 啊廉坷绰 孽府巩
countsql = countsql + wheresql; //肮荐甫 啊廉坷绰 孽府巩
%>
<html>
<head>
<title>葛捞磊-八祸搬苞</title>
<link href="mobile.css" rel="stylesheet" type="text/css">
</head>
<body>
<%
try
{
//=========================== 傍烹函券累诀 : 2008-01-21 ===========================
/**
* 公丰霸烙鸥款 矫胶袍痢八 棺 喉发蜡历 八免
*
* @ date ?8-01-21
* @ version 1.2.0
*/
String SYSTEM_PARAMETER_SET = "?mphone="+request.getParameter("mphone")+"&gphone="+request.getParameter("mphone");
String SYSTEM_PHONE_NUMBER = request.getParameter("mphone");
// 矫胶袍 痢八 眉农
//
if(IS_SYSTEM_CHECK)
{
if( ! IS_TESTER_MODE )
{
response.sendRedirect(url_path+"/system_notice.jsp"+SYSTEM_PARAMETER_SET);
return;
}
}
// DB 楷搬捞 登瘤 臼阑 锭, 救郴芒栏肺 捞悼
//
con = DBConnector.getConnection(db_name);
if( con == null )
{
response.sendRedirect(url_path+"/system_notice2.jsp"+SYSTEM_PARAMETER_SET);
return;
}
// 矫胶袍痢八 吝捞咯档 抛胶磐绰 荤侩啊瓷
//
if( IS_TESTER_MODE )
{
boolean isTester = DBConnector.chkTester( con, SYSTEM_PHONE_NUMBER );
if( ! isTester )
{
response.sendRedirect(url_path+"/system_notice.jsp"+SYSTEM_PARAMETER_SET);
return;
}
}
// 喉发蜡历牢瘤 眉农,
//
boolean isBlackUser = DBConnector.chkBlackList( con, SYSTEM_PHONE_NUMBER );
if( isBlackUser )
{
response.sendRedirect(url_path+"/bad_member.jsp"+SYSTEM_PARAMETER_SET);
return;
}
//=========================== 傍烹函券累诀 : 2008-01-21 ===========================
// 其捞瘤 函荐蔼 荤侩窍扁 困秦辑 DB俊辑 眠免窍绰 何盒
stmt = con.createStatement();
pageset = stmt.executeQuery(countsql);
if( pageset.next())
{
dbcount = pageset.getInt(1); //醚 肮荐
pageset.close();
}
if(dbcount%pagesize == 0)
pagecount = dbcount/(pagesize);
else
pagecount = dbcount/(pagesize)+1; // 醚 其捞瘤荐 备窍扁
if(request.getParameter("pageNUM")!=null)
{
pageNUM=Integer.parseInt(request.getParameter("pageNUM"));//瘤沥等 其捞瘤 焊咯林扁
if(pageNUM > pagecount)
pageNUM = pagecount;
absolutepage=(pageNUM-1)*pagesize+1;
}
rs = stmt.executeQuery(sql);
if(!rs.next()) // 蔼捞 绝阑锭
{
isNoPage = 1;
pagesize=0;
}
else // 蔼捞 乐阑锭 //rs.absolute(absolutepage);
{
for(int s=0; s<absolutepage-1; s++)
rs.next();
}
if(isNoPage == 1)//八祸等 其捞瘤啊 绝栏骨肺 其捞瘤 绝澜 其捞瘤肺 捞悼矫挪促.
{
serchTemp = java.net.URLEncoder.encode(serchCafename);
String goNoPage = url_path+"/ranking/ranking_searchno.jsp?mphone="+mphone+"&gphone="+gphone+"&searchText="+serchTemp;
response.sendRedirect(goNoPage);
}
%>
<table width="176" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8" height="19" background="<%=img_path%>images/202img/202_bar/red.png"></td>
<td width="168" height="19" background="<%=img_path%>images/202img/202_bar/red.png"><font color="#ffffff">八祸搬苞</font></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<%
int count = 0 ; //其捞瘤 墨款磐 函荐 phonenum, nickname, intro
int sizeCvt = 26;
while(count < pagesize)
{
tmpCafe = rs.getInt(1);
tmpCafename = rs.getString(2);
tmpCategory_idx = rs.getInt(3);
cafe_back_img = rs.getInt(4);
linkStr = url_path+"/ranking/ranking_caferanking.jsp?"+"mphone="+mphone+"&gphone="+gphone+"&cafe_idx="+tmpCafe;// 傅农甫 楷搬茄促
%>
<!--霸矫魄 府胶飘 矫累-->
<tr>
<td colspan="2"><!--05/15(拳) 抛捞喉 荐沥 矫累--><table width="176" height="45" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="53" height="45" align="center" valign="middle" bgcolor="#d3e2e5">
<img src="<%=img_path%>images/202img/202_cafe/cafe_s_0<%=cafe_back_img%>_<%=tmpCategory_idx%>.png" width="48" height="41"><!-- 墨其 捞固瘤 持阑 镑-->
</td>
<td width="2"></td>
<td width="122" align="center" valign="middle" bgcolor="#d3e2e5"><table width="113" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="85" valign="bottom"><a href="<%=linkStr%>"><%=tmpCafename%></a></td>
<td width="28" valign="bottom"><table width="26" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="26" align="center" valign="bottom" bgcolor="#d3e2e5"><font color="#7c8889"></font></td>
</tr>
</table></td>
</tr>
</table>
<table width="117" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="56" height="15" align="right"><font color="#7c8889"></font></td>
<td width="61" height="15" valign="top"></td>
</tr>
<tr>
<td colspan="2" valign="top"></td>
</tr>
</table></td>
</tr>
</table><!--05/15(拳) 抛捞喉 荐沥 场--></td>
</tr>
<tr>
<td height="2" colspan="2"></td>
</tr>
<%
if(rs.isLast())
{ //盖 付瘤阜 饭内靛 老版快
break;
}
else
{
rs.next();
}
count++;
}//end_while
}
catch (Exception e)
{
out.println(e);
}
finally
{
if(rs != null) try{ rs.close(); }catch(Exception se){}
if(pageset != null) try{ pageset.close(); }catch(Exception se){}
if(pstmt != null) try{ pstmt.close(); }catch(Exception se){}
if(stmt != null) try{ stmt.close(); }catch(Exception se){}
if(con != null) try{ con.close(); }catch(Exception se){}
}
%>
<!--霸矫魄 府胶飘 2俺 馆汗(醚 3俺啊 唱客具 窃) 场-->
<tr>
<td height="16" colspan="2" align="center" valign="bottom" bgcolor="#fef4c2">
<%//其捞瘤 备泅何
int limit = 4 ; //其捞瘤 府胶飘 俺荐 瘤沥
int temp =(pageNUM-1) % limit ; //矫累 其捞瘤 备窍扁
int startPage = pageNUM - temp;
String pageurl=url_path+"/ranking/ranking_searchresult_cafe.jsp?mphone="+mphone+"&gphone="+gphone + nextPageParm;
%>
<%// [捞傈] 傅农 眠啊窍扁
if ((startPage-limit)>0){ %>
<a href="<%=pageurl%>&pageNUM=<%=startPage-1%>"><font color="#DB1A00">捞傈</font></a>
<%}
//其捞瘤 锅龋 唱凯窍扁
if(isNoPage == 0)
{
for(int i=startPage ; i<(startPage+limit);i++)
{
if( i == pageNUM)
{%>
<font color="#DB1A00"><b><%=i%></b></font>
<% }
else
{ %>
<a href="<%=pageurl%>&pageNUM=<%=i%>"><font color="#DB1A00"><%=i%></font></a>
<% }
if(i >= pagecount) break;
}
}
else
out.println("钎矫 且 郴侩捞 绝嚼聪促.");
//[促澜] 傅农 眠啊
if((startPage+limit)<=pagecount){ %>
<a href="<%=pageurl%>&pageNUM=<%=(startPage+limit)%>"><font color="#DB1A00">促澜</font></a>
<%}
%>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table>
<%
String step1=url_path+"/main.jsp?mphone="+mphone+"&gphone="+gphone;//权
String step2=url_path+"/ranking/ranking_main.jsp?mphone="+mphone+"&gphone="+mphone;//珐欧皋牢
%>
<table width="176" border="0" cellspacing="0" cellpadding="0">
<tr height="15">
<td width="7" bgcolor="#BBC7C8"></td>
<td width="162" bgcolor="#DAE6E8"><a href="<%=step1%>">权</a>><a href="<%=step2%>">鸥款珐欧</a>>墨其珐欧茫扁</td>
<td width="7" bgcolor="#BBC7C8"></td>
</tr>
</table>
<%@ include file="../newbottom.jsp"%>
</body>
</html>
<%!
public static String isNull(String str)
{
if (str == null)
return "";
else
return str;
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -