顺风搬家

#数据库
CREATE TABLE users (
id int(11) AUTO_INCREMENT PRIMARY key,
name varchar(20) NOT NULL,
password varchar(20) NOT NULL
);

INSERT into users(name,PASSWORD) VALUES (‘admin’,‘123’);

CREATE TABLE movebook(
mid int AUTO_INCREMENT PRIMARY key,
area VARCHAR(50) not NULL,
cartype VARCHAR(20) not NULL,
moyedate date not NULL,
contact VARCHAR(20) not NULL,
phone VARCHAR(20) not NULL,
status int not NULL
);

INSERT into movebook(area,cartype,moyedate,contact,phone,status) VALUES (‘朝阳区’,‘1041货车’,‘2011-03-26’,‘崔佩’,‘13652854125’,2);
INSERT into movebook(area,cartype,moyedate,contact,phone,status) VALUES (‘东城区’,‘厢式货车’,‘2011-04-26’,‘李河’,‘010-85412541’,1);
INSERT into movebook(area,cartype,moyedate,contact,phone,status) VALUES (‘石景山’,‘皮卡’,‘2011-03-06’,‘王光’,‘01085263652’,2);

#Users.java

package com.neu.entity;

public class Users {
	private Integer id;
	private String name;
	private String password;
	public Users() {
		super();
		// TODO Auto-generated constructor stub
	}
	public Users(Integer id, String name, String password) {
		super();
		this.id = id;
		this.name = name;
		this.password = password;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((password == null) ? 0 : password.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Users other = (Users) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (password == null) {
			if (other.password != null)
				return false;
		} else if (!password.equals(other.password))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "Users [id=" + id + ", name=" + name + ", password=" + password + "]";
	}

}

#movebook.java

package com.neu.entity;

import java.util.Date;

public class Movebook {
	private Integer mid;
	private String area;
	private String cartype;
	private Date moyedate;
	private String contact;
	private String phone;
	private Integer status;
	public Movebook() {
		super();
		// TODO Auto-generated constructor stub
	}
	public Movebook(Integer mid, String area, String cartype, Date moyedate, String contact, String phone,
			Integer status) {
		super();
		this.mid = mid;
		this.area = area;
		this.cartype = cartype;
		this.moyedate = moyedate;
		this.contact = contact;
		this.phone = phone;
		this.status = status;
	}
	public Integer getMid() {
		return mid;
	}
	public void setMid(Integer mid) {
		this.mid = mid;
	}
	public String getArea() {
		return area;
	}
	public void setArea(String area) {
		this.area = area;
	}
	public String getCartype() {
		return cartype;
	}
	public void setCartype(String cartype) {
		this.cartype = cartype;
	}
	public Date getMoyedate() {
		return moyedate;
	}
	public void setMoyedate(Date moyedate) {
		this.moyedate = moyedate;
	}
	public String getContact() {
		return contact;
	}
	public void setContact(String contact) {
		this.contact = contact;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((area == null) ? 0 : area.hashCode());
		result = prime * result + ((cartype == null) ? 0 : cartype.hashCode());
		result = prime * result + ((contact == null) ? 0 : contact.hashCode());
		result = prime * result + ((mid == null) ? 0 : mid.hashCode());
		result = prime * result + ((moyedate == null) ? 0 : moyedate.hashCode());
		result = prime * result + ((phone == null) ? 0 : phone.hashCode());
		result = prime * result + ((status == null) ? 0 : status.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Movebook other = (Movebook) obj;
		if (area == null) {
			if (other.area != null)
				return false;
		} else if (!area.equals(other.area))
			return false;
		if (cartype == null) {
			if (other.cartype != null)
				return false;
		} else if (!cartype.equals(other.cartype))
			return false;
		if (contact == null) {
			if (other.contact != null)
				return false;
		} else if (!contact.equals(other.contact))
			return false;
		if (mid == null) {
			if (other.mid != null)
				return false;
		} else if (!mid.equals(other.mid))
			return false;
		if (moyedate == null) {
			if (other.moyedate != null)
				return false;
		} else if (!moyedate.equals(other.moyedate))
			return false;
		if (phone == null) {
			if (other.phone != null)
				return false;
		} else if (!phone.equals(other.phone))
			return false;
		if (status == null) {
			if (other.status != null)
				return false;
		} else if (!status.equals(other.status))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "Movebook [mid=" + mid + ", area=" + area + ", cartype=" + cartype + ", moyedate=" + moyedate
				+ ", contact=" + contact + ", phone=" + phone + ", status=" + status + "]";
	}
}

#UsersDao.java

package com.neu.dao;

import com.neu.entity.Users;

public interface UsersDao {
	Users getUser(String name,String password) throws Exception;
}

#UsersDaoImpl.java

package com.neu.dao;

import java.sql.Connection;
import java.sql.ResultSet;

import com.neu.entity.Users;

public class UsersDaoImpl implements UsersDao {

	@Override
	public Users getUser(String name, String password) throws Exception {
		Connection connection = JDBCUtil.getConnection();
		String sql = "select * from users where name = ? and password = ?";
		ResultSet rs = JDBCUtil.executeQuery(connection, sql, new Object[] {name,password});
		Users users = null;
		if(rs.next()) {
			int id = rs.getInt("id");
			users = new Users(id, name, password);
		}
		JDBCUtil.closeConnection(connection);
		return users;
	}

}

#UsersService.java

package com.neu.service;

import com.neu.entity.Users;

public interface UsersService {
	Users getUser(String name,String password) throws Exception;
}

#UsersServiceImpl.java

package com.neu.service;

import com.neu.dao.UsersDao;
import com.neu.dao.UsersDaoImpl;
import com.neu.entity.Users;

public class UsersServiceImpl implements UsersService {
	private UsersDao usersDao = new UsersDaoImpl();
	@Override
	public Users getUser(String name, String password) throws Exception {
		// TODO Auto-generated method stub
		return usersDao.getUser(name, password);
	}

}

#MovebookDao.java

package com.neu.dao;

import java.util.Date;
import java.util.List;

import com.neu.entity.Movebook;

public interface MovebookDao {
	List<Movebook> getAll(int pageNum,int pageSize) throws Exception;
	Movebook getById(int mid) throws Exception;
	int getInsert(String area,String cartype,Date moyedate,String contact,String phone,int status) throws Exception;
	int getUpdate(int mid,int status) throws Exception;
	int getCount() throws Exception;
	
}


#MovebookDaoImpl.java

package com.neu.dao;

import java.sql.Connection;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.neu.entity.Movebook;

public class MovebookDaoImpl implements MovebookDao {

	@Override
	public Movebook getById(int mid) throws Exception {
		Connection connection = JDBCUtil.getConnection();
		String sql = "SELECT * FROM movebook where mid =?";
		ResultSet rs = JDBCUtil.executeQuery(connection, sql, new Object[] {mid});
		Movebook movebook = null;
		String area;
		String cartype;
		Date moyedate;
		String contact;
		String phone;
		Integer status;
		if(rs.next()) {
			area = rs.getString("area");
			cartype = rs.getString("cartype");
			moyedate = rs.getDate("moyedate");
			contact = rs.getString("contact");
			phone = rs.getString("phone");
			status = rs.getInt("status");
			movebook = new Movebook(mid, area, cartype, moyedate, contact, phone, status);
		}
		JDBCUtil.closeConnection(connection);
		return movebook;
	}

	@Override
	public int getInsert(String area, String cartype, Date moyedate, String contact, String phone, int status) throws Exception {
		String sql = "INSERT into movebook(area,cartype,moyedate,contact,phone,status) VALUES (?,?,?,?,?,?)";
		int n = JDBCUtil.executeUpdate(sql, new Object[] {
				area,cartype,moyedate,contact,phone,status});
		return n;
	}

	@Override
	public int getUpdate(int mid, int status) throws Exception {
		String sql = "update movebook set status = ? where mid = ?";
		int n = JDBCUtil.executeUpdate(sql, new Object[] {status,mid});
		return n;
	}

	@Override
	public int getCount() throws Exception {
		Connection connection = JDBCUtil.getConnection();
		String sql = "select count(*) from movebook";
		ResultSet rs = JDBCUtil.executeQuery(connection, sql, null);
		int count = 0;
		if(rs.next()) {
			count = rs.getInt(1);
		}
		return count;
	}

	@Override
	public List<Movebook> getAll(int pageNum, int pageSize) throws Exception {
		Connection connection = JDBCUtil.getConnection();
		String sql = "SELECT * FROM movebook ORDER BY mid DESC limit ?,?";
		ResultSet rs = JDBCUtil.executeQuery(connection, sql, new Object[] {(pageNum-1)*pageSize,pageSize});
		List<Movebook> list = new ArrayList<>();
		Movebook movebook = null;
		int mid;
		String area;
		String cartype;
		Date moyedate;
		String contact;
		String phone;
		Integer status;
		while(rs.next()) {
			mid = rs.getInt("mid");
			area = rs.getString("area");
			cartype = rs.getString("cartype");
			moyedate = rs.getDate("moyedate");
			contact = rs.getString("contact");
			phone = rs.getString("phone");
			status = rs.getInt("status");
			movebook = new Movebook(mid, area, cartype, moyedate, contact, phone, status);
			list.add(movebook);
		}
		JDBCUtil.closeConnection(connection);
		return list;
	}

}


#MovebookService.java

package com.neu.service;

import java.util.Date;
import java.util.List;

import com.neu.entity.Movebook;

public interface MovebookService {
	List<Movebook> getAll(int pageNum,int pageSize) throws Exception;
	Movebook getById(int mid) throws Exception;
	int getInsert(String area,String cartype,Date moyedate,String contact,String phone,int status) throws Exception;
	int getUpdate(int mid,int status) throws Exception;
	int getCount() throws Exception;
}

#MovebookServiceImpl.java

package com.neu.service;

import java.util.Date;
import java.util.List;

import com.neu.dao.MovebookDao;
import com.neu.dao.MovebookDaoImpl;
import com.neu.entity.Movebook;

public class MovebookServiceImpl implements MovebookService {
	private MovebookDao movebookDao = new MovebookDaoImpl();
	@Override
	public List<Movebook> getAll(int pageNum,int pageSize) throws Exception {
		// TODO Auto-generated method stub
		return movebookDao.getAll(pageNum, pageSize);
	}

	@Override
	public Movebook getById(int mid) throws Exception {
		// TODO Auto-generated method stub
		return movebookDao.getById(mid);
	}

	@Override
	public int getInsert(String area, String cartype, Date moyedate, String contact, String phone, int status)
			throws Exception {
		// TODO Auto-generated method stub
		return movebookDao.getInsert(area, cartype, moyedate, contact, phone, status);
	}

	@Override
	public int getUpdate(int mid, int status) throws Exception {
		// TODO Auto-generated method stub
		return movebookDao.getUpdate(mid, status);
	}

	@Override
	public int getCount() throws Exception {
		// TODO Auto-generated method stub
		return movebookDao.getCount();
	}

}


#userLoginServlet.java

package com.neu.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import com.neu.entity.Users;
import com.neu.service.UsersService;
import com.neu.service.UsersServiceImpl;

/**
 * Servlet implementation class userLoginServlet
 */
@WebServlet("/userLogin")
public class userLoginServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
    
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		String name = request.getParameter("name");
		String password = request.getParameter("password");
		
		UsersService userService = new UsersServiceImpl();
		Users users = null;
		try {
			users = userService.getUser(name, password);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		if(users!=null) {
			try {
				request.getRequestDispatcher("/showMB.jsp").forward(request, response);
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}

#showMBServlet.java

package com.neu.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.neu.entity.Movebook;
import com.neu.service.MovebookService;
import com.neu.service.MovebookServiceImpl;

/**
 * Servlet implementation class showMBServlet
 */
@WebServlet("/showMB")
public class showMBServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
     
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		int pageNum = 1;
		int pageSize = 5;
		if(request.getParameter("pageNum")!=null) {
			pageNum = Integer.parseInt(request.getParameter("pageNum"));
		}
		
		MovebookService movebookService = new MovebookServiceImpl();
		
		try {
			List<Movebook> list = movebookService.getAll(pageNum, pageSize);
			request.setAttribute("list", list);
			request.setAttribute("errNum", pageNum);
			int count = movebookService.getCount();
			int num = count % pageSize==0?count/pageSize:count/pageSize+1;
			request.setAttribute("num", num);
			
			request.getRequestDispatcher("WEB-INF/movebook/showAll.jsp").forward(request, response);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}

#insertMBServlet.java

package com.neu.servlet;

import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.neu.entity.Movebook;
import com.neu.service.MovebookService;
import com.neu.service.MovebookServiceImpl;

/**
 * Servlet implementation class insertMBServlet
 */
@WebServlet("/insertMB")
public class insertMBServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
    
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		String area = request.getParameter("area");
		String cartype = request.getParameter("cartype");
		
		SimpleDateFormat d = new SimpleDateFormat("yyyy-MM-dd");
		Date moyedate = null;
		try {
			moyedate = d.parse(request.getParameter("moyedate"));
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		String contact = request.getParameter("contact");
		String tp = request.getParameter("tp");
		String tf = request.getParameter("tf");
		String phone = null;
		if(tp!="") {
			phone = tp+"-"+tf;
		}else {
			phone = tf;
		}
		int status = 0;
		MovebookService movebookService = new MovebookServiceImpl();
		try {
			movebookService.getInsert(area, cartype, moyedate, contact, phone, status);
			request.getRequestDispatcher("/registration.jsp?err=a").forward(request, response);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}

#byIdMBServlet.java

package com.neu.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.neu.entity.Movebook;
import com.neu.service.MovebookService;
import com.neu.service.MovebookServiceImpl;

/**
 * Servlet implementation class byIdMBServlet
 */
@WebServlet("/byIdMB")
public class byIdMBServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
    
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String m = request.getParameter("m");
		int mid = Integer.parseInt(request.getParameter("mid"));
		
		MovebookService movebookService = new MovebookServiceImpl();
		try {
			Movebook movebook = movebookService.getById(mid);
			if(m!=null) {
				request.setAttribute("movebook", movebook);
				request.getRequestDispatcher("WEB-INF/movebook/idMB.jsp").forward(request, response);
			}else {
				request.setAttribute("movebook", movebook);				
				request.getRequestDispatcher("WEB-INF/movebook/updateId.jsp").forward(request, response);
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}

#updateMB.java

package com.neu.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.neu.service.MovebookService;
import com.neu.service.MovebookServiceImpl;

/**
 * Servlet implementation class updateMBServlet
 */
@WebServlet("/updateMB")
public class updateMBServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
    
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		int mid = Integer.parseInt(request.getParameter("mid"));
		int status = Integer.parseInt(request.getParameter("status"));
		
		MovebookService movebookService = new MovebookServiceImpl();
		
		try {
			movebookService.getUpdate(mid, status);
			request.getRequestDispatcher("/showMB").forward(request, response);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}

#login.jsp

<%@ 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>
	<p><h1>管理员登录</h1></p>
	<form action="${ pageContext.request.contextPath }/userLogin" method="post">
		用户名:<input type="text" name="name">
		密码:<input type="text" name="password">
		<input type="submit" value="登录">
	</form>
</body>
</html>

#showAll.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>   
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>  
<!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 align="center">
	<p><h1>顺风搬家预约信息查询</h1></p>
	<%-- <form action="${ pageContext.request.contextPath }/byIdMB?mid=${ movebook.mid }" method="post"> --%>
		<table border="1" width="700" height="180">
			<caption align="right">一一顺风搬家,一路顺风</caption>
			<tr>
				<th>起始地区</th>
				<th>所用车型</th>
				<th>搬家日期</th>
				<th>联系人</th>
				<th>联系电话</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
			<c:forEach items="${ list }" var="movebook">
				<tr>
					<td>${ movebook.area }</td>
					<td>${ movebook.cartype }</td>
					<td><fmt:formatDate value="${ movebook.moyedate }" pattern="yyyy-MM-dd"/> </td>
					<td>${ movebook.contact }</td>
					<td>${ movebook.phone }</td>
					<td>
						<c:choose>
							<c:when test="${ movebook.status==0 }">未处理</c:when>
							<c:when test="${ movebook.status==1 }">已派车</c:when>
							<c:otherwise>已结束</c:otherwise>
						</c:choose>
					</td>
					<td>
						<!-- <c:choose>
							<c:when test="${ movebook.status==2 }"><input type="submit" value="处理" disabled="disabled"></c:when>
							<c:otherwise><input type="submit" value="处理"></c:otherwise>
						</c:choose> -->
						<c:choose>
							<c:when test="${ movebook.status==2 }"><a>处理</a></c:when>
							<c:otherwise><a href="${ pageContext.request.contextPath }/byIdMB?mid=${ movebook.mid }">处理</a></c:otherwise>
						</c:choose>
						<a href="${ pageContext.request.contextPath }/byIdMB?mid=${ movebook.mid }&m=a">详情</a>
					</td>
				</tr>
			</c:forEach>
			<tr align="center">
				<td colspan="7">
					<c:forEach begin="1" end="${ num }" var="pageNum">
					<a href="${ pageContext.request.contextPath }/showMB?pageNum=${ pageNum }">[${ pageNum }]</a>
					</c:forEach>
					<c:if test="${ errNum==num }"><a>>></a></c:if>
					<c:if test="${ errNum<num }"><a href="${ pageContext.request.contextPath }/showMB?pageNum=${errNum+1}">>></a></c:if>
					<a href="${ pageContext.request.contextPath }/showMB?pageNum=${num}">末页</a>
					${ errNum }/${ num }
				</td>
			</tr>
		</table>
	<!-- </form> -->
	</div>
</body>
</html>

#registration.jsp

<%@ 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>
	<%
	Object o = request.getParameter("err");
	if(o!=null){
		%>
		<p>登记成功!</p>
		<%
	}
	%>
	<div align="center">
		<p><h1>顺风搬家预约登记</h1></p>
		<form action="${ pageContext.request.contextPath }/insertMB" method="post">
			<table>
				<caption align="right">一一顺风搬家,一路顺风</caption>
				<tr>
					<td>起始地区:</td>
					<td align="left">
						<select name="area">
							<option value="海淀区">海淀区</option>
							<option value="朝阳区">朝阳区</option>
							<option value="西城区">西城区</option>
							<option value="东城区">东城区</option>
							<option value="丰台区">丰台区</option>
							<option value="大兴区">大兴区</option>
							<option value="石景山">石景山</option>
						</select>
					</td>
				</tr>
				<tr>
					<td>所用车型:</td>
					<td align="left">
						<input type="radio" name="cartype" value="金杯">金杯
						<input type="radio" name="cartype" value="皮卡">皮卡
						<input type="radio" name="cartype" value="厢式小货">厢式小货
						<input type="radio" name="cartype" value="1041货车">1041货车
					</td>
				</tr>
				<tr>
					<td>搬家日期:</td>
					<td align="left"><input type="text" name="moyedate"><span style="color: red"> 日期格式如:2010-06-10</span></td>
				</tr>
				<tr>
					<td>&nbsp;&nbsp; 人:</td>
					<td align="left"><input type="text" name="contact"></td>
				</tr>
				<tr>
					<td>联系电话:</td>
					<td align="left"><input type="text" name="tp" size="4">-<input type="text" name="tf"></td>
				</tr>
				<tr align="center"><td colspan="2"><input type="submit" value="预约登记"></td></tr>
			</table>
		</form>
	</div>
</body>
</html>

#idMB.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 
<!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 align="center">
		<p><h1>顺风搬家预约登记</h1></p>
		<p style="margin-left: 300px ">一一顺风搬家,一路顺风</p>
		<form action="${ pageContext.request.contextPath }/showMB" method="post">
			<table>
				<tr>
					<td>起始地区:</td>
					<td align="left">${ movebook.area }</td>
				</tr>
				<tr>
					<td>所用车型:</td>
					<td align="left">${ movebook.cartype }</td>
				</tr>
				<tr>
					<td>搬家日期:</td>
					<td align="left"><fmt:formatDate value="${ movebook.moyedate }" pattern="yyyy-MM-dd"/> </td>
				</tr>
				<tr>
					<td>&nbsp;&nbsp; 人:</td>
					<td align="left">${ movebook.contact }</td>
				</tr>
				<tr>
					<td>联系电话:</td>
					<td align="left">${ movebook.phone }</td>
				</tr>
				<tr>
					<td align="right">&nbsp; &nbsp; 态:</td>
					<td align="left">
						<c:choose>
							<c:when test="${ movebook.status==0 }">未处理</c:when>
							<c:when test="${ movebook.status==1 }">已派车</c:when>
							<c:otherwise>已结束</c:otherwise>
						</c:choose>
					</td>
				</tr>
				<tr align="center">
					<td colspan="2"><input type="submit" value="返回"></td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>

#updateId.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>    
<!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 align="center">
		<p><h1>顺风搬家预约登记</h1></p>
		<p style="margin-left: 300px ">一一顺风搬家,一路顺风</p>
		<form action="${ pageContext.request.contextPath }/updateMB?mid=${ movebook.mid }" method="post">
			<table>
				<tr>
					<td>起始地区:</td>
					<td align="left">${ movebook.area }</td>
				</tr>
				<tr>
					<td>所用车型:</td>
					<td align="left">${ movebook.cartype }</td>
				</tr>
				<tr>
					<td>搬家日期:</td>
					<td align="left"><fmt:formatDate value="${ movebook.moyedate }" pattern="yyyy-MM-dd"/> </td>
				</tr>
				<tr>
					<td>&nbsp;&nbsp; 人:</td>
					<td align="left">${ movebook.contact }</td>
				</tr>
				<tr>
					<td>联系电话:</td>
					<td align="left">${ movebook.phone }</td>
				</tr>
				<tr>
					<td align="right">&nbsp; &nbsp; 态:</td>
					<td>
						<select name="status">
							<option value="0">未处理</option>
							<option value="1">已派车</option>
							<option value="2">已结束</option>
						</select>
					</td>
				</tr>
				<tr><td colspan="2"><input type="submit" value="处理登记信息"></td></tr>
			</table>
		</form>	
</body>
</html>
  • 6
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值