vehicle_edit.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:5k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8"%>
  2. <%@ page import = "java.net.URLEncoder"%>
  3. <%@ page import = "java.util.*"%>
  4. <%@ page import = "cn.js.fan.util.*"%>
  5. <%@ page import = "cn.js.fan.web.*"%>
  6. <%@ page import = "com.redmoon.oa.vehicle.*"%>
  7. <html xmlns="http://www.w3.org/1999/xhtml">
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  10. <title>车辆信息编辑</title>
  11. <link href="../common.css" rel="stylesheet" type="text/css">
  12. <style type="text/css">
  13. <!--
  14. .style2 {font-size: 14px}
  15. -->
  16. </style>
  17. <script language="JavaScript" type="text/JavaScript">
  18. <!--
  19. function findObj(theObj, theDoc)
  20. {
  21.   var p, i, foundObj;
  22.   
  23.   if(!theDoc) theDoc = document;
  24.   if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  25.   {
  26.     theDoc = parent.frames[theObj.substring(p+1)].document;
  27.     theObj = theObj.substring(0,p);
  28.   }
  29.   if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  30.   for (i=0; !foundObj && i < theDoc.forms.length; i++) 
  31.     foundObj = theDoc.forms[i][theObj];
  32.   for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
  33.     foundObj = findObj(theObj,theDoc.layers[i].document);
  34.   if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  35.   
  36.   return foundObj;
  37. }
  38. var GetDate=""; 
  39. function SelectDate(ObjName,FormatDate){
  40. var PostAtt = new Array;
  41. PostAtt[0]= FormatDate;
  42. PostAtt[1]= findObj(ObjName);
  43. GetDate = showModalDialog("../util/calendar/calendar.htm", PostAtt ,"dialogWidth:286px;dialogHeight:221px;status:no;help:no;");
  44. }
  45. function SetDate()
  46. findObj(ObjName).value = GetDate; 
  47. }
  48. //-->
  49. </script>
  50. </head>
  51. <body>
  52. <%
  53. String oldLicenseNo = ParamUtil.get(request, "licenseNo");
  54. VehicleMgr vm = new VehicleMgr();
  55. VehicleDb vd = null;
  56. try {
  57. vd = vm.getVehicleDb(oldLicenseNo);
  58. }
  59. catch (ErrMsgException e) {
  60. out.print(SkinUtil.makeErrMsg(request, e.getMessage()));
  61. return;
  62. }
  63. String buyDate = DateUtil.format(vd.getBuyDate(), "yyyy-MM-dd");
  64. %>
  65. <%@ include file="vehicle_inc_menu_top.jsp"%>
  66. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  67. <%
  68. if (!privilege.isUserPrivValid(request, "vehicle")) {
  69. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  70. return;
  71. }
  72. %>
  73. <br>
  74. <table width="70%" border="0" align="center" cellPadding="2" cellSpacing="1" bgcolor="#FFFFFF" class="tableframe">
  75.   <form name="form1" action="vehicle_do.jsp?op=modify&licenseNo=<%=StrUtil.UrlEncode(vd.getLicenseNo())%>" method="post" encType="multipart/form-data">
  76.     <tbody>
  77.   <tr>
  78. <td colspan="3" class="right-title">添加车辆</td>
  79.   </tr>
  80.       <tr>
  81.         <td noWrap width="80">车牌号:</td>
  82.         <td><%=vd.getLicenseNo()%><input type="hidden" name="licenseNo" value="<%=vd.getLicenseNo()%>">
  83.         <input type="hidden" name="oldLicenseNo" value="<%=oldLicenseNo%>"></td>
  84.         <td width="250" rowSpan="6"><%if(vd.getImage().equals("")){%><center>暂无照片</center><%}else{%><img src="../<%=vd.getImage()%>"><%}%></td>
  85.       </tr>
  86.       <tr>
  87.         <td noWrap>厂牌型号:</td>
  88.         <td><input maxLength="100" name="brand" size="20" value="<%=vd.getBrand()%>"></td>
  89.       </tr>
  90.       <tr>
  91.         <td noWrap>发动机号:</td>
  92.         <td><input maxLength="100" name="engineNo" size="20" value="<%=vd.getEngineNo()%>"></td>
  93.       </tr>
  94.       <tr>
  95.         <td noWrap>车辆类型:</td>
  96.         <td><select name="type">
  97. <%
  98.   VehicleTypeDb vtd = new VehicleTypeDb();
  99.   String sql = "select id from vehicle_type";
  100.   Iterator ir = vtd.list(sql).iterator();
  101.   while (ir.hasNext()) {
  102.    vtd = (VehicleTypeDb)ir.next();
  103. %>
  104. <option value="<%=vtd.getId()%>" <%if(vd.getType()==vtd.getId()){%> selected <%}%>><%=vtd.getDescription()%></option>
  105. <%}%>
  106.           </select></td>
  107.       </tr>
  108.       <tr>
  109.         <td noWrap>驾驶员:</td>
  110.         <td><input maxLength="100" size="12" name="driver" value="<%=vd.getDriver()%>"></td>
  111.       </tr>
  112.       <tr>
  113.         <td noWrap>购买价格:</td>
  114.         <td><input maxLength="25" size="12" name="price" value="<%=vd.getPrice()%>"></td>
  115.       </tr>
  116.       <tr>
  117.         <td noWrap>车辆照片上传:</td>
  118.         <td colSpan="2"><input title="选择附件文件" type="file" size="30" name="image"></td>
  119.       </tr>
  120.       <tr>
  121.         <td noWrap>购买日期:</td>
  122.         <td colSpan="2"><input name="buyDate" size="10" value="<%=buyDate%>"><img style="CURSOR: hand" onClick="SelectDate('buyDate', 'yyyy-MM-dd')" src="../images/form/calendar.gif" align="absMiddle" border="0" width="26" height="26">  
  123.           日期格式形如 1999-1-2</td>  
  124.       </tr>
  125.       <tr>
  126.         <td noWrap>当前状态:</td>
  127.         <td colSpan="2"><select name="state">
  128.             <option value="0" <%if(vd.getState() == 0){%> selected <%}%>>可用</option>
  129.             <option value="1" <%if(vd.getState() == 1){%> selected <%}%>>损坏</option>
  130.             <option value="2" <%if(vd.getState() == 2){%> selected <%}%>>报废</option>
  131.           </select></td>
  132.       </tr>
  133.       <tr>
  134.         <td noWrap>备注:</td>
  135.         <td colSpan="2"><textarea name="remark" cols="45" rows="3" wrap="yes" class="BigINPUT" id="remark"><%=vd.getRemark()%></textarea></td>
  136.       </tr>
  137.       <tr>
  138.         <td noWrap align="middle" colSpan="3"><input value="保存" type="submit">&nbsp;&nbsp; 
  139.           <input type="reset" value="重填">&nbsp;&nbsp;</td>
  140.       </tr>
  141.     </tbody>
  142.   </FORM>
  143. </table>
  144. </body>
  145. </html>