📄 place_detail.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%@ page import="cn.kmp.accommodation.domain.*" %>
<%@ page import="cn.kmp.accommodation.service.*"%>
<%@ page import="com.littleQworks.commons.util.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'place_detail.jsp' starting page</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="<%=basePath %>styles/list.css">
</head>
<body>
<%
String placeNum=request.getParameter("placeNum");
String departmentNum=request.getParameter("departmentNum");
String roomNum=request.getParameter("roomNum");
String type=request.getParameter("type");
int pNum=Integer.parseInt(placeNum);
int dNum=Integer.parseInt(departmentNum);
int rNum=Integer.parseInt(roomNum);
int t=Integer.parseInt(type);
PlaceService ps=ServiceFactory.getPlaceService();
LeaseService ls=ServiceFactory.getLeaseService();
StudentService ss=ServiceFactory.getStudentService();
DepartmentService ds=ServiceFactory.getDepartmentService();
List<Lease> ll=ls.getLeasesByPlace(pNum,dNum,t,rNum);
Place p=ps.getPlaceById(pNum,dNum,t,rNum);
Department d=ds.getDepartmentByDepartmentNumType(dNum,t);
DateTimeUtils dtime=UtilsFactory.getInstance().getDateTimeUtils();
String date=dtime.getDate();
%>
<div id="container">
<div id="header">
<a href="<%=basePath %>/jsp/department_list.jsp">公寓</a>
<% if(type!=null && type.equals("0")){%>
--><a href="<%=basePath %>jsp/department_list.jsp?type=0">单间公寓</a>
<%} %>
<% if(type!=null && type.equals("1")){%>
--><a href="<%=basePath %>jsp/department_list.jsp?type=1">集体公寓</a>
<%} %>
<% if(departmentNum!=null&&type!=null){ %>
--><a href="<%=basePath%>jsp/place_list.jsp?departmentNum=<%=dNum %>&type=<%=t%>"><%=d.getDepartmentName()%></a>
<%} %>
</div>
<div id="content">
<table border="1">
<tr>
<td>床位号</td>
<td>房间号</td>
<td>学生号</td>
<td>学生名</td>
<td>租期</td>
<td>入住日期</td>
<td>退房日期</td>
<td>学年</td>
<td>状态</td>
<td colspan="2">操作</td>
</tr>
<%for(Lease l:ll){
Student st=ss.getStudentByStudentNum(l.getStudentNum());
String name=st.getLname()+st.getFname();
String status=null;
if(date.compareTo(l.getLeaveTime())<=0)status="有效";
else status="过期";
%>
<tr>
<td><%=p.getPlaceNum() %></td>
<td><%=p.getRoomNum() %></td>
<td><%=st.getStudentNum() %></td>
<td><%=name %></td>
<td><%=l.getDuration() %></td>
<td><%=l.getEnterTime() %></td>
<td><%=l.getLeaveTime() %></td>
<td><%=l.getSchoolYear() %></td>
<td><%=status %></td>
<td><a href="<%=basePath %>jsp/edit_lease.jsp?leaseNum=<%=l.getLeaseNum() %>"/>编辑</a></td>
<td><a href="<%=basePath %>deleteLease.do?leaseNum=<%=l.getLeaseNum() %>" onclick="{if(confirm('确定要删除吗?')){return true;}return false;}">删除</a></td>
</tr>
<%} %>
</table>
</div>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -