adminlyb.jsp
上传用户:mkymky1985
上传日期:2014-06-23
资源大小:754k
文件大小:8k
源码类别:

其他数据库

开发平台:

Java

  1. <%@ page language = "java" contentType = "text/html;charset=gb2312"%>
  2. <%@ page import = "java.sql.*" %>
  3. <jsp:useBean id = "sts" scope = "page" class = "wsxk.ConDB" />
  4. <%
  5. int  intPage;
  6. int currentPage = 1;
  7. int PageNumbers = 5;
  8. if(request.getParameter("page")!= null && request.getParameter("page")!="")
  9. {intPage = Integer.parseInt(request.getParameter("page"));
  10. currentPage=intPage;}
  11. else
  12. intPage = 1;
  13. int totalRecord = 0;
  14. ResultSet counters = sts.executeQuery("select count(*) as mesid from message");
  15. if(counters.next())
  16. {
  17. totalRecord = Integer.parseInt(counters.getString("mesid"));
  18. }
  19. %>
  20. <html>
  21. <head>
  22. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  23. <link href="_notes/aaa.css" rel="stylesheet" type="text/css">
  24. <style type="text/css">
  25. <!--
  26. @import url("_notes/ccc");
  27. .style1 {color: #FFFFFF}
  28. body,td,th {
  29. color: #FFFFFF;
  30. font-weight: bold;
  31. font-size: 12px;
  32. }
  33. a:link {
  34. color: #FFFFFF;
  35. }
  36. a:visited {
  37. color: #FFFFFF;
  38. }
  39. -->
  40. </style>
  41. </HEAD>
  42. <BODY BGCOLOR=#0D85A6 BACKGROUND="images/bg.gif" >
  43. <br>
  44. <br>
  45. <TABLE WIDTH=750 height="494" BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>
  46.   <TR>
  47.     <TD> <IMG SRC="images/spacer.gif" WIDTH=231 HEIGHT=1></TD>
  48.     <TD> <IMG SRC="images/spacer.gif" WIDTH=4 HEIGHT=1></TD>
  49.     <TD> <IMG SRC="images/spacer.gif" WIDTH=75 HEIGHT=1></TD>
  50.     <TD> <IMG SRC="images/spacer.gif" WIDTH=110 HEIGHT=1></TD>
  51.     <TD> <IMG SRC="images/spacer.gif" WIDTH=110 HEIGHT=1></TD>
  52.     <TD> <IMG SRC="images/spacer.gif" WIDTH=110 HEIGHT=1></TD>
  53.     <TD> <IMG SRC="images/spacer.gif" WIDTH=105 HEIGHT=1></TD>
  54.     <TD> <IMG SRC="images/spacer.gif" WIDTH=5 HEIGHT=1></TD>
  55.   </TR>
  56.   <TR>
  57.     <TD COLSPAN=4> <IMG SRC="images/temp_01.jpg" WIDTH=420 HEIGHT=15></TD>
  58.     <TD COLSPAN=4> <IMG SRC="images/temp_02.jpg" WIDTH=330 HEIGHT=15></TD>
  59.   </TR>
  60.   <TR>
  61.     <TD COLSPAN=8> <IMG SRC="images/temp_03.jpg" WIDTH=750 HEIGHT=5></TD>
  62.   </TR>
  63.   <TR>
  64.     <TD>
  65.       <table width="231" border="0" cellspacing="0" cellpadding="0" height="226" background="images/left_top.jpg">
  66.         <tr>
  67.           <td width="231" valign="bottom">
  68.             <div align="center">
  69.               <p><br>
  70.               <font color="#2DFFFF" size="5"><strong> </strong></font></p>
  71.               <table width="200" border="1">
  72.                 <tr>
  73.                   <td><div align="center"><strong><a href="adminstudent.jsp">【学生管理】</a></strong></div></td>
  74.                 </tr>
  75.                 <tr>
  76.                   <td><div align="center"><a href="adminteacher.jsp">【教师<strong>管理</strong>】</a></div></td>
  77.                 </tr>
  78.                 <tr>
  79.                   <td><div align="center"><a href="admincourse.jsp">【课程<strong>管理</strong>】</a></div></td>
  80.                 </tr>
  81.               </table>
  82.               <p>  <strong><font color="#2DFFFF" size="5"> </font></strong></p>
  83.             </div>
  84.           </td>
  85.         </tr>
  86.       </table>
  87.     </TD>
  88.     <TD ROWSPAN=2> <IMG SRC="images/temp_05.jpg" WIDTH=4 HEIGHT=455></TD>
  89.     <TD COLSPAN=5 ROWSPAN=2>
  90.       <table width="510" border="0" cellspacing="0" cellpadding="0" height="455" background="images/main_bg.jpg">
  91.         <tr>
  92.           <td width="510">
  93.             <table width="510" border="0" cellspacing="0" cellpadding="0" height="455">
  94.               <tr>
  95.                 <td width="510" height="78">
  96.                   <div align="center"><img src="images/blank_banner.gif" width="468" height="60"></div>
  97.                 </td>
  98.               </tr>
  99.               <tr>
  100.                 <td valign="top">                  <div align="left">
  101.                   <table width="483" height="217" border="0">
  102.                     <tr>
  103.                       <td height="14"><a href="index1.htm">首页</a>&gt;<a href="index3.jsp">后台管理</a>&gt;查看留言</td>
  104.                     </tr>
  105.                     <tr>
  106.                       <td height="16"><span class="style1">分页: 留言总数:<%=totalRecord%> <a href="adminlyb.jsp?page=1">[首页]</a>
  107.                           <%
  108. if(intPage>1 && intPage<((totalRecord+PageNumbers)/PageNumbers))
  109. {
  110. out.print("<a href='adminlyb.jsp?page=" + (intPage-1) + "'>[前页]&nbsp;&nbsp;</a>");
  111. out.print("<a href='adminlyb.jsp?page=" + (intPage+1) +"'>[后页]&nbsp;&nbsp;</a>");
  112. out.print("<a href='adminlyb.jsp?page=" + ((totalRecord+PageNumbers)/PageNumbers) + "'>[尾页]</a>");
  113. }
  114. if(intPage ==((totalRecord+PageNumbers)/PageNumbers))
  115. out.print("<a href='adminlyb.jsp?page=" + (intPage-1) + "'>[前页]&nbsp;&nbsp;</a>");
  116. if(intPage == 1)
  117. {
  118. out.print("<a href='adminlyb.jsp?page=" + (intPage+1) +"'>[后页]&nbsp;&nbsp;</a>");
  119. out.print("<a href='adminlyb.jsp?page=" + ((totalRecord+PageNumbers)/PageNumbers) + "'>[尾页]</a>");
  120. }
  121. %>
  122.                           页次:<%=currentPage%>/<%=(totalRecord+PageNumbers)/PageNumbers%> <%=PageNumbers%>篇/页</span></td>
  123.                     </tr>
  124.                     <tr>
  125.                       <td></td>
  126.                     </tr>
  127.                     <tr>
  128.                       <td>
  129. <%String strSQL = "select mesid ,stuname ,mescontent from message order by mesid desc  ";
  130. ResultSet rs = sts.executeQuery(strSQL);
  131. int i=0;
  132. int tmpid;
  133. while(rs.next())
  134. {
  135. if(i >= (intPage-1)*PageNumbers && i < intPage*PageNumbers)
  136. {
  137. String stuname = rs.getString("stuname");
  138. String mescontent = rs.getString("mescontent");
  139. tmpid =rs.getInt("mesid");
  140. out.print(stuname);%>同学:
  141. <br><%//out.print(mescontent);
  142. int tmp =0;
  143. for ( int j=0 ; j < mescontent.length();j++)
  144. {
  145. if (mescontent.charAt(j)=='n'||j==mescontent.length()-1)
  146. {out.print("&nbsp;&nbsp;");
  147.           out.print(mescontent.substring(tmp,j+1));
  148.           out.print("<br>");
  149.  tmp = j+1;
  150. }}
  151. %><%out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='adminlyb2.jsp?delpage=" +tmpid + "'>删除</a>");%><br><br><%
  152. //out.print("<TD>□ <a href="wz.jsp?id="+id+"">" + title + "    (" + time + ")" + "</a></td><td></td></tr>");
  153. }
  154. i++;
  155. }
  156. %>
  157. <br></td>
  158.                     </tr>
  159.                   </table>
  160.                 </div></td>
  161.               </tr>
  162.             </table>
  163.           </td>
  164.         </tr>
  165.       </table>
  166.     </TD>
  167.     <TD ROWSPAN=2> <IMG SRC="images/temp_07.jpg" WIDTH=5 HEIGHT=455></TD>
  168.   </TR>
  169.   <TR>
  170.     <TD>
  171.       <table width="231" border="0" cellspacing="0" cellpadding="0" height="229" background="images/left_bottom.jpg">
  172.         <tr>
  173.           <td width="231" height="222" valign="top"><div align="center">
  174.             <p><font color="#2DFFFF" size="5"> </font></p>
  175.               <table width="200" border="1">
  176.                 <tr>
  177.                   <td><div align="center"><a href="admincourse.jsp">【课程分配】</a></div></td>
  178.                 </tr>
  179.                 <tr>
  180.                   <td><div align="center"><a href="adminscore.jsp">【成绩录入】</a></div></td>
  181.                 </tr>
  182.                
  183.               </table>
  184.               <br>
  185.               <br>
  186.               <table width="200" border="0">
  187.                 <tr>
  188.                   <td><div align="center">查看留言</div></td>
  189.                 </tr>
  190.               </table>
  191.               <p align="center"><br>
  192.               <a href="index1.htm" class="ccc">[退出系统]</a></p>
  193.               </div>
  194.           </td>
  195.         </tr>
  196.       </table>
  197.     </TD>
  198.   </TR>
  199.   <TR>
  200.     <TD COLSPAN=8> <IMG SRC="images/temp_09.jpg" WIDTH=750 HEIGHT=5></TD>
  201.   </TR>
  202.   <TR>
  203.     <TD COLSPAN=8> <img src="images/temp_10.jpg" width=752 height=20></TD>
  204.   </TR>
  205. </TABLE>
  206. </BODY>
  207. </HTML>