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

📄 customermessage.jsp

📁 JAVA 开发的一个企业网站 JAVABEAN+JSP +ACCE
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" import="java.sql.*" %>
<%@ page import="mfkvit.JdbcBean,java.util.*" %>
<jsp:useBean id="login" class="mfkvit.login" scope="session">
</jsp:useBean>
<%
if(session.isNew()){response.sendRedirect("index.jsp");}
String success=login.getSuccess();
if(success==null){success="";}
if(!(success.equals("ok"))){response.sendRedirect("index.jsp");}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>admin</title>
<link href="c.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 50px;
	background-image: url();
	margin-bottom: 0px;
	background-color: #d6dff7;
}
-->
</style></head>

<body leftmargin="0" topmargin="0">
 
      
<table width="622" height="35" border="1" align="center" cellspacing="2" bordercolor="#E8EDF4">
  <tr> 
          <td bordercolor="#E8EDF4" bgcolor="#E8EDF4"> 
            <div align="center" class="w">
              <div align="left"><span class="fds"><img src="img/newmail.gif" width="28" height="11" /></span>顾客留言信息</font></div>
          </div></td>
  </tr>
</table>
 <%! int pageSize =3;//每页显示的记录
      int pageCount = 0;//总页数
      int showPage =1;//当前显示的页数
      %><%
 request.setCharacterEncoding("gb2312");
 try{
      JdbcBean jdbc = new JdbcBean();
	int lastRow = jdbc.execQueryName("select * from customerMessage");
    ArrayList a = jdbc.getRS();
   pageCount = (lastRow % pageSize == 0) ? (lastRow / pageSize) : (lastRow / pageSize + 1);//固定算法
     String go1=request.getParameter("page");
     if(go1==null)
     { go1="1";
     }
     try{
      showPage=Integer.parseInt(go1);
     }
     catch(NumberFormatException e){
       showPage=1;
       }
     if(showPage<=1)//输入的页数小于则显示第一页
     {  showPage=1;
     }
     if(showPage>=pageCount)//输入的页数大于总页数则显示最后一页
     {  showPage=pageCount;
     }
int posion=(showPage-1)*pageSize;
%> 

                                            
<table  width="622" align="center">
  <tr><td class="xb"> <div align="right"><span class="c">共<%=pageCount%>页&nbsp; 当前第 <%=showPage%> 页 &nbsp;
                                                     <%if (showPage>1){%>
                                                             <a href="customerMessage.jsp?page=1">[第一页]</a>&nbsp;<a href="customerMessage.jsp?page=<%=showPage-1%>">[上一页]</a>
                                                     <%}else{%>
                                                     [第一页]&nbsp;[上一页]
                                                     <%}
         if (showPage< pageCount) {%>
                                                     &nbsp;<a href="customerMessage.jsp?page=<%=showPage+1%>">[下一页]</a>&nbsp;<a href="customerMessage.jsp?page=<%=pageCount%>">[最后页]</a>
                                                     <%}else{%>
  &nbsp;[下一页]&nbsp;[最后页]
  <%}%>
                                                                        </span></div></td></tr>
</table>
      
	  <%
for(int t=posion;t<posion+pageSize && t<lastRow;t++)
   
 { HashMap col = (HashMap)a.get(t);
	String x=(String)col.get("id");
%>   
<table width="622" border="0" align="center" cellspacing="2" bordercolor="#990000">
  <tr bordercolor="#FF9966"> 
          
    <td width="444" height="25" valign="middle" bordercolor="#E8EDF4" bgcolor="#799ae1"><font class="c"><strong><img src="img/profile.gif" width="45" height="18" />:留言人: <%=(String)col.get("name")%>     Email: <%=(String)col.get("email")%></strong></font></td>
          
    <td width="80" height="25" valign="bottom" bordercolor="#E8EDF4" bgcolor="#799ae1"class="er"><a href="/basic/index.jsp"><img src="img/homepage.gif" width="47" height="18" border="0" usemap="#Map" /></a></td>
          
    <td width="84" valign="bottom" bordercolor="#E8EDF4" bgcolor="#799ae1"class="er"> 
    <div align="right"><a href="DEL1.jsp?id=<%=x%>" ><span class="STYLE1"><img src="img/a_delete.gif" width="52" height="16" border="0" usemap="#Map" /></span></a></div>   </td>
  </tr>						
				
        <tr bgcolor="#E8EDF4"> 
          
    <td height="42" colspan="3" valign="top" bordercolor="#999999" bgcolor="#E8EDF4"> 
      <p><font class="c">&nbsp;&nbsp;&nbsp;&nbsp;<%=(String)col.get("nr")%></font></p>           
      <div align="left" class="unnamed1"></div>      <div align="center"></div></td>
        </tr>
</table>
      
<div align="center"></div>
<p>
      
       
        <%}} catch (Exception ex) {ex.printStackTrace();} %>
     
<p>

</body>
</html>

⌨️ 快捷键说明

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