1 2 3 4

12.4

员工管理系统

教师相关功能的界面

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="Teaservlet?method=gradeadd" method="post" onsubmit="return check()">

<tr>
<h2>请输入您要添加的成绩信息:</h2>
</tr>

<table align="center"> 

    
    <tr>
    <td>学生工号:</td>
    <td> 
     <input pattern="[a-zA-Z0-9]{6,10}" name="stuID" >
     </td> 
    </tr>
<tr>
    <td>学生姓名:</td>
    <td>
    <input type="text" name="stuname">
    </td>
</tr>

<tr>
    <td>科目名称:</td>
    <td>
    <input type="text" name="course">
    </td>
</tr>

<tr>
    <td>成绩分数:</td>
    <td>
    <input type="text" name="grade">
    </td>
</tr>



<tr>
                      <td colspan="2"><div align="center">
                        <input type="submit" value="录入信息">    
                    </div>
                </td>
                  </tr>
                  <ul>
                
                <li><a href="teacher.jsp">回到主页 </a></li>
                </ul>
                  </form>
                  </div>
                  
</body>
<script type="text/javascript">
function check()                        //封装一个<body>中做成点击事件的函数
{
    
    if($('input:radio[name="stuname"]:checked').val()==null) {
          alert('学生姓名不能为空!');
          document.getElementById('stuname').focus();
          return false;
         }
    if($('input:radio[name="stuID"]:checked').val()==null) {
          alert('学生工号不能为空!');
          document.getElementById('stuID').focus();
          return false;
         }
    if($('input:radio[name="course"]:checked').val()==null) {
          alert('课程名称不能为空!');
          document.getElementById('course').focus();
          return false;
         }
    if($('input:radio[name="grade"]:checked').val()==null) {
          alert('课程成绩不能为空!');
          document.getElementById('grade').focus();
          return false;
         }
    
    
}
</script>

</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

<div id="addSubjectForm" align="center">
                <form action="Teaservlet?method=fangshi" method="post">
                <tr>
                <h1>请选择汇总查看方式</h1> 
                
                <td>
                <select name="fangshi"> 
                 <option value="1">显示成绩达到及格</option> 
                 <option value="2">显示成绩达到优秀</option>
                 
                 </select> 
                </td>
                
                </tr>
                <tr>
                      <td colspan="2"><div align="center">
                        <input type="submit" value="查询信息">    
                    </div>
                </td>
                  </tr>
                  <tr align="center">
                  <font color="red" size="5"> <br>  <br>

                请点击 <a href="teacher.jsp">这里回到主页面</a>!!! <br>

            </font>
                  </tr>
                 
                </form>
</div>


</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="dao.*"  %>
    <%@page import= "java.util.*" %>
    <%@page import="entity.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<div id="stushowclass" align="center"><!--显示试题-->            
                      <%
                      List<Staff> list=(List<Staff>)request.getAttribute("list");    
                      if(list==null||list.size()<1){
                          response.setHeader("refresh","5;URL=teacher.jsp");
                      %>
                      <font color="red" size="5"> 查询信息时出现错误,未能读出个人的信息<br> 五秒后将跳转到主页面 <br>
                如果没有跳转,请点击 <a href="teacher.jsp">这里</a>!!! <br>
            </font>
                      <% }
                      else{%>
                          <table border="0" cellspacing="10" cellpadding="0">
                        <tr>
                        <td align="center" colspan="5">
                        <h1>个人信息</h1>
                        </td>
                        </tr>
                        <tr align="center">
                                <td><b>工号</b></td>
                                <td><b>姓名</b></td>
                                <td><b>性别</b></td>
                                <td><b>部门</b></td>
                                <td><b>职称</b></td>
                            </tr>
                       <%
                          for(Staff school:list){
                          
                  %>
                          <tr align="center">
                          
                          <td><%=school.getTeaID() %></td>
                          <td><%=school.getTeaname() %></td>
                          <td><%=school.getTeasex()%></td>
                          
                          
                          
                          <td><%=school.getTeaclass() %></td>
                          <td><%=school.getTeatitle() %></td>
                  </tr>
                  
                  <%}
                      
                  %>
                 <tr align="center">
                  <font color="red" size="5"> <br>  <br>

                请点击 <a href="teacher.jsp">这里回到主页面</a>!!! <br>

            </font>
                  </tr>
                 <%} %>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="dao.*"  %>
    <%@page import= "java.util.*" %>
    <%@page import="entity.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
        String teaID=(String)request.getSession().getAttribute("ID");
        System.out.println(teaID);     
                  %>
<div id="stushowclass" align="center"><!--显示试题-->            
                      <%
                      List<Staff> list=(List<Staff>)request.getAttribute("list");    
                      if(list==null||list.size()<1){
                          response.setHeader("refresh",
                                "5;URL=teacher.jsp");
                      %>
                      <font color="red" size="5"> 查询信息时出现错误,未能读出个人的信息<br> 五秒后将跳转到主页面 <br>
                如果没有跳转,请点击 <a href="teacher.jsp">这里</a>!!! <br>
            </font>
                      <% }
                      else{%>
                          <table border="0" cellspacing="10" cellpadding="0">
                        <tr>
                        <td align="center" colspan="5">
                        <h1>个人信息</h1>
                        </td>
                        </tr>
                        <tr align="center">
                                <td><b>工号</b></td>
                                <td><b>姓名</b></td>
                                <td><b>性别</b></td>
                                <td><b>部门</b></td>
                                <td><b>职称</b></td>
                            </tr>
                       <%
                          for(Staff school:list){                        
                  %>
                          <tr align="center">                       
                          <td><%=school.getTeaID() %></td>
                          <td><%=school.getTeaname() %></td>
                          <td><%=school.getTeasex()%></td>
                          <td><%=school.getTeaclass() %></td>
                          <td><%=school.getTeatitle() %></td>
                  </tr>
                  
                  <%}
                      
                  %>
                 <tr align="center">
                  <font color="red" size="5"> <br>  <br>

                请点击 <a href="teacher.jsp">这里回到主页面</a>!!! <br>

            </font>
                  </tr>
                 
<form action="Teaservlet?method=update" method="post">
<tr>
<td>输入修改后的信息:</td>
</tr>
  
    <tr>
    <td>工号:</td>
    <td> 
     <%=teaID %>(八位工号,不允许修改)  
     </td> 
    </tr>
<tr>
    <td>姓名:</td>
    <td>
    <input type="text" name="teaname">
    
    </td>
</tr>



<tr>
    <td>性别:</td>
    <td>
     <input type="radio" name="teasex" value=""><input type="radio" name="teasex" value="" checked></td>
</tr>

<tr>
    <td>部门:</td>
    <td>
    <input type="text" name="teaclass">
    </td>
</tr>

<tr>
    <td>职称:</td>
    <td>
     <input type="text" name="teatitle">
    </td>
</tr>

<tr>
                      <td colspan="2"><div align="center">
                        <input type="submit" value="修改信息"> </tr>
                  </form>
                 <%} %>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="dao.*"  %>
    <%@page import= "java.util.*" %>
    <%@page import="entity.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

<div id="stushowclass" align="center"><!--显示试题-->            
                      <%
                      List<Staff> list=(List<Staff>)request.getAttribute("list");    
                      if(list==null||list.size()<1){
                          response.setHeader("refresh",
                                "5;URL=teacher.jsp");
                      %>
                      <font color="red" size="5"> 查询信息时出现错误,未能读出个人的信息<br> 五秒后将跳转到主页面 <br>
                如果没有跳转,请点击 <a href="teacher.jsp">这里</a>!!! <br>
            </font>
                      <% }
                      else{%>
                          <table border="0" cellspacing="10" cellpadding="0">
                        <tr>
                        <td align="center" colspan="5">
                        <h1>所有成绩信息,点击相应工号进入修改页面</h1>
                        </td>
                        </tr>
                        <tr align="center">
                                <td><b>学生工号</b></td>
                                <td><b>学生姓名</b></td>
                                <td><b>科目</b></td>
                                <td><b>成绩</b></td>
                                
                            </tr>
                       <%
                          for(Staff school:list){                        
                  %>
                          <tr align="center">                       
                          <td><a href="Teaservlet?method=gradeshow&stuID=<%=school.getStuID()%>"><%=school.getStuID() %></td>
                          <td><%=school.getStuname() %></td>
                          <td><%=school.getCourse()%></td>
                          <td><%=school.getGrade() %></td>
                          
                  </tr>
                  
                  <%}
                      
                  %>
                 <tr align="center">
                  <font color="red" size="5"> <br>  <br>

                请点击 <a href="teacher.jsp">这里回到主页面</a>!!! <br>

            </font>
                  </tr>
                <%} %> 

</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="dao.*"  %>
    <%@page import= "java.util.*" %>
    <%@page import="entity.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

<div id="stushowclass" align="center"><!--显示试题-->            
                      <%
                      List<Staff> list=(List<Staff>)request.getAttribute("list");    
                      String stuID=null;
                      if(list==null||list.size()<1){
                          response.setHeader("refresh",
                                "5;URL=Teaservlet?method=showgrade");
                      %>
                      <font color="red" size="5"> 查询信息时出现错误,未能读出个人的信息<br> 五秒后将跳转到上一个页面 <br>
                如果没有跳转,请点击 <a href="Teaservlet?method=showgrade">这里</a>!!! <br>
            </font>
                      <% }
                      else{%>
                          <table border="0" cellspacing="10" cellpadding="0">
                        <tr>
                        <td align="center" colspan="5">
                        <h1>所有成绩信息,点击相应工号进入修改页面</h1>
                        </td>
                        </tr>
                        <tr align="center">
                                <td><b>学生工号</b></td>
                                <td><b>学生姓名</b></td>
                                <td><b>科目</b></td>
                                <td><b>成绩</b></td>
                                
                            </tr>
                       <%
                          for(Staff school:list){                        
                  %>
                          <tr align="center">                       
                          <td><%=school.getStuID() %></td>
                          <%stuID=school.getStuID();
                          session.setAttribute("stuID", stuID);
                        request.setAttribute("stuID", stuID); 
                          %>
                          <td><%=school.getStuname() %></td>
                          <td><%=school.getCourse()%></td>
                          <td><%=school.getGrade() %></td>
                          
                  </tr>
                  
                  <%}
                      
                  %>
                 <tr align="center">
                  <font color="red" size="5"> <br>  <br>

                请点击 <a href="Teaservlet?method=showgrade">这里</a>回到信息页面!!! <br>

            </font>
                  </tr>
                
<form action="Teaservlet?method=updategrade" method="post">
<tr>
<td>输入修改后的成绩:</td>
</tr>
<tr>
    <td>学生工号:</td>
    <td>
     <td><%=stuID %></td>
    </td>
</tr>
<tr>
    <td>成绩:</td>
    <td>
     <input type="text" name="grade">
    </td>
</tr>

<tr>
                      <td colspan="2"><div align="center">
                        <input type="submit" value="修改成绩"> </tr>
                  </form>
                 <%} %>
</body>
</html>

 

posted @ 2020-12-04 22:22  小陈的太阳  阅读(99)  评论(0编辑  收藏  举报