admin_subject.jsp
上传用户:nbluoke
上传日期:2013-08-09
资源大小:4851k
文件大小:5k
源码类别:

教育系统应用

开发平台:

WORD

  1. <%@ page contentType="text/html; charset=gb2312" language="java" %>
  2. <%@ page import="java.sql.*" %>
  3. <%@ page import="java.io.*"%>
  4. <%@ page import="jinghua.*"%>
  5. <jsp:useBean id="DBCon" class="jinghua.JinghuaConn" scope="session">
  6. </jsp:useBean>
  7. <%!
  8. Connection con=null;
  9. PreparedStatement pstmt=null;
  10. ResultSet rs=null;
  11. %>
  12. <%
  13. try{
  14.     con=DBCon.getConnection();
  15.     String sql="SELECT  `subject`.`Name`,  `subject`.`ID`,  `grade`.`Name` AS `gn` "+
  16.         "FROM  `subject`  LEFT OUTER JOIN `grade` ON (`subject`.`gradenote` = `grade`.`note`) "+
  17.         "ORDER BY  `subject`.`gradenote`,  `subject`.`ID`";
  18.     pstmt=con.prepareStatement(sql);
  19.     rs=pstmt.executeQuery();
  20. %>
  21. <script language="javascript">
  22. function submitit(myform)
  23. {
  24. }
  25. function saveit(myform)
  26. {
  27.   if (confirm("是否保存所有修改?"))
  28.   {
  29.     myform.action="adminnianjisaveedit.asp";
  30.     myform.submit();
  31.   }
  32. }
  33. function delit(myform)
  34. {
  35.   if (confirm("将删除所有选择的科目数据?"))
  36.   {
  37.     myform.action="admin_subjectdel.jsp";
  38.     myform.submit();
  39.   }
  40. }
  41. function banji(myform)
  42. {
  43.     myform.action="adminbanji.asp";
  44.     myform.submit();
  45. }
  46. function power(myform)
  47. {
  48.     myform.action="adminbanjipower.asp";
  49.     myform.submit();
  50. }
  51. function FanAll(form){
  52. for (var i=1;i<form.elements.length;i++){
  53. var e = form.elements[i];
  54. if (e.checked == false){ e.checked = true; }
  55. else { e.checked = false;}
  56. }}
  57. </script>
  58. <html>
  59. <head>
  60. <meta http-equiv="Content-Language" content="zh-cn">
  61. <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
  62. <meta name="ProgId" content="FrontPage.Editor.Document">
  63. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  64. <title>系统管理 | 科目管理</title>
  65. </script>
  66. <link rel="stylesheet" type="text/css" href="../css.css">
  67. </head>
  68. <body>
  69. <table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2" height="25">
  70.   <tr>
  71.     <td width="100%">当前位置: 系统管理  &gt; 科目管理</td>
  72.   </tr>
  73. </table>
  74. <center><form name="admin_sub_add" method="POST" action="admin_subjectadd.jsp">
  75.     <table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#799AE1" width="508" id="AutoNumber3" height="20">
  76.       <tr>
  77.         <td width="65" bgcolor="#FFFDE8" background="../images/admin_bg_1.gif">
  78.           <p align="center"><b><font color="#FFFFFF">科目名称</font></b></td>
  79.         <td bgcolor="#FFFDE8" width="198"> <p align="left">
  80.             <input type="text" name="subject_name" size="33" onblur="this.className='inputnormal'" onfocus="this.className='inputedit';this.select()"     class="inputnormal" value="请输入科目名称">
  81.         </td>
  82. <td width="43" bgcolor="#FFFDE8" background="../images/admin_bg_1.gif">
  83.           <p align="center"><b><font color="#FFFFFF">年级</font></b></td>
  84.         <td bgcolor="#FFFDE8" width="122"><select name="grade" id="grade">
  85.             <%Tools.showGradeOption(con,out); %>
  86.           </select></td>
  87.         <td width="52" bgcolor="#FFFDE8"> <p align="center">
  88.             <input border="0" value="添 加" name="I1" type="submit" class="s02">
  89.         </td>
  90.       </tr>
  91.     </table>
  92.   </form>
  93. </center>
  94. <p><center>
  95.   </center>
  96. <br>
  97. </p>
  98. <center>
  99. <form name="admin_sub_del" method="get" onSubmit="return submitit(this)">
  100.     <table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#799AE1" width="324" id="AutoNumber1">
  101.       <tr    class="trh">
  102.         <td width="28" align="center" bgcolor="#E1E1E1" height="20"><input type=checkbox name=del_all1 value=1 onclick=FanAll(adminbanji)></td>
  103.         <td width="37" align="center" bgcolor="#E1E1E1"><font color="#FFFFFF"><b>序号</b></font></td>
  104.         <td align="center" bgcolor="#E1E1E1" width="120"> <font color="#FFFFFF">
  105.           <b>科目</b> </font></td>
  106.         <td align="center" bgcolor="#E1E1E1" width="120"> <font color="#FFFFFF">
  107.           <b>年级</b> </font></td>
  108.       </tr>
  109.   <%
  110.         int i=1;
  111.         while(rs.next()){%>
  112.       <tr   class="trh1">
  113.         <td align="center"   width="28"> <input type="checkbox" name="id" value="<%=rs.getString("ID")%>"></td>
  114.         <td align="center" width="37"><%=i%> </td>
  115.         <td width="120" align="center"><%=""+rs.getString("name")%>&nbsp; </td>
  116.         <td width="120" align="center"><%=""+rs.getString("gn")%>&nbsp;</td>
  117.       </tr>
  118.       <%
  119.       i++;
  120.       }
  121.       rs.close();
  122.       pstmt.close();
  123.       %>
  124.       <caption>
  125.       <p align="right">
  126.         <input type="submit" value="删除所选项" name="del" onclick="delit(admin_sub_del)" class="s02">
  127.       </p>
  128.       </caption>
  129.     </table>
  130.   </form>
  131. </center>
  132. </body>
  133. </html>
  134. <%}
  135. catch(SQLException se){
  136.     System.out.print(se.toString());
  137.     out.print(se.toString() );
  138. }
  139. finally{
  140.     DBCon.dropConnection();
  141. }
  142. %>