综合实践设计报告2006 级信息工程学院计算机科学与技术专业题目:网上书店系统大连水产学院实验报告纸学院(系):信息工程学院专业班级: 计本06-1一、选题意义:网上选购图书二、主要功能:注册和登录网站,可以选购书籍,管理员可对书籍和用户进行管理,包括添加图书,修改用户信息等;三、开发环境:myeclipse+tomcat+mysql;四、设计内容及步骤:登录界面图形及代码:网上书店登录书籍浏览书籍查询用户登录用户注册用户退出购书购物车管理订单管理后台管理用户管理书籍管理<table border="0"><tr align="center"><td align="center" colspan="2"><strong><font size="4">用户登录</font></strong></td></tr><tr><td><strong>用户名:</strong></td><td><html:text property="cust_name" size="20" /></td></tr><tr><td><strong>密码:</strong></td><td><html:password property="password" size="21" /></td></tr><tr><td colspan="2" align="center"><html:submit value="提交" /></td></tr>书籍查询的功能实现:<head><title>网上书店</title><link href="image/css.css" rel="stylesheet" type="text/css"> <style type="text/css"><!--body {background-color: #006600;}.style1 {font-size: 14px;color: #FF0000;font-weight: bold;}--></style><script type="text/javascript">function checkLogin(){alert("对不起,你还没有登录!")return false;}</script><script type="text/javascript" src="js/login.js"></script> <script language=javaScript><!--//function clockon() {thistime= new Date()var hours=thistime.getHours()var minutes=thistime.getMinutes()var seconds=thistime.getSeconds()if (eval(hours) <10) {hours="0"+hours}if (eval(minutes) < 10) {minutes="0"+minutes}if (seconds < 10) {seconds="0"+seconds}thistime = hours+":"+minutes+":"+secondsif(document.all) {bgclocknoshade.innerHTML=thistimebgclockshade.innerHTML=thistime}if(yers) {document.bgclockshade.document.write('<div id="bgclockshade"style="position:absolute;visibility:visible;font-family:Verdana;color:FFAAAAA;fo nt-size:120px;top:10px;left:152px">'+thistime+'</div>')document.bgclocknoshade.document.write('<div id="bgclocknoshade"style="position:absolute;visibility:visible;font-family:Verdana;color:DDDDDD;fon t-size:120px;top:10px;left:150px">'+thistime+'</div>')document.close()}var timer=setTimeout("clockon()",200)}//--></script></head><body bgcolor="#fef4d9" onLoad="clockon()"><div id="bgclockshade"style="position:absolute;visibility:visible;font-family:Arial;color:FF8888;f ont-size:30px;top:10px;left:0px"></div><div id="bgclocknoshade"style="position:absolute;visibility:visible;font-family:Arial;color:DDDDDD;f ont-size:30px;top:10px;left:0px"></div><div id="mainbody" style="position:absolute; visibility:visible"></div><!--head--><%@ include file="head.jsp"%><!--body--><table width="780" height="343" border="0" align="center"cellpadding="0" cellspacing="0"><tr><td align="center" bgcolor="f9fff0"><table width="80%" height="267" border="0" cellpadding="0"cellspacing="1" bgcolor="#99CC00"><logic:present name="books" scope="session"><logic:iterate id="element" name="books"><tr bgcolor="f9fff0"><td width="24%" rowspan="2" align="center"><img src="<bean:write name='element'property='image'/>"width="149" height="141"><br>价格:¥<bean:write name="element" property="bookPrice" /></td><td height="217" colspan="2" align="left"bgcolor="f9fff0"><bean:write name="element" property="describes" /></td></tr><tr><td width="34%" height="25" align="center"valign="middle"bgcolor="f9fff0"><html:link page="/bookdetail.jsp"onclick="checkLogin();"><strong>购买</strong></html:link></td><td width="42%" height="25" align="center"bgcolor="f9fff0"><img src="image/ckgwc.gif" width="120" height="25" border="0"></td></tr></logic:iterate></logic:present></table><logic:empty name="books" scope="session"><font color="red" size="4">对不起,没有找到你所需要的图书,请确定你所输入的信息是否正确!</font></logic:empty></td></tr></table><!--tail--></body></html:html>购物车实现:/head><body bgcolor="#fef4d9" onLoad="clockon()"><div id="bgclockshade"style="position:absolute;visibility:visible;font-family:Arial;color:FF8888;f ont-size:30px;top:10px;left:0px"></div><div id="bgclocknoshade"style="position:absolute;visibility:visible;font-family:Arial;color:DDDDDD;f ont-size:30px;top:10px;left:0px"></div><div id="mainbody" style="position:absolute; visibility:visible"></div><!--head--><%@include file="headout.jsp"%><!--body--><logic:present name="items" scope="session"><table width="780" height="335" border="0" align="center"cellpadding="0" cellspacing="0"><tr><td height="46" align="center" bgcolor="f9fff0"><img src="image/wdgwc.gif" width="120" height="25"></td></tr><tr><td height="289" align="center" valign="top" bgcolor="f9fff0"><table width="95%" border="0" cellpadding="0" cellspacing="1"bgcolor="99CC00"><tr align="center" bgcolor="f9fff0"><td width="19%"><strong>书名</strong></td><td width="53%"><strong>简介</strong></td><td width="9%" bgcolor="f9fff0"><strong>单价</strong></td><td width="9%" bgcolor="f9fff0"><strong>数量</strong></td><td width="9%" bgcolor="f9fff0"><strong>操作</strong></td></tr><logic:iterate id="element" name="items"><tr align="center" bgcolor="f9fff0"><td><bean:write name="element" property="bookName" /></td><td><bean:write name="element" property="describes" /></td><td bgcolor="f9fff0" class="style1"><bean:write name="element" property="bookPrice" /></td><td bgcolor="f9fff0"><bean:write name="element" property="quantity" /></td><td width="9%" bgcolor="f9fff0"><html:link action="/deleteCart.do"paramName="element"paramId="bookId" paramProperty="bookId">删除</html:link></td></tr></logic:iterate><tr align="center" bgcolor="f9fff0"><td colspan="5">你所购买的书籍的总价格为:<%=((com.ascent.util.ShoppingCart)request.getSession().getAttribute("cart")).getTotalPrice()%></td></tr><tr align="center" bgcolor="f9fff0"><td colspan="5"></td></tr><tr align="center" bgcolor="f9fff0"><td colspan="5"><form name="form3" method="post" action=""><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="30%" align="right"><html:link page="/listbook.jsp">继续购物</html:link></td><td width="30%" align="right"><html:link action="/emptyCart.do">清空购物车</html:link></td><td width="40%" align="right"><span class="style1"><html:errorsproperty="cartempty" /></span><html:link action="/sureCart.do"><strong>确认购买</strong><logic:notPresent name="items" scope="session"><table width="780" height="335" border="0" align="center"cellpadding="0" cellspacing="0"><tr><td height="46" align="center" bgcolor="f9fff0"><img src="image/wdgwc.gif" width="120" height="25"></td></tr><tr><td height="289" align="center" valign="top" bgcolor="f9fff0"> <table width="95%" border="0" cellpadding="0" cellspacing="1"bgcolor="99CC00"><tr align="center" bgcolor="f9fff0"><td width="19%"><strong>书名</strong></td><td width="53%"><strong>简介</strong></td><td width="9%" bgcolor="f9fff0"><strong>单价</strong></td><td width="9%" bgcolor="f9fff0"><strong>数量</strong></td><td width="9%" bgcolor="f9fff0"><strong>操作</strong></td></tr><tr align="center" bgcolor="f9fff0"></tr><tr align="center" bgcolor="f9fff0"><td colspan="5">你所购买的书籍的总价格为:0.0</td></tr><tr align="center" bgcolor="f9fff0"><td colspan="5"></td></tr><tr align="center" bgcolor="f9fff0"><td colspan="5"><form name="form3" method="post" action=""><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="30%" align="right"><html:link page="/listbook.jsp">继续购物</html:link></td><td width="30%" align="right">清空购物车</td><td width="40%" align="right"><strong>确认购买</strong>书籍管理:<head><title>网上书店</title><link href="image/css.css" rel="stylesheet" type="text/css"><style type="text/css"><!--body {background-color: #006600;}.style1 {font-size: 14px;color: #FF0000;font-weight: bold;}--></style><script type="text/javascript" src="js/login.js"></script><script language=javaScript><!--//function clockon() {thistime= new Date()var hours=thistime.getHours()var minutes=thistime.getMinutes()var seconds=thistime.getSeconds()if (eval(hours) <10) {hours="0"+hours}if (eval(minutes) < 10) {minutes="0"+minutes}if (seconds < 10) {seconds="0"+seconds}thistime = hours+":"+minutes+":"+secondsif(document.all) {bgclocknoshade.innerHTML=thistimebgclockshade.innerHTML=thistime}if(yers) {document.bgclockshade.document.write('<div id="bgclockshade"style="position:absolute;visibility:visible;font-family:Verdana;color:FFAAAAA;fo nt-size:120px;top:10px;left:152px">'+thistime+'</div>')document.bgclocknoshade.document.write('<div id="bgclocknoshade"style="position:absolute;visibility:visible;font-family:Verdana;color:DDDDDD;fon t-size:120px;top:10px;left:150px">'+thistime+'</div>')document.close()}var timer=setTimeout("clockon()",200)}//--></script></head><body bgcolor="#fef4d9" onLoad="clockon()"><div id="bgclockshade"style="position:absolute;visibility:visible;font-family:Arial;color:FF8888;f ont-size:30px;top:10px;left:0px"></div><div id="bgclocknoshade"style="position:absolute;visibility:visible;font-family:Arial;color:DDDDDD;f ont-size:30px;top:10px;left:0px"></div><div id="mainbody" style="position:absolute; visibility:visible"></div><!--head--><%@ include file="headad.jsp"%><!--body--><table width="780" height="180" border="1" align="center"><tr bgcolor="f9fff0"><td align="center" colspan="6">书籍信息/<html:link page="/addbook.jsp">增加图书</html:link></td></tr><tr bgcolor="f9fff0"><td align="center">图片</td><td align="center">书籍名</td><td align="center">作者</td><td align="center">价格</td><td align="center">描述</td><td align="center">操作</td></tr><logic:present name="adbook" scope="session"><logic:iterate id="element" name="adbook"><tr bgcolor="f9fff0"><td align="right"><img src="<bean:write name="element"property="image"/>"width="80" height="80" border="0"></td><td align="right"><bean:write name="element" property="bookName" /></td><td align="right"><bean:write name="element" property="bookAuthor" /></td><td align="right"><bean:write name="element" property="bookPrice" /></td><td align="right"><bean:write name="element" property="describes" /></td><td align="center"><html:link action="/deleteBook.do" paramName="element"paramId="bookId" paramProperty="bookId">删除</html:link>/<html:link action="/updateBook.do" paramName="element" paramId="bookId"paramProperty="bookId">更新</html:link></td></tr></logic:iterate></logic:present></table></body></html:html>数据管理部分:五、存在问题及改进意见:页面难看,这是因为我们css的知识太少,以后会加强这方面的学习。