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

其他数据库

开发平台:

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. <%  int  signing =0;
  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 tcid from tc");
  15. if(counters.next())
  16. {
  17. totalRecord = Integer.parseInt(counters.getString("tcid"));
  18. }
  19. String couid1 = new String();
  20. String teaid1 = new String();
  21. %>
  22. <html>
  23. <head>
  24. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  25. <link href="_notes/aaa.css" rel="stylesheet" type="text/css">
  26. <style type="text/css">
  27. <!--
  28. @import url("_notes/ccc");
  29. .style1 {color: #FFFFFF}
  30. body,td,th {
  31. color: #FFFFFF;
  32. font-weight: bold;
  33. font-size: 12px;
  34. }
  35. a:link {
  36. color: #FFFFFF;
  37. }
  38. a:visited {
  39. color: #FFFFFF;
  40. }
  41. .style2 {
  42. font-size: 12px;
  43. color: #FFFFFF;
  44. }
  45. .style3 {font-size: 14px}
  46. -->
  47. </style>
  48. </HEAD>
  49. <BODY BGCOLOR=#0D85A6 BACKGROUND="images/bg.gif" >
  50. <br>
  51. <br>
  52. <TABLE WIDTH=750 height="500" BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>
  53.   <TR>
  54.     <TD> <IMG SRC="images/spacer.gif" WIDTH=231 HEIGHT=1></TD>
  55.     <TD> <IMG SRC="images/spacer.gif" WIDTH=4 HEIGHT=1></TD>
  56.     <TD> <IMG SRC="images/spacer.gif" WIDTH=75 HEIGHT=1></TD>
  57.     <TD> <IMG SRC="images/spacer.gif" WIDTH=110 HEIGHT=1></TD>
  58.     <TD> <IMG SRC="images/spacer.gif" WIDTH=110 HEIGHT=1></TD>
  59.     <TD> <IMG SRC="images/spacer.gif" WIDTH=110 HEIGHT=1></TD>
  60.     <TD> <IMG SRC="images/spacer.gif" WIDTH=105 HEIGHT=1></TD>
  61.     <TD> <IMG SRC="images/spacer.gif" WIDTH=5 HEIGHT=1></TD>
  62.   </TR>
  63.   <TR>
  64.     <TD COLSPAN=4> <IMG SRC="images/temp_01.jpg" WIDTH=420 HEIGHT=15></TD>
  65.     <TD COLSPAN=4> <IMG SRC="images/temp_02.jpg" WIDTH=330 HEIGHT=15></TD>
  66.   </TR>
  67.   <TR>
  68.     <TD COLSPAN=8> <IMG SRC="images/temp_03.jpg" WIDTH=750 HEIGHT=5></TD>
  69.   </TR>
  70.   <TR>
  71.     <TD height="225">
  72.       <table width="231" border="0" cellspacing="0" cellpadding="0" height="225" background="images/left_top.jpg">
  73.         <tr>
  74.           <td width="231" height="225" valign="bottom"><div align="center">            <br>
  75.               <font color="#2DFFFF" size="5"><strong><br>
  76.               </strong></font><strong></strong>
  77.               <p><strong><span class="style2">网上选课<br>
  78.                 <br>
  79.                 </span></strong></p>
  80.               <p><strong><span class="style2">
  81.                   </span></strong>
  82.     
  83.             </p>
  84.               <table width="200" border="1">
  85.                 <tr>
  86.                   <td><div align="center">【网上选课】</div></td>
  87.                 </tr>
  88.                 <tr>
  89.                   <td><div align="center"><a href="studentcjcx.jsp">【成绩查询】</a></div></td>
  90.                 </tr>
  91.                 
  92.               </table>
  93.               <p>  <strong><font color="#2DFFFF" size="5"> </font></strong></p>
  94.           </div>          </td>
  95.         </tr>
  96.       </table>
  97.     </TD>
  98.     <TD ROWSPAN=2> <IMG SRC="images/temp_05.jpg" WIDTH=4 HEIGHT=455></TD>
  99.     <TD COLSPAN=5 ROWSPAN=2>
  100.       <table width="510" border="0" cellspacing="0" cellpadding="0" height="455" background="images/main_bg.jpg">
  101.         <tr>
  102.           <td width="510">
  103.             <table width="510" border="0" cellspacing="0" cellpadding="0" height="455">
  104.               <tr>
  105.                 <td width="510" height="78">
  106.                   <div align="center"><img src="images/blank_banner.gif" width="468" height="60"></div>
  107.                 </td>
  108.               </tr>
  109.               <tr>
  110.                 <td valign="top">                  <div align="left">
  111.                   <table width="483" height="204" border="0">
  112.                     <tr>
  113.                       <td height="14" colspan="5"><a href="index1.htm">首页</a>&gt;<a href="index1.jsp">学生</a>&gt;网上选课</td>
  114.                     </tr>
  115.                     <tr>
  116.                       <td height="16" colspan="5"><span class="style1">分页: 课程总数:<%=totalRecord%> <a href="studentwsxk.jsp?page=1">[首页]</a>
  117.                           <%
  118. if(intPage>1 && intPage<((totalRecord+PageNumbers)/PageNumbers))
  119. {
  120. out.print("<a href='studentwsxk.jsp?page=" + (intPage-1) + "'>[前页]&nbsp;&nbsp;</a>");
  121. out.print("<a href='studentwsxk.jsp?page=" + (intPage+1) +"'>[后页]&nbsp;&nbsp;</a>");
  122. out.print("<a href='studentwsxk.jsp?page=" + ((totalRecord+PageNumbers)/PageNumbers) + "'>[尾页]</a>");
  123. }
  124. if(intPage ==((totalRecord+PageNumbers)/PageNumbers))
  125. out.print("<a href='studentwsxk.jsp?page=" + (intPage-1) + "'>[前页]&nbsp;&nbsp;</a>");
  126. if(intPage == 1)
  127. {
  128. out.print("<a href='studentwsxk.jsp?page=" + (intPage+1) +"'>[后页]&nbsp;&nbsp;</a>");
  129. out.print("<a href='studentwsxk.jsp?page=" + ((totalRecord+PageNumbers)/PageNumbers) + "'>[尾页]</a>");
  130. }
  131. %>
  132.                           页次:<%=currentPage%>/<%=(totalRecord+PageNumbers)/PageNumbers%> <%=PageNumbers%>篇/页</span></td>
  133.                     </tr>
  134.                     <tr>
  135.                       <td colspan="5"></td>
  136.                     </tr>
  137.                     <tr valign="bottom">
  138.                       <td width="103" height="26"><br>
  139.                         授课教师</td>
  140.                       <td width="107">课程说明</td>
  141.                       <td width="58">课程名</td>
  142.                       <td width="71"><div align="right">学分</div></td>
  143.                       <td width="122">&nbsp;</td>
  144.                     </tr>
  145.                     <tr>
  146.                       <td colspan="5">
  147. <br>
  148. <form name="form1" method="post" action="">
  149.   <%String sql2 = "select tcid,teaid,couid from tc order by tcid desc";
  150. ResultSet rs2=sts.executeQuery(sql2);
  151. String tmpteaid = new String();
  152. String tmpcouid = new String();
  153. int i=0;
  154. int tmpid;
  155. while (rs2.next())
  156. {
  157. if(i >= (intPage-1)*PageNumbers && i < intPage*PageNumbers)
  158. {
  159. tmpid =rs2.getInt("tcid");
  160. couid1 = rs2.getString("couid");
  161. teaid1 = rs2.getString("teaid");
  162. //out.print("tttt");
  163. String sql4 = "select teaid,teaname from teacher where teaid = '"+teaid1+"'";
  164. ResultSet rs4=sts.executeQuery(sql4);
  165. while (rs4.next())
  166. {
  167. out.print(rs4.getString("teaname"));
  168. tmpteaid = rs4.getString("teaid");
  169. }
  170. out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  171. String sql3 = "select couid,couname,coumark,couback from course where couid = '"+couid1+"'";
  172. ResultSet rs3=sts.executeQuery(sql3);
  173. while (rs3.next())
  174. {//out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  175. //out.print(rs3.getString("couid"));
  176. tmpcouid = rs3.getString("couid");
  177. out.print(rs3.getString("couback"));
  178. out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  179. out.print(rs3.getString("couname"));
  180. out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  181. out.print(rs3.getString("coumark"));
  182. String sql5 = "select teaid,couid from sc where stuid = '"+session.getValue("wnum")+"'";
  183. ResultSet rs5 = sts.executeQuery(sql5);
  184. while (rs5.next())
  185. {
  186. if (tmpteaid.trim().equals(rs5.getString("teaid"))&&tmpcouid.trim().equals(rs5.getString("couid")))
  187. {
  188. signing = 1;
  189. }
  190. }//out.print(" <input name="1" type="checkbox" id="1" value="1">");
  191. %>
  192.   <br>
  193.       <%if (signing==0){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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='studentwsxk2.jsp?xuan=" +tmpid + "'>选课</a>");}
  194.    else {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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;已选择");}
  195.   %>
  196.   <br>
  197.    <br>
  198.   <%
  199. }
  200. }signing = 0;
  201. i++;
  202. }
  203. //out.print(rs3.getString("couback"));
  204. %>
  205.       <br>
  206.   </form>
  207. <br>
  208. <br></td>
  209.                     </tr>
  210.                   </table>
  211.                 </div></td>
  212.               </tr>
  213.             </table>
  214.           </td>
  215.         </tr>
  216.       </table>
  217.     </TD>
  218.     <TD ROWSPAN=2> <IMG SRC="images/temp_07.jpg" WIDTH=5 HEIGHT=455></TD>
  219.   </TR>
  220.   <TR>
  221.     <TD>
  222.       <table width="231" border="0" cellspacing="0" cellpadding="0" height="229" background="images/left_bottom.jpg">
  223.         <tr>
  224.           <td width="231" height="222" valign="top"><div align="center">
  225.             <p>&nbsp;</p>
  226.             <p><br>
  227.               <font color="#2DFFFF" size="5"> </font></p>
  228.             <table width="200" border="1">
  229.                 <tr>
  230.                   <td><div align="center"><a href="studentxkd.jsp">【选课单】</a></div></td>
  231.                 </tr>
  232.                 <tr>
  233.                   <td><div align="center"><a href="lyb.jsp">【留言板】</a></div></td>
  234.                 </tr>
  235.               </table>
  236.               <br>
  237.               <br>
  238.               <p align="center"><br>
  239.               <a href="index1.htm" class="style3">[退出系统]</a></p>
  240.               </div>
  241.           </td>
  242.         </tr>
  243.       </table>
  244.     </TD>
  245.   </TR>
  246.   <TR>
  247.     <TD COLSPAN=8> <IMG SRC="images/temp_09.jpg" WIDTH=750 HEIGHT=5></TD>
  248.   </TR>
  249.   <TR>
  250.     <TD COLSPAN=8> <img src="images/temp_10.jpg" width=752 height=20></TD>
  251.   </TR>
  252. </TABLE>
  253. </BODY>
  254. </HTML>