1 2 3 4

11.26

图书信息管理系统

今天发一下管理员各个功能的界面

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<div id="addSubjectForm" align="center">
<form action="libraryaddservlet?method=stu" method="post" onsubmit="return check()">
<tr>
<h2>请输入教师信息</h2>
</tr>

<table align="center"> 

    
    <tr>
    <td>读者学号:</td>
    <td> 
     <input pattern="[a-zA-Z0-9]{8,8}" name="stuID" >(输入八位学号)  
     </td> 
    </tr>
    <tr>
    <td>读者登录密码:</td>
    <td> 
     <input pattern="[a-zA-Z0-9]{6,8}" name="stupassword" >(默认为八位学号)  
     </td> 
    </tr>
<tr>
    <td>读者姓名:</td>
    <td>
    <input type="text" name="stuname">
    </td>
</tr>



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

<tr>
    <td>所在学院:</td>
    <td>
    <input type="text" name="college">
    </td>
</tr>



<tr>
                      <td colspan="2"><div align="center">
                        <input type="submit" value="录入信息">    
                    </div>
                </td>
                  </tr>
                  </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="stupassword"]:checked').val()==null) {
          alert('登录密码不能为空!');
          document.getElementById('stupassword').focus();
          return false;
         }
    if($('input:radio[name="stusex"]:checked').val()==null) {
          alert('性别不能为空!');
          document.getElementById('stusex').focus();
          return false;
         }
    
    
    if(document.getElementById('college').value=='') {
          alert('所在学院不能为空!');
          document.getElementById('college').focus();
          return false;
         }
    
}
</script>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<div id="addSubjectForm" align="center">
<form action="libraryaddservlet?method=book" method="post" onsubmit="return check()">
<tr>
<h2>请输入教师信息</h2>
</tr>

<table align="center"> 

    
    <tr>
    <td>图书编号:</td>
    <td> 
     <input pattern="[a-zA-Z0-9]{8,8}" name="bookID" >(输入八位学号)  
     </td> 
    </tr>
    <tr>
    <td>图书书名:</td>
    <td> 
     <input type="text" name="bookname" >  
     </td> 
    </tr>
<tr>
    <td>作者姓名:</td>
    <td>
    <input type="text" name="author">
    </td>
</tr>



<tr>
    <td>出版社名称:</td>
    <td>
     <input type="text" name="banname">
    </td>
</tr>

<tr>
    <td>可借阅数量:</td>
    <td>
    <input type="text" name="booknum">
    </td>
</tr>



<tr>
                      <td colspan="2"><div align="center">
                        <input type="submit" value="录入信息">    
                    </div>
                </td>
                  </tr>
                  </form>
                  </div>
                  
</body>
<script type="text/javascript">
function check()                        //封装一个<body>中做成点击事件的函数
{
    
    if($('input:radio[name="bookname"]:checked').val()==null) {
          alert('学生姓名不能为空!');
          document.getElementById('bookname').focus();
          return false;
         }
    if($('input:radio[name="bookID"]:checked').val()==null) {
          alert('学生学号不能为空!');
          document.getElementById('bookID').focus();
          return false;
         }
    if($('input:radio[name="author"]:checked').val()==null) {
          alert('作者不能为空!');
          document.getElementById('author').focus();
          return false;
         }
    
    
    if(document.getElementById('banname').value=='') {
          alert('出版社名称不能为空!');
          document.getElementById('banname').focus();
          return false;
         }
    if(document.getElementById('booknum').value=='') {
          alert('可借阅数量不能为空!');
          document.getElementById('booknum').focus();
          return false;
         }
    
}
</script>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="dao.SchoolDaoImpl"  %>
    <%@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="selectshow" align="center"><!--显示试题-->

            
                      <%
                      List<School> list=(List<School>)request.getAttribute("list");
                      
                      if(list==null||list.size()<1){
                          response.setHeader("refresh",

                                "5;URL=manage.jsp");
                      %>
                      <font color="red" size="5"> 没有催还图书<br> 五秒后将跳转到主页面 <br>

                如果没有跳转,请点击 <a href="manage.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(School school:list){
                          
                  %>
                          <tr align="center">
                          
                          
                          
                          <td><%=school.getBookID()%></td>
                          <td><%=school.getBookname()%></td>
                          <td><%=school.getAuthor()%></td>
                          <td><%=school.getBanname() %></td>
                          
                  </tr>
                  
                  <%}
                      
                  %>

                 <%} %>
                 <tr align="center">
                  <ul>
                <li><a href="manage.jsp">回到主页 </a></li>
                
                </ul>
                  </tr>
                 
                    </table>
            </div>
</body>
</html>

 

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