📄 friendnewslist.jsp.svn-base
字号:
<%@ page import='java.io.*,java.text.*,java.util.Date,java.util.*, 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"%>
<%@ include file="appConstants.jsp"%>
<%@ include file="formatUtil.jsp"%>
<%@ include file="../makeKOR.jsp"%>
<%
String mphone= request.getParameter("mphone");
if (!mphone.isEmpty() && mphone != null)
mphone = getStrPhone(getLong(mphone));
String gphone= request.getParameter("gphone");
if (!gphone.isEmpty() && gphone != null)
gphone = getStrPhone(getLong(gphone));
/*------------------------------------------------------------------------------------------------------
+ 傈开 函荐
-------------------------------------------------------------------------------------------------------*/
String sql = null;
String strNickName = null;
String guestPhone = null;
String title = null;
int reCount = 0;
String regdate = null;
int tltleIdx = 0;
/*------------------------------------------------------------------------------------------------------
+ Page
-------------------------------------------------------------------------------------------------------*/
String pageurl = null;
// 其捞瘤 备泅 眠啊 函荐
int pagesize = 10; // 茄其捞瘤寸 10俺 免仿拱
// 傈开 函荐肺 急攫.. 其捞瘤 备泅 何盒俊 犁荤侩
int pageNUM = 1; // 其捞瘤 锅龋
int pagecount = 1 ; // 其捞瘤 肮荐 瘤沥 函荐
int absolutepage = 1; // 例措 困摹 其捞瘤 锅龋
int dbcount = 0; // DB 救俊 臂 肮荐 历厘 函荐
int isNoPage = 0; //茄俺档 绝蠢衬.. 绝栏搁0, 乐栏搁1
String strJSPLink = ""; //link jsp
/*------------------------------------------------------------------------------------------------------
+ DB 包访 函荐
-------------------------------------------------------------------------------------------------------*/
Connection con = null;
PreparedStatement pstmt = null;
PreparedStatement pstmt1 = null;
Statement stmt = null;
ResultSet rs = null;
ResultSet rs1 = null;
ResultSet rsDate = null;
/*--------------------------------------------------------------------------------
+ 郴啊 荤侩窍绰 函荐
---------------------------------------------------------------------------------*/
int iIdx = 0;
String strNewsTitle = "";
int iNewsReCnt = 0;
String strRegdate = "";
int iNewsKind = 0;
String strFriendPhone = "";
int iQueryType = 0;
int iCount = 0;
String strSql = "";
String nickName = "";
String strNewsKind = "";
String strPrintNewsTitle = ""; //臂 力格 (畴免窍绰)
// string蜡屈狼 辨捞
int cStringTypeLength = 0;
try
{
/*------------------------------------------------------------------------------------------------
* DB 目池记
-------------------------------------------------------------------------------------------------*/
%><%@ include file="../getConnection.jsp"%>
<%@ include file="bgColor.jsp"%>
<%
/*------------------------------------------------------------------------------------------------
* Host nickName
-------------------------------------------------------------------------------------------------*/
sql = "SELECT NICKNAME FROM GT_USER_INFO WITH (READUNCOMMITTED) WHERE PHONENUM = '" + gphone + "'";
pstmt = con.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
nickName = rs.getString("NICKNAME");
}
rs.close();
pstmt.close();
/*------------------------------------------------------------------------------------------------
* pageCount
-------------------------------------------------------------------------------------------------*/
sql = "SELECT COUNT(a.title) FROM (SELECT title, kind, recnt, regdate, phonenum, 1 q FROM GT_NSNEWS WITH (READUNCOMMITTED) ";
sql = sql + " UNION ALL SELECT title, kind, recnt, regdate, phonenum, 2 q FROM GT_NsQuiz WITH (READUNCOMMITTED) ";
sql = sql + " UNION ALL SELECT title, 0, provision1cnt + provision2cnt + provision3cnt + provision4cnt + provision5cnt recnt, regdate, phonenum, 3 q FROM GT_NsResearch WITH (READUNCOMMITTED) ";
sql = sql + " ) a , GT_friend b WITH (READUNCOMMITTED) WHERE b.phonenum = '"+ gphone +"' AND b.friend_flag = 1 ";
sql = sql + " and CONVERT(BIGINT, b.guest_phone) = a.phonenum ";
pstmt = con.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next()){
dbcount = rs.getInt(1); // 臂 醚 肮荐
rs.close();
pstmt.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;
}
/*------------------------------------------------------------------------------------------------
* Research Title List
-------------------------------------------------------------------------------------------------*/
sql = "SELECT a.* FROM (SELECT idx, title, kind, recnt, regdate, phonenum, 1 q FROM GT_NSNEWS WITH (READUNCOMMITTED) ";
sql = sql + " UNION ALL SELECT idx, title, kind, recnt, regdate, phonenum, 2 q FROM GT_NsQuiz WITH (READUNCOMMITTED) ";
sql = sql + " UNION ALL SELECT idx, title, 0, provision1cnt + provision2cnt + provision3cnt + provision4cnt + provision5cnt recnt, regdate, phonenum, 3 q FROM GT_NsResearch WITH (READUNCOMMITTED) ";
sql = sql + " ) a , GT_friend b WITH (READUNCOMMITTED) WHERE b.phonenum = '"+ gphone +"' AND b.friend_flag = 1 ";
sql = sql + " and CONVERT(BIGINT, b.guest_phone) = a.phonenum ORDER BY a.regdate DESC";
pstmt = con.prepareStatement(sql);
rs = pstmt.executeQuery();
if(!rs.next()) // 蔼捞 绝阑锭
{
isNoPage = 1;
pagesize=0;
}
else // 蔼捞 乐阑锭 //rs.absolute(absolutepage);
{
for(int s=0; s<absolutepage-1; s++)
rs.next();
}
%>
<html>
<head>
<title></title>
<link href="http://entaz.mugeta.com/client/mugeta_v2_test/web/user/mobile.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="176" border="0" cellspacing="0" cellpadding="0">
<!-- 鸥捞撇 矫累 -->
<tr>
<td>
<table width="176" border="0" cellspacing="0" cellpadding="0">
<tr height="19">
<td width="8" bgcolor="<%=mainBgColor%>"></td>
<td bgcolor="<%=mainBgColor%>"><font color="#ffffff">模备春胶格废</font></td>
</tr>
</table>
</td>
</tr>
<!-- 鸥捞撇 场 -->
<!-- 咯归 矫累 -->
<tr height="4">
<td></td>
</tr>
<!-- 咯归 场 -->
<!--捞傈/促澜 傅农 冠胶 矫累-->
<%
pageurl=url_path+"/news/friendNewsList.jsp?mphone="+mphone+"&gphone="+gphone;
String [] szSplit = pagePathTop(pageurl, dbcount, pageNUM, pagecount);
%>
<tr>
<td>
<table width="176" border="0" cellspacing="0" cellpadding="0" bgcolor="<%=pageBgColor %>">
<tr>
<td width="10"></td>
<td width="60" height="16" align="left"><font color="#676767" size="3">⒏ </font><font color="<%=pageFNFontColor %>" size="3">(7)</font><%=szSplit[0]%><b><font color="#ff6587" size="3">捞傈</font></b><%=szSplit[1]%></td>
<td></td>
<td width="60" height="16" align="right"><%=szSplit[2]%><b><font color="<%=pageFNFontColor %>" size="3">促澜</font></b><%=szSplit[3]%><font color="#ff8eab" size="3"> (9)</font><font color="#676767" size="3"> ⒑</font></td>
<td width="10"></td>
</tr>
</table>
</td>
</tr>
<!--捞傈/促澜 傅农 冠胶 场-->
<!--咯归 矫累-->
<tr>
<td height="4"></td>
</tr>
<!--咯归 场-->
<!-- 府敲 格废 矫累 -->
<tr>
<td>
<table width="176" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="2"></td>
<td>
<%
int count = 0 ; //其捞瘤 墨款磐 函荐
while(count<pagesize)
{
count++;
iIdx = rs.getInt("idx");
strNewsTitle = rs.getString("title");
iNewsReCnt = rs.getInt("reCnt");
strRegdate = rs.getString("regdate");
iNewsKind = rs.getInt("kind");
strFriendPhone = rs.getString("phonenum");
iQueryType = rs.getInt("q");
if (iQueryType == 1){
if (iNewsKind == 1)
strNewsKind = "[荤扒/荤绊]";
else if (iNewsKind == 2)
strNewsKind = "[瘤开]";
else if (iNewsKind == 3)
strNewsKind = "[楷抗/胶器明]";
else if (iNewsKind == 4)
strNewsKind = "[扁鸥]";
} else if (iQueryType == 2) {
if (iNewsKind == 1)
strNewsKind = "[郴秒氢]";
else if (iNewsKind == 2)
strNewsKind = "[郴厚剐]";
else if (iNewsKind == 3)
strNewsKind = "[郴己氢]";
else if (iNewsKind == 4)
strNewsKind = "[扁鸥]";
} else {
strNewsKind = "Q.";
}
cStringTypeLength = 15 - strNewsKind.length();
strPrintNewsTitle = cStringTypeLength < strNewsTitle.length() ? strNewsTitle.substring(0,cStringTypeLength) + "..." : strNewsTitle;
if (iQueryType == 3){
strJSPLink = "ResearchList.jsp";
%>
<font color="#716e63"> <%=strNewsKind%></font><a href="<%=url_path%>/news/<%=strJSPLink%>?mphone=<%=mphone%>&gphone=<%=strFriendPhone%>"><font color="#716e63"><%=strPrintNewsTitle%></font><font color="#ff4759"> [<%=iNewsReCnt%>] </font></a><br>
<% }
else {
if (iQueryType == 2)
strJSPLink = "myQuizList.jsp";
else
if (mphone.equals(strFriendPhone))
strJSPLink = "my_news_list_lhl.jsp";
else
strJSPLink = "other_news_list_lhl.jsp";
%>
<font color="<%=mainFontColor%>"> <%=strNewsKind%> </font><a href="<%=url_path%>/news/<%=strJSPLink%>?mphone=<%=mphone%>&gphone=<%=strFriendPhone%>"><font color="#716e63"><%=strPrintNewsTitle%></font><font color="#ff4759"> [<%=iNewsReCnt%>]</font></a><br>
<%}
if(rs.isLast())
{ //盖 付瘤阜 饭内靛 老版快
break;
}
else
{
rs.next();
}
}
%>
</td>
<td width="2"></td>
</tr>
</table>
</td>
</tr>
<!-- 府敲 格废 场 -->
<!--咯归 矫累-->
<tr>
<td height="4"></td>
</tr>
<!--咯归 场-->
<!--其捞瘤 傅农 矫累-->
<%
String [] szSplit2 = pagePathBottom(pageurl, dbcount, pageNUM, pagecount);
%>
<tr>
<td>
<table width="176" border="0" cellspacing="0" cellpadding="0" bgcolor="<%=pageBgColor %>">
<tr>
<td height="16">
<table width="176" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
<td width="21" align="center"><%=szSplit2[0]%><font color="#676767" size="3"><%=szSplit2[1]%></font><%=szSplit2[2]%></td>
<%
String pageColor = "";
for(int i=1;i<6;i++)
{
if(pageNUM%10 == Integer.parseInt(szSplit2[i*3+1]))
pageColor = pageFontColorY;
else
pageColor = pageFontColorN;
%>
<td width="1" align="center"><font color="<%=pageColor %>" size="3">|</font></td>
<td width="21" align="center"><%=szSplit2[i*3]%><font color="<%=pageColor%>" size="3"><b><%=szSplit2[i*3+1]%></b></font><%=szSplit2[i*3+2]%></td>
<%
}
%>
<td width="21" align="center"><%=szSplit2[18]%><font color="#676767" size="3"><%=szSplit2[19]%></font><%=szSplit2[20]%></td>
<td></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<!--其捞瘤 傅农 场-->
<!--咯归 矫累-->
<tr>
<td height="4"></td>
</tr>
<!--咯归 场-->
<% //String step1=url_path+"/main.jsp?mphone="+mphone+"&gphone="+gphone;//权
String returnMyphone=url_path+"/mypage/my_confirm.jsp?mphone="+mphone+"&gphone="+mphone;
String returnPhoneNews=url_path+"/news/NewsMain.jsp?mphone="+mphone+"&gphone="+gphone;
%>
<!-- 滚瓢 矫累 -->
<tr>
<td>
<table width="176" border="0" cellspacing="0" cellpadding="0">
<tr height="16">
<td></td>
<td width="65" bgcolor="<%=mainBgColor%>" align="center" ><a href="<%=returnPhoneNews%>"><font color="#ffffff">迄乔春胶肺</font></a></td>
<td width="2"></td>
<td width="65" bgcolor="<%=mainBgColor%>" align="center" ><a href="<%=returnMyphone%>"><font color="#ffffff">郴迄乔啊扁</font></a></td>
<td></td>
</tr>
</table>
</td>
</tr>
<!-- 滚瓢 场 -->
<!-- 咯归 矫累 -->
<tr height="11">
<td></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+"/news/NewsMain.jsp?mphone="+mphone+"&gphone="+gphone;
%>
<!--版肺钎矫 矫累-->
<tr>
<td>
<table width="176" border="0" cellspacing="0" cellpadding="0">
<tr height="15">
<td width="8" bgcolor="#BBC7C8"></td>
<td bgcolor="#DAE6E8">
<a href="<%=step1%>">权</a>><a href="<%=step2%>">硅萍丛狼迄乔</a>><a href="<%=step3%>">春胶</a>>眠玫春胶
</td>
<td width="8" bgcolor="#BBC7C8"></td>
</tr>
</table>
</td>
</tr>
<!--版肺钎矫 场-->
</table>
</body>
</html>
<%
}
catch(Exception e)
{
throw e;
}
finally
{
if ( rs != null ) { try { rs.close(); } catch ( Exception e ) { } }
if ( stmt != null ) { try { stmt.close(); } catch ( Exception e ) { } }
if ( con != null ) { try { con.close(); } catch ( Exception e ) { } }
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -