studentcjcx3.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"><div align="left"><br>
  147.                           <% String temterm = new String (request.getParameter("select2"));
  148. temterm=temterm.trim();
  149. temterm=trans(temterm);
  150. System.out.println (temterm);
  151. String temcouid = new String();
  152. String temcouname = new String();
  153. String result = new String();
  154. String term = new String();
  155. int temno=0;
  156. /*String sql1 = "select couid,term from course where couname = '"+couname+"'";
  157. ResultSet rs1 = subject.executeQuery(sql1);
  158. while(rs1.next())
  159. {
  160. temcouid = rs1.getString("couid");
  161. }
  162. rs1.close();*/
  163. String sql2 = "select result,couid from score where term = '"+temterm+"'and stuid = '"+session.getValue("wnum")+"'";
  164. ResultSet rs2 = subject.executeQuery(sql2);
  165. while(rs2.next())
  166. {temno=1;
  167. result = rs2.getString("result");
  168. temcouid = rs2.getString("couid");
  169. String sql1 = "select couname from course where couid = '"+temcouid+"'";
  170. ResultSet rs1 = subject.executeQuery(sql1);
  171. while(rs1.next())
  172. {
  173. temcouname = rs1.getString("couname");
  174. out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  175. out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  176. out.print(temcouname);
  177. out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  178. out.print("&nbsp;&nbsp;&nbsp;&nbsp;");
  179. out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  180. out.print(result);
  181. out.print("<br><br>");
  182. }
  183. rs1.close();
  184. }
  185. rs2.close();
  186. if (temno==0)
  187. response.sendRedirect("studentcjcxerr2.htm");
  188. %>
  189. <%
  190. /*//String sql2 = "select couid,couname,coumark,couback from course where couid in (select couid from tc where teaid = '"+session.getValue("wnum")+"')";
  191.    String sql2 = "select scid,teaid,couid from sc where stuid = '"+session.getValue("wnum")+"'";
  192. ResultSet rs2=subject.executeQuery(sql2);
  193. while (rs2.next())
  194. { temscid = rs2.getInt("scid");
  195. out.print ("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  196. out.print ("<a href='studentxkd2.jsp?tuixuan=" +temscid + "'>退选</a>");
  197. teaid1 = rs2.getString("teaid");
  198. String  sql4 = "select teaname from teacher where teaid = '"+teaid1+"'";
  199. ResultSet rs4 = subject.executeQuery(sql4);
  200. while (rs4.next())
  201. {
  202. out.print ("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  203. out.print (rs4.getString("teaname"));
  204. }
  205. couid1 = rs2.getString("couid");
  206. //out.print("tttt");
  207. String sql3 = "select couid,couname,coumark,couback from course where couid = '"+couid1+"'";
  208. ResultSet rs3=subject.executeQuery(sql3);
  209. while (rs3.next())
  210. {out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  211. out.print(rs3.getString("couback"));
  212. out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  213. out.print(rs3.getString("couname"));
  214. out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  215. out.print(rs3.getString("coumark"));
  216. //out.print(rs3.getString("couback"));
  217. } */ %>
  218.                           <br>
  219.                           <br>
  220.                           (以上为第<%out.print(temterm);%>
  221.                           学年成绩)<br>
  222.                       </div></td></tr>
  223.                     <tr>
  224.                       <td colspan="7">&nbsp;</td>
  225.                     </tr>
  226.                                         </table></td>
  227.               </tr>
  228.             </table>
  229.           </td>
  230.         </tr>
  231.       </table>
  232.     </TD>
  233.     <TD ROWSPAN=2> <IMG SRC="images/temp_07.jpg" WIDTH=5 HEIGHT=455></TD>
  234.   </TR>
  235.   <TR>
  236.     <TD>
  237.       <table width="231" border="0" cellspacing="0" cellpadding="0" height="229" background="images/left_bottom.jpg">
  238.         <tr>
  239.           <td width="231" height="222">
  240.             <div align="center">
  241.               <table width="200" border="1">
  242.                 <tr>
  243.                   <td><div align="center"><a href="lyb.jsp">【留言板】</a></div></td>
  244.                 </tr>
  245.               </table>
  246.               <p>  <font color="#2DFFFF" size="5"> </font></p>
  247.               <p>&nbsp;  </p>
  248.               <p> <strong><font color="#2DFFFF" size="5"> </font></strong></p>
  249.               <p class="aaa"><a href="index1.htm" class="style1">[退出系统]</a></p>
  250.             </div>
  251.           </td>
  252.         </tr>
  253.       </table>
  254.     </TD>
  255.   </TR>
  256.   <TR>
  257.     <TD COLSPAN=8> <IMG SRC="images/temp_09.jpg" WIDTH=750 HEIGHT=5></TD>
  258.   </TR>
  259.   <TR>
  260.     <TD COLSPAN=8> <img src="images/temp_10.jpg" width=752 height=20></TD>
  261.   </TR>
  262. </TABLE>
  263. </BODY>
  264. </HTML>