?? mailbox.jsp
字號:
<% String puid= (String) session.getValue("puid");
if((puid==null)|(puid=="")){
out.print("<SCRIPT language=JavaScript>alert('操作超時,請重新登錄!');");
out.print("this.location.href='../default.jsp';</SCRIPT>");
}
%>
<%@ include file="../conn.jsp"%>
<%request.setCharacterEncoding("GB2312");
String uname= (String) session.getValue("puid");
if(request.getParameter("del")!=null)
{stmt.executeUpdate("delete from scott.pmailbox where id='"+request.getParameter("del")+"'");
}
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../inc/index.css" type="text/css">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>天天人才—>站內(nèi)信箱</title>
</head>
<SCRIPT language=JavaScript src="../inc/window.js"></SCRIPT>
<body topmargin="0" leftmargin="0">
<%@ include file="../inc/top2.htm"%>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="780" height="358">
<tr>
<td width="778" height="18" valign="top" colspan="5" bgcolor="#5388C1">
</td>
</tr>
<tr>
<td width="139" valign="top" bgcolor="#5388C1" height="176">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="118" height="280">
<tr>
<td width="100%" height="163" background="../images/stat-bg.GIF" valign="top">
<p align="center"><br>
<a href="main.jsp">登錄首頁</a><br>
<br>
<a href="register.jsp">登錄求職簡歷</a><br>
<br>
<a href="modify.jsp">更新求職簡歷</a><br>
<br>
<a href="../changepwd.jsp?stype=person" target="_blank">修改登錄密碼</a><br>
<br><a href="search.jsp">全部職位列表</a>
</td>
</tr>
<tr>
<td width="100%" height="117" background="../images/stat-bg.GIF" valign="top">
<p align="center"><br>
<br><a href="favorite.jsp">我的收藏夾</a><br>
<br>
<a href="mailbox.jsp">我的信箱</a><br>
<br>
<a href="../exit.jsp">退出登錄</a>
</td>
</tr>
</table>
</div>
<p align="center"> </p>
<p align="center">
</td>
<td width="20" height="284" valign="top"><img border="0" src="../images/selfk.GIF"></td>
</center>
<td width="484" height="284" valign="top">
<% int intPageSize;
int intRowCount;//記錄總數(shù)
int intPageCount;//總頁數(shù)
int intPage;//頁面參數(shù)
String strPage;//定義變量用來傳遞page
int i,j;
intPageSize=5;//定義每頁顯示5條記錄
strPage=request.getParameter("page");//取得當(dāng)前的頁碼
if(strPage==null){//判斷初始頁面,如果沒有顯示記錄,就置為第一頁
intPage=1;
}else{
intPage=Integer.parseInt(strPage);//將strPage轉(zhuǎn)化為整數(shù)
if(intPage<1) intPage=1;
}
String sqlname;
sqlname="select count(id) from scott.pmailbox where reid='"+uname+"' order by id desc" ;
ResultSet rt=stmt.executeQuery(sqlname);
rt.next();
intRowCount=rt.getInt(1);//取得整數(shù)保存與intRowCount變量中
intPageCount=(intRowCount+intPageSize-1)/intPageSize;//計算出總頁數(shù)(記錄總數(shù)+每頁顯示的記錄-1)/每頁顯示的記錄)
if(intPage>intPageCount)
intPage=intPageCount;
sqlname="select * from scott.pmailbox where reid='"+uname+"' order by id desc" ;
ResultSet rs=stmt.executeQuery(sqlname);//執(zhí)行sql,按照時間先后排序顯示
i=(intPage-1)*intPageSize;
if(intRowCount==0){
out.print("<SCRIPT language=JavaScript>alert('對不起,你的信箱內(nèi)暫無信件!');");
out.print("javascript:history.go(-1)</SCRIPT>");
}else{
%>
<div align="left">
<table border="1" cellpadding="0" cellspacing="0" width="477" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
<tr>
<td height="1" colspan="6" valign="bottom" width="473"><font color="#000000"> </font></td>
</tr>
<tr>
<td width="473" height="6" colspan="6" valign="bottom"><font color="#000000"> </font><font color="#000000">
您的信箱內(nèi)共有[<font color="#ff0000"><%=intRowCount%></font>]封站內(nèi)信件 </font></td>
<tr>
<td height="3" valign="top" colspan="6" bgcolor="#000000" width="473">
</td>
</tr>
<tr>
<td width="42" height="18" bgcolor="#EBEEF3" valign="bottom">
<p align="center">新郵件</p>
</td>
<td width="103" height="18" bgcolor="#EBEEF3" valign="bottom"> 發(fā)信單位</td>
<td width="119" height="18" bgcolor="#EBEEF3" valign="bottom"> 標(biāo) 題</td>
<td height="18" bgcolor="#EBEEF3" valign="bottom" width="127"><p align="center">發(fā)信時間</p></td>
<td height="18" bgcolor="#EBEEF3" valign="bottom" width="36">
<p align="center">回復(fù)</td>
<td height="18" bgcolor="#EBEEF3" valign="bottom" width="36">
<p align="center">刪除</td>
</tr>
<%
i=0;
while(i<intPageSize && rs.next()){
%>
<tr>
<td width="42" height="18" bgcolor="#EBEEF3" valign="bottom">
<p align="center">
<%String newmail="0";
if(newmail.equals(rs.getString("newmail")))
{ %>
<font color="#000080">new</font>
<% } %>
</td>
<td width="103" height="18" bgcolor="#EBEEF3" valign="bottom"> <a href="javascript:openwin('../company.jsp?uid=<%=rs.getString("senduid")%>','top=10,left=300,width=460,height=420')"><%=rs.getString("sendname")%></a></td>
<td width="119" height="18" bgcolor="#EBEEF3" valign="bottom"> <a href="javascript:openwin('viewmail.jsp?id=<%=rs.getString("id")%>','top=10,left=300,width=460,height=420')"><%=rs.getString("title")%></a></td>
<td width="127" height="18" bgcolor="#EBEEF3" valign="bottom"><p align="center"><%=rs.getString("sdate")%></p></td>
<td width="36" height="18" bgcolor="#EBEEF3" valign="bottom">
<p align="center"><a href="javascript:openwin('sendmail.jsp?reid=<%=rs.getString("senduid")%>','top=20,left=200,width=450,height=400')"><font color="#000060">回復(fù)</font></a>
</td>
<td width="36" height="18" bgcolor="#EBEEF3" valign="bottom">
<p align="center"><a href="mailbox.jsp?del=<%=rs.getString("id")%>">
<font color="#000060">刪除</font></a></td>
</tr>
<% i++;//通過I循環(huán)設(shè)置每頁的頁數(shù)
} %>
<tr>
<td height="3" valign="top" colspan="6" bgcolor="#000000" width="473">
</td>
</tr>
<tr>
<td width="473" height="8" valign="bottom" colspan="6"><br>
<p align="center"> <% for(j=0;j<i;j++)
rs.next();
%>
<%-- 設(shè)置intPage參數(shù) --%>
<FORM action=index.jsp method=POST>
<p align='center' vAlign='bottom'>
第<%=intPage%>頁 共<%=intPageCount%>頁
<%if(intPage<intPageCount){%>
<a href="mailbox.jsp?page=<%=intPage+1%>%>">下一頁</a>
<%}%>
<%if(intPage>1){%>
<a href="mailbox.jsp?page=<%=intPage-1%>">上一頁</a>
<%}%>
</form>
</td>
</tr>
</table>
</div>
</td>
<center>
<td width="1" height="284" valign="top" bgcolor="#00006A"></td>
<td width="126" height="284" valign="top" bgcolor="#F3F3F3"></td>
</tr>
<tr>
<td height="1" valign="top" colspan="5" bgcolor="#5388C1" width="778">
<p align="center"> </td>
</tr>
</center>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="780" height="1">
<tr>
<td width="743" height="3" valign="top">
<p align="center">
</td>
</tr>
<tr>
<td width="743" height="1" valign="top">
<p align="center"><script language="javascript" src="../inc/copyright.js"></script>
</td>
</tr>
<tr>
<td width="743" height="3" valign="top">
</td>
</tr>
</table>
<%}%>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -