<%@ page contentType="text/html; charset=GB2312"
import="java.lang.*,
java.sql.*,
javax.sql.*,
java.util.ArrayList,
com.rjc.utility.*,
com.yn.test.ynutil0.*,
com.yn.test.ynutil.*"
%>
<html>
<head>
<link rel="stylesheet" href="../styles/style1.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<title>短信查询</title>
<script lang=javascript>
function setFocus(){
if(window.event.keyCode==13){
window.event.keyCode=9;
}
}
function init(){
}
function setsubmit(){
form1.submit();
}
function mouseOver(obj){
obj.style.backgroundColor="rgb(214,227,255)";
}
function mouseOut(obj){
obj.style.backgroundColor="#FFFFFF";
}
function bt_onclick(){
window.location.href="../note/addnotetxl.jsp";
}
</script>
</head>
<body οnlοad="init()" style="margin:2,0;border:0,0;overflow-x:hidden;overflow-y:hidden">
<%! int pageSize = 10;//每页显示的记录数
int pageCount = 0;//总页数
%>
<%
String username=(String)session.getAttribute("note_user");
String strGroup=(session.getAttribute("GROUP")==null)?"":session.getAttribute("GROUP").toString();
String strSwjgdm=(session.getAttribute("SWJGDM")==null)?"":session.getAttribute("SWJGDM").toString();
String strSwjgmc=(session.getAttribute("SWJGMC")==null)?"":session.getAttribute("SWJGMC").toString();
Connection con=null;
Statement stmt=null;
ResultSet rs=null;
try {
DataSource ds=null;
if(application.getAttribute("DS_ELECTAX")!=null){
ds=(DataSource)application.getAttribute("DS_ELECTAX");
}else{
System.out.println("DataSource is null!");
return;
}
con=ds.getConnection();
stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
%>
<%
String sql="",fszt="",jszt="",fssjq="",fssjz="";
sql=" select a.note_fshm,to_char(a.note_fssj,'YYYY-MM-DD HH24:MI:SS'),b.sendstate_mc,a.note_nr from note_info a,note_sendstate b "
+"where a.sendstate_dm=b.sendstate_dm and a.note_fshm='"+username+"'";
/**
fssjq=request.getParameter("fssjq");
if(fssjq.compareTo("")==0){
sql+="";
}else{
sql+=" and to_date(to_char(a.note_fssj,'yyyy-mm-dd'),'yyyy-mm-dd')>=to_date('"+fssjq+"','yyyy-mm-dd')";
}
fssjz=request.getParameter("fssjz");
if(fssjz.compareTo("")==0){
sql+="";
}else{
sql+=" and to_date(to_char(a.note_fssj,'yyyy-mm-dd'),'yyyy-mm-dd')<=to_date('"+fssjz+"','yyyy-mm-dd')";
}
**/
System.out.println(sql);
rs=stmt.executeQuery(sql);
rs.last(); //让游标到表中的最后一行
int rowCount=rs.getRow(); //获取记录总数.
//总页数的计算公式
pageCount=(rowCount%pageSize==0)?(rowCount/pageSize):(rowCount/pageSize+1);
int showPage = 1;//当前页
%>
<%
//取得用户所指定的页
String goToPage = request.getParameter("showPage");
if (goToPage == null){
goToPage = "1";
}
//转换成整形
try{
showPage = Integer.parseInt(goToPage);
}
catch (NumberFormatException ex){
showPage = 1;
}
//当前页小于等于第一页 则按第一页算 如果 当前页大于等于总页数则为最后页
if(showPage <=1){
showPage = 1;
}
else if(showPage >= pageCount){
showPage = pageCount;
}
//游标的位置 (当前页 - 1) * 页面大小 + 1
int posion = (showPage -1 ) * pageSize + 1;
//设置游标的位置
rs.absolute(posion);
%>
<br>
<table width="98%" border="0" cellspacing="1" cellpadding="3" align="center">
<tr>
<td width="100%" align=center>
<table width="466" border="0" cellspacing="1" cellpadding="0">
<tr>
<td width="32"><img src="../image/querry.gif"></td>
<td width="372" valign="bottom">
<table border="0" cellspacing="2" cellpadding="0">
<tr>
<td align="left" valign="bottom" width="180" style="font-family:华文新魏;font-size:24px;color:rgb(123,154,242);">短信查询</td>
<td width="20"><img src="../image/p_point03.gif" width="20" height="20"></td>
<td width="20"><img src="../image/p_point03.gif" width="20" height="20"></td>
<td width="20"><img src="../image/p_point03.gif" width="20" height="20"></td>
<td width="20"><img src="../image/p_point03.gif" width="20" height="20"></td>
<td width="20"><img src="../image/p_point03.gif" width="20" height="20"></td>
<td width="20"><img src="../image/p_point03.gif" width="20" height="20"></td>
<td width="20"><img src="../image/p_point03.gif" width="20" height="20"></td>
<td width="20"><img src="../image/p_point03.gif" width="20" height="20"></td>
<td width="20"><img src="../image/p_point03.gif" width="20" height="20"></td>
<td width="20"><img src="../image/p_point03.gif" width="20" height="20"></td>
<td width="20"><img src="../image/p_point03.gif" width="20" height="20"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="98%" border="0" cellspacing="1" cellpadding="0" align="center">
<tr>
<td width="100%">
<div style="font: bold 14px/20px;font-family:Arial;color: #8CAAE7;background-color: #8CAAE7;width: 98%;padding-top: 2px;padding-Left: 10px;margin-bottom:5px;"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<table border="0" cellspan="0" style="border-collapse:collapse" bordercolor="#799ae1" width="508" height="20">
<tr>
<td style="FONT-FAMILY: Verdana;font-weight:bold;font-size:12px;"><%=username %>您当前的位置: 短信平台业务 >> 短信查询</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" >
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="right">
<tr bgcolor="#ffffff" align="right"><td colspan="3" valign=center align="right">
<form method="post" name="form1" action="notequerry.jsp">
<!-- 从<input type="text" name="fssjq" value="" width="10">至<input type="text" name="fssjz" value="" width="10"> -->
发送状态:
<select name="fszt">
<option value=""></option>
<option value="1">发送成功</option>
<option value="0">发送失败</option>
<option value="-1">未返回结果</option>
</select>
<input type="submit" name="submit" value="查询" class="buttonx4">
</form>
</td></tr>
</table>
</td>
</tr>
<tr bgcolor="">
<td colspan="0">
<table width="100%" align="center" border=0 cellspacing="1" cellpadding="0" bordercolordark="#88a6dd" bordercolorlight="#88a6dd" bgcolor="#88a6dd" style="cursor:hand" >
<tr>
<td colspan="2"></td>
</tr>
<tr bgcolor="#fffdc8" height=24>
<th width="10%">手机号码</th>
<th width="20%">发送时间</th>
<th width="10%">是否成功</th>
<th width="60%">发送内容</th>
</tr>
<%
int i =0;
//循环显示表中的数据 pageSize(每页所显示的记录)
//rs.isAfterLast() 游标是否在最后一行之后 说明后面已经没记录
while(i<pageSize && !rs.isAfterLast()){
%>
<tr BGCOLOR="#FFFFFF" height="18" οnmοuseοver="mouseOver(this)" οnmοuseοut="mouseOut(this)" οnclick="mouseClick(this)">
<td><%=rs.getString(1)%></td>
<td><%=rs.getString(2)%></td>
<%
String strfszt=(rs.getString(3)==null)?"--":rs.getString(3).trim();
%>
<td><%=com.yn.test.ynutil0.gb2312ToUnicode(strfszt)%></td>
<%
String strnotenr1=(rs.getString(4)==null)?"--":rs.getString(4).trim();
%>
<td>
<%
String strnotenr=(rs.getString(4)==null)?"--":rs.getString(4).trim();
strnotenr=new String(strnotenr.getBytes("ISO-8859-1"),"GB2312");
strnotenr=new String(strnotenr);
out.print(strnotenr);
%>
</td>
<% rs.next();
i++;
}
%>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="0">
<table width="100%" align="right">
<tr align="right">
<td>
<%if(showPage < pageCount){%>
<a href="notequerry.jsp?showPage=<%=showPage+1%>">[下一页]</a>
<%}%>
<%if(showPage > 1){%>
<a href="notequerry.jsp?showPage=<%=showPage-1%>">[上一页]</a>
<%}%>
共<%=pageCount%>页
当前第<%=showPage%>页
<a href="notequerry.jsp?showPage=1">『首页』</a>
<a href="notequerry.jsp?showPage=<%=pageCount%>">『尾页』</a>
共<%=rowCount%>条记录
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
rs.close();
stmt.close();
con.close();
}catch(Exception ex) {
out.println(ex.toString());
out.println("操作超时或查询条件设置有误,请重新查询!");
}
%>
</body>
</html>