Design and implementation of hotel management system based on JSP+MySQL

Contents
Abstract i
ABSTRACT ii
1. Introduction 1
1.1 Background of the topic 1
1.2 Purpose and significance 1
1.3 Development tools and technologies 1
1.3.1 Development tools 1
1.3.2 JSP 2
1.3.4 Introduction to MVC 2
1.4 Software and hardware requirements 3
1.5 Summary of this chapter 3
2. Requirements analysis 4
2.1 Requirements research 4
2.2 Feasibility analysis 4
2.2.1 Technical feasibility 4
2.2.2 Economic feasibility 4
2.2.3 Operational feasibility 4
2.2.4 Legal feasibility 4
2.3 System user use cases Figure 5
2.3.1 Administrator use case diagram 5
2.4 Function module requirement analysis 5
2.5 Performance requirements 6
2.5.1 System security 6
2.5.2 Data integrity 6
2.6 Summary of this chapter 6
3. System analysis and design 7
3.1 System modules Design 7
3.1.1 Overall design framework 7
3.1.2 Overall design module 7
3.2 Analysis and design of database 8
3.2.1 Conceptual structure design of database 8
3.2.2 Logical structure design of database 9
3.2.2 Database connection principle 11
3.3 Design ideas 12
3.4 Detailed design 12
3.4.1 Login module design 12
3.4.2 Room management module design 12
3.4.3 Customer module design 13
3.4.4 Special dish introduction module design 13
3.4.5 Table reservation module design 14
3.4.6 Catering consumption management module design 14
3.5 Summary of this chapter 14
4. System function implementation 15
4.1 System login page implementation 15
4.2 Overall function module 16
4.2.1 Administrator management 16
4.2.2 Room category management 18
4.2 .3 Room information management 20
4.2.4 Room reservation information management 22
4.2.5 Customer information management 23
4.2.6 Specialty catering management 24
4.2.7 Table reservation management 25
4.2.8 Customer consumption management 26
4.3 Summary of this chapter 28
5. System test …29
5.1 The purpose and significance of system testing 29
5.2 Testing principles 29
5.3 Testing objectives 29
5.4 Principles of test case design 29
5.5 Testing process 30
5.5.1 Main page login module test 30
5.5.2 Change password test 31
5.5.3 Customer Add test 32
5.5.4 Room reservation addition test 33
5.5.5 Customer information query test 33
5.5.6 Other module tests 34
5.6 Chinese garbled problem 34
5.7 Other errors 34
Conclusion 36
References 37
Acknowledgments 38
Foreign literature and translation 39

3 System analysis and design
System analysis and design Analysis and design are the most important components in the system development process. It will affect the implementation of subsequent code writing. Although the specific implementation processes of different systems are different, they all have the same purpose. It can be seen from actual work and study that the quality of system analysis and design has a huge connection with the success or failure of the system.
The task of management system analysis is: on the basis of fully understanding the original system, by querying feasible information, defining problem identification, planning detailed investigations, and through systematic analysis, finally completing the logical scheme design of the new system, or logical prototype design [2].
3.1 System module design
3.1.1 Overall design framework
Based on the above analysis of the system, the overall design of the system is now carried out. The modules of the overall design function are shown in Figure 3.1.

Insert image description here

Figure 3.1 Modules of the overall design function Figure
3.1.2 Specific modules of the overall design
According to the functional modules and demand analysis of the overall design, the data dictionary of each module of the hotel management system:
1. System administrator data: included data items user name, password .
2. Room type data: The data items included include ID number and type name.
3. Room information data: The data items included include room number, room area, room introduction, room pictures, and room type.
4. Room reservation data: The data items included include room reservation, reservation time, name and phone number of the reservation user, and number of reservation days.
5. Check-in consumption data: Data items included include room stay, check-in time, customer name and contact information, number of days booked and consumption amount.
6. Customer information data: The data items included include customer name, address, phone number, and E-mail.
7. Specialty meal data: The data items included include name, description, picture, and price.
8. Table reservation data: The data items included include reservation time, reservation table number, and reservation person.
9. Catering consumption data: The data items included include consumption time, consumption amount, and consumer name.

<%@ page language="java" pageEncoding="utf-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
	<title>酒店管理系统</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
     
  <link rel="stylesheet" type="text/css" href="<%=path %>/css/style.css">
    <style type="text/css">
    body 
    {
    
    
	   margin-left: 0px;
	   background-image: url(<%=path %>/images/bhj.jpg);
    }
/*     table {
 background-color: #0099FF;
} */
    .style2 {
    
    color: #990000}
    .input2 
    {
    
    
 	   font-size: 12px;
	   border: 3px double #A8D0EE;
	   color: #344898;
    }
    .submit1 
    {
    
    
	   border: 3px double #416C9C;
	   height: 22px;
	   width: 45px;
	   background-color: #F2F2F2;
	   font-size: 12px;
	   padding-top: 1px;
	   background-image: url(bt.gif);
	   cursor: hand;
    }
    .STYLE12 {
    
    font-family: Georgia, "Times New Roman", Times, serif}
    .STYLE13 {
    
    color: #316BD6; }
    .STYLE15 {
    
    color: #fdsere; font-size: 9pt; }
 </style>
 <script type='text/javascript' src='<%=path %>/dwr/interface/loginService.js'></script>
 <script type='text/javascript' src='<%=path %>/dwr/engine.js'></script>
 <script type='text/javascript' src='<%=path %>/dwr/util.js'></script>
      
 <script language="javascript"> 
 function check1()
 {
    
                                                                                             
     if(document.ThisForm.userName.value=="")
	 {
    
    
	 	alert("请输入用户名");
		document.ThisForm.userName.focus();
		return false;
	 }
	 if(document.ThisForm.userPw.value=="")
	 {
    
    
	 	alert("请输入密码");
		document.ThisForm.userPw.focus();
		return false;
	 }
	 document.getElementById("indicator").style.display="block";
	 loginService.login(document.ThisForm.userName.value,document.ThisForm.userPw.value,0,callback);
 }

 function callback(data)
 {
    
    
    document.getElementById("indicator").style.display="none";
    if(data=="no")
    {
    
    
        alert("用户名或密码错误");
    }
    if(data=="yes")
    {
    
    
        alert("通过验证,系统登录成功");
        window.location.href="<%=path %>/loginSuccess.jsp";
    }
 }
 </script>
</head>
<body>
	<br>
	<br>
	<br>
	<br>
	<table width="559" height="423" border="0" align="center" cellpadding="0" cellspacing="0"  bgColor="#ceceff">
	 <tr>
	    <td><div align="center" style="FONT-WEIGHT: bold; FONT-SIZE: 40pt;">酒店管理系统</div></td>
	 </tr>
	 <tr>
		<td width="559">
			<form name="ThisForm" method="POST" action="">
				<center><table width="410" height="198" border="0" align="right" cellpadding="0" cellspacing="0">
					<tr>
						<td height="10" colspan="2"></td>
					</tr>
			        <tr>
					    <td width="54" height="25" valign="bottom">
						    <span class="STYLE15" >用户名:</span>
						</td>
						<td width="356" valign="bottom">
					        <input name="userName"  type="text" class="input2" size="21" onMouseOver="this.style.background='#F0DAF3';" onMouseOut="this.style.background='#FFFFFF'">
						</td>
					</tr>
					<tr>
						<td height="10" colspan="2" valign="bottom"></td>
					</tr>
					<tr>
						<td height="31" colspan="2" valign="top" class="STYLE15">&nbsp;&nbsp;码:
							<input name="userPw" type="password" size="21" class="input2" align="bottom" onMouseOver="this.style.background='#F0DAF3';" onMouseOut="this.style.background='#FFFFFF'">
						</td>
					</tr> 
					<tr style="display: none">
					    <td height="31" colspan="2" valign="top" class="STYLE15">&nbsp;&nbsp;&nbsp;&nbsp;份:
					         <select class="INPUT_text" name="userType">
							    <option value="-1" selected="selected">请选择登陆身份</option>
								<option value="0">管理员</option>
								<option value="1">操作员</option>
							 </select>
                        </td>
				    </tr>
					<tr>
						<td height="10" colspan="2" valign="bottom"></td>
					</tr>
					<tr>
						<td colspan="2" valign="top">&nbsp; &nbsp; &nbsp; &nbsp;
							<input name="button" type="button" class="submit1" value="登录" onclick="check1()"> &nbsp;
							<input name="Submit2" type="reset" class="submit1" value="重置">
							<img id="indicator" src="<%=path %>/images/loading.gif" style="display:none"/>
						</td>
				    </tr>
                </table></center>
	        </form>
        </td>
     </tr>
  </table>
</body>

Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here

Guess you like

Origin blog.csdn.net/newlw/article/details/133375431