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

其他数据库

开发平台:

Java

  1. <%@ page language = "java" contentType = "text/html;charset=gb2312"%>
  2. <%@ page import = "java.sql.*,wsxk.*" %>
  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">
  75.             <p><br>
  76.               <font color="#2DFFFF" size="5"><strong><br>
  77.               </strong></font><strong>全部课表</strong><font color="#2DFFFF" size="5"><strong><br>
  78.               </strong></font><strong><span class="style2"><br>
  79.               <br>
  80.               <br>
  81.               </span></strong>
  82.               </p>
  83.               <table width="200" border="1">
  84.                 <tr>
  85.                   <td><div align="center"><a href="teacherkccx.jsp">【课程查询】</a></div></td>
  86.                 </tr>
  87.                 <tr>
  88.                   <td><div align="center"><a href="teacherqbkb.jsp">【全部课表】</a></div></td>
  89.                 </tr>
  90.               </table>
  91.               <p></p>
  92.               <p>  <strong><font color="#2DFFFF" size="5"> </font></strong></p>
  93.           </div>          </td>
  94.         </tr>
  95.       </table>
  96.     </TD>
  97.     <TD ROWSPAN=2> <IMG SRC="images/temp_05.jpg" WIDTH=4 HEIGHT=455></TD>
  98.     <TD COLSPAN=5 ROWSPAN=2>
  99.       <table width="510" border="0" cellspacing="0" cellpadding="0" height="455" background="images/main_bg.jpg">
  100.         <tr>
  101.           <td width="510">
  102.             <table width="510" border="0" cellspacing="0" cellpadding="0" height="455">
  103.               <tr>
  104.                 <td width="510" height="78">
  105.                   <div align="center"><img src="images/blank_banner.gif" width="468" height="60"></div>
  106.                 </td>
  107.               </tr>
  108.               <tr>
  109.                 <td valign="top">                  <div align="left">
  110.                   <table width="483" height="204" border="0">
  111.                     <tr>
  112.                       <td height="14" colspan="5"><a href="index1.htm">首页</a>&gt;<a href="index2.jsp">教师</a>&gt;全部课表</td>
  113.                     </tr>
  114.                     <tr>
  115.                       <td height="16" colspan="5"><span class="style1">分页: 课程总数:<%=totalRecord%> <a href="teacherqbkb.jsp?page=1">[首页]</a>
  116.                           <%
  117. if(intPage>1 && intPage<((totalRecord+PageNumbers)/PageNumbers))
  118. {
  119. out.print("<a href='teacherqbkb.jsp?page=" + (intPage-1) + "'>[前页]&nbsp;&nbsp;</a>");
  120. out.print("<a href='teacherqbkb.jsp?page=" + (intPage+1) +"'>[后页]&nbsp;&nbsp;</a>");
  121. out.print("<a href='teacherqbkb.jsp?page=" + ((totalRecord+PageNumbers)/PageNumbers) + "'>[尾页]</a>");
  122. }
  123. if(intPage ==((totalRecord+PageNumbers)/PageNumbers))
  124. out.print("<a href='teacherqbkb.jsp?page=" + (intPage-1) + "'>[前页]&nbsp;&nbsp;</a>");
  125. if(intPage == 1)
  126. {
  127. out.print("<a href='teacherqbkb.jsp?page=" + (intPage+1) +"'>[后页]&nbsp;&nbsp;</a>");
  128. out.print("<a href='teacherqbkb.jsp?page=" + ((totalRecord+PageNumbers)/PageNumbers) + "'>[尾页]</a>");
  129. }
  130. %>
  131.                           页次:<%=currentPage%>/<%=(totalRecord+PageNumbers)/PageNumbers%> <%=PageNumbers%>篇/页</span></td>
  132.                     </tr>
  133.                     <tr>
  134.                       <td colspan="5"></td>
  135.                     </tr>
  136.                     <tr valign="bottom">
  137.                       <td width="103" height="26"><br>
  138.                         授课教师</td>
  139.                       <td width="107">课程说明</td>
  140.                       <td width="58">课程名</td>
  141.                       <td width="71"><div align="right">学分</div></td>
  142.                       <td width="122">&nbsp;</td>
  143.                     </tr>
  144.                     <tr>
  145.                       <td colspan="5">
  146. <br>
  147. <form name="form1" method="post" action="">
  148.   <%String sql2 = "select tcid,teaid,couid from tc order by tcid desc";
  149. ResultSet rs2=sts.executeQuery(sql2);
  150. String tmpteaid = new String();
  151. String tmpcouid = new String();
  152. int i=0;
  153. int tmpid;
  154. while (rs2.next())
  155. {
  156. if(i >= (intPage-1)*PageNumbers && i < intPage*PageNumbers)
  157. {
  158. tmpid =rs2.getInt("tcid");
  159. couid1 = rs2.getString("couid");
  160. teaid1 = rs2.getString("teaid");
  161. //out.print("tttt");
  162. String sql4 = "select teaid,teaname from teacher where teaid = '"+teaid1+"'";
  163. ResultSet rs4=sts.executeQuery(sql4);
  164. while (rs4.next())
  165. {
  166. out.print(rs4.getString("teaname"));
  167. tmpteaid = rs4.getString("teaid");
  168. }
  169. out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  170. String sql3 = "select couid,couname,coumark,couback from course where couid = '"+couid1+"'";
  171. ResultSet rs3=sts.executeQuery(sql3);
  172. while (rs3.next())
  173. {//out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  174. //out.print(rs3.getString("couid"));
  175. tmpcouid = rs3.getString("couid");
  176. out.print(rs3.getString("couback"));
  177. out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  178. out.print(rs3.getString("couname"));
  179. out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  180. out.print(rs3.getString("coumark"));
  181. String sql5 = "select teaid,couid from sc where stuid = '"+session.getValue("wnum")+"'";
  182. ResultSet rs5 = sts.executeQuery(sql5);
  183. while (rs5.next())
  184. {
  185. if (tmpteaid.trim().equals(rs5.getString("teaid"))&&tmpcouid.trim().equals(rs5.getString("couid")))
  186. {
  187. signing = 1;
  188. }
  189. }//out.print(" <input name="1" type="checkbox" id="1" value="1">");
  190. %>
  191.   <br>
  192.       <%//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>");}
  193.    //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;已选择");}
  194.   %>
  195.   <br>
  196.    <br>
  197.   <%
  198. }
  199. }signing = 0;
  200. i++;
  201. }
  202. //out.print(rs3.getString("couback"));
  203. %>
  204.       <br>
  205.   </form>
  206. <br>
  207. <br></td>
  208.                     </tr>
  209.                   </table>
  210.                 </div></td>
  211.               </tr>
  212.             </table>
  213.           </td>
  214.         </tr>
  215.       </table>
  216.     </TD>
  217.     <TD ROWSPAN=2> <IMG SRC="images/temp_07.jpg" WIDTH=5 HEIGHT=455></TD>
  218.   </TR>
  219.   <TR>
  220.     <TD>
  221.       <table width="231" border="0" cellspacing="0" cellpadding="0" height="229" background="images/left_bottom.jpg">
  222.         <tr>
  223.           <td width="231" height="222" valign="top"><div align="center">
  224.             <p>&nbsp;</p>
  225.             <p><br>
  226.               <font color="#2DFFFF" size="5"> </font></p>
  227.             <br>
  228.               <p align="center"><br>
  229.               <a href="index1.htm" class="style3">[退出系统]</a></p>
  230.               </div>
  231.           </td>
  232.         </tr>
  233.       </table>
  234.     </TD>
  235.   </TR>
  236.   <TR>
  237.     <TD COLSPAN=8> <IMG SRC="images/temp_09.jpg" WIDTH=750 HEIGHT=5></TD>
  238.   </TR>
  239.   <TR>
  240.     <TD COLSPAN=8> <img src="images/temp_10.jpg" width=752 height=20></TD>
  241.   </TR>
  242. </TABLE>
  243. </BODY>
  244. </HTML>