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

教育系统应用

开发平台:

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   `grade`.`Name` AS `gn`,  `knowpoint`.`ID`,  `knowpoint`.`Name`, "+
  16.         " `subject`.`Name` AS `sn`,  `knowpoint`.`gradeid` FROM  `knowpoint` "+
  17.         "  LEFT OUTER JOIN `subject` ON (`knowpoint`.`subid` = `subject`.`ID`) "+
  18.         "  LEFT OUTER JOIN `grade` ON (`knowpoint`.`gradenote` = `grade`.`note`) "+
  19.         "ORDER BY   `grade`.`ID`,  `subject`.`ID`";
  20.     pstmt=con.prepareStatement(sql);
  21.     rs=pstmt.executeQuery();
  22. %>
  23. <script language="javascript">
  24. function submitit(myform)
  25. {
  26. }
  27. function checkdata(){
  28.     if( myform.selgrade.selectedIndex == 0) {
  29.         alert("请选择知识点的年级信息!")
  30.         return false;
  31.     }
  32.     if(myform.selsubject.selectedIndex==0){
  33.         alert("请选择知识点的科目信息!")
  34.         return false;
  35.     }
  36. }
  37. function saveit(myform)
  38. {
  39.   if (confirm("是否保存所有修改?"))
  40.   {
  41.     myform.action="adminnianjisaveedit.asp";
  42.     myform.submit();
  43.   }
  44. }
  45. function delit(myform)
  46. {
  47.   if (confirm("将删除所有选择的知识点数据?"))
  48.   {
  49.     myform.action="admin_knowdel.jsp";
  50.     myform.submit();
  51.   }
  52. }
  53. function banji(myform)
  54. {
  55.     myform.action="adminbanji.asp";
  56.     myform.submit();
  57. }
  58. function power(myform)
  59. {
  60.     myform.action="adminbanjipower.asp";
  61.     myform.submit();
  62. }
  63. function FanAll(form){
  64. for (var i=1;i<form.elements.length;i++){
  65. var e = form.elements[i];
  66. if (e.checked == false){ e.checked = true; }
  67. else { e.checked = false;}
  68. }}
  69. </script>
  70. <%String gs=Tools.selgrade_sub(con);
  71. out.print(gs);
  72. %>
  73. <html>
  74. <head>
  75. <meta http-equiv="Content-Language" content="zh-cn">
  76. <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
  77. <meta name="ProgId" content="FrontPage.Editor.Document">
  78. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  79. <title>系统管理 | 科目管理</title>
  80. </script>
  81. <link rel="stylesheet" type="text/css" href="../css.css">
  82. </head>
  83. <body>
  84. <table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2" height="25">
  85.   <tr>
  86.     <td width="100%">当前位置: 系统管理 &gt; 知识点管理</td>
  87.   </tr>
  88. </table>
  89. <center><form name="myform" method="POST" action="admin_knowadd.jsp" onSubmit="return checkdata()">
  90.     <table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#799AE1" width="593" id="AutoNumber3" height="20">
  91.       <tr>
  92.         <td width="67" nowrap background="../images/admin_bg_1.gif" bgcolor="#FFFDE8"> 
  93.           <p align="center"><b><font color="#FFFFFF">知识点名称</font></b></td>
  94.         <td bgcolor="#FFFDE8" width="209"> <p align="left">
  95.             <input type="text" name="name" size="33" onblur="this.className='inputnormal'" onfocus="this.className='inputedit';this.select()"     class="inputnormal" value="请输入知识点名称">
  96.         </td>
  97.         <td width="44" nowrap background="../images/admin_bg_1.gif" bgcolor="#FFFDE8"> 
  98.           <p align="center"><b><font color="#FFFFFF">年级</font></b></td>
  99.  <td bgcolor="#FFFDE8" width="122">
  100.  <select name="selgrade" id="grade"
  101.         onChange="changegs(document.myform.selgrade.options[document.myform.selgrade.selectedIndex].value)" size="1">
  102.         <option selected value="temp">未选择</option>
  103.             <%Tools.showGradeOption(con,out); %>
  104.           </select></td>
  105.         <td width="54" nowrap background="../images/admin_bg_1.gif" bgcolor="#FFFDE8"> 
  106.           <p align="center"><b><font color="#FFFFFF">科目</font></b></td>
  107.         <td width="82" bgcolor="#FFFDE8">
  108. <select name="selsubject" id="subject">
  109.         <option selected value="temp">未选择</option>
  110.           </select></td>
  111.         <td width="52" bgcolor="#FFFDE8">
  112.         <input border="0" value="添 加" name="I1" type="submit" class="s02" onsubmit="return checkform1(this)"></td>
  113.       </tr>
  114.     </table>
  115.   </form>
  116. </center>
  117. <p><center>
  118.   </center>
  119. <br>
  120. </p>
  121. <center>
  122. <form name="admin_sub_del" method="get" onSubmit="return submitit(this)">
  123.     <table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#799AE1" width="424" id="AutoNumber1">
  124.       <tr    class="trh"> 
  125.         <td width="36" align="center" bgcolor="#E1E1E1" height="20"><input type=checkbox name=del_all1 value=1 onclick=FanAll(adminbanji)></td>
  126.         <td width="48" align="center" bgcolor="#E1E1E1"><font color="#FFFFFF"><b>序号</b></font></td>
  127.         <td align="center" bgcolor="#E1E1E1" width="175"> <font color="#FFFFFF"> 
  128.           <b>知识点</b> </font></td>
  129.         <td align="center" bgcolor="#E1E1E1" width="71"><font color="#FFFFFF"><b>科目</b> 
  130.           </font></td>
  131.         <td align="center" bgcolor="#E1E1E1" width="66"> <font color="#FFFFFF"> 
  132.           <b>年级</b> </font></td>
  133.       </tr>
  134.       <%
  135.       int i=1;
  136.         while(rs.next()){%>
  137.       <tr   class="trh1"> 
  138.         <td align="center"   width="36"> <input type="checkbox" name="id" value="<%=rs.getString("ID")%>"></td>
  139.         <td align="center" width="48"><%=i%> </td>
  140.         <td width="175" align="center"><%=""+rs.getString("name")%>&nbsp; </td>
  141.         <td width="71" align="center"><%=rs.getString("sn")%>&nbsp;</td>
  142.         <td width="66" align="center"><%=""+rs.getString("gn")%>&nbsp;</td>
  143.       </tr>
  144.       <%
  145.       i++;}
  146.       rs.close();
  147.       pstmt.close();
  148.       %>
  149.       <caption>
  150.       <p align="right"> 
  151.         <input type="submit" value="删除所选项" name="del" onClick="delit(admin_sub_del)" class="s02">
  152.       </p>
  153.       </caption>
  154.     </table>
  155.   </form>
  156. </center>
  157. </body>
  158. </html>
  159. <%
  160. }
  161. catch(SQLException se){
  162.     out.print(se.toString() );
  163. }
  164. catch(Exception e){
  165.     out.print(e.toString());
  166. }
  167. finally{
  168.     DBCon.dropConnection();
  169. }
  170. %>