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

📄 list.jsp

📁 struts+spring+hibernate新闻管理
💻 JSP
字号:

<%@ page language="java" import="model.*,java.util.*" pageEncoding="gbk"%>
<HTML><HEAD><TITLE>用户管理系统</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="\hiber\images\SystemStyle.css" type=text/css rel=stylesheet>
<script language="JavaScript" src="/hiber/images/datetime.js"></script>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
<%@ taglib uri="../show.tld" prefix="llb" %>
<%
    	if(request.getSession().getAttribute("uname")==null) response.sendRedirect("/hiber/login.jsp");
		request.setCharacterEncoding("gbk");
		String nn=request.getParameter("name");
		String dn=request.getParameter("dname");
		if(nn==null) nn="";
		//System.out.println(nn);
		//System.out.println("jsb"+dn);
        //System.out.println(al.size());
		int curPage= Integer.parseInt((String)request.getAttribute("page"));
		int rowCount= Integer.parseInt((String)request.getAttribute("rowCount"));
		int pageCount= Integer.parseInt((String)request.getAttribute("pageCount"));
%>

<META content="MSHTML 6.00.2900.2769" name=GENERATOR></HEAD>
<body background="/hiber/images/back.gif">
<FORM name=Form1 action="/hiber/news.do?method=list_k&op=que" method=post>
<TABLE cellSpacing=3 cellPadding=0 width=760 align=center border=0>
  <TBODY>
  <TR>
    <TD>
      <TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
        <TBODY>
        <TR>
          	<TD height=25 class=xiangdao align=center><llb:show/>管理
			</TD>
        </TR>
        <TR><TD height=10>&nbsp;</TD></TR>
        <TR><TD style="font-size:16px">
			<table border="1" bordercolor="#7FB0DE" align="center" bordercolordark="#ffffff"
				cellpadding="3" cellspacing="0" width="80%" style="font-size:13px">
						<tr>
							<td colspan="2"><div align="center">查询条件</div></td>
						</tr>
						<tr>
							<td align="right">标题:</td>
							<td><input type="text" name="titleNews" value="<%=request.getAttribute("titleNews")%>" size=50></td>
						</tr>
						<tr>
						  <td align="right">发布时间:</td>
						  <td>从
						    <input type="text" name="beginTime" value="<%=request.getAttribute("beginTime")%>" onClick="SelectDate(this,'yyyy-MM-dd')" readonly="readonly">
<input type="text" name="endTime" value="<%=request.getAttribute("endTime")%>" onClick="SelectDate(this,'yyyy-MM-dd')" readonly="readonly"></td>
					  </tr>
							
						<tr>
							<td colspan="2" align="center">
								<INPUT class=button1 type="submit" value="查询">&nbsp;&nbsp;
								<input class=button1 type="reset" value="重置"/></td>
						</tr>				
					</table></TD></TR>
        <TR><TD height=10>&nbsp;</TD></TR>
		<TR align="right"><TD>
        <INPUT class=button1 type="button" value=添加 onClick="ad(document.Form1)" name=add> 
		<INPUT class=button1 type=button value=删除 name=delete onClick="de(document.Form1)"> </TD></TR>
        <TR><TD height=5></TD></TR>
        <TR align=middle>
          <TD>
            <TABLE class=tab2 cellSpacing=0 width="100%">
              <TBODY>
              <TR align=center>
                <TD vAlign=bottom width=20% height=15><B>期数</B></TD>
                <TD vAlign=bottom width=20% height=22><B>开奖日期</B></TD>
                <TD vAlign=bottom width=40% height=22><B>开奖号码</B></TD>
                <TD vAlign=bottom width=10% height=22><B>修改信息</B></TD>
                <TD vAlign=bottom width=10% height=22><B>删除</B><input type=checkbox onclick='sele(this)'></TD></TR>
              <TR>
                <TD align=middle colSpan=9>
                  <HR noShade SIZE=1>                </TD></TR>
		 <logic:iterate id="value1" name="list">
              <TR onMouseOver="this.bgColor='#C1CDD8'" 
              onmouseout="this.bgColor='#FFF7E5'" bgColor=#fff7e5>
                <TD align=left><bean:write name='value1' property='newsTitle'/></TD>
                <TD align=center><bean:write name='value1' property='newsDate'/></TD>
                <TD align=center><bean:write name='value1' property='newsContent'/></TD>
                <TD align=center><INPUT class=button1 onclick=Update("<bean:write name='value1' property='id'/>") type=button value=修改></TD>
                <TD align=center width=60><INPUT type=checkbox name=chk value="<bean:write name='value1' property='id'/>"></TD></TR>
		 </logic:iterate>
              <TR>
                <TD align=middle colSpan=9>
                  <HR noShade SIZE=1>                </TD></TR>
              <tr>
                <td colspan="4">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr style="font-size:12px" height="22">
    <td ><%=curPage%>/<%=pageCount%>页 共:<%=rowCount%>条</td>
    <td align="center">
      <%=(curPage>1)?"<a href='javascript:goPage(1)'>首页</a> | <a href='javascript:goPage("+(curPage-1)+")'>上页</a>":"首页 | 上页"%> |
      <%=(curPage<pageCount)?"<a href='javascript:goPage("+(curPage+1)+")'>下页</a> | <a href='javascript:goPage("+pageCount+")'>末页</a>":"下页 | 末页"%>    </td>   
    <td align="right" valign="top">页
      <input type="text" name="curPage" size="4" maxlength="2" value="<%=curPage%>" style="height:17px">
      <input class=button1 type="button" name="Submit" value="Go" onClick="goPage()" style="height:18px">
	  </td></tr>
</table>
</td>
              </tr>
              </TBODY></TABLE></TD></TR>
        <TR>
          <TD class=itemFont align=right height=10>&nbsp;</TD></TR>
        </TBODY></TABLE></TD></TR></TBODY></TABLE>
          <INPUT type="hidden" name="id">
          <INPUT type="hidden" name="page" value="<%=request.getAttribute("page")%>">
          <INPUT type="hidden" name="newsType" value="<%=request.getAttribute("newsType")%>">
          <INPUT type="hidden" name="cx" value="<%=request.getAttribute("cx")%>"></FORM></BODY>
<SCRIPT language=javascript>
 var count = document.getElementsByName("chk").length
 function sele(obj){
 		if(count==1) self.document.all.chk.checked =obj.checked;
		if(count>1) for(i=0;i<count;i++) self.document.all.chk[i].checked=obj.checked;
}

 function de(obj){
 		var s="";
 		if(count==1) if(obj.chk.checked) s=obj.chk.value;
		if(count>1)
		for(i=0;i<document.getElementsByName("chk").length;i++){
			if(obj.chk[i].checked){
				if(s!="") s+=",";
				s+=obj.chk[i].value;
			}
		}
		if(s=="") alert("请选择要删除的用户!"); 
		else{
			//if(confirm("确定要删除选择的用户?")){
				obj.action="/hiber/news.do?method=del_k&id="+s;
				obj.submit();
			//}
		}
}

 function ad(obj){
		obj.action="kjhm/add.jsp?method=ins_k";
		obj.submit();
}
 
function Update(id){
  document.Form1.id.value=id;
  document.Form1.action="/hiber/news.do?method=getMdfInfo_k";
  document.Form1.submit();
}

function goPage(toPage) {
	if (toPage==null){ 
		if(document.Form1.curPage.value.replace(/(^\s*)|(\s*$)/g,"")==""||isNaN(document.Form1.curPage.value)){
    		alert("页码不合法");
    		return false;
		}
		else{
    		toPage = document.Form1.curPage.value.replace(/(^\s*)|(\s*$)/g,"");
		}
	}
	if (toPage><%=pageCount%> || toPage<1) {
		alert("目标页码超出范围!");
    	return 0;
	} else {
    	document.Form1.page.value = toPage;
		document.Form1.action="/hiber/news.do?method=list_k";
    	document.Form1.submit();
	}
}      
</SCRIPT>
</HTML>

⌨️ 快捷键说明

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