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

其他数据库

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312"%>
  2. <%@ page language="java" import="java.sql.*"%>
  3. <%@ page import="java.util.*"%>
  4. <%@ page import="java.io.*"%>
  5. <%@ page import="java.lang.*"%>
  6. <jsp:useBean id="subject" scope="page" class="wsxk.ConDB"/>
  7. <%!
  8.  String trans(String chi)
  9. {
  10.                String result = null;
  11.                byte temp [];
  12.                try
  13.                 {
  14.                       temp=chi.getBytes("iso-8859-1");
  15.                       result = new String(temp, "gb2312");
  16.                 }
  17.                 catch(Exception e)
  18.                 {
  19.                         System.out.println (e.toString());
  20.                 }
  21.                 return result;
  22. }
  23.    //String  temid = new String();
  24.   // String  couid1   = new String();
  25.   // String  teaid1 = new String();
  26. //int temscid = 0;
  27. String  teaname = new String();
  28. %>
  29. <html>
  30. <head>
  31. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  32. <link href="_notes/aaa.css" rel="stylesheet" type="text/css">
  33. <style type="text/css">
  34. <!--
  35. @import url("_notes/ccc");
  36. body,td,th {
  37. font-size: 12px;
  38. color: #FFFFFF;
  39. font-weight: bold;
  40. }
  41. a {
  42. font-size: 12px;
  43. color: #FFFFFF;
  44. }
  45. a:visited {
  46. color: #FFFFFF;
  47. }
  48. .style1 {font-size: 14px}
  49. -->
  50. </style>
  51. </HEAD>
  52. <BODY BGCOLOR=#0D85A6 BACKGROUND="images/bg.gif" >
  53. <br>
  54. <br>
  55. <TABLE WIDTH=750 height="494" BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>
  56.   <TR>
  57.     <TD> <IMG SRC="images/spacer.gif" WIDTH=231 HEIGHT=1></TD>
  58.     <TD> <IMG SRC="images/spacer.gif" WIDTH=4 HEIGHT=1></TD>
  59.     <TD> <IMG SRC="images/spacer.gif" WIDTH=75 HEIGHT=1></TD>
  60.     <TD> <IMG SRC="images/spacer.gif" WIDTH=110 HEIGHT=1></TD>
  61.     <TD> <IMG SRC="images/spacer.gif" WIDTH=110 HEIGHT=1></TD>
  62.     <TD> <IMG SRC="images/spacer.gif" WIDTH=110 HEIGHT=1></TD>
  63.     <TD> <IMG SRC="images/spacer.gif" WIDTH=105 HEIGHT=1></TD>
  64.     <TD> <IMG SRC="images/spacer.gif" WIDTH=5 HEIGHT=1></TD>
  65.   </TR>
  66.   <TR>
  67.     <TD COLSPAN=4> <IMG SRC="images/temp_01.jpg" WIDTH=420 HEIGHT=15></TD>
  68.     <TD COLSPAN=4> <IMG SRC="images/temp_02.jpg" WIDTH=330 HEIGHT=15></TD>
  69.   </TR>
  70.   <TR>
  71.     <TD COLSPAN=8> <IMG SRC="images/temp_03.jpg" WIDTH=750 HEIGHT=5></TD>
  72.   </TR>
  73.   <TR>
  74.     <TD>
  75.       <table width="231" border="0" cellspacing="0" cellpadding="0" height="226" background="images/left_top.jpg">
  76.         <tr>
  77.           <td width="231">
  78.             <div align="center">
  79.               <p>&nbsp;</p>
  80.               <p>&nbsp;</p>
  81.               <p> 总选课单 <br>
  82.                 <br>
  83.                 <br>
  84.               <font color="#2DFFFF" size="5"><strong> </strong></font></p>
  85.               <table width="200" border="1">
  86.                 <tr>
  87.                   <td><div align="center"><a href="studentwsxk.jsp">【网上选课】</a></div></td>
  88.                 </tr>
  89.                 <tr>
  90.                   <td><div align="center"><a href="studentcjcx.jsp">【成绩查询】</a></div></td>
  91.                 </tr>
  92.                 
  93.               </table>
  94.               <p>  <strong><font color="#2DFFFF" size="5"> </font></strong></p>
  95.             </div>          </td>
  96.         </tr>
  97.       </table>
  98.     </TD>
  99.     <TD ROWSPAN=2> <IMG SRC="images/temp_05.jpg" WIDTH=4 HEIGHT=455></TD>
  100.     <TD COLSPAN=5 ROWSPAN=2>
  101.       <table width="510" border="0" cellspacing="0" cellpadding="0" height="455" background="images/main_bg.jpg">
  102.         <tr>
  103.           <td width="510">
  104.             <table width="510" border="0" cellspacing="0" cellpadding="0" height="455">
  105.               <tr>
  106.                 <td width="510" height="78">
  107.                   <div align="center"><img src="images/blank_banner.gif" width="468" height="60"></div>
  108.                 </td>
  109.               </tr>
  110.               <tr>
  111.                 <td valign="top">
  112.                   <div align="left"></div>                  <table width="91%" height="66" border="0" cellpadding="0" cellspacing="0">
  113.                     <tr>
  114.                       <td height="2" colspan="7">
  115.                         <p>                          <a href="index1.htm">首页</a>&gt;<a href="index1.jsp">学生</a>&gt;<a href="studentcjcx.jsp">成绩查询</a><br>
  116.                           <br>
  117. </p>
  118.                         <div align="center"></div></td>
  119.                     </tr>
  120.                     <tr>
  121.                       <td height="3" colspan="7"><% String sql = "select stuname  from student where stuid = '"+session.getValue("wnum")+"'";
  122. ResultSet rs=subject.executeQuery(sql);
  123. while (rs.next())
  124. {
  125. out.print(rs.getString("stuname"));
  126. teaname = rs.getString("stuname");
  127. }
  128. %>
  129. 同学 :</td>
  130.                     </tr>
  131.                     <tr>
  132.                       <td height="5" colspan="7"><div align="center">您所查询的课程成绩如下<br>
  133.                         <br>
  134.                       </div></td>
  135.                     </tr>
  136.                     <tr>
  137.                       <td width="10%" height="11"><div align="center"></div></td>
  138.                       <td width="12%">&nbsp;</td>
  139.                       <td width="19%"><div align="center">授课学期</div></td>
  140.                       <td width="23%"><div align="center">课程名称</div></td>
  141.                       <td width="13%"><div align="center">成绩</div></td>
  142.                       <td width="12%"><div align="center"></div></td>
  143.                       <td width="11%"><div align="center"></div></td>
  144.                     </tr>
  145.                     <tr>
  146.                       <td height="22" colspan="7"><br>
  147.                         <% String couname = new String (request.getParameter("select"));
  148. couname=couname.trim();
  149. couname=trans(couname);
  150. System.out.println (couname);
  151. String temcouid = new String();
  152. String result = new String();
  153. String term = new String();
  154. int temno=0;
  155. String sql1 = "select couid,couname from course where couname = '"+couname+"'";
  156. ResultSet rs1 = subject.executeQuery(sql1);
  157. while(rs1.next())
  158. {
  159. temcouid = rs1.getString("couid");
  160. }
  161. rs1.close();
  162. String sql2 = "select result,term from score where couid = '"+temcouid+"'and stuid = '"+session.getValue("wnum")+"'";
  163. ResultSet rs2 = subject.executeQuery(sql2);
  164. while(rs2.next())
  165. {temno=1;
  166. result = rs2.getString("result");
  167. term = rs2.getString("term");
  168. out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  169. %>
  170.                         第<%out.print(term);%>学期
  171.                         <%out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  172. out.print(couname);
  173. out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  174. out.print(result);out.print("<br>");
  175. }
  176. rs2.close();
  177. if (temno==0)
  178. response.sendRedirect("studentcjcxerr.htm");
  179. /*//String sql2 = "select couid,couname,coumark,couback from course where couid in (select couid from tc where teaid = '"+session.getValue("wnum")+"')";
  180.    String sql2 = "select scid,teaid,couid from sc where stuid = '"+session.getValue("wnum")+"'";
  181. ResultSet rs2=subject.executeQuery(sql2);
  182. while (rs2.next())
  183. { temscid = rs2.getInt("scid");
  184. out.print ("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  185. out.print ("<a href='studentxkd2.jsp?tuixuan=" +temscid + "'>退选</a>");
  186. teaid1 = rs2.getString("teaid");
  187. String  sql4 = "select teaname from teacher where teaid = '"+teaid1+"'";
  188. ResultSet rs4 = subject.executeQuery(sql4);
  189. while (rs4.next())
  190. {
  191. out.print ("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  192. out.print (rs4.getString("teaname"));
  193. }
  194. couid1 = rs2.getString("couid");
  195. //out.print("tttt");
  196. String sql3 = "select couid,couname,coumark,couback from course where couid = '"+couid1+"'";
  197. ResultSet rs3=subject.executeQuery(sql3);
  198. while (rs3.next())
  199. {out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  200. out.print(rs3.getString("couback"));
  201. out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  202. out.print(rs3.getString("couname"));
  203. out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  204. out.print(rs3.getString("coumark"));
  205. //out.print(rs3.getString("couback"));
  206. } */ %>                        <br>
  207.                         <br>
  208.                         <br>
  209.                       <%
  210. //couid1 = rs2.getString("couid");
  211. //teaname = rs.getString("teaname");
  212. //}
  213. /*String sql3 = "select couid,couname,coumark,couback from course where couid = '"+couid1+"'";
  214. ResultSet rs3=subject.executeQuery(sql3);
  215. while (rs3.next())
  216. {
  217. out.print("tttt");
  218. }*/
  219.   %></td></tr>
  220.                     <tr>
  221.                       <td colspan="7">&nbsp;</td>
  222.                     </tr>
  223.                                         </table></td>
  224.               </tr>
  225.             </table>
  226.           </td>
  227.         </tr>
  228.       </table>
  229.     </TD>
  230.     <TD ROWSPAN=2> <IMG SRC="images/temp_07.jpg" WIDTH=5 HEIGHT=455></TD>
  231.   </TR>
  232.   <TR>
  233.     <TD>
  234.       <table width="231" border="0" cellspacing="0" cellpadding="0" height="229" background="images/left_bottom.jpg">
  235.         <tr>
  236.           <td width="231" height="222">
  237.             <div align="center">
  238.               <table width="200" border="1">
  239.                 <tr>
  240.                   <td><div align="center"><a href="lyb.jsp">【留言板】</a></div></td>
  241.                 </tr>
  242.               </table>
  243.               <p>  <font color="#2DFFFF" size="5"> </font></p>
  244.               <p>&nbsp;  </p>
  245.               <p> <strong><font color="#2DFFFF" size="5"> </font></strong></p>
  246.               <p class="aaa"><a href="index1.htm" class="style1">[退出系统]</a></p>
  247.             </div>
  248.           </td>
  249.         </tr>
  250.       </table>
  251.     </TD>
  252.   </TR>
  253.   <TR>
  254.     <TD COLSPAN=8> <IMG SRC="images/temp_09.jpg" WIDTH=750 HEIGHT=5></TD>
  255.   </TR>
  256.   <TR>
  257.     <TD COLSPAN=8> <img src="images/temp_10.jpg" width=752 height=20></TD>
  258.   </TR>
  259. </TABLE>
  260. </BODY>
  261. </HTML>