AddPublicRes.jsp
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:9k
源码类别:

OA系统

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312"%>
  2. <%@ page import="com.gforce.gfoa.*,com.gforce.currency.*,java.util.*" %>
  3. <jsp:include page="/CheckLogin.jsp" flush="true"/> <% Session m_session = new Session(session); %>
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
  7. <title>公物共享管理-- GForce OA 2.0</title>
  8. <link href="/css/txt.jsp" rel="stylesheet" type="text/css">
  9. <SCRIPT language="JavaScript" src="/Calendar/PopUpCalendarDlg.js"></SCRIPT>
  10. <script language="JavaScript" type="text/javascript">
  11. function checkAddPublicRes()
  12. {
  13.     if(document.AddPublicRes.Purpose.value=="")
  14.     {
  15.         alert("请输入用途!");
  16.         document.AddPublicRes.Purpose.focus();
  17.         return false;
  18.     }
  19.         if(!isDate(document.AddPublicRes.StartDateD.value))
  20.         {
  21.             alert("日期格式错误,请按照“2002-02-18”重新输入!");
  22.             document.AddPublicRes.StartDateD.focus();
  23.             return false;
  24.         }
  25.         if(!isDate(document.AddPublicRes.EndDateD.value))
  26.         {
  27.             alert("日期格式错误,请按照“2002-02-18”重新输入!");
  28.             document.AddPublicRes.EndDateD.focus();
  29.             return false;
  30.         }
  31.         if (document.AddPublicRes.StartDateD.value>document.AddPublicRes.EndDateD.value)
  32.         {
  33.           alert("开始日期不能大于结束日期!");
  34.           document.AddPublicRes.EndDateD.focus();
  35.           return false;
  36.         }
  37. if (document.AddPublicRes.StartDateTm.value=="")
  38. {
  39.   document.AddPublicRes.StartDateTm.value=0;
  40. }
  41. else if(isNaN(parseInt(document.AddPublicRes.StartDateTm.value,10)) || parseInt(document.AddPublicRes.StartDateTm.value,10)>59 || parseInt(document.AddPublicRes.StartDateTm.value,10)<0)
  42. {
  43. alert("请输入正确的分钟!");
  44. document.AddPublicRes.StartDateTm.select();
  45. document.AddPublicRes.StartDateTm.focus();
  46. return false;
  47. }
  48. if (document.AddPublicRes.EndDateTm.value=="")
  49. {
  50.   document.AddPublicRes.EndDateTm.value=0;
  51. }
  52. else if(isNaN(parseInt(document.AddPublicRes.EndDateTm.value,10)) || parseInt(document.AddPublicRes.EndDateTm.value,10)>59 || parseInt(document.AddPublicRes.EndDateTm.value,10)<0)
  53. {
  54. alert("请输入正确的分钟!");
  55. document.AddPublicRes.EndDateTm.select();
  56. document.AddPublicRes.EndDateTm.focus();
  57. return false;
  58. }
  59. if (document.AddPublicRes.StartDateD.value==document.AddPublicRes.EndDateD.value)
  60. {
  61.   if (parseInt(document.AddPublicRes.StartDateT.value,10)>parseInt(document.AddPublicRes.EndDateT.value,10))
  62.   {
  63.     alert("开始时间不能大于结束时间!");
  64.     document.AddPublicRes.EndDateT.focus();
  65.     return false;
  66.   }
  67.   else if (parseInt(document.AddPublicRes.StartDateT.value,10)==parseInt(document.AddPublicRes.EndDateT.value,10))
  68.   {
  69.     if (parseInt(document.AddPublicRes.StartDateTm.value,10)>parseInt(document.AddPublicRes.EndDateTm.value,10))
  70.     {
  71.       alert("开始时间不能大于结束时间!");
  72.       document.AddPublicRes.EndDateTm.focus();
  73.       document.AddPublicRes.EndDateTm.select();
  74.       return false;
  75.     }
  76.   }
  77. }
  78. //计划开始时间,结束时间合成
  79.    document.AddPublicRes.StartTime.value = document.AddPublicRes.StartDateD.value + " "+
  80.                                                  document.AddPublicRes.StartDateT.value + ":"+document.AddPublicRes.StartDateTm.value+":00";
  81.    document.AddPublicRes.EndTime.value = document.AddPublicRes.EndDateD.value + " "+
  82.                                                  document.AddPublicRes.EndDateT.value + ":"+document.AddPublicRes.EndDateTm.value+":00";
  83. }
  84. </script>
  85. </head>
  86. <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0">
  87. <table width="100%" height="100%" border="0" align="center" cellspacing="0">
  88.     <tr>
  89.         <td align="center" valign="top"><p>&nbsp;</p>
  90. <%
  91. Request m_request = new Request(request);
  92. int iSysDirID = m_request.GetInt("SysDirID");
  93. int iIsPlan = m_request.GetInt("IsPlan");
  94. int iAssetID = m_request.GetInt("AssetID");
  95. int intUserID = m_session.GetInt("UserID");
  96. %>
  97.             <form name="AddPublicRes" action="/Asset/AddPublicResAction.jsp?SysDirID=<%=iSysDirID%>&IsPlan=<%=iIsPlan%>" method="post" onSubmit="javascript:return checkAddPublicRes();">
  98.             <table  border="0" cellpadding="0" cellspacing="0" width="90%">
  99.                 <tr>
  100.                     <td align="right" valign="middle"><font color="#0A0A0A">用途:</font></td>
  101.                     <td align="left" valign="middle" nowrap>
  102.                         <input name="AssetID" type="hidden" value="<%=iAssetID%>">
  103.                         <input name="UserID" type="hidden" value="<%=intUserID%>">
  104.                         <input name="IsPlan" type="hidden" value="<%=iIsPlan%>">
  105.                         <input name="Purpose" type="text" maxlength="60" size="37">
  106.                     </td>
  107.                 </tr>
  108.                 <tr>
  109.                     <td align="right" valign="middle"><font color="#0A0A0A">开始时间:</font></td>
  110.                     <td align="left" valign="middle" nowrap>
  111.                     <input name="StartTime" type="hidden">
  112.                     <input name="StartDateD" type="text" onFocus="JavaScript:this.value=fPopUpCalendarDlg(this.value,-5,+5);" maxlength="12" size="12" onDblClick="JavaScript:this.value=fPopUpCalendarDlg(this.value,-5,+5);">
  113.               <select name="StartDateT">
  114.                 <option value="0">0</option>
  115.                 <option value="1">1</option>
  116.                 <option value="2">2</option>
  117.                 <option value="3">3</option>
  118.                 <option value="4">4</option>
  119.                 <option value="5">5</option>
  120.                 <option value="6">6</option>
  121.                 <option value="7">7</option>
  122.                 <option value="8">8</option>
  123.                 <option value="9" selected>9</option>
  124.                 <option value="10">10</option>
  125.                 <option value="11">11</option>
  126.                 <option value="12">12</option>
  127.                 <option value="13">13</option>
  128.                 <option value="14">14</option>
  129.                 <option value="15">15</option>
  130.                 <option value="16">16</option>
  131.                 <option value="17">17</option>
  132.                 <option value="18">18</option>
  133.                 <option value="19">19</option>
  134.                 <option value="20">20</option>
  135.                 <option value="21">21</option>
  136.                 <option value="22">22</option>
  137.                 <option value="23">23</option>
  138.               </select>
  139.               <font color="#0A0A0A">时</font>
  140.               <input name="StartDateTm" type="text" size="3" maxlength="2">
  141.                 <font color="#0A0A0A">分</font> </td>
  142.                 </tr>
  143.                 <tr>
  144.                     <td align="right" valign="middle"><font color="#0A0A0A">结束时间:</font></td>
  145.                     <td align="left" valign="middle" nowrap>
  146.                     <input name="EndTime" type="hidden">
  147.                     <input name="EndDateD" type="text" onFocus="JavaScript:this.value=fPopUpCalendarDlg(this.value,-5,+5);" maxlength="12" size="12" onDblClick="JavaScript:this.value=fPopUpCalendarDlg(this.value,-5,+5);">
  148.                 <select name="EndDateT">
  149.                 <option value="0">0</option>
  150.                 <option value="1">1</option>
  151.                 <option value="2">2</option>
  152.                 <option value="3">3</option>
  153.                 <option value="4">4</option>
  154.                 <option value="5">5</option>
  155.                 <option value="6">6</option>
  156.                 <option value="7">7</option>
  157.                 <option value="8">8</option>
  158.                 <option value="9">9</option>
  159.                 <option value="10">10</option>
  160.                 <option value="11">11</option>
  161.                 <option value="12">12</option>
  162.                 <option value="13">13</option>
  163.                 <option value="14">14</option>
  164.                 <option value="15">15</option>
  165.                 <option value="16">16</option>
  166.                 <option value="17" selected>17</option>
  167.                 <option value="18">18</option>
  168.                 <option value="19">19</option>
  169.                 <option value="20">20</option>
  170.                 <option value="21">21</option>
  171.                 <option value="22">22</option>
  172.                 <option value="23">23</option>
  173.               </select>
  174.               <font color="#0A0A0A">时</font>
  175.               <input name="EndDateTm" type="text" size="3" maxlength="2">
  176.               分</td>
  177.                 </tr>
  178.                 <tr>
  179.                     <td align="right" valign="middle">&nbsp;</td>
  180.                     <td align="left" valign="middle" nowrap>
  181.                     </td>
  182.                 </tr>
  183.                 <tr>
  184.                     <td align="right" valign="middle">&nbsp;</td>
  185.                     <td align="left" valign="middle" nowrap>
  186.                         <input type="submit" value="添加">  &nbsp;&nbsp;&nbsp;
  187.                         <input type="reset" value="重填">  &nbsp;&nbsp;&nbsp;
  188.                         <input type="button" value="返回" onclick="window.location='PublicResManage.jsp?SysDirID=<%=iSysDirID%>&ID=<%=iAssetID%>&IsPlan=<%=iIsPlan%>';">
  189.                     </td>
  190.                 </tr>
  191.             </table>
  192.             </form>
  193.         </td>
  194.     </tr>
  195. </table>
  196. </body>
  197. </html>