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