home *** CD-ROM | disk | FTP | other *** search
/ 61.19.244.139 / 61.19.244.139.zip / 61.19.244.139 / MortorEpolicy / entry-policy-add.jsp < prev    next >
Text File  |  2015-01-22  |  39KB  |  1,146 lines

  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
  3. <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
  4. <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
  5. <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  6.  
  7. <div class="widget-content">
  8.                 <div class="widget-box">
  9.                     <form:form class="form-horizontal well" method="post" action="savePolicy" modelAttribute="policyBean" id="frmPolicy">
  10.                         <fieldset>
  11.  
  12.                             <div class="box-tab">
  13.                                 <div class="tabbable">
  14.                                     <ul class="nav nav-tabs">
  15.                                         <li class="active"><a data-toggle="tab" href="#tab1"><i class="black-icons blocks_images"></i>α╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î</a></li>
  16.                                         <li><a data-toggle="tab" href="#tab2"><i class="black-icons abacus"></i> α╕£α╕╣α╣ëα╣Çα╕¡α╕▓α╕¢α╕úα╕░α╕üα╕▒α╕Öα╕áα╕▒α╕ó</a></li>
  17.                                         <li><a data-toggle="tab" href="#tab3"><i class="black-icons abacus"></i> α╕úα╕▓α╕óα╕Ñα╕░α╣Çα╕¡α╕╡α╕óα╕öα╕úα╕û</a></li>
  18.                                         <li><a data-toggle="tab" href="#tab4"><i class="black-icons abacus"></i> α╕äα╕ºα╕▓α╕íα╕äα╕╕α╣ëα╕íα╕äα╕úα╕¡α╕ç</a></li>
  19.                                         <li><a data-toggle="tab" href="#tab5"><i class="black-icons abacus"></i>α╕£α╕╣α╣ëα╕éα╕▒α╕Üα╕éα╕╡α╣ê</a></li>
  20.                                         <li><a data-toggle="tab" href="#tab6"><i class="black-icons abacus"></i> α╣Çα╕Üα╕╡α╣ëα╕óα╕¢α╕úα╕░α╕üα╕▒α╕Öα╕áα╕▒α╕ó</a></li>
  21.                                         <!-- <li><a data-toggle="tab" href="#tab7"><i class="black-icons abacus"></i>α╣Çα╕¡α╕üα╕¬α╕▓α╕úα╣üα╕Öα╕Ü</a></li> -->
  22.                                     </ul>
  23.  
  24.                                     <div class="tab-content">
  25.  
  26.                                         <div id="tab1" class="tab-pane active">
  27.                                             <div class=" row-fluid">
  28.                                                 <div class="widget-box">
  29.                                                     <div class="control-group">
  30.                                                         <label class="control-label" for="packageCode">PACKAGE</label>
  31.                                                         <div class="controls">
  32.                                                             <form:select path="packageCode" id="packageCode">
  33.                                                                 <form:options items="${packageList}" itemValue="packageCode" itemLabel="packageCode" />
  34.                                                             </form:select>
  35.                                                         </div>
  36.                                                     </div>
  37.  
  38.                                                     <div class="control-group">
  39.                                                         <label class="control-label" for="packageCode">α╕½α╕íα╕▓α╕óα╣Çα╕Ñα╕éα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î</label>
  40.                                                         <div class="controls">
  41.                                                             <form:input path="policyNo" class="input-medium"  readonly="true"/> (α╕½α╕íα╕▓α╕óα╣Çα╕Ñα╕éα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î )
  42.                                                         </div>
  43.                                                     </div>
  44.  
  45.                                                     <div class="control-group">
  46.                                                         <label class="control-label" for="beginDate">α╕ºα╕▒α╕Öα╕ùα╕╡α╣êα╣Çα╕úα╕┤α╣êα╕íα╕òα╣ëα╕Ö</label>
  47.                                                         <div class="controls">
  48.                                                             <form:input path="beginDate" class="input-small" />
  49.                                                             α╕ºα╕▒α╕Öα╕ùα╕╡α╣êα╕¬α╕┤α╣ëα╕Öα╕¬α╕╕α╕ö
  50.                                                             <form:input path="endDate" class="input-small" />
  51.                                                         </div>
  52.                                                     </div>
  53.  
  54.                                                     <div class="control-group">
  55.                                                         <label class="control-label" for="issueDate">α╕ºα╕▒α╕Öα╕ùα╕╡α╣ê α╕ùα╕│α╕¬α╕▒α╕ìα╕ìα╕▓</label>
  56.                                                         <div class="controls">
  57.                                                             <form:input path="agreeDate" class="input-small" />
  58.                                                             α╕ºα╕▒α╕Öα╕ùα╕╡α╣êα╕¡α╕¡α╕üα╣Çα╕¡α╕üα╕¬α╕▓α╕ú :
  59.                                                             <form:input path="issueDate" class="input-small" />
  60.                                                         </div>
  61.                                                     </div>
  62.  
  63.                                                     <div class="control-group">
  64.                                                         <label class="control-label" for=" "></label>
  65.                                                         <div class="controls">
  66.                                                             <form:radiobutton path="premCal" value="A" id="premCalA" />
  67.                                                             Annual (α╣Çα╕òα╣çα╕íα╕¢α╕╡)
  68.                                                             <form:radiobutton path="premCal" value="P" id="premCalP" />
  69.                                                             Pro-Rata (α╕Öα╕▒α╕Üα╕ºα╕▒α╕Ö)
  70.                                                             <form:radiobutton path="premCal" value="S" id="premCalS" />
  71.                                                             Short Rate (α╕úα╕░α╕óα╕░α╕¬α╕▒α╣ëα╕Ö)
  72.                                                         </div>
  73.                                                     </div>
  74.  
  75.                                                 </div>
  76.                                             </div>
  77.                                         </div>
  78.  
  79.  
  80.                                         <div id="tab2" class="tab-pane ">
  81.                                             <div class=" row-fluid">
  82.  
  83.                                                 <div class="control-group">
  84.                                                     <label class="control-label" for="packageCode"> α╕¢α╕úα╕░α╣Çα╕áα╕ùα╕Üα╕▒α╕òα╕úα╕¬α╕│α╕äα╕▒α╕ì</label>
  85.                                                     <div class="controls">
  86.  
  87.  
  88.                                                         <form:radiobutton path="insureType" value="P" id="insureTypeP" />
  89.                                                         α╕Üα╕╕α╕äα╕äα╕Ñα╕ÿα╕úα╕úα╕íα╕öα╕▓
  90.                                                         <form:radiobutton path="insureType" value="C" id="insureTypeC" />
  91.                                                         α╕Öα╕┤α╕òα╕┤α╕Üα╕╕α╕äα╕äα╕Ñ
  92.                                                         <form:radiobutton path="insureType" value="O" id="insureTypeO" />
  93.                                                         α╕¡α╕╖α╣êα╕Öα╣å
  94.  
  95.                                                         <form:input path="regId" class="input-small" id="regId" />
  96.  
  97.  
  98.                                                     </div>
  99.                                                 </div>
  100.  
  101.                                                 <div class="control-group">
  102.                                                     <label class="control-label" for="insureTitle"> α╕èα╕╖α╣êα╕¡-α╕¬α╕üα╕╕α╕Ñ</label>
  103.                                                     <div class="controls">
  104.  
  105.                                                         <form:select path="insureTitle" cssClass="input-small">
  106.                                                             <form:options items="${titles}" itemLabel="refDesc1" itemValue="refCode" />
  107.                                                         </form:select>
  108.                                                         <form:input path="insureName" class="input-xxlarge" maxlength="200"  />
  109.                                                     </div>
  110.                                                 </div>
  111.  
  112.                                                 <div class="control-group">
  113.                                                     <label class="control-label" for=""> α╕ùα╕╡α╣êα╕¡α╕óα╕╣α╣ê</label>
  114.                                                     <div class="controls">
  115.  
  116.  
  117.                                                         <form:input path="address" class="input-xxlarge"  maxlength="200" />
  118.                                                     </div>
  119.                                                 </div>
  120.  
  121.                                                 <div class="control-group">
  122.                                                     <label class="control-label" for="insureTitle"> α╕êα╕▒α╕çα╕½α╕ºα╕▒α╕ö</label>
  123.                                                     <div class="controls">
  124.                                                         <form:select path="province" id="province" class="input-medium">
  125.                                                             <form:options items="${provinceList}" itemLabel="provName" itemValue="provCode" />
  126.                                                         </form:select>
  127.                                                         α╕¡α╕│α╣Çα╕áα╕¡
  128.                                                         <form:select path="amphur" id="amphur" class="input-medium"></form:select>
  129.                                                         α╕òα╕│α╕Üα╕Ñ
  130.                                                         <form:select path="tambol" id="tambol" class="input-medium"></form:select>
  131.                                                     </div>
  132.                                                 </div>
  133.  
  134.                                                 <div class="control-group">
  135.                                                     <label class="control-label" for="insureTitle"> α╕úα╕½α╕▒α╕¬α╣äα╕¢α╕úα╕⌐α╕ôα╕╡α╕óα╣î</label>
  136.                                                     <div class="controls">
  137.                                                         <form:input path="zipcode" class="input-medium" id="zipcode" maxlength="5" />
  138.                                                         α╕¡α╕▓α╕èα╕╡α╕₧
  139.                                                         <form:select path="occuCode" id="occuCode">
  140.  
  141.                                                             <form:options items="${occuCodeList}" itemLabel="refDesc1" itemValue="refCode" />
  142.                                                         </form:select>
  143.  
  144.                                                     </div>
  145.                                                 </div>
  146.  
  147.                                                 α╕ùα╕╡α╣êα╕¡α╕óα╕╣α╣êα╕½α╕Öα╣ëα╕▓α╣âα╕Üα╣Çα╕¬α╕úα╣çα╕ê  <input type="checkbox" id="reciptionName"/>  α╣Çα╕½α╕íα╕╖α╕¡α╕Öα╕£α╕╣α╣ëα╣Çα╕¡α╕▓α╕¢α╕úα╕░α╕üα╕▒α╕Ö
  148.  
  149.  
  150.                                                 <div class="control-group">
  151.                                                     <label class="control-label" for=""> α╕èα╕╖α╣êα╕¡-α╕Öα╕▓α╕íα╕¬α╕üα╕╕α╕Ñ</label>
  152.                                                     <div class="controls">
  153.                                                         <form:input path="receiptName"  id="receiptName" class="input-xxlarge" maxlength="200" />
  154.                                                     </div>
  155.                                                 </div>
  156.  
  157.                                                 <div class="control-group">
  158.                                                     <label class="control-label" for=""> α╕ùα╕╡α╣êα╕¡α╕óα╕╣α╣ê</label>
  159.                                                     <div class="controls">
  160.                                                         <form:input path="receiptAddress1" id="receiptAddress1" class="input-xxlarge"  maxlength="200" />
  161.                                                     </div>
  162.                                                 </div>
  163.  
  164.                                                 <div class="control-group">
  165.                                                     <label class="control-label" for=""> </label>
  166.                                                     <div class="controls">
  167.                                                         <form:input path="receiptAddress2" id="receiptAddress2" class="input-xxlarge"  maxlength="200" />
  168.                                                     </div>
  169.                                                 </div>
  170.                                                 <div class="control-group">
  171.                                                     <label class="control-label" for=""> α╕£α╕╣α╣ëα╕úα╕▒α╕Üα╕£α╕Ñα╕¢α╕úα╕░α╣éα╕óα╕èα╕Öα╣î</label>
  172.                                                     <div class="controls">
  173.                                                         <form:input path="beneficiaryName" class="input-xxlarge" />
  174.                                                     </div>
  175.                                                 </div>
  176.  
  177.                                             </div>
  178.                                         </div>
  179.                                         <div id="tab3" class="tab-pane ">
  180.                                             <div class=" row-fluid">
  181.  
  182.                                                 <div class="control-group">
  183.                                                     <label class="control-label" for=""> α╕óα╕╡α╣êα╕½α╣ëα╕¡α╕úα╕ûα╕óα╕Öα╕òα╣î</label>
  184.                                                     <div class="controls">
  185.                                                         <form:select path="vehBrand" class="input-medium" id="vehBrand" />
  186.                                                         α╕¢α╕úα╕░α╣Çα╕áα╕ù MV /α╕üα╕▓α╕úα╣âα╕èα╣ëα╕úα╕û
  187.                                                         <form:select path="vehCode" class="input-medium"  id="vehSize" />
  188.                                                     </div>
  189.                                                 </div>
  190.  
  191.                                                 <div class="control-group">
  192.                                                     <label class="control-label" for=""> α╕úα╕╕α╣êα╕Öα╕úα╕ûα╕óα╕Öα╕òα╣î</label>
  193.                                                     <div class="controls">
  194.                                                         <form:select path="vehBrandmodel" class="input-medium" id="vehBrandmodel" />
  195.                                                         α╕¬α╕╡α╕úα╕û
  196.                                                         <form:input path="vehColor" class="input-medium" />
  197.                                                     </div>
  198.                                                 </div>
  199.  
  200.                                                 <div class="control-group">
  201.                                                     <label class="control-label" for="">α╕ùα╕░α╣Çα╕Üα╕╡α╕óα╕Öα╕úα╕û</label>
  202.                                                     <div class="controls">
  203.                                                         <form:input path="vehLicense" class="input-medium" />
  204.                                                         α╕êα╕▒α╕çα╕½α╕ºα╕▒α╕öα╕ùα╕░α╣Çα╕Üα╕╡α╕óα╕Öα╕úα╕û
  205.                                                         <form:select path="vehLicenseProv" class="input-medium">
  206.                                                             <form:options items="${ provinceList}" itemLabel="provName" itemValue="provCode" />
  207.                                                         </form:select>
  208.                                                     </div>
  209.                                                 </div>
  210.  
  211.                                                 <div class="control-group">
  212.                                                     <label class="control-label" for="packageCode">α╣Çα╕Ñα╕éα╕òα╕▒α╕ºα╕ûα╕▒α╕ç</label>
  213.                                                     <div class="controls">
  214.                                                         <form:input path="vehChassis" class="input-large" maxlength="35" onblur="this.value=this.value.toUpperCase()"/>
  215.                                                         α╣Çα╕Ñα╕éα╣Çα╕äα╕úα╕╖α╣êα╕¡α╕çα╕óα╕Öα╕òα╣î
  216.                                                         <form:input path="vehMachine" class="input-large" maxlength="35" onblur="this.value=this.value.toUpperCase()"/>
  217.                                                     </div>
  218.                                                 </div>
  219.  
  220.                                                 <div class="control-group">
  221.                                                     <label class="control-label" for="">α╣üα╕Üα╕Üα╕òα╕▒α╕ºα╕ûα╕▒α╕ç</label>
  222.                                                     <div class="controls">
  223.  
  224.                                                         <form:select path="vehChassisModel" id="vehChassisModel">
  225.  
  226.                                                             <form:options items="${chassisModelList}" itemLabel="refDesc1" itemValue="refCode" />
  227.                                                         </form:select>
  228.  
  229.                                                         CC:
  230.                                                         <form:input path="vehCc" class="input-mini autoInt" maxlength="5"/>
  231.                                                         / α╕ùα╕╡α╣êα╕Öα╕▒α╣êα╕ç:
  232.                                                         <form:input path="vehSeat" class="input-mini autoInt" maxlength="3"/>
  233.                                                         / α╕Öα╣ëα╕│α╕½α╕Öα╕▒α╕ü:
  234.                                                         <form:input path="vehWeigth" class="input-mini autoInt" maxlength="5"/>
  235.                                                         /
  236.                                                     </div>
  237.                                                 </div>
  238.  
  239.                                                 <div class="control-group">
  240.                                                     <label class="control-label" for="">α╕¢α╕╡α╕ùα╕╡α╣êα╕êα╕öα╕ùα╕░α╣Çα╕Üα╕╡α╕óα╕Ö</label>
  241.                                                     <div class="controls">
  242.                                                         <form:input path="vehYrreg" class="input-small  autoInt" maxlength="4" />
  243.                                                         α╕¢α╕╡α╕ùα╕╡α╣êα╕£α╕Ñα╕┤α╕ò
  244.                                                         <form:input path="vehYrprod" class="input-small autoInt"  maxlength="4" />
  245.                                                     </div>
  246.                                                 </div>
  247.  
  248.                                                 <div class="control-group">
  249.                                                     <label class="control-label" for="">α╕úα╕▓α╕óα╕üα╕▓α╕úα╕òα╕üα╣üα╕òα╣êα╕çα╣Çα╕₧α╕┤α╣êα╕íα╣Çα╕òα╕┤α╕í</label>
  250.                                                     <div class="controls">
  251.                                                         <form:input path="vehOption" class="input-xxlarge" />
  252.                                                     </div>
  253.                                                 </div>
  254.                                             </div>
  255.                                         </div>
  256.  
  257.                                         <div id="tab4" class="tab-pane ">
  258.  
  259.                                             <div class=" row-fluid">
  260.                                                 α╕òα╕▓α╕úα╕▓α╕çα╕äα╕ºα╕▓α╕íα╕äα╕╕α╣ëα╕íα╕äα╕úα╕¡α╕ç
  261.  
  262.                                                 <div role="grid" class="dataTables_wrapper">
  263.                                                     <div class="table_top clearfix"></div>
  264.  
  265.                                                     <div class="table_content">
  266.  
  267.                                                         <table class="data-tbl-striped table table-striped table-bordered dataTable">
  268.                                                             <thead>
  269.                                                                 <tr role="row">
  270.                                                                     <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 100px;">α╕äα╕ºα╕▓α╕íα╕äα╕╕α╣ëα╕íα╕äα╕úα╕¡α╕ç</th>
  271.                                                                     <th class=" " role="columnheader" rowspan="1" colspan="1" style="width: 87px;">α╣Çα╕Üα╕╡α╣ëα╕óα╕¢α╕úα╕░α╕üα╕▒α╕Öα╕ùα╕▒α╣ëα╕çα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î</th>
  272.                                                                     <th class="   " role="columnheader" rowspan="1" colspan="1" style="width: 87px;">α╕ùα╕╕α╕Öα╕¢α╕úα╕░α╕üα╕▒α╕Öα╕áα╕▒α╕óα╕òα╣êα╕¡α╕äα╕úα╕▒α╣ëα╕ç</th>
  273.                                                                     <th class="   " role="columnheader" rowspan="1" colspan="1" style="width: 87px;">α╕ùα╕╕α╕Öα╕¢α╕úα╕░α╕üα╕▒α╕Öα╕áα╕▒α╕óα╕òα╣êα╕¡α╕äα╕Ö</th>
  274.                                                                     <th class="   " role="columnheader" rowspan="1" colspan="1" style="width: 53px;">α╕êα╕│α╕Öα╕ºα╕Öα╕äα╕Ö</th>
  275.                                                                     <th class="   " role="columnheader" rowspan="1" colspan="1" style="width: 152px;">Deduct</th>
  276.  
  277.                                                                 </tr>
  278.                                                             </thead>
  279.  
  280.  
  281.                                                             <tbody role="alert" aria-live="polite" aria-relevant="all" id="coverContent">
  282.  
  283.  
  284.                                                                 <!--content-->
  285.  
  286.  
  287.  
  288.  
  289.                                                             </tbody>
  290.                                                         </table>
  291.  
  292.                                                     </div>
  293.                                                 </div>
  294.  
  295.                                             </div>
  296.  
  297.  
  298.                                         </div>
  299.  
  300.                                         <div id="tab5" class="tab-pane ">
  301.                                             <div class=" row-fluid">
  302.                                                 α╕äα╕Öα╕éα╕▒α╕Üα╕äα╕Öα╕ùα╕╡α╣ê 1
  303.                                                 <div class="control-group">
  304.                                                     <label class="control-label" for=""> α╕èα╕╖α╣êα╕¡-α╕Öα╕▓α╕íα╕¬α╕üα╕╕α╕Ñ</label>
  305.                                                     <div class="controls">
  306.  
  307.  
  308.                                                         <form:select path="driver1Title" cssClass="input-small driverT" id="driver1Title">
  309.                                                             <form:options items="${titles}" itemLabel="refDesc1" itemValue="refCode" />
  310.                                                         </form:select>
  311.                                                         <form:input path="driver1Name" class="input-xxlarge driverT" />
  312.  
  313.                                                     </div>
  314.                                                 </div>
  315.  
  316.                                                 <div class="control-group">
  317.                                                     <label class="control-label" for="">α╣Çα╕₧α╕¿</label>
  318.                                                     <div class="controls">
  319.  
  320.                                                         <form:radiobutton path="driver1Sex" value="M" class=" driverT" />
  321.                                                         α╕èα╕▓α╕ó
  322.                                                         <form:radiobutton path="driver1Sex" value="F" class=" driverT" />
  323.                                                         α╕½α╕ìα╕┤α╕ç α╕¡α╕▓α╕èα╕╡α╕₧
  324.                                                         <form:select path="driver1OccuCode" id="driver1OccuCode" class=" driverT">
  325.  
  326.                                                             <form:options items="${occuCodeList}" itemLabel="refDesc1" itemValue="refCode" />
  327.                                                         </form:select>
  328.                                                     </div>
  329.                                                 </div>
  330.                                                 <div class="control-group">
  331.                                                     <label class="control-label" for="">α╕ºα╕▒α╕Öα╣Çα╕üα╕┤α╕ö</label>
  332.                                                     <div class="controls">
  333.  
  334.                                                         <form:input path="driver1DateofBirth" class="input-large driverT" />
  335.  
  336.                                                     </div>
  337.                                                 </div>
  338.  
  339.                                                 <div class="control-group">
  340.                                                     <label class="control-label" for="">α╕½α╕íα╕▓α╕óα╣Çα╕Ñα╕éα╣âα╕Üα╕éα╕▒α╕Üα╕éα╕╡α╣ê:</label>
  341.                                                     <div class="controls">
  342.  
  343.  
  344.                                                         <form:input path="driver1LicenseNo" class="input-large driverT" />
  345.                                                     </div>
  346.                                                 </div>
  347.  
  348.                                                 <div class="control-group">
  349.                                                     <label class="control-label" for="">α╕½α╕íα╕▓α╕óα╣Çα╕Ñα╕éα╕Üα╕▒α╕òα╕úα╕¢α╕úα╕░α╕èα╕▓α╕èα╕Ö:</label>
  350.                                                     <div class="controls">
  351.  
  352.  
  353.                                                         <form:input path="driver1RegId" class="input-large driverT" maxlength="20"/>
  354.                                                     </div>
  355.                                                 </div>
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.                                                 α╕äα╕Öα╕éα╕▒α╕Üα╕äα╕Öα╕ùα╕╡α╣ê 2
  364.                                                 <div class="control-group">
  365.                                                     <label class="control-label" for=""> α╕èα╕╖α╣êα╕¡-α╕Öα╕▓α╕íα╕¬α╕üα╕╕α╕Ñ</label>
  366.                                                     <div class="controls">
  367.  
  368.  
  369.                                                         <form:select path="driver2Title" cssClass="input-small driverT" id="driver2Title">
  370.                                                             <form:options items="${titles}" itemLabel="refDesc1" itemValue="refCode" />
  371.                                                         </form:select>
  372.                                                         <form:input path="driver2Name" class="input-xxlarge driverT" maxlength="200"/>
  373.  
  374.                                                     </div>
  375.                                                 </div>
  376.  
  377.                                                 <div class="control-group">
  378.                                                     <label class="control-label" for="">α╣Çα╕₧α╕¿</label>
  379.                                                     <div class="controls">
  380.  
  381.                                                         <form:radiobutton path="driver2Sex" value="M" class="driverT" />
  382.                                                         α╕èα╕▓α╕ó
  383.                                                         <form:radiobutton path="driver2Sex" value="F" class="driverT" />
  384.                                                         α╕½α╕ìα╕┤α╕ç α╕¡α╕▓α╕èα╕╡α╕₧
  385.                                                         <form:select path="driver2OccuCode" id="driver2OccuCode" class="driverT">
  386.  
  387.                                                             <form:options items="${occuCodeList}" itemLabel="refDesc1" itemValue="refCode" />
  388.                                                         </form:select>
  389.                                                     </div>
  390.                                                 </div>
  391.                                                 <div class="control-group">
  392.                                                     <label class="control-label" for="">α╕ºα╕▒α╕Öα╣Çα╕üα╕┤α╕ö</label>
  393.                                                     <div class="controls">
  394.  
  395.                                                         <form:input path="driver2DateofBirth" class="input-large driverT"  />
  396.  
  397.                                                     </div>
  398.                                                 </div>
  399.  
  400.                                                 <div class="control-group">
  401.                                                     <label class="control-label" for="">α╕½α╕íα╕▓α╕óα╣Çα╕Ñα╕éα╣âα╕Üα╕éα╕▒α╕Üα╕éα╕╡α╣ê:</label>
  402.                                                     <div class="controls">
  403.  
  404.  
  405.                                                         <form:input path="driver2LicenseNo" class="input-large driverT" maxlength="20"/>
  406.                                                     </div>
  407.                                                 </div>
  408.  
  409.                                                 <div class="control-group">
  410.                                                     <label class="control-label" for="">α╕½α╕íα╕▓α╕óα╣Çα╕Ñα╕éα╕Üα╕▒α╕òα╕úα╕¢α╕úα╕░α╕èα╕▓α╕èα╕Ö:</label>
  411.                                                     <div class="controls">
  412.  
  413.  
  414.                                                         <form:input path="driver2RegId" class="input-large driverT" maxlength="20"/>
  415.                                                     </div>
  416.                                                 </div>
  417.  
  418.                                             </div>
  419.                                         </div>
  420.  
  421.                                         <div id="tab6" class="tab-pane ">
  422.                                             <div class=" row-fluid">
  423.  
  424.                                                 <div class="control-group">
  425.                                                     <label class="control-label" for=""> α╣Çα╕Üα╕╡α╣ëα╕óα╕¢α╕úα╕░α╕üα╕▒α╕Öα╕áα╕▒α╕óα╣Çα╕òα╣çα╕íα╕¢α╕╡</label>
  426.                                                     <div class="controls">
  427.  
  428.                                                         <form:input path="annualPrem" class=" autoNumber" id="annualPrem"  readonly="true"/>
  429.  
  430.                                                     </div>
  431.                                                 </div>
  432.  
  433.                                                 <div class="control-group">
  434.                                                     <label class="control-label" for=""> α╣Çα╕Üα╕╡α╣ëα╕óα╕¢α╕úα╕░α╕üα╕▒α╕Öα╕¬α╕╕α╕ÿα╕╖</label>
  435.                                                     <div class="controls">
  436.  
  437.                                                         <form:input path="netPremium" class="input-small autoNumber" id="netPremium"  readonly="true"/>
  438.                                                         α╣Çα╕Üα╕╡α╣ëα╕óα╕¢α╕úα╕░α╕üα╕▒α╕Öα╕áα╕▒α╕óα╕úα╕ºα╕í
  439.                                                         <form:input path="totalPremium" class="input-small autoNumber" id="totalPremium"  readonly="true" />
  440.                                                     </div>
  441.                                                 </div>
  442.  
  443.                                                 <div class="control-group">
  444.                                                     <label class="control-label" for=""> α╕¡α╕▓α╕üα╕ú</label>
  445.                                                     <div class="controls">
  446.                                                         <form:input path="feeAmt" class="input-small autoNumber" id="feeAmt"  readonly="true"/>
  447.  
  448.                                                     </div>
  449.                                                 </div>
  450.                                                 <div class="control-group">
  451.                                                     <label class="control-label" for="">VAT</label>
  452.                                                     <div class="controls">
  453.                                                         <form:input path="vatAmt" class="input-small autoNumber" id="vatAmt"  readonly="true" />
  454.                                                     </div>
  455.                                                 </div>
  456.  
  457.                                             </div>
  458.                                         </div>
  459.  
  460.                                         <!-- <div id="tab7" class="tab-pane ">
  461.                                             <div class=" row-fluid">
  462.  
  463.                                                 <div class="control-group">
  464.                                                     <label class="control-label">File input</label>
  465.                                                     <div class="controls">
  466.                                                         α╕¢α╕úα╕░α╣Çα╕áα╕ùα╣Çα╕¡α╕üα╕¬α╕▓α╕úα╣üα╕Öα╕Ü <select name="" id="">
  467.                                                             <option>α╣Çα╕¡α╕üα╕¬α╕▓α╕úα╕òα╕úα╕ºα╕êα╕¬α╕áα╕▓α╕₧α╕úα╕ûα╕óα╕Öα╕òα╣î</option>
  468.                                                             <option>α╕úα╕╣α╕¢α╕ûα╣êα╕▓α╕ó</option>
  469.                                                             <option>α╕¡α╕╖α╣êα╕Öα╣å</option>
  470.                                                         </select> <input class="input-file" type="file">
  471.                                                     </div>
  472.                                                 </div>
  473.  
  474.                                             </div>
  475.                                         </div>
  476.  -->
  477.                                     </div>
  478.                                 </div>
  479.                             </div>
  480.                             <!-- end tab -->
  481.                         </fieldset>
  482.                         <button class="btn btn-success" name="saveBtn" id="saveBtn">α╕Üα╕▒α╕Öα╕ùα╕╢α╕üα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î</button>
  483.                         <a class="btn" id="cancelBtn" onClick="$('#tableFrm').dialog('close');">α╕óα╕üα╣Çα╕Ñα╕┤α╕ü/α╕¢α╕┤α╕ö</a>
  484.                     </form:form>
  485.                 </div>
  486.             </div> 
  487.             
  488.             <script>
  489.  
  490.             $(function() {
  491.             var vehBrandmodel;
  492.             var vehBrand;
  493.             var packageCode;
  494.             var vatRate = ${vatRate};
  495.             var feeRate = ${feeRate}/100;
  496.             
  497.                 function check_idcard(idcard) {
  498.                     if (idcard.value == "") {
  499.                         return false;
  500.                     }
  501.                     if (idcard.length < 13) {
  502.                         return false;
  503.                     }
  504.  
  505.                     var num = str_split(idcard); // function α╣Çα╕₧α╕┤α╣êα╕íα╣Çα╕òα╕┤α╕í
  506.                     var sum = 0;
  507.                     var total = 0;
  508.                     var digi = 13;
  509.  
  510.                     for (i = 0; i < 12; i++) {
  511.                         sum = sum + (num[i] * digi);
  512.                         digi--;
  513.                     }
  514.                     total = ((11 - (sum % 11)) % 10);
  515.  
  516.                     if (total == num[12]) { //alert('α╕úα╕½α╕▒α╕¬α╕½α╕íα╕▓α╕óα╣Çα╕Ñα╕éα╕¢α╕úα╕░α╕êα╕│α╕òα╕▒α╕ºα╕¢α╕úα╕░α╕èα╕▓α╕èα╕Öα╕ûα╕╣α╕üα╕òα╣ëα╕¡α╕ç');
  517.                         return true;
  518.                     } else { //alert('α╕úα╕½α╕▒α╕¬α╕½α╕íα╕▓α╕óα╣Çα╕Ñα╕éα╕¢α╕úα╕░α╕êα╕│α╕òα╕▒α╕ºα╕¢α╕úα╕░α╕èα╕▓α╕èα╕Öα╣äα╕íα╣êα╕ûα╕╣α╕üα╕òα╣ëα╕¡α╕ç');
  519.                         return false;
  520.                     }
  521.                 }
  522.  
  523.  
  524.                 function checkID(id) {
  525.                     if (id.length != 13)
  526.                         return false;
  527.                     for (i = 0, sum = 0; i < 12; i++)
  528.                         sum += parseFloat(id.charAt(i)) * (13 - i);
  529.                     if ((11 - sum % 11) % 10 != parseFloat(id.charAt(12)))
  530.                         return false;
  531.                     return true;
  532.  
  533.                 }
  534.                  
  535.                 $("#issueDate").datepicker({ dateFormat: 'dd/mm/yy',minDate: new Date() });
  536.                 $("#agreeDate").datepicker({ dateFormat: 'dd/mm/yy',minDate: new Date() });
  537.  
  538.  
  539.  
  540.                  $('#beginDate').datepicker({ dateFormat: 'dd/mm/yy' , onSelect: function( selectedDate ) {
  541.  
  542.                 
  543.                 $("#endDate").datepicker("option", "minDate", selectedDate);
  544.  
  545.                         if ($('#premCalA').prop('checked')) {
  546.                             
  547.                             $('#endDate').prop('readonly', true);
  548.                             
  549.                              var enddate = $('#beginDate').datepicker('getDate', '+1y');
  550.                               enddate.setDate(enddate.getDate()+365);
  551.                             $('#endDate').datepicker('setDate', enddate);
  552.                            // $('#endDate').datepicker("destroy");;
  553.                             
  554.                         } else {
  555.  
  556.                             $('#endDate').prop('readonly', false);
  557.                         /*     $('#endDate').datepicker({
  558.                                 dateFormat : 'dd/mm/yy',
  559.                                 onSelect : function(selectedDate) {
  560.                                     $("#beginDate").datepicker("option", "maxDate", selectedDate);
  561.                                 }
  562.                             }); */
  563.                         }
  564.  
  565.                         $("input[name=premCal]:radio").change();
  566.  
  567.                     }
  568.                 });
  569.  
  570.                 $('#endDate').datepicker({
  571.                     dateFormat : 'dd/mm/yy',
  572.                     onSelect : function(selectedDate) {
  573.                         $("#beginDate").datepicker("option", "maxDate", selectedDate);
  574.                         $("input[name=premCal]:radio").change();
  575.                     }
  576.                 });
  577.  
  578.                 //$('#beginDate').datepicker( {  dateFormat: 'dd/MM/yyyy' });
  579.                 //$("#beginDate").datepicker("setDate", new Date());
  580.                 //$('#endDate').datepicker({  dateFormat: 'dd/mm/yyyy' });
  581.                 //$('#issueDate').datepicker( {  dateFormat: 'dd/mm/yyyy' });
  582.                 //$('#agreeDate').datepicker({  dateFormat: 'dd/mm/yyyy' });
  583.  
  584.                       $('#beginDate').change(function(){
  585.                         var date1 = $('#beginDate').datepicker('getDate');
  586.                         var date = new Date( Date.parse( date1 ) ); 
  587.                         date.setFullYear( date.getFullYear() + 1 );
  588.  
  589.                         var newDate = date.toDateString(); 
  590.                         newDate = new Date( Date.parse( newDate ) );
  591.  
  592.                         $('#date2').datepicker('setDate', newDate );
  593.                     })  
  594.  
  595.                 $('#beginDate').on('change', function() {
  596.  
  597.                 });
  598.  
  599.                 $("#regId").blur(function() {
  600.                      
  601.                     if ($('input[name=insureType]:checked').val() =='P'&&!check_idcard(this.value)) {
  602.                         alert('α╕½α╕íα╕▓α╕óα╣Çα╕Ñα╕éα╕Üα╕▒α╕òα╕úα╣äα╕íα╣êα╕ûα╕╣α╕üα╕òα╣ëα╕¡α╕çα╕üα╕úα╕╕α╕ôα╕▓α╕òα╕úα╕ºα╕êα╕¬α╕¡α╕Üα╕¡α╕╡α╕üα╕äα╕úα╕▒α╣ëα╕ç');
  603.                         $("#regId").focus();
  604.                     }
  605.  
  606.                 });
  607.  
  608.                 $('#tambol').on('change', function() {
  609.                     $.ajax({
  610.                         type : "GET",
  611.                         dataType : "json",
  612.                         url : 'tambol?amphurCode=' + $('#amphur option:selected').val() + '&provCode=' + $('#province option:selected').val() + '&tambolCode=' + this.value,
  613.                         success : function(data) {
  614.  
  615.                             $('#zipcode').val(data.tabolZipcode);
  616.  
  617.                         },
  618.                         error : function(xhr, ajaxOptions, thrownError) {
  619.                             alert(xhr.status);
  620.                             alert(thrownError);
  621.                         }
  622.                     });
  623.  
  624.                 });
  625.  
  626.                 $('#amphur').on('change', function() {
  627.                     $.ajax({
  628.                         type : "GET",
  629.                         dataType : "json",
  630.                         url : 'tambol-list?amphurCode=' + this.value + '&provCode=' + $('#province option:selected').val(),
  631.                         success : function(data) {
  632.  
  633.                             $('#tambol').find('option').remove().end();
  634.                             $.each(data, function() {
  635.                                 $('#tambol').append(new Option(this.tambolName, this.tambolCode));
  636.                             });
  637.                             $('#tambol').change();
  638.  
  639.                         },
  640.                         error : function(xhr, ajaxOptions, thrownError) {
  641.                             alert(xhr.status);
  642.                             alert(thrownError);
  643.                         }
  644.                     });
  645.  
  646.                 });
  647.  
  648.                 $('#province').on('change', function() {
  649.  
  650.                     $.ajax({
  651.                         type : "GET",
  652.                         dataType : "json",
  653.                         url : 'amphur-list?provCode=' + this.value,
  654.                         success : function(data) {
  655.  
  656.                             $('#amphur').find('option').remove().end();
  657.                             $('#tambol').find('option').remove().end();
  658.  
  659.                             $.each(data, function() {
  660.                                 $('#amphur').append(new Option(this.amphurName, this.amphurCode));
  661.                             });
  662.                             $('#amphur').change();
  663.                         },
  664.                         error : function(xhr, ajaxOptions, thrownError) {
  665.                             alert(xhr.status);
  666.                             alert(thrownError);
  667.                         }
  668.                     });
  669.  
  670.                 });
  671.  
  672.                 $('#vehBrand').on('change', function() {
  673.  
  674.                     $('#vehBrandmodel').find('option').remove().end();
  675.  
  676.                     if (packageCode.allBrand != 'Y') {
  677.                         $.each(vehBrandmodel, function() {
  678.  
  679.                             if ($('#vehBrand option:selected').val() == this.brand) {
  680.  
  681.                                 $('#vehBrandmodel').append(new Option(this.model, this.model));
  682.                             }
  683.  
  684.                         });
  685.                     } else {
  686.  
  687.                         $.each(vehBrandmodel, function() {
  688.  
  689.                             if ($('#vehBrand option:selected').val() == this.brandId) {
  690.  
  691.                                 $('#vehBrandmodel').append(new Option(this.modelName, this.modelName));
  692.                             }
  693.  
  694.                         });
  695.  
  696.                     }
  697.  
  698.                 });
  699.                 $('#packageCode').on('change', function() {
  700.  
  701.                     $.ajax({
  702.                         type : "GET",
  703.                         dataType : "json",
  704.                         url : 'get-packageH-detail?packageCode=' + encodeURIComponent(this.value),
  705.                         success : function(data) {
  706.  
  707.                             packageCode = data;
  708.                             //brand Model
  709.  
  710.                             //    data.totalPremium;
  711.  
  712.                             $('#vehBrand').find('option').remove().end();
  713.  
  714.                             vehBrandmodel = data.brandmodels;
  715.                             vehBrand = {};
  716.  
  717.                             if (data.allBrand != 'Y') {
  718.                                 $.each(vehBrandmodel, function() {
  719.  
  720.                                     if (!(this.brand in vehBrand)) {
  721.                                         $('#vehBrand').append(new Option(this.brand, this.brand));
  722.                                         vehBrand[this.brand] = this.brand;
  723.                                     }
  724.  
  725.                                 });
  726.                             } else {
  727.  
  728.                                 $.ajax({
  729.                                     type : "GET",
  730.                                     dataType : "json",
  731.                                     url : 'vehBrandmodel-list',
  732.                                     success : function(data2) {
  733.                                         vehBrandmodel = data2;
  734.                                         $.each(data2, function() {
  735.  
  736.                                             if (!(this.brandId in vehBrand)) {
  737.                                                 $('#vehBrand').append(new Option(this.brandId, this.brandId));
  738.                                                 vehBrand[this.brandId] = this.brandId;
  739.                                             }
  740.  
  741.                                         });
  742.  
  743.                                         $('#vehBrand').change();
  744.                                     }
  745.                                 });
  746.  
  747.                             }
  748.  
  749.                             
  750.                          
  751.                             //vehSize
  752.                  $('#vehSize').find('option').remove().end();
  753.                  
  754.                 
  755.                 
  756.                 if (data.allVehCode != 'Y') {
  757.  
  758.                                 $.each(data.vehSizeBeans, function() {
  759.                                     $('#vehSize').append(new Option(this.vehSizeDesc, this.vehSize+"|"+this.vehCode));
  760.                                 });
  761.  
  762.                             } else {
  763.  
  764.                                 $.ajax({
  765.                                     type : "GET",
  766.                                     dataType : "json",
  767.                                     url : 'veh-size-list',
  768.                                     success : function(data2) {
  769.                                         vehBrandmodel = data2;
  770.                                         $.each(data2, function() {
  771.                                             $('#vehSize').append(new Option(this.vehSizeDesc, this.vehSize+"|"+this.vehCode ));
  772.                                         });
  773.                                     }
  774.                                 });
  775.  
  776.                             }
  777.  
  778.                             //cover Table
  779.                             coverages = data.coverages;
  780.                             var coveragesTable = '';
  781.  
  782.                             $.each(coverages, function() {
  783.  
  784.                                 coveragesTable += '<tr class="odd">';
  785.  
  786.                                 coveragesTable += '<td class="span4">' + this.covCode + ':' + this.covName;
  787.  
  788.                                 coveragesTable += '</td>';
  789.                                 coveragesTable += '<td class=" "> ';
  790.  
  791.                                 if (!this.enableSumOfPol) {
  792.                                     coveragesTable += '-';
  793.  
  794.                                 } else {
  795.                                     coveragesTable += this.sumOfPol.toLocaleString();
  796.                                 }
  797.  
  798.                                 coveragesTable += '</td>';
  799.                                 coveragesTable += '<td class="center ">';
  800.                                 if (!this.enableSumOfTimes) {
  801.                                     coveragesTable += '-';
  802.  
  803.                                 } else {
  804.                                     coveragesTable += this.sumOfTimes.toLocaleString();
  805.                                 }
  806.                                 coveragesTable += '</td>';
  807.                                 coveragesTable += '<td class="center ">';
  808.                                 if (!this.enableSumOfPerson) {
  809.                                     coveragesTable += '-';
  810.  
  811.                                 } else {
  812.                                     coveragesTable += this.sumOfPerson.toLocaleString();
  813.                                 }
  814.                                 coveragesTable += '</td>';
  815.                                 coveragesTable += '<td class="center ">';
  816.                                 if (!this.enableNoPerson) {
  817.                                     coveragesTable += '-';
  818.  
  819.                                 } else {
  820.                                     coveragesTable += this.noPerson.toLocaleString();
  821.                                 }
  822.                                 coveragesTable += '</td>';
  823.                                 coveragesTable += '<td class="center ">';
  824.                                 if (!this.enableDeduct) {
  825.                                     coveragesTable += '-';
  826.  
  827.                                 } else {
  828.                                     coveragesTable += this.deduct.toLocaleString();
  829.                                 }
  830.  
  831.                                 coveragesTable += '</td>';
  832.  
  833.                                 coveragesTable += '</tr>';
  834.  
  835.                             });
  836.                             $('#coverContent').html("");
  837.                             $(coveragesTable).appendTo('#coverContent');
  838.                             //end cover table;
  839.  
  840.                             //driver tab
  841.  
  842.                             $(".driverT").prop('disabled', !(data.drivrers == 'Y'));
  843.  
  844.                             if (data.annualFlag == 'Y') {
  845.  
  846.                                 $('#premCalA').prop('checked', true);
  847.                                 $('#premCalP').prop('disabled', true);
  848.                                 $('#premCalS').prop('disabled', true);
  849.  
  850.                                 $("#endDate").prop('readonly', true);
  851.                                                                 $('#endDate').datepicker('disable');
  852.  
  853.                             } else {
  854.                                 //$("input[type=radio]").attr('disabled', false);
  855.                                 $('#premCalP').prop('disabled', !(data.prorata == 'Y'));
  856.                                 $('#premCalS').prop('disabled', !(data.shortrate == 'Y'));
  857.  
  858.                             }
  859.                             if (data.insureType == 'Y') {
  860.                                 $('#insureTypeP').prop('checked', true);
  861.                                 $('#insureTypeO').prop('disabled', true);
  862.                                 $('#insureTypeC').prop('disabled', true);
  863.  
  864.                             } else {
  865.                                 // $('#insureTypeP').prop('checked', true);
  866.                                 $('#insureTypeO').prop('disabled', false);
  867.                                 $('#insureTypeC').prop('disabled', false);
  868.  
  869.                             }
  870.  
  871.                             //                        data.allVehCode;
  872.                             //                        data.allBrand;
  873.                             //                        data.allGroup;
  874.                             //                        data.prorata;
  875.                             //                        data.shortrate;
  876.                             //                        ; 
  877.  
  878.                             $('#vehBrand').change();
  879.  
  880.                             //premium
  881.                             $("input[name=premCal]:radio").change();
  882.                             /* if ($('#premCalA').prop('checked')) {
  883.                                 
  884.                                 $('#annualPrem').val(data.totalPremium);
  885.                                 $('#netPremium').val(data.netPremium);
  886.                                 $('#totalPremium').val(data.totalPremium);
  887.                                 $('#feeAmt').val(data.fee);
  888.                                 $('#vatAmt').val(data.vatAmt);
  889.  
  890.                             } else if ($('#premCalP').prop('checked')) {
  891.  
  892.                                 var netPremium = data.netPremium;
  893.                                 var bDate = ('#beginDate').datepicker("getDate") ;
  894.                                 var eDate = ('#endDate').datepicker("getDate");
  895.                                 //alert((eDate- bDate) /( 86400 * 1000));
  896.                                 
  897.                                 $('#annualPrem').val(data.totalPremium);
  898.                                 $('#netPremium').val(data.netPremium);
  899.                                 $('#totalPremium').val(data.totalPremium);
  900.                                 $('#feeAmt').val(data.fee);
  901.                                 $('#vatAmt').val(data.vatAmt);
  902.                                 
  903.                             } else if ($('#premCalS').prop('checked')) {
  904.  
  905.  
  906.                                 $('#annualPrem').val(data.totalPremium);
  907.                                 $('#netPremium').val(data.netPremium);
  908.                                 $('#totalPremium').val(data.totalPremium);
  909.                                 $('#feeAmt').val(data.fee);
  910.                                 $('#vatAmt').val(data.vatAmt);
  911.                             }
  912.                              */
  913.                             $('.autoNumber').autoNumeric('init', {
  914.                                 aSep : ',',
  915.                                 aDec : '.',
  916.                                 vMin : '0.00',
  917.                                 vMax : '1000000000.00'
  918.                             });
  919.  
  920.                             //documents
  921.                             if (data.loadDoc != 'Y') {
  922.  
  923.                                 //disable loaddocs
  924.                             }
  925.  
  926.                         },
  927.                         error : function(xhr, ajaxOptions, thrownError) {
  928.                             alert(xhr.status);
  929.                             alert(thrownError);
  930.                         }
  931.                     });
  932.  
  933.                 });
  934.  
  935.             $('#reciptionName').on('change', function() {
  936.  
  937.               
  938.             if ($('#reciptionName').prop('checked')) {
  939.  
  940.                     $('#receiptName').val($('#insureTitle option:selected').text()+$('#insureName').val());
  941.                     $('#receiptAddress1').val($('#address').val());
  942.                     $('#receiptAddress2').val(" "+$('#tambol option:selected').text()+" "+$('#amphur option:selected').text()+" "+$('#province option:selected').text() );
  943.                     $('#receiptName').prop('readonly', true);
  944.                     $('#receiptAddress1').prop('readonly', true);
  945.                     $('#receiptAddress2').prop('readonly', true);
  946.                 } else {
  947.  
  948.                     /* $('#receiptName').val('');
  949.                     $('#receiptAddress1').val('');
  950.                     $('#receiptAddress2').val(''); */
  951.                     $('#receiptName').prop('readonly', false);
  952.                     $('#receiptAddress1').prop('readonly', false);
  953.                     $('#receiptAddress2').prop('readonly', false);
  954.                     
  955.  
  956.                 }
  957.  
  958.             });
  959.             
  960.             $("input[name=premCal]:radio").change(function() {
  961.  
  962.                 var freeAmt;
  963.                 var vatAmt;
  964.                 var totalPremium;
  965.                 var netP;
  966.                 var netPremium;
  967.                 
  968.                 if ($("input[name=premCal]:checked").val()=='P') {
  969.                      
  970.                     netPremium = packageCode.netPremium;
  971.                     var bDate =  $('#beginDate').datepicker("getDate");
  972.                     var eDate =  $('#endDate').datepicker("getDate");             
  973.                     var difDate=  (eDate- bDate) /( 86400 * 1000);
  974.                     netPremium = difDate*netPremium/365;
  975.  
  976.                 } else if ($("input[name=premCal]:checked").val()=='S') {
  977.                      
  978.                     var bDate =  $('#beginDate').datepicker("getDate");
  979.                     var eDate =  $('#endDate').datepicker("getDate");
  980.                     var difDate= 1+(eDate- bDate) /( 86400 * 1000);
  981.                      netPremium = packageCode.netPremium;
  982.  
  983.                     $.ajax({
  984.                         type : "GET",
  985.                         dataType : "json",
  986.                         url : 'get-short-rate?days='+difDate,
  987.                         success : function(moShtRntBean) {
  988.                         netPremium = netPremium*moShtRntBean.srShtPercent/100;
  989.                         }
  990.                     });
  991.                     
  992.                      
  993.                     
  994.                 }else {
  995.                      
  996.                     $('#annualPrem').val(packageCode.totalPremium);
  997.                     $('#netPremium').val(packageCode.netPremium);
  998.                     netPremium = packageCode.netPremium;
  999.                     }
  1000.               
  1001.                 freeAmt =  (feeRate*netPremium/100.00);
  1002.                 vatAmt  = (netPremium+feeRate)*vatRate/100.00;
  1003.                 totalPremium = netP+freeAmt+vatAmt;
  1004.             
  1005.                  var f = (netPremium*feeRate);
  1006.                  var free =  Math.ceil(f);
  1007.                  
  1008.                 $('#netPremium').val(netPremium);
  1009.                 $("#feeAmt").val(free);
  1010.                 var vat =  Math.ceil(( parseFloat( netPremium)+ parseInt(free) )*vatRate)/100 ;
  1011.                  $("#vatAmt").val(vat);
  1012.                 var total =  parseFloat(netPremium)+parseFloat(free)+parseFloat(vat);
  1013.                  $("#totalPremium").val(total);
  1014.  
  1015.  
  1016.                 /*     $('.autoNumber').autoNumeric('update', {
  1017.                         aSep : ',',
  1018.                         aDec : '.',
  1019.                         vMin : '0.00',
  1020.                         vMax : '1000000000.00'
  1021.                     }); */
  1022.                     
  1023.             });
  1024.  
  1025.             $('#province').change();
  1026.  
  1027.             $('#packageCode').change();
  1028.  
  1029.             $("#packageCode").select2({
  1030.                 width : 'resolve'
  1031.             });
  1032.  
  1033.             $("#driver1OccuCode").select2({
  1034.                 width : 'resolve'
  1035.             });
  1036.             $("#driver2OccuCode").select2({
  1037.                 width : 'resolve'
  1038.             });
  1039.             $("#driver1Title").select2({
  1040.                 width : 'resolve'
  1041.             });
  1042.             $("#driver2Title").select2({
  1043.                 width : 'resolve'
  1044.             });
  1045.             $("#occuCode").select2({
  1046.                 width : 'resolve'
  1047.             });
  1048.             $("#insureTitle").select2({
  1049.                 width : 'resolve'
  1050.             });
  1051.             $("#province").select2({
  1052.                 width : 'resolve'
  1053.             });
  1054.             $("#amphur").select2({
  1055.                 width : 'resolve'
  1056.             });
  1057.             $("#tambol").select2({
  1058.                 width : 'resolve'
  1059.             });
  1060.  
  1061.             $('#driver1DateofBirth').datepicker({
  1062.                 dateFormat : 'dd/mm/yy',
  1063.                 minDate : new Date()
  1064.             });
  1065.             $('driver2DateofBirth').datepicker({
  1066.                 dateFormat : 'dd/mm/yy',
  1067.                 minDate : new Date()
  1068.             });
  1069.             $('.autoInt').autoNumeric('init', {
  1070.                 aSep : '',
  1071.                 aPad : false,
  1072.                 vMin : '0',
  1073.                 vMax : '99999'
  1074.             });
  1075.             //$("#frmPolicy").preventDoubleSubmission();
  1076.             
  1077.             <%if (request.getParameter("policyNo") == null) {%>
  1078.                                  
  1079.                                 <%} else {%>
  1080.                                 $('#amphur option:selected').val('${policyBean.tambol}');
  1081.                                 //$('#amphur').change();
  1082.                                 $('#tambol option:selected').val('${policyBean.amphur}');
  1083.                                  $('#vehBrand option:selected').val('${policyBean.vehBrand}');
  1084.                                 //$('#vehBrand').change();
  1085.                                  $('#vehBrandmodel option:selected').val('${policyBean.vehBrandmodel}'); 
  1086.                                 //$('#vehBrandmodel').change();
  1087.                                 //$('#vehSize option:selected').val('${policyBean.vehSize}|${policyBean.vehCode}'); 
  1088.                                 <%}%>
  1089.             
  1090.  
  1091.             $("#frmPolicy").submit(function() {
  1092.  
  1093.                 $('#saveBtn').click(function() {
  1094.                     return false;
  1095.                 });
  1096.  
  1097.                 var form = $(this);
  1098.                 $('input').each(function(i) {
  1099.                     var self = $(this);
  1100.                     try {
  1101.                         var v = self.autoNumeric('get');
  1102.                         self.autoNumeric('destroy');
  1103.                         self.val(v);
  1104.                     } catch (err) {
  1105.                         console.log("Not an autonumeric field: " + self.attr("name"));
  1106.                     }
  1107.                 });
  1108.  
  1109.                 //$("saveBtn").prop('disabled', true);
  1110.                 var url = "savePolicy";
  1111.                 $.ajax({
  1112.                     type : "POST",
  1113.                     url : url,
  1114.                     data : $("#frmPolicy").serialize(),
  1115.                     success : function(data) {
  1116.  
  1117.                         $('#grid').trigger("reloadGrid", [ {
  1118.                             page : 1
  1119.                         } ]);
  1120.                         //$('#tableFrm').dialog('close');
  1121.                         $("#saveBtn").unbind();
  1122.                         $('#saveBtn').click(function() {
  1123.                             return true;
  1124.                         });
  1125.  
  1126.                     updateCreditMenu();
  1127.                     
  1128.                     
  1129.                         $('#tableFrm').dialog('close');
  1130.                     },
  1131.                     error : function(xhr, ajaxOptions, thrownError) {
  1132.  
  1133.                         var obj = JSON.parse(xhr.responseText);
  1134.                         alert(obj.errorMessages);
  1135.                         $("#saveBtn").unbind();
  1136.                         $('#saveBtn').click(function() {
  1137.                             return true;
  1138.                         });
  1139.                     }
  1140.                 });
  1141.  
  1142.                 return false;
  1143.             });
  1144.  
  1145.             });
  1146.             </script>