基于javaweb+jsp實(shí)現(xiàn)企業(yè)車輛管理系統(tǒng)
運(yùn)行環(huán)境
java≥6、tomcat≥7.0、mysql≥5.5
開發(fā)工具
idea/eclipse/myeclipse
技術(shù)框架
javaweb javabean jsp mvc mysql tomcat javascript idea eclipse myeclipse servlet ssm maven …
適用
課程設(shè)計(jì),大作業(yè),畢業(yè)設(shè)計(jì),項(xiàng)目練習(xí),學(xué)習(xí)演示等
功能說(shuō)明
登錄、注冊(cè)、退出、用戶模塊、公告模塊、車輛模塊的增刪改查管理
部分代碼實(shí)現(xiàn)jsp
<%@ page contenttype="text/html; charset=utf-8" pageencoding="utf-8" %> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>車輛添加</title> <%@ include file="include/head.jsp" %> </head> <body> <div class="container-fluid"> <ul class="nav nav-tabs"> <li><a href="carlist?" rel="external nofollow" >車輛列表</a></li> <li class="active"><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" >添加</a></li> </ul> <br/> <form class="form-horizontal" role="form" action="caradd" method="post" onsubmit="return check()"> <div class="form-group"> <label class="col-sm-3 control-label">車牌:</label> <div class="col-sm-5">
</tr> </c:foreach> </tbody> </table> <div style="float: right;padding-right: 10px;color: #515151;"><jsp:include page="split.jsp"/></div> </div> </body>
<div class="col-sm-5" style="padding-top: 7px;"> ${vo.carphone} </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">備注:</label> <div class="col-sm-5" style="padding-top: 7px;"> <textarea rows="3" class="form-control" id="cartext" name="cartext" disabled="disabled">${vo.cartext}</textarea> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label"></label> <div class="col-sm-5" style="padding-top: 7px;"> <input type="button" class="btn btn-pill btn-grad btn-success btn-sm" value="返回" onclick="javascript:history.back(-1);"> </div> </div> </form> </div>
<div class="form-group"> <label class="col-sm-3 control-label">購(gòu)買日期:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="carindate" name="carindate"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">狀態(tài):</label> <div class="col-sm-5"> <input name="carstatus" type="radio" value="正常" checked="checked"/> 正常 <input name="carstatus" type="radio" value="故障"/> 故障 </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">駕駛員:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="caruser" name="caruser"> </div> </div> <div class="form-group">
</body> <script type="text/javascript"> //提交之前進(jìn)行檢查,如果return false,則不允許提交 function check() { //根據(jù)id獲取值 if (document.getelementbyid("carpai").value.trim().length == 0) { alert("車牌不能為空!"); return false; } if (document.getelementbyid("carname").value.trim().length == 0) { alert("品牌型號(hào)不能為空!"); return false;
<ul class="nav nav-tabs"> <li><a href="carlist" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >車輛列表</a></li> <li class="active"><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" >編輯</a></li> </ul> <br/> <form class="form-horizontal" role="form" action="caredit" method="post" onsubmit="return check()"> <input type="hidden" class="form-control" id="id" name="id" value="${vo.id}"/> <div class="form-group"> <label class="col-sm-3 control-label">車牌:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="carpai" name="carpai" value="${vo.carpai}"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">品牌型號(hào):</label> <div class="col-sm-5">
<ul class="nav nav-tabs"> <li><a href="carlist" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >車輛列表</a></li> <li class="active"><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" >編輯</a></li> </ul> <br/> <form class="form-horizontal" role="form" action="caredit" method="post" onsubmit="return check()"> <input type="hidden" class="form-control" id="id" name="id" value="${vo.id}"/> <div class="form-group"> <label class="col-sm-3 control-label">車牌:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="carpai" name="carpai" value="${vo.carpai}"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">品牌型號(hào):</label> <div class="col-sm-5">
<th>里程</th> <th>購(gòu)買日期</th> <th>狀態(tài)</th> <th>駕駛員</th> <th>聯(lián)系方式</th> <th>操作</th> </tr> </thead> <tbody> <c:foreach items="${list}" var="vo"> <tr> <td>${vo.carpai}</td> <td><a href="carget?id=${vo.id}" rel="external nofollow" >${vo.carname}</a></td> <td>${vo.carchexing}</td> <td>${vo.carcheng}</td> <td>${vo.carindate}</td>
<input type="submit" class="btn btn-pill btn-grad btn-warning btn-sm" value="保存"> <input type="button" class="btn btn-pill btn-grad btn-success btn-sm" value="返回" onclick="javascript:history.back(-1);"> </div> </div> </form> </div> </body> <script type="text/javascript"> //提交之前進(jìn)行檢查,如果return false,則不允許提交 function check() { //根據(jù)id獲取值 if (document.getelementbyid("carpai").value.trim().length == 0) { alert("車牌不能為空!"); return false; } if (document.getelementbyid("carname").value.trim().length == 0) {
</script> </html> <%@ page contenttype="text/html; charset=utf-8" pageencoding="utf-8" %> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>車輛詳情</title> <%@ include file="include/head.jsp" %> </head> <body> <div class="container-fluid"> <ul class="nav nav-tabs"> <li><a href="carlist" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >用戶列表</a></li>
${vo.carindate} </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">狀態(tài):</label> <div class="col-sm-5" style="padding-top: 7px;"> ${vo.carstatus} </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">駕駛員:</label> <div class="col-sm-5" style="padding-top: 7px;"> ${vo.caruser} </div> </div> <div class="form-group">
<input type="text" class="form-control" name="keyword" id="keyword" placeholder="品牌型號(hào)"> <input type="hidden" id="searchcolumn" name="searchcolumn" value="car_name"/> </div> <button class="btn btn-pill btn-grad btn-info btn-sm"><span class="glyphicon glyphicon-search" aria-hidden="true">查詢 </button> </form> <br/> <table class="table table-hover table-bordered"> <thead> <tr> <th>車牌</th> <th>品牌型號(hào)</th>
<div class="col-sm-5"> <input type="text" class="form-control" id="carphone" name="carphone" value="${vo.carphone}"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">備注:</label> <div class="col-sm-5"> <textarea rows="3" class="form-control" id="cartext" name="cartext" placeholder="請(qǐng)輸入內(nèi)容......">${vo.cartext}</textarea> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label"></label> <div class="col-sm-5"> <input type="submit" class="btn btn-pill btn-grad btn-warning btn-sm" value="保存"> <input type="button" class="btn btn-pill btn-grad btn-success btn-sm" value="返回" onclick="javascript:history.back(-1);"> </div> </div> </form>
</html> <%@ page contenttype="text/html; charset=utf-8" pageencoding="utf-8" %> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>車輛管理</title> <%@ include file="include/head.jsp" %> </head> <body> <div class="container-fluid"> <ul class="nav nav-tabs"> <li class="active"><a href="carlist" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >車輛列表</a></li> <c:if test="${loginuser.usertype == '管理員'}"><li><a href="car_add.jsp" rel="external nofollow" >添加</a></li></c:if> </ul> <br/> <form class="form-inline" id="searchform" action="carlist" method="post">
if (document.getelementbyid("carphone").value.trim().length == 0) { alert("聯(lián)系方式不能為空!"); return false; } return true; } </script> </html> <%@ page contenttype="text/html; charset=utf-8" pageencoding="utf-8" %> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>車輛編輯</title> <%@ include file="include/head.jsp" %> </head> <body>
<label class="col-sm-3 control-label">狀態(tài):</label> <div class="col-sm-5"> <input name="carstatus" type="radio" value="正常" ${vo.carstatus=='正常'?'checked':''}/> 正常 <input name="carstatus" type="radio" value="故障" ${vo.carstatus=='故障'?'checked':''}/> 故障 </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">駕駛員:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="caruser" name="caruser" value="${vo.caruser}"> </div> </div> <div class="form-group">
return false; } if (document.getelementbyid("carchexing").value.trim().length == 0) { alert("車型不能為空!"); return false; } if (document.getelementbyid("carcheng").value.trim().length == 0) { alert("里程不能為空!"); return false; } if (document.getelementbyid("carindate").value.trim().length == 0) { alert("購(gòu)買日期不能為空!"); return false; } if (document.getelementbyid("caruser").value.trim().length == 0) { alert("駕駛員不能為空!"); return false;
<div class="col-sm-5" style="padding-top: 7px;"> ${vo.carchexing} </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">里程:</label> <div class="col-sm-5" style="padding-top: 7px;"> ${vo.carcheng} </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">購(gòu)買日期:</label>
<td>${vo.caruser}</td> <td>${vo.carphone}</td> <td> <button onclick="window.location.href='careditpre?id=${vo.id}'" class="btn btn-pill btn-grad btn-info btn-xs" <c:if test="${loginuser.usertype != '管理員'}">disabled="disabled" title="沒(méi)有權(quán)限?。。?</c:if> > <span class="glyphicon glyphicon-pencil" aria-hidden="true"> 編輯 </button> <button onclick="if(window.confirm('將要?jiǎng)h除:${vo.carname}?'))window.location.href='cardelete?id=${vo.id}'" class="btn btn-pill btn-grad btn-default btn-xs" <c:if test="${loginuser.usertype != '管理員'}">disabled="disabled" title="沒(méi)有權(quán)限!!!"</c:if> > <span class="glyphicon glyphicon-remove" aria-hidden="true"> 刪除 </button>
</div> </div> <div class="form-group"> <label class="col-sm-3 control-label">品牌型號(hào):</label> <div class="col-sm-5"> <input type="text" class="form-control" id="carname" name="carname"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">車型:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="carchexing" name="carchexing"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">里程:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="carcheng" name="carcheng"> </div>
</ul> <br/> <form class="form-horizontal" role="form" action="#" method="post"> <input type="hidden" class="form-control" id="id" name="id" value="${vo.id}"/> <div class="form-group"> <label class="col-sm-3 control-label">車牌:</label> <div class="col-sm-5" style="padding-top: 7px;"> ${vo.carpai} </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">品牌型號(hào):</label> <div class="col-sm-5" style="padding-top: 7px;"> ${vo.carname} </div> </div> <div class="form-group">
<div class="col-sm-5"> <input type="text" class="form-control" id="carphone" name="carphone"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">備注:</label> <div class="col-sm-5"> <textarea rows="3" class="form-control" id="cartext" name="cartext" placeholder="請(qǐng)輸入內(nèi)容......"></textarea> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label"></label>
if (document.getelementbyid("carchexing").value.trim().length == 0) { alert("車型不能為空!"); return false; } if (document.getelementbyid("carcheng").value.trim().length == 0) { alert("里程不能為空!"); return false; } if (document.getelementbyid("carindate").value.trim().length == 0) { alert("購(gòu)買日期不能為空!"); return false; } if (document.getelementbyid("caruser").value.trim().length == 0) { alert("駕駛員不能為空!"); return false; } if (document.getelementbyid("carphone").value.trim().length == 0) { alert("聯(lián)系方式不能為空!"); return false; } return true;
</div> </div> <div class="form-group"> <label class="col-sm-3 control-label">車型:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="carchexing" name="carchexing" value="${vo.carchexing}"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">里程:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="carcheng" name="carcheng" value="${vo.carcheng}"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">購(gòu)買日期:</label> <div class="col-sm-5"> <input type="text" class="form-control" id="carindate" name="carindate" value="${vo.carindate}"> </div> </div>
效果圖
以上就是基于javaweb+jsp實(shí)現(xiàn)企業(yè)車輛管理系統(tǒng)的詳細(xì)內(nèi)容,更多關(guān)于javaweb jsp 的資料請(qǐng)關(guān)注碩編程其它相關(guān)文章!