⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 selectsort.jsp

📁 新闻系统
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.util.List"%>
<%@ page import="com.actionForm.SortForm"%><jsp:useBean id="chinese" scope="request" class="com.tool.Chinese"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>宇晨网络新闻中心后台</title>
<script language="javascript">
function deleteForm(date1,date2){
if(confirm("您真的要删除吗?")){
window.location.href="sortAction.do?method=deleteSortAction&bigSort="+date1+"&id="+date2;
}
}
</script>
</head>
<%
String bigSort=chinese.toChinese(request.getParameter("bigSort"));
List list=(List)request.getAttribute("list");
int number=list.size();
//以下这段代码是计算多少页数
int pageNumber=number;
if(pageNumber%10==0){
pageNumber=pageNumber/10;
}else{
pageNumber=pageNumber/10+1;
}
//以下是计算当前页的页数
int count;
if(request.getParameter("count")==null){
count=0;
}else{
count=Integer.valueOf(request.getParameter("count"));
}
//以下显示多少条纪录
int start=count*10;//开始条数
int over=(count+1)*10;//结束条数
int lastCount=number-over;//还剩多少条记录
 if(lastCount<=0){
  over=number;
  }
%>
<body><div align="center">
<jsp:include page="../bTop.jsp"/>
<table width="800" height="465" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="196" rowspan="2" valign="top"><jsp:include page="../bleft.jsp"/></td>
    <td width="604" height="57" background="bImage/place.jpg" >
      <table width="601" height="36" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td>&nbsp;&nbsp;&nbsp;当前位置提示&nbsp;&gt;&gt;&nbsp;<%=bigSort%>&nbsp;&gt;&gt;&nbsp;详细类别管理</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td height="400" align="center" valign="top" background="bImage/big.jpg"><table width="601" border="0" cellpadding="0" cellspacing="0" background="bImage/placeNext.jpg">
      <tr>
        <td height="21" >&nbsp;</td>
        <td>新闻类别查询</td>
      </tr>
    </table>
	  <%if(number==0){%>
	  <br>
	  <br>
	  没有新闻详细类别!!!<br>
	  <br>
	  <br>
      <a href="sortAction.do?method=insertSortAction&bigSort=<%=bigSort%>">添加</a>&nbsp;&nbsp;&nbsp;或者&nbsp;&nbsp;&nbsp;<a href="newsAction.do?method=selectNewsAction&bigSort=<%=bigSort%>">返回</a>
      <%}else{%>
      <table width="415" border="0">
        <tr align="right">
          <td><a href="newsAction.do?method=selectNewsAction&bigSort=<%=bigSort%>">返回</a></td>
          <td width="76"> <a href="sortAction.do?method=insertSortAction&bigSort=<%=bigSort%>">添加类别</a> </td>
        </tr>
      </table>
      <table width="415" border="1" cellpadding="0" cellspacing="0">
        <tr>
          <td width="64" height="27"><div align="center">类别编号</div></td>
          <td width="150"><div align="center">名称</div></td>
          <td width="83"><div align="center">创建时间</div></td>
          <td width="108"><div align="center">操作</div></td>
        </tr>
        <%

  for(int i=start;i<over;i++){
  SortForm form=(SortForm)list.get(i);
  %>
        <tr align="center">
          <td width="64" height="31"><%=i+1%></td>
          <td width="150"><%=form.getSmallSort()%></td>
          <td width="83"><%=form.getCreateTime()%></td>
          <td width="108"><a href="sortAction.do?method=selectOneAction&smallSort=<%=form.getSmallSort()%>">修改</a>&nbsp;&nbsp;<a href="javascript:deleteForm('<%=bigSort%>','<%=form.getId()%>')">删除</a></td>
        </tr>
        <%}%>
      </table>
      <%}%>
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr align="center">
          <td width="578" height="37" >
            <%for(int i=0;i<pageNumber;i++){%>
            <%if(count==i){%>
            [<font color="#FF0000"><b><%=i+1%></b></font>]
            <%}else{%>
      [<a href="sortAction.do?method=selectSortAction&bigSort=<%=bigSort%>&count=<%=i%>"><b><%=i+1%></b></a>]
      <%}}%></td>
        </tr>
      </table></td>
  </tr>
</table>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -