package control;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUpload;
import org.apache.commons.fileupload.RequestContext;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.fileupload.servlet.ServletRequestContext;
import util.Info;
import util.StrUtil;
import dao.CommDAO;
public class MainCtrl extends HttpServlet {
public MainCtrl() {
super();
}
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doPost(request, response);
}
public void go(String url, HttpServletRequest request, HttpServletResponse response) {
try {
request.getRequestDispatcher(url).forward(request, response);
} catch (ServletException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
public void gor(String url, HttpServletRequest request, HttpServletResponse response) {
try {
response.sendRedirect(url);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String ac = request.getParameter("ac");
if (ac == null) ac = "";
CommDAO dao = new CommDAO();
String date = Info.getDateStr();
String today = date.substring(0, 10);
String tomonth = date.substring(0, 7);
HttpSession session = request.getSession();
if (ac.equals("compl")) {
String touname = request.getParameter("touname") == null ? "" : request.getParameter("touname");
String sname = request.getParameter("sname") == null ? "" : request.getParameter("sname");
String ctype = request.getParameter("ctype") == null ? "" : request.getParameter("ctype");
String message = request.getParameter("message") == null ? "" : request.getParameter("message");
String bid = request.getParameter("bid") == null ? "" : request.getParameter("bid");
String savetime = date;
String uname = Info.getUser(request).get("uname").toString();
String sql = "insert into compl(sname,touname,ctype,message,bid,savetime,uname " +
")values('" + sname + "','" + touname + "','" + ctype + "','" + message + "','" + bid + "','" + savetime + "','" + uname + "')";
dao.commOper(sql);
session.setAttribute("suc", "suc");
response.sendRedirect("/travelopr/pre.jsp?id=" + bid);
}
if (ac.equals("login")) {
String pagerandom = request.getParameter("pagerandom") == null ? "" : request.getParameter("pagerandom");
String random = (String) request.getSession().getAttribute("random");
if (!pagerandom.equals(random) && request.getParameter("a") != null) {
request.setAttribute("random", "");
go("/login.jsp", request, response);
} else {
String username = request.getParameter("uname");
String password = request.getParameter("upass");
String utype = request.getParameter("utype");
request.getSession().setAttribute("utype", utype);
List<HashMap> list = dao
.select("select * from sysuser where uname='"
+ username + "' and status='正常'");
if (list.size() == 1) {
HashMap map = list.get(0);
List<HashMap> ulist = dao
.select("select * from sysuser where utype='" + utype + "' and uname='"
+ username + "' and upass='" + password
+ "' and status='正常' ");
if (ulist.size() == 1 && password.equals(map.get("upass").toString())) {
request.getSession().setAttribute("admin", map);
gor("/travelopr/index.jsp", request, response);
} else {
request.setAttribute("error", "");
go("/login.jsp", request, response);
}
} else {
request.setAttribute("error", "");
go("/login.jsp", request, response);
}
}
}
//修改密码
if (ac.equals("uppass")) {
String userpass = request.getParameter("upass");
String copyuserpass = request.getParameter("copyuserpass");
HashMap user = dao.getmap(Info.getUser(request).get("id").toString(), "sysuser");
String id = (String) user.get("id");
String sql = "update sysuser set upass='" + userpass + "' where id=" + id;
dao.commOper(sql);
request.setAttribute("suc", "");
go("/admin/uppass.jsp", request, response);
}
if (ac.equals("uploaddoc")) {
try {
String filename = "";
request.setCharacterEncoding("utf-8");
RequestContext requestContext = new ServletRequestContext(request);
if (FileUpload.isMultipartContent(requestContext)) {
DiskFileItemFactory factory = new DiskFileItemFactory();
factory.setRepository(new File(request.getRealPath("/upfile/") + "/"));
ServletFileUpload upload = new ServletFileUpload(factory);
upload.setSizeMax(100 * 1024 * 1024);
List items = new ArrayList();
items = upload.parseRequest(request);
FileItem fileItem = (FileItem) items.get(0);
if (fileItem.getName() != null && fileItem.getSize() != 0) {
if (fileItem.getName() != null && fileItem.getSize() != 0) {
File fullFile = new File(fileItem.getName());
filename = Info.generalFileName(fullFile.getName());
File newFile = new File(request.getRealPath("/upfile/") + "/" + filename);
try {
fileItem.write(newFile);
} catch (Exception e) {
e.printStackTrace();
}
} else {
}
}
}
gor("/travelopr/js/uploaddoc.jsp?docname=" + filename, request, response);
} catch (Exception e1) {
e1.printStackTrace();
}
}
if (ac.equals("uploaddoc2")) {
try {
String filename = "";
request.setCharacterEncoding("utf-8");
没有合适的资源?快使用搜索试试~ 我知道了~
ssm jsp mysql 旅游管理系统.zip
共1037个文件
js:272个
png:163个
css:94个
0 下载量 186 浏览量
2024-10-15
09:30:39
上传
评论
收藏 30.85MB ZIP 举报
温馨提示
计算机系毕业设计
资源推荐
资源详情
资源评论
收起资源包目录
ssm jsp mysql 旅游管理系统.zip (1037个子文件)
9823521225632.avi 2.36MB
Info.class 36KB
MainCtrl.class 30KB
CommDAO.class 29KB
SysController.class 20KB
PageManager.class 6KB
Orders.class 5KB
Pros.class 4KB
Sysuser.class 4KB
Upload.class 3KB
StrUtil.class 3KB
WaterMarkUtils.class 3KB
MailSenderInfo.class 3KB
SetChar.class 3KB
Pinlun.class 3KB
Mixinfo.class 2KB
Hbnews.class 2KB
Messages.class 2KB
Tgroup.class 2KB
Article.class 2KB
Guides.class 2KB
MessagesServiceImpl.class 2KB
ArticleServiceImpl.class 2KB
SysuserServiceImpl.class 2KB
MixinfoServiceImpl.class 2KB
GuidesServiceImpl.class 2KB
TgroupServiceImpl.class 2KB
HbnewsServiceImpl.class 2KB
PinlunServiceImpl.class 2KB
OrdersServiceImpl.class 2KB
ProsServiceImpl.class 2KB
MyAuthenticator.class 744B
MessagesMapper.class 596B
MixinfoMapper.class 593B
SysuserMapper.class 593B
ArticleMapper.class 593B
MessagesService.class 592B
PinlunMapper.class 590B
OrdersMapper.class 590B
GuidesMapper.class 590B
HbnewsMapper.class 590B
TgroupMapper.class 590B
SysuserService.class 589B
ArticleService.class 589B
MixinfoService.class 589B
TgroupService.class 586B
PinlunService.class 586B
GuidesService.class 586B
HbnewsService.class 586B
OrdersService.class 586B
ProsMapper.class 584B
ProsService.class 580B
bootstrap.min.css 124KB
style.css 80KB
samples.css 64KB
ionicons.min.css 50KB
editor_ie8.css 36KB
editor_iequirks.css 36KB
editor_ie.css 36KB
editor_gecko.css 35KB
editor.css 35KB
all.css 24KB
sweetalert.css 22KB
_all.css 20KB
dialog_ie8.css 15KB
dialog_iequirks.css 14KB
dialog_ie.css 14KB
_all.css 14KB
_all.css 14KB
dialog.css 13KB
_all.css 12KB
codemirror.css 8KB
demo.css 7KB
magnific-popup.css 7KB
zTreeStyle.css 6KB
datepicker.css 5KB
datepicker.css 5KB
datepicker.css 5KB
datepicker.css 5KB
sample.css 5KB
jquery.toast.min.css 4KB
flexslider.css 4KB
datepicker.css 4KB
datepicker.css 3KB
owl.carousel.min.css 3KB
contents.css 3KB
purple.css 2KB
yellow.css 2KB
orange.css 2KB
green.css 2KB
blue.css 2KB
grey.css 2KB
pink.css 2KB
aero.css 2KB
demo.css 2KB
red.css 2KB
lb.css 2KB
line.css 2KB
outputxhtml.css 2KB
zTreeIcons.css 2KB
共 1037 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11
资源评论
学术菜鸟小晨
- 粉丝: 2w+
- 资源: 5718
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Delmia白车身侧围焊接的仿真分析与研究.pdf
- 基于Delmia白车身侧围焊接的研究.pdf
- 基于DSC的数字化逆变焊接电源的研制 - .pdf
- 基于FLUENT的CMT焊接熔池流场的数值分析 - .pdf
- 基于FPGA的焊接电源给定电流波形的研究 - .pdf
- 基于FPGA的焊接电源控制系统设计.pdf
- 基于GA算法的协调机器人双光束激光焊接轨迹规划研究.pdf
- 基于GMAW焊接快速制造的控形研究新进展 - .pdf
- 基于HMI和运动控制器的数控焊接系统设计.pdf
- 基于ISO15614-2标准的焊接工艺评定数据库系统 - .pdf
- 基于JB4708-2005的承压设备焊接工艺评定系统 - .pdf
- 基于MPC07运动控制卡的数控焊接机控制系统的开发.pdf
- 基于Labview平台的焊接电弧图像研究.pdf
- 基于MATLAB的仿人焊接机械手运动学分析和仿真 - .pdf
- 基于LabVIEW的搅拌摩擦焊焊接力监测系统设计.pdf
- 基于MFC和OpenGL的相贯线焊接仿真系统设计.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功