admin_subject.jsp
资源名称:0102010.rar [点击查看]
上传用户:nbluoke
上传日期:2013-08-09
资源大小:4851k
文件大小:5k
源码类别:
教育系统应用
开发平台:
WORD
- <%@ page contentType="text/html; charset=gb2312" language="java" %>
- <%@ page import="java.sql.*" %>
- <%@ page import="java.io.*"%>
- <%@ page import="jinghua.*"%>
- <jsp:useBean id="DBCon" class="jinghua.JinghuaConn" scope="session">
- </jsp:useBean>
- <%!
- Connection con=null;
- PreparedStatement pstmt=null;
- ResultSet rs=null;
- %>
- <%
- try{
- con=DBCon.getConnection();
- String sql="SELECT `subject`.`Name`, `subject`.`ID`, `grade`.`Name` AS `gn` "+
- "FROM `subject` LEFT OUTER JOIN `grade` ON (`subject`.`gradenote` = `grade`.`note`) "+
- "ORDER BY `subject`.`gradenote`, `subject`.`ID`";
- pstmt=con.prepareStatement(sql);
- rs=pstmt.executeQuery();
- %>
- <script language="javascript">
- function submitit(myform)
- {
- }
- function saveit(myform)
- {
- if (confirm("是否保存所有修改?"))
- {
- myform.action="adminnianjisaveedit.asp";
- myform.submit();
- }
- }
- function delit(myform)
- {
- if (confirm("将删除所有选择的科目数据?"))
- {
- myform.action="admin_subjectdel.jsp";
- myform.submit();
- }
- }
- function banji(myform)
- {
- myform.action="adminbanji.asp";
- myform.submit();
- }
- function power(myform)
- {
- myform.action="adminbanjipower.asp";
- myform.submit();
- }
- function FanAll(form){
- for (var i=1;i<form.elements.length;i++){
- var e = form.elements[i];
- if (e.checked == false){ e.checked = true; }
- else { e.checked = false;}
- }}
- </script>
- <html>
- <head>
- <meta http-equiv="Content-Language" content="zh-cn">
- <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
- <meta name="ProgId" content="FrontPage.Editor.Document">
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>系统管理 | 科目管理</title>
- </script>
- <link rel="stylesheet" type="text/css" href="../css.css">
- </head>
- <body>
- <table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2" height="25">
- <tr>
- <td width="100%">当前位置: 系统管理 > 科目管理</td>
- </tr>
- </table>
- <center><form name="admin_sub_add" method="POST" action="admin_subjectadd.jsp">
- <table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#799AE1" width="508" id="AutoNumber3" height="20">
- <tr>
- <td width="65" bgcolor="#FFFDE8" background="../images/admin_bg_1.gif">
- <p align="center"><b><font color="#FFFFFF">科目名称</font></b></td>
- <td bgcolor="#FFFDE8" width="198"> <p align="left">
- <input type="text" name="subject_name" size="33" onblur="this.className='inputnormal'" onfocus="this.className='inputedit';this.select()" class="inputnormal" value="请输入科目名称">
- </td>
- <td width="43" bgcolor="#FFFDE8" background="../images/admin_bg_1.gif">
- <p align="center"><b><font color="#FFFFFF">年级</font></b></td>
- <td bgcolor="#FFFDE8" width="122"><select name="grade" id="grade">
- <%Tools.showGradeOption(con,out); %>
- </select></td>
- <td width="52" bgcolor="#FFFDE8"> <p align="center">
- <input border="0" value="添 加" name="I1" type="submit" class="s02">
- </td>
- </tr>
- </table>
- </form>
- </center>
- <p><center>
- </center>
- <br>
- </p>
- <center>
- <form name="admin_sub_del" method="get" onSubmit="return submitit(this)">
- <table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#799AE1" width="324" id="AutoNumber1">
- <tr class="trh">
- <td width="28" align="center" bgcolor="#E1E1E1" height="20"><input type=checkbox name=del_all1 value=1 onclick=FanAll(adminbanji)></td>
- <td width="37" align="center" bgcolor="#E1E1E1"><font color="#FFFFFF"><b>序号</b></font></td>
- <td align="center" bgcolor="#E1E1E1" width="120"> <font color="#FFFFFF">
- <b>科目</b> </font></td>
- <td align="center" bgcolor="#E1E1E1" width="120"> <font color="#FFFFFF">
- <b>年级</b> </font></td>
- </tr>
- <%
- int i=1;
- while(rs.next()){%>
- <tr class="trh1">
- <td align="center" width="28"> <input type="checkbox" name="id" value="<%=rs.getString("ID")%>"></td>
- <td align="center" width="37"><%=i%> </td>
- <td width="120" align="center"><%=""+rs.getString("name")%> </td>
- <td width="120" align="center"><%=""+rs.getString("gn")%> </td>
- </tr>
- <%
- i++;
- }
- rs.close();
- pstmt.close();
- %>
- <caption>
- <p align="right">
- <input type="submit" value="删除所选项" name="del" onclick="delit(admin_sub_del)" class="s02">
- </p>
- </caption>
- </table>
- </form>
- </center>
- </body>
- </html>
- <%}
- catch(SQLException se){
- System.out.print(se.toString());
- out.print(se.toString() );
- }
- finally{
- DBCon.dropConnection();
- }
- %>