📄 questionself.jsp
字号:
<!-----------------------------------------------------------
* @ 权> Xxx丛狼 迄乔 > 家匡皋捞飘 > 鸥肺痢
* @ Author : 碍辑康 ( 2008-05-21 )
* @ Images :
-------------------------------------------------------------->
<%@ page import='java.io.*,java.text.*,java.util.Date,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="../common_func.jsp"%>
<%!
public static String isNull(String str)
{
if (str == null)
return "";
else
return str;
}
%>
<%
/*------------------------------------------------------------------------------------------------------
+ 扁夯 颇扼固磐
-------------------------------------------------------------------------------------------------------*/
String mphone = request.getParameter("mphone");
String gphone = request.getParameter("gphone");
/*------------------------------------------------------------------------------------------------------
+ 其捞瘤 函荐
-------------------------------------------------------------------------------------------------------*/
int pageNUM=1; // 其捞瘤 锅龋
int absolutepage=1; // 例措 困摹 其捞瘤 锅龋
int dbcount=0 ; // DB 救俊 臂 肮荐 历厘 函荐
int isNoPage = 0; //茄俺档 绝蠢衬.. 绝栏搁0, 乐栏搁1
int recordCount=0; //其捞隆 且 饭内靛 墨款飘
int pagesize=10; //其捞瘤 府胶飘 荐
int pagecount=1; //其捞瘤 荐
int gotoPage=1; //其捞瘤 逞滚
/*------------------------------------------------------------------------------------------------------
+ DB 包访 函荐
-------------------------------------------------------------------------------------------------------*/
Connection con = null;
PreparedStatement pstmt=null;
Statement stmt = null;
ResultSet rs = null;
ResultSet pageset = null;
/*------------------------------------------------------------------------------------------------------
+ 傈开 函荐
-------------------------------------------------------------------------------------------------------*/
String query1=null , query2 = null ,sql = null;
int idx = 0;
int phonenum = 0;
String text = "";
String username = "";
int sex = 0;
int comment = 0;
int age = 0 ;
String otherPhone = "";
Calendar calendar=Calendar.getInstance();
int now=calendar.get(Calendar.YEAR);
int date = 0;
int questionCount = 0 ;
String szCount ="";
String name = "";
String pageurl = "";
%>
<%
try
{
/*------------------------------------------------------------------------------------------------
* DB 目池记
-------------------------------------------------------------------------------------------------*/
%><%@ include file="../getConnection.jsp"%><%
con.setAutoCommit(false);
stmt=con.createStatement();
/*------------------------------------------------------------------------------------------------
* 郴 鸥肺 龙巩 饭内靛
-------------------------------------------------------------------------------------------------*/
query1 = "select count(idx) as questioncount from GT_LUCKY_TARO WITH (READUNCOMMITTED) where phonenum = "+ mphone ;
pstmt = con.prepareStatement(query1);
rs = pstmt.executeQuery();
if(rs.next()){
questionCount = rs.getInt("questioncount");
}
rs.close();
pstmt.close();
/*------------------------------------------------------------------------------------------------
* 其捞瘤
-------------------------------------------------------------------------------------------------*/
szCount = query1;
pstmt = con.prepareStatement(szCount);
pageset = pstmt.executeQuery();
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"));//瘤沥等 其捞瘤 焊咯林扁
absolutepage=(pageNUM-1)*pagesize+1;
}
/*------------------------------------------------------------------------------------------------
* 匙 name 啊廉坷促
-------------------------------------------------------------------------------------------------*/
sql = "select nickname from GT_user_info WITH (READUNCOMMITTED) where phonenum = '"+mphone+"'";
pstmt = con.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next()){
name = rs.getString("nickname");
}
%>
<html>
<head>
<link href="http://entaz.mugeta.com/client/mugeta_v2_test/web/user/mobile.css" rel="stylesheet" type="text/css">
<title>权> <%=name %>丛狼 迄乔 > 家匡皋捞飘 > 鸥肺痢</title>
</head>
<body>
<table width="176" border="0" cellspacing="0" cellpadding="0">
<!--鸥捞撇 矫累-->
<tr>
<td>
<table width="176" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" height="2" bgcolor="#c789ff"></td>
</tr>
<tr>
<td width="6" height="14" bgcolor="#9819e9"></td>
<td height="14" bgcolor="#9819e9"><font color="#ffffff">鸥肺痢 毫林扁</font></td>
</tr>
<tr>
<td colspan="2" height="2" bgcolor="#c789ff"></td>
</tr>
<tr>
<td colspan="2" height="1" bgcolor="#9819e9"></td>
</tr>
</table>
</td>
</tr>
<!--鸥捞撇 场-->
<!--咯归 矫累-->
<tr>
<td height="4"></td>
</tr>
<!--咯归 场-->
<tr>
<td>
<!--捞傈/促澜 傅农 冠胶 矫累-->
<table width="176" bgcolor="#c789ff" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#e8f2f2" align="center">
<%
pageurl=url_path+"/soulmate/questionself.jsp?mphone="+mphone;
out.println(pagePath(pageurl, dbcount, pageNUM, pagecount));
%>
</td>
</tr>
</table>
<!--捞傈/促澜 傅农 冠胶 场-->
</td>
</tr>
<!--咯归 矫累-->
<tr>
<td height="4"></td>
</tr>
<!--咯归 场-->
<%
if(questionCount == 0){
%>
<tr>
<td>
<table width="176" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><font color="#545454">钎矫且 郴侩捞 绝嚼聪促.</font></td>
</tr>
</table>
</td>
</tr>
<%}else{
// query2 ="SELECT U.nickname,U.sex,T.text,T.comment,T.idx,U.year ,TC.phonenum "+
// " FROM GT_USER_INFO U LEFT JOIN GT_LUCKY_TARO T ON convert(bigint,U.phonenum) = T.phonenum LEFT JOIN GT_LUCKY_TARO_COMMENT TC ON T.idx = TC.taro_idx "+
// " WHERE U.phonenum = '"+mphone+"' "+
// "ORDER BY T.regdate DESC,TC.regdate DESC ";
query2 = "SELECT U.nickname,U.sex,T.text,T.comment,T.idx,U.year ,TC.phonenum " +
" FROM GT_USER_INFO U WITH (READUNCOMMITTED) LEFT JOIN GT_LUCKY_TARO_COMMENT TC WITH (READUNCOMMITTED) "+
" ON convert(bigint,U.phonenum) = TC.phonenum LEFT JOIN GT_LUCKY_TARO T WITH (READUNCOMMITTED)"+
" ON T.idx = TC.taro_idx "+
" WHERE U.phonenum = TC.phonenum "+
" AND T.phonenum= '"+mphone+"'"+
"ORDER BY T.regdate DESC,TC.regdate DESC ";
pstmt = con.prepareStatement(query2);
rs = pstmt.executeQuery();
if(!rs.next()) // 蔼捞 绝阑锭
{
isNoPage = 1;
pagesize=0;
}
else // 蔼捞 乐阑锭 //rs.absolute(absolutepage);
{
for(int s=0; s<absolutepage-1; s++)
rs.next();
}
int count = 0 ;
while(count<pagesize)
{
count++;
username = rs.getString("nickname");
sex = rs.getInt("sex");
text = rs.getString("text");
comment = rs.getInt("comment");
idx = rs.getInt("idx");
age = (now - rs.getInt("year"))+1 ;
otherPhone = rs.getString("phonenum");
%>
<tr>
<td>
<!--龙巩郴侩 冠胶1 矫累-->
<table width="176" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4"></td>
<%
if (sex == 1){
%>
<td valign="top"><font color="#545454"><%=username%> 丛</font></td>
<td align="right" width="54"><font color="#909090">咯己(<%=age %>技)</font></td>
<%
}else{
%>
<td valign="top"><font color="#545454"><%=username%> 丛</font></td>
<td align="right" width="54"><font color="#909090">巢己(<%=age %>技)</font></td>
<%
}
%>
<td width="4"></td>
</tr>
<tr>
<td width="4"></td>
<td colspan="2" align="right"><font color="#ff6c78">(翠函肯丰)</font></td>
<td width="4"></td>
</tr>
<tr>
<td width="4"></td>
<td colspan="2"><input type="hidden" name ="idx" value="<%=idx%>"/><a href="<%=url_path%>/soulmate/answerDetail.jsp?mphone=<%=mphone%>&gphone=0<%=otherPhone%>&idx=<%=idx%>"><font color="#c789ff"><%=text%></font></a></td>
<td width="4"></td>
</tr>
<!--备盒 扼牢 矫累-->
<tr>
<td width="4"></td>
<td align="center" colspan="2">
<font color="#d5d1be" size="3" align="center">··························</font>
</td>
<td width="4"></td>
</tr>
<!--备盒 扼牢 场-->
</table>
<!--龙巩郴侩 冠胶1 场-->
</td>
</tr>
<%
if(rs.isLast())
{ //盖 付瘤阜 饭内靛 老版快
break;
}
else
{
rs.next();
}
}
}
%>
<tr>
<td>
<!--其捞瘤 傅农 矫累-->
<table width="176" height="16" bgcolor="#e8f2f2" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="16" colspan="6" bgcolor="#e8f2f2" valign="bottom" align="center">
<%//其捞瘤 备泅何
int limit = 5 ; //其捞瘤 府胶飘 俺荐 瘤沥
int temp =(pageNUM-1) % limit ; //矫累 其捞瘤 备窍扁
int startPage = pageNUM - temp;
%>
<%// [捞傈] 傅农 眠啊窍扁
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>
</table>
<!--其捞瘤 傅农 场-->
</td>
</tr>
<!--咯归 矫累-->
<tr>
<td height="5"></td>
</tr>
<!--咯归 场-->
<!--滚瓢 矫累-->
<tr>
<td>
<table width="176" height="16" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
<td width="55" height="16" bgcolor="#c789ff" align="center"><a href="<%=url_path%>/soulmate/MySoulmate.jsp?mphone=<%=mphone%>&gphone=<%=mphone%>"><font color="#ffffff">倒酒啊扁</font></a></td>
<td></td>
</tr>
</table>
</td>
</tr>
<!--滚瓢 场-->
<!--咯归 矫累-->
<tr>
<td height="11"></td>
</tr>
<!--咯归 场-->
<!--窍窜 版肺钎矫 矫累-->
<%
String step1=url_path+"/main.jsp?mphone="+mphone+"&gphone="+gphone;//权
String step2=url_path+"/mypage/my_confirm.jsp?mphone="+mphone+"&gphone="+gphone;
String step3=url_path+"/soulmate/Soulmate_zp.jsp?mphone="+mphone+"&gphone="+gphone;
%>
<tr>
<td>
<table width="176" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10" bgcolor="#BBC7C8"></td>
<td width="156" bgcolor="#DAE6E8" height="15"> <a href="<%=step1%>">权</a>><a href="<%=step2%>"><b><%=name%></b> 丛狼 迄乔</a></td>
<td width="10" bgcolor="#BBC7C8"></td>
</tr>
<tr>
<td width="10" bgcolor="#BBC7C8"></td>
<td width="156" bgcolor="#DAE6E8" height="15"> ><a href="<%=step3%>">家匡皋捞飘</a>>鸥肺痢</td>
<td width="10" bgcolor="#BBC7C8"></td>
</tr>
</table>
</td>
</tr>
<!--窍窜 版肺钎矫 场-->
</table>
<!--窍窜 版肺钎矫 矫累-->
<%@ include file="../newbottom.jsp"%>
<!--窍窜 版肺钎矫 场-->
</body>
</html>
<%
}
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 es){}
if(stmt != null) try{stmt.close();}catch(Exception es){}
if(con != null) try{con.close();}catch(Exception es){}
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -