add_accident.jsp
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:9k
源码类别:

电子政务应用

开发平台:

Java

  1. <%@ taglib uri="/vnex.tld" prefix="vnex" %>
  2. <%@ taglib uri="/vnex_vehicle_automobile.tld" prefix="vnex_auto" %>
  3. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  4. <%@ page import="com.vnex.intranet.util.*" %>
  5. <%@ page import="java.sql.Timestamp" %>
  6. <%
  7.  // get the currentTime
  8.   Timestamp tCurrent = new Timestamp(System.currentTimeMillis());
  9.   Calendar calCurrent = TimeStamp.convertTimestampToCalendar(tCurrent); 
  10.   String currentDate = "" + TimeStamp.formatCalendar( TimeStamp.YMD, calCurrent   );
  11.      
  12. %>
  13. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  14. <HTML>
  15. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  16. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  17. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_office.js"></script>
  18. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  19. <script Language="JavaScript" src="/vnex/intranet/calendar/Popup.js"></script>
  20. <script language="JavaScript" src="/vnex/util/strUtil.js"></script>
  21. <script language="JavaScript" src="/vnex/util/validate.js"></script>
  22. <script language="JavaScript">
  23. var currentDate ="<%=currentDate%>";
  24. function addAccidentSuccess(form)
  25. {
  26.     if(checkIt(form))
  27.     {
  28.         form.action="/mainctrl/driver/addAccidentSuccess";
  29.         form.submit();
  30.     }
  31. }
  32. function listAccident(form)
  33. {
  34.     form.action="/mainctrl/driver/listAccident";
  35.     form.submit();
  36. }
  37. function checkIt(form)
  38. {   
  39.     if(isEmpty(form.timeS.value) || isEmptyStr(form.timeS.value))
  40.     {
  41.         alert("请输入事故日期");
  42.         form.timeS.focus();
  43.         return false;
  44.     }
  45.                
  46.       if(!isVNEXDate(form.timeS.value) )
  47.       {
  48.         alert("事故日期非法");
  49.         form.timeS.focus();
  50.         return false;
  51.       }      
  52.       if( currentDate < form.timeS.value )
  53.       {
  54.         alert("事故日期必须是本日或之前");
  55.         form.timeS.focus();
  56.         return false;
  57.       }
  58.          
  59.     if(isEmpty(form.site.value) || isEmptyStr(form.site.value))
  60.     {
  61.         alert("请输入事故地点");
  62.         form.site.focus();
  63.         return false;
  64.     }
  65.     if(isInvalidateLen(form.site.value,100))
  66.     {
  67.         alert("事故地点不能超过25个汉字或100个英文字符");
  68.         form.site.focus();
  69.         return false;
  70.     }    
  71.     if(isEmpty(form.severityLevel.value) || isEmptyStr(form.severityLevel.value))
  72.     {
  73.         alert("请输入事故严重程度");
  74.         form.severityLevel.focus();
  75.         return false;
  76.     }
  77.     if(isInvalidateLen(form.severityLevel.value,100))
  78.     {
  79.         alert("事故严重程度不能超过25个汉字或100个英文字符");
  80.         form.severityLevel.focus();
  81.         return false;
  82.     }    
  83.     if(isInvalidateLen(form.reason.value,100))
  84.     {
  85.         alert("事故原因不能超过25个汉字或100个英文字符");
  86.         form.reason.focus();
  87.         return false;
  88.     }        
  89.     if(isEmpty(form.processResult.value) || isEmptyStr(form.processResult.value))
  90.     {
  91.         alert("请输入处理结果");
  92.         form.processResult.focus();
  93.         return false;
  94.     }
  95.     if(isInvalidateLen(form.processResult.value,100))
  96.     {
  97.         alert("处理结果不能超过25个汉字或100个英文字符");
  98.         form.processResult.focus();
  99.         return false;
  100.     }    
  101.     if(isInvalidateLen(form.note.value, 800))
  102.     {
  103.         alert("你的说明过长了,它只能容纳200个汉字或800个英文字符");
  104.         return false;
  105.     }    
  106.     return true;
  107. }
  108. </script>
  109. <DIV align=center>
  110. <form name="myform" method="post" action="">
  111. <input type="hidden" name="empId" value="<%=request.getParameter("empId")%>">   
  112. <input type="hidden" name="empName" value="<%= request.getParameter("empName") %>">
  113.    
  114.     <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  115.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  116.     <TR> 
  117.         <TD colSpan=3 align="center"><br>
  118.           <!--个人信息开始 -->
  119.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  120.             <tr bgcolor="#fafafa"> 
  121.               <td> 
  122.                 <table class=title width="600" border="0" cellspacing="1" cellpadding="2">
  123.                   <tr> 
  124.                     <td colspan="2" height="15" bgcolor="#666666"><font class="strongw">&nbsp;<a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>&gt;&gt;<a href="/mainctrl/office/main"><font color="#FFFFFF">办公室管理</font></a>&gt;&gt;<a href="/mainctrl/driver/listDriver"><font color="#FFFFFF">司机管理</font></a>&gt;&gt;<a href="/mainctrl/driver/detailDriver?empId=<%= request.getParameter("empId") %>"><font color="#FFFFFF">司机详细信息</font></a>&gt;&gt;新增事故记录                     
  125.                       </font></td>
  126.                   </tr>
  127.                   <tr bgcolor="#e0e0e0"> 
  128.                     <td width="115"><font  class="strong">&nbsp;姓名:</font></td>
  129.                     <td colspan="2" width="477"><%= FieldUtil.filterScriptTag(request.getParameter("empName")) %> </td>
  130.                   </tr>
  131.                   <tr bgcolor="#fafafa"> 
  132.                     <td width="115"> <font  class="strong">&nbsp;事故日期:</font> 
  133.                     </td>
  134.                     <td align="left" width="461"> 
  135.                       <input type="text" name="timeS" readonly size="24" class="text" value="">
  136.                       &nbsp; <img src="/vnex/intranet/calendar/datetime.gif" style="cursor:hand;" align="absmiddle" alt="弹出日历下拉菜单" onClick="fPopUpCalendarDlg(timeS);return false;" width="16" height="16"> 
  137.                       *( 注:带 * 的为必填内容) </td>
  138.                   </tr>
  139.                   <tr bgcolor="#e0e0e0"> 
  140.                     <td width="115"><font  class="strong">&nbsp;事故地点:</font></td>
  141.                     <td colspan="2" width="477"> 
  142.                       <input type="text" name="site" class="file" size="24">
  143.                       * </td>
  144.                   </tr>
  145.                   <tr bgcolor="#fafafa"> 
  146.                     <td width="115"><font  class="strong">&nbsp;使用车辆:</font></td>
  147.                     <td width="487">
  148.                       <select name="automobileId">
  149.                         <vnex_auto:autoList> 
  150.                           <vnex:items select='<%= request.getParameter("automobileId") %>' >
  151.                             <option value="<vnex_auto:autoAttribute attribute="automobileId" />" <vnex_auto:autoAttribute attribute="isSelected" /> > 
  152.                               <vnex_auto:autoAttribute attribute="carCertNo" /> 
  153.                             </option>
  154.                           </vnex:items> 
  155.                         </vnex_auto:autoList> 
  156.                       </select>
  157.                       * </td>
  158.                   </tr>
  159.                   <tr bgcolor="#e0e0e0"> 
  160.                     <td width="115"><font  class="strong">&nbsp;严重程度:</font></td>
  161.                     <td colspan="2" width="477"> 
  162.                       <input type="text" name="severityLevel" class="file" size="6">
  163.                       * </td>
  164.                   </tr>
  165.                   <tr bgcolor="#fafafa"> 
  166.                     <td width="115"> <font  class="strong">&nbsp;事故原因:</font> 
  167.                     </td>
  168.                     <td colspan="2" width="477"> 
  169.                       <input type="text" name="reason" class="file" size="72">
  170.                     </td>
  171.                   </tr>
  172.                   <tr bgcolor="#e0e0e0"> 
  173.                     <td width="115"><font  class="strong">&nbsp;是主要责任人:</font></td>
  174.                     <td colspan="2" width="477"> 
  175.                       <input type="checkbox" name="isResponsible" value="1">
  176.                     </td>
  177.                   </tr>
  178.                   <tr bgcolor="#fafafa"> 
  179.                     <td width="115"> <font  class="strong">&nbsp;处理结果: </font> 
  180.                     </td>
  181.                     <td colspan="2" width="477"> 
  182.                       <input type="text" name="processResult" class="file" size="24">
  183.                       * </td>
  184.                   </tr>
  185.                   <tr bgcolor="#e0e0e0"> 
  186.                     <td width="115"> <font  class="strong">&nbsp;其他说明: 
  187.                       </font> </td>
  188.                     <td colspan="2" width="477"> 
  189.                       <textarea name="note" cols="59" rows="4"></textarea>
  190.                     </td>
  191.                   </tr>
  192.                   <tr bgcolor="#fafafa" align="center"> 
  193.                     <td colspan="3" height="30"> 
  194.                       <input type="button" name="Submit" value="保存" class="file"  onclick="addAccidentSuccess(this.form)">&nbsp;&nbsp;
  195.                       <input type="reset" name="Submit2" class="file" value="重置">&nbsp;&nbsp;
  196.                       <input type="button" name="Submit22" class="file" value="放弃" onClick="listAccident(this.form)">
  197.                     </td>
  198.                   </tr>
  199.                 </table>
  200.               </td>
  201.             </tr>
  202.           </table>          
  203.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  204.         </TD>
  205.       </TR>
  206.       <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  207.     </TABLE>
  208.   <BR>
  209.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  210. </form></DIV>
  211. </BODY></HTML>