|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
手机用到的是用j2me所编出来的小程序。js|程序|分页<%@pagecontentType="text/html;charset=gb2312"language="java"%>
<%@pageimport="java.util.*"%>
<%@pageimport="java.io.*"%>
<%@pageimport="java.sql.*"%>
<html>
<head>
<title>教员信息查询</title>
<styletype="text/CSS">
<!--
.style1{
font-family:"汉文行楷";
color:#FFFFFF;
}
-->
</style>
<linkhref="default.css"rel="stylesheet"type="text/css">
<styletype="text/css">
<!--
.style6{
color:#000000;
font-size:24px;
}
.style9{font-size:24px}
-->
</style>
</head>
<bodybgcolor="#ffffff">
<%session.getAttribute("a_name");%>
<h1align="center"class="style1style6style9">教员信息查询</h1>
<hr/>
<jsp:useBeanid="tmessgeBean"scope="page"class="computer.sqlbean"/>
<tablewidth="100%"border="0"cellpadding="0"cellspacing="0">
<tralign="center"bgcolor="#00FFFF">
<tdcolspan="5"bgcolor="#666666"class="style4"><divalign="right"><ahref="index.html">前往首页</a></div></td>
</tr>
<tralign="center"bgcolor="#999999">
<tdclass="style4">教号</td>
<tdclass="style4">姓名</td>
<tdclass="style4">系别</td>
<tdclass="style4">专业</td>
<tdclass="style4">操纵选项</td>
</tr>
<%
request.setCharacterEncoding("gb2312");
intnowPages;//以后页
intpages;//哀求页数
intcountPerPage=10;//每页显现条数
intpageCount;//总页数
intrecordCount=tmessgeBean.getCounter("selectcount(*)fromdysf_teacher");
pageCount=(int)Math.ceil((recordCount+countPerPage-1)/countPerPage);//算出总页数
if(request.getParameter("pages")==null){
pages=1;
}else{
pages=newInteger(request.getParameter("pages")).intValue();
}
if(pages>pageCount){
nowPages=1;
}else{
nowPages=pages;
}
ResultSetrs=tmessgeBean.executeQuery("Selecttop"+countPerPage+"*fromdysf_teacherwhereidnotin(selecttop"+(nowPages-1)*countPerPage+"idfromdysf_teacherorderbyiddesc)orderbyiddesc");
while(rs.next()){
StringID=rs.getString("id");
Stringtdepartment=rs.getString("department");
Stringtspecial=rs.getString("special");
Stringtname=rs.getString("name");
%>
<tr>
<tdwidth="20%"align="center"><%=ID%></td>
<tdwidth="20%"><divalign="center"></div>
<divalign="center"><%=tname%></div></td>
<tdwidth="20%"><divalign="center"></div>
<divalign="center"><%=tdepartment%></div></td>
<tdwidth="20%"><divalign="center"></div>
<divalign="center"><%=tspecial%></div></td>
<tdalign="center"><ahref="atdelete.jsp?ID=<%=ID%>">删除</a></td>
</tr>
<%
}
rs.close();
%>
<tralign="right">
<tdcolspan="5">共有<fontcolor=red><%=recordCount%></font>笔记录以后<fontcolor=red><%=nowPages%>/<%=pageCount%></font>页
<%if(pageCount>1){%>
<%if(pages>1){%>
<ahref="">首页</a>
<%}if(pages<pageCount){%>
<ahref="?pages=<%=nowPages+1%>">下一页</a>
<%}if(pages!=1){%>
<ahref="?pages=<%=nowPages-1%>">上一页</a>
<%}%>
<ahref="?pages=<%=pageCount%>">尾页</a>
<%}%>跳转到
<selectname="pages">
<%for(inti=1;i<=pageCount;i++){%>
<optionvalue="<%=i%>"<%if(nowPages==i){%>selected<%}%>><%=i%></option>
<%}%>
</select>页</td>
</tr>
</table>
<hr/>
</body>
</html>
微软什么都提供了。你可以试想一下,如果你是新手,你是希望你点一下按钮程序就能运行那,还是想自己一点一点的组织结构,然后打包发部,调错再打包...... |
|