网上订餐系统_第1页
网上订餐系统_第2页
网上订餐系统_第3页
已阅读5页,还剩42页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、前台界面是用HTML实现,具体代码功能如下Login.jsp文件:用于客户的登录<%page Ianguage ="java"pageEncoding ="UTF-8"%><%Stri ng path = request.getC on textPath();Stri ng basePath = request.getScheme() + request.getServerName() +":" + request.getServerPort()+ path +"/"%> <! DOC

2、TYPEHTMLPUBLIC "-/W3C/DTD HTML 4.01 Transitional/EN"><html ><head><basehref =" <%=basePath %> ><title登录页面</ title ><meta<meta<meta<metahttp-equiv http-equiv http-equiv http-equiv="pragma" content ="no-cache" >=&quo

3、t;cache-control"content ="no-cache" ><meta<style body http-equivtype ="text/css"="expires"content ="0" >="keywords" content ="keyword1,keyword2,keyword3" >="descriptio n"content ="This is my page">

4、>background-image : url(images/background/6.jpg) background-repeat : repeat-x ;</ style ></head> <body bgcolor =lightblue ><a href =dkcanting.jsp >返回首页 </ a>vform name="form1" action ="UserServlet?method=login"method ="post" ><tabl

5、e width ="200" border ="1" align =center ><tr ><td colspan ="2" > 登录窗口 </ td ><tr ><td >用户名</ td ><td ><input type ="text"name="User_ID" size ="10" ></ td ></ tr ><tr ><

6、;td > 密码 </ td ><td ><input type ="password" name="Password" size ="10" ></ td > </ tr ><tr ><td colspan ="2" ><input type ="submit" name="submit" value ="登录"> <ahref ="re

7、gister.jsp">注册新用户 </a></td>v/tr ></table > </ form ></ body ></ html >Login_admi n.jsp 文件:用于管理员的登录<%page language ="java"pageEncoding ="UTF-8"%><%Stri ng path = request.getC on textPath();Stri ng basePath = request.getScheme

8、() +":/"+ request.getServerName() +":" + request.getServerPort()+ path +"/"%> <! DOCTYPEHTMLPUBLIC "-/W3C/DTD HTML 4.01 Transitional/EN"><html > <head><basehref =" <%=)asePath %>' ><title登录页面</ title ><meta

9、<meta<metahttp-equivhttp-equivhttp-equiv="pragma" content ="no-cache" > ="cache-control"content ="no-cache" ><meta<meta<style body http-equivhttp-equivtype ="text/css" >="expires"content ="0" >="key

10、words" content ="keyword1,keyword2,keyword3" >="descriptio n"content ="This is my page">background-image : url(images/background/6.jpg) background-repeat : repeat-x ; </ style ></head> <body bgcolor =lightblue ><form name="form1"

11、; action ="UserServlet?method=login_admin"method="post" ><table width ="200" border ="1" align =center ><tr ><td colspan ="2" >管理员登录 </ td ><tr ><td >用户名</ td ><td ><input type ="text" n

12、ame="User_ID" size ="10" ></ td ></ tr ><tr ><td > 密码 </ td ><td ><input type ="password" name="Password" size ="10" ></ td >v/tr ><tr ><td colspan ="2" ><inputtype ="

13、;submit" name="submit" value ="登录"> </ td ></ tr ></ table ></ form ></ body ></ html >Register.jsp 文件:用于客户的注册<%page language ="java"pageEncoding ="UTF-8"%><%Stri ng path = request.getC on textPath();Stri ng

14、 basePath = request.getScheme() +":/"+ request.getServerName() +":" + request.getServerPort()+ path +"/"%><! DOCTYPEHTMLPUBLIC "-/W3C/DTD HTML 4.01 Transitional/EN"> <html ><head><basehref =" <%=basePath %> ><title<m

15、eta<meta>注册页面http-equivhttp-equiv</ title >="pragma" content ="no-cache" >="cache-control"content ="no-cache" ><meta<metahttp-equiv http-equiv<metahttp-equivtype ="text/css" >="expires"content ="0" &g

16、t;="keywords" content ="keyword1,keyword2,keyword3" >="descripti on"content ="This is my page"<stylebody background-image : url(images/background/6.jpg) background-repeat: repeat-x ;</ style ></head><body bgcolor =lightblue ><a href

17、=dkcanting.jsp >返回首页 </ a>vform name="form1" action ="UserServlet?method=register"method="post" > <table width ="200" border ="1" align =center ><tr ><td colspan ="2" > 注册窗口 </ td ><tr ><td >用

18、户名</ td ><td ><input type ="text"name="User_ID" size ="10" ></ td ></ tr ><tr ><td > 密码 </ td ><td ><input type ="password" name="Password1" size ="10" ></ td ></ tr >&

19、lt;tr ><td >确认密码</ td ><td ><input type ="password" name="Password2" size ="10" ></ td ></ tr ><tr ><td >联系电话</ td ><td ><input type ="text" name="User_Tel" size ="10" >&l

20、t;/ td ></ tr ><tr ><td >送餐地址</ td ><td ><input type ="text"name="User_Address" size ="10"></td></ tr ><tr >value ="<td colspan ="4" align =center ><input type -'submit" name="

21、;submit" 注册"> </ td ></ tr ></ table ></ form ></ body ></ html >Admin_ce nter.jsp文件:管理员中心界面,管理全部信息<%page language ="java"pageEncoding ="UTF-8"%><%Stri ng path - request.getC on textPath();Stri ng basePath - request.getSch

22、eme() +":/"+ request.getServerName() +":" + request.getServerPort()+ path +"/"%> <! DOCTYPEHTMLPUBLIC "-/W3C/DTD HTML 4.01 Transitional/EN"> <html ><head><base href =" <%=basePath %>' ><title>管理员 </ title >

23、<meta http-equiv="pragma" content ="no-cache" ><meta http-equiv="cache-c on trol"content ="no-cache" ><meta http-equiv ="expires"content ="0" ><meta http-equiv="keywords" content ="keyword1,keyword2,keywo

24、rd3" ><meta http-equiv="descriptio n"content ="This is my page" ><style type ="text/css">body background-image : url(images/background/6.jpg);background-repeat : repeat-x ;</ style ></head><body bgcolor =lightyellow text =black link =r

25、ed alink =green vlink =blue ><p align = right ><%String n = (String)session.getAttribute("User_ID");if (n = null )%><a href ="login_admin.jsp">登录</a><%else %>vform name="form1" action ="UserServlet?method=logout_admin"method=&q

26、uot;post" >欢迎你,<%=session.getAttribute("User_ID" ) %><input type -'submit" name="submit" value ="退出"></ form ><% %><table ><tr ><td ><form name="form2" action ="Dish_copyServlet?method=type&quo

27、t;method -"post" ><select n ame=Type_Name<option >面食<option >川菜<option >粤菜<option >鲁菜<option >浙菜<option >徽菜<option >闽菜<option >湘菜<option >苏菜</ select ><p><input type -submit value ="搜索"></ form >&

28、lt;/ td ></ table ><form name="form2" action -"Dish_copyServlet?method-select"method-"post"><p align - center ><input type -'submit" name="submit" value ="DK一下"> </ p></ form ><br ><br ><

29、br ><br ><center >vform action ="dingdan.jsp"method="get" ><inputtype -'submit"name="button"value ="查看订单" id ="button"style -"width : 150px; height : 30px;" ></ form ></ center ></ body >&l

30、t;/ html >Detail.jsp文件:用于查看美食的详细信息,在此页面可以提交订单<%page Ianguage -"java" import -"java.util.*"pageEncoding ="UTF-8"%><%page Ianguage -"java" import -"com.dingcan.javabean.*"%><%Stri ng path - request.getC on textPath();Stri ng basePath

31、- request.getScheme() +":/"+ request.getServerName() +":" + request.getServerPort()+ path +"/"%><! DOCTYPEHTMLPUBLIC "-/W3C/DTD HTML 4.01 TransitionaI/EN"><html ><head><base href -" <%=basePath %>' ><title >管理员 &

32、lt;/ title > body <meta<meta<metahttp-equivhttp-equivhttp-equiv-"pragma" content -"no-cache" > -"cache-control"content -"no-cache" ><meta<meta<stylehttp-equivhttp-equivtype -"text/css" >-"expires"content -"

33、;0" >-"keywords" content -"keyword1,keyword2,keyword3" >-"description"content -"This is my page">background-image : url(images/background/6.jpg)background-repeat : repeat-x ;</ style ></head >vbody bgcolor =lightyellow text =black lin

34、k =red alink =green vlink =blue ><p align = right ><%String n = (String)session.getAttribute("User_ID");if (n = null )%><a href ="login_admin.jsp">登录</a><%else %>vform name="form1" action ="UserServlet?method=logout_admin"metho

35、d="post" >欢迎你,<%=session.getAttribute("User_ID" ) %><input type -'submit"name="submit" value ="退出"></ form ><% %><table ><tr ><td ><form name="form2" action ="Dish_copyServlet?method=type&

36、quot;method -"post" ><selectn ame=Type_Name<option >面食<option >川菜<option >粤菜<option >鲁菜<option >浙菜<option >徽菜<option >闽菜<option >湘菜<option >苏菜</ select ><p><input type -submit value -"搜索"></ form >

37、;</ td ></ table ><form n ame="form2" acti on ="Dish_copyServlet?method=select"method-"post"><p align - center ><input type -"text" name="Dish_Name" size -"40" ><input type -"submit" name-"sub

38、mit" value ="DK一下"></ p></ form ><br ><br ><center >vform action ="OrderServlet?method=fahuo"method="post" >vtable border ="1" ><%String Order_ID=(String) session.getAttribute("Order_ID");List<Orderdi

39、sh> list= new ArrayList<Orderdish>();OrderBea n orderBea n= new OrderBea n();list = orderBea n.getOrderdish1(Order_ID);for (int i=O;i<list.size();i+)%><tr ><td ><in puttype ="hidde n"n ame="Order_ID"value =" <%=ist.get(i).getOrder_ID()%>&#

40、39;></ td ><td ><img src =" <%=ist.get(i).getUrl()%>' height ="40px" width ="60px" ></ td ><td >菜品编号: <%=ist.get(i).getDish_ID()</ td ><td >菜名:<%=st.get(i).getDish_Name()</ td ><td >类型:<%=st.get(i).g

41、etType_ID()</ td ><td >价格:<%=st.get(i).getDish_Name()</ td ></ tr >%>%>%>%><%> </ table ><input type ="submit" name="submit" value ="发货"style =" width : 100px; height : 30px;" ></ form > <br >

42、; <br ></ center ></ body ></ html >Dingdan.jsp文件:管理员查看订单详情<%page Ianguage ="java" import ="java.util.*" pageEncoding ="UTF-8"%><%page language ="java" import ="com.dingcan.javabean.*"%><%String path = request.g

43、etC on textPath();Stri ng basePath = request.getScheme() + request.getServerName() + request.getServerPort()+ path +"/"%> <! DOCTYPEHTMLPUBLIC "-/W3C/DTD HTML 4.01 Transitional/EN"><html > <head> <base href =" <%=basePath %>' ><title&g

44、t;查询结果页面</ title ><meta<metahttp-equiv http-equiv="pragma" content ="no-cache" >="cache-control"content ="no-cache" ><meta<meta<metahttp-equivhttp-equiv http-equiv<style body type ="text/css"="expires"content =

45、"0" >="keywords" content ="keyword1,keyword2,keyword3" >="descriptio n"content ="This is my page">>background-image : url(images/background/6.jpg) background-repeat : repeat-x ; </ style ></head> <body><body bgcolor =

46、lightyellow text =black link =red alink =green vlink =blue ><a href ="admin_center.jsp">返回首页 </ a><p align = right ><%String n = (String)session.getAttribute("User_ID");if (n = null )%><a href ="login_admin.jsp">登录</ a><%else %&

47、gt;vform name="form1" action ="UserServlet?method=logout_admin"method="post" >欢迎你,<%=session.getAttribute( "User_ID" ) %><input type -'submit" name="submit"value ="退出"></ form > <% %><table ><tr

48、><td >vform name="form2" action ="Dish_copyServlet?method=type"method ="post" ><selectn ame=Type_Name<option >面食<option >川菜<option >粤菜<option >鲁菜<option >浙菜<option >徽菜<option >闽菜<option >湘菜<option >苏菜&

49、lt;/ select ><p><input type =submit value ="搜索"></ form ></ td ></ table ><formn ame="form2" acti on ="Dish_copyServlet?method=select"method="post"><p align = center ><input type -'text" name="Dish_

50、Name" size ="40" ><input type -"submit" name="submit" value ="D下"></ p></ form ><br ><br ><center ><%List<Order> list-new ArrayList<Order>();OrderBea n orderBea n= new OrderBea n();list - orderBea n. g

51、etOrd();for (int i=O;i<list.size();i+)%><form action ="OrderServlet?method=detail1" method="post" ><table border ="1" ><tr ><td ><inputtype -"hidden"name="Order_ID"value ="<%=ist.get(i).getOrder_ID()%>'

52、></td><td >订单编号:<%=ist.get(i).getOrder_ID()%></ td ><td >顾客姓名:<%=ist.get(i).getUser_ID()%></ td ><td >%>订单状态:<%=ist.get(i).getOder_State()</ td ><td >总价:<%=st.get(i).getSumPrice()%></ td ><td ><inputtype -'

53、submit"name="submit"value ="订 单 详 情 "style =" width : 100px; height : 30px;" ></ td ></ tr ></ table ></ form ><%><br ><br ></ center ></ body ></ html >Dkca nti ng.jsp文件:主页面,用户可以注册,登录,可以查询关于美食的所需信息<

54、%page<%page<%page<%lan guage ="java"lan guage ="java"lan guage ="java"pageE ncodi ng ="UTF-8" %>import ="java.sql.*" %>import ="com.d in gca n.javabea n.DBAccess"%>Stri ng path - request.getC on textPath();String basePath

55、- request.getScheme() + request.getServerName() + path +"/"":/"II. I!+ request.getServerPort()%> <! DOCTYPEHTMLPUBLIC "-/W3C/DTD HTML 4.01 Transitional/EN"> vhtml ><head><base<title<meta<meta<meta<meta<metahref =" <%=basePa

56、th %> >>DK餐厅,订餐首选!</ title >http-equiv http-equiv http-equiv http-equiv http-equivtype ="text/css"="pragma" content ="no-cache" >="cache-control"content ="no-cache" >="expires"content ="0" >="keywords&

57、quot; content ="keyword1,keyword2,keyword3" > ="descriptio n"content ="This is my page" >><stylebody background-image : url(images/background/6.jpg)background-repeat: repeat-x</ style ></head><body bgcolor =lightyellow<%DBAccess db =db.crea

58、teC onn(); db.query( "select * from dish"System.out.pr intln("/结果集的对象 ResultSet rs= db.getRs();/对结果集进行输岀 while (rs.next()System.out.pri ntl n( 格:"+rs.getString( "Price");%><a href ="dkcanting.jsp">返回首页 </a><p align = right ><%Stri ng n

59、= (Stri ng)sessi on .getAttribute(if (n = null )%><a href ="login.jsp" >登录</ a> <a href ="register.jsp" >注册</ a>text =black link =red alink=green vlink =blue >n ewDBAccess();););"菜名:"+rs.getString("Dish_Name" )+ "t" +&qu

60、ot;价"User_ID");<%else %><form name="form1" action ="UserServlet?method=logout"method="post" >欢迎你, <a href =user_center.jsp ><%=session.getAttribute( "User_ID" ) %></ a><input type -'submit" name="submit&

61、quot; value ="退出"></ form ><% %><a href -gouwuche.jsp >我的购物车 </ a><br ><br > <table > <tr ><td ><form name="form2" action ="DishServlet?method=type"method="post" ><select n ame=Type_Name<opti

62、on >面食voption >川菜voption >粤菜voption >鲁菜voption >浙菜voption >徽菜voption >闽菜voption >湘菜voption >苏菜v/ select >vp>vinput type =submit value ="搜索">v/ form >v/td >v/ table >vformn ame="form2" acti on ="DishServlet?method=select"metho

63、d ="post"><p align = center >vinput type -'text" name="Dish_Name" size ="40" >vinput type -"submit" name="submit" value ="DK一下">v/ p>v/ form >v/ body >v/ html >Gouwuche.jsp文件:用户将所需美食放进购物车,在此可以提交订单,可以取消订单v

64、%page Ianguage -"java" import -"java.util.*"pageEncoding ="UTF-8"%>v%page language -"java" import -"com.dingcan.javabean.*"%>v%Stri ng path - request.getC on textPath();Stri ng basePath - request.getScheme() +":/"+ request.getServerNa

65、me() +":" + request.getServerPort()+ path +"/"%>v! DOCTYPEHTMLPUBLIC "-/W3C/DTD HTML 4.01 Transitional/EN">vhtml >vhead>vbase href =" v%=basePath %>' > vtitle>我的购物车v/ title > vstyle type ="text/css" >vmetahttp-equivvmetavmet

66、ahttp-equiv http-equiv-"pragma" content ="no-cache" >="cache-control"content -"no-cache" >vmetavmetahttp-equivhttp-equiv-"expires"content -"0" >-"keywords" content -"keyword1,keyword2,keyword3" >-"descri

67、ption"content -"This is my page">body background-image : url(images/background/6.jpg);background-repeat : repeat-x ;</ style ></head><body><body bgcolor =lightyellow text =black link =red alink<a href ="dkcanting.jsp">返回首页 </ a><p align

68、 = right ><%String n = (String)session.getAttribute("User_ID");if (n = null )%><a href ="login.jsp">登录</ a><a href ="register.jsp">注册</ a><%else %>vform name="form1" action ="UserServlet?method=logout" 欢迎你, <

69、a href =user_center.jsp><%=sessio n.getAttribute("User_ID"</ a><input type -'submit"name="submit" value ="退出"</ form ><% %><a href -gouwuche.jsp >我的购物车 </a><br ><br ><table ><tr ><td ><form

70、 name="form2" action ="DishServlet?method=type" <selectn ame=Type_Name<option >面食<option >川菜<option >粤菜<option >鲁菜<option >浙菜<option >徽菜<option >闽菜<option >湘菜<option >苏菜green vlink -blue >method="post)%>>metho

71、d="post" ></ select ><p><input type =submit value ="搜索"></ form ></ td > </ table >vformn ame="form2" acti on ="DishServlet?method=select"method ="post" ><p align = center ><input type -'text&quo

72、t; name="Dish_Name" size ="40" ><input type -"submit" name="submit" value ="D下"></ p></ form > <br > <br ><ce nter<formacti on ="DishServlet?method=ca ncel"method -"post" ><tableborder

73、="1" ><%Stri ng User_ID-(Str ing) sessi on. getAttribute( List<Car> list- new ArrayList<Car>(); CarBean carBean- new CarBean();list - carBea n. getCar(User_ID);"User_ID");for (int i=O;i<list.size();i+)%><tr ><td ><imgsrc =" <%=st.get

74、(i).getUrl()%>' height ="40px" width ="60px" ></ td ><td ><in put<in put</ td >type -"hidden" name="Dish type -"hidden" name="User_ID"ID"value ="<%=ist.get(i).getDish_ID()value ="<%=ist.get(

75、i).getUser_ID()%>'>%>'><td >菜名:<%=ist.get(i).getDish_Name()%></ td ><td >菜价:<%=st.get(i).getPrice()%></ td ><td >菜系:<%=st.get(i).getType_ID()%></ td ><td >n ame="submit"-"submit"<i nputstyle -"

76、;width : 100px; height : 30px;" >typevalue -" 取 消 订</ td ></ tr ><% %>v/table ></ form ><br ><br >vform action ="DishServlet?method=submitorder"method - 'post" ><in put type ="submit"n ame="submit"value

77、="提 交 订style =" width : 120px; height : 50px;" ></ form ></ center ></ body ></ html >Orderdetail.jsp 文件:订单详情页面<%page language ="java" import ="java.util.*"pageEncoding ="UTF-8"%><%page language ="java" import

78、 ="com.dingcan.javabean.*"%><%Stri ng path - request.getC on textPath();Stri ng basePath - request.getScheme() +":/"+ request.getServerName() +":" + request.getServerPort()+ path +"/"%> <! DOCTYPEHTMLPUBLIC "-/W3C/DTD HTML 4.01 Transitional/EN"><html > <head> <base href =" <%=basePath %&

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论