home *** CD-ROM | disk | FTP | other *** search
/ 61.19.244.139 / 61.19.244.139.zip / 61.19.244.139 / entry-policy-view.jsp < prev    next >
Text File  |  2015-01-29  |  57KB  |  1,238 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="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"/>
  215.                                             α╣Çα╕Ñα╕éα╣Çα╕äα╕úα╕╖α╣êα╕¡α╕çα╕óα╕Öα╕òα╣î
  216.                                             <form:input path="vehMachine" class="input-large" maxlength="35"/>
  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.         $("#issueDate").prop('readonly', true);
  539.         $("#agreeDate").prop('readonly', true);
  540.  
  541.  
  542.  
  543.  
  544.         $('#beginDate').datepicker({dateFormat: 'dd/mm/yy', minDate: new Date(), onSelect: function (selectedDate) {
  545.  
  546.  
  547.                 $("#endDate").datepicker("option", "minDate", selectedDate);
  548.  
  549.                 if ($('#premCalA').prop('checked')) {
  550.  
  551.                     $('#endDate').prop('readonly', true);
  552.  
  553.                     var enddate = $('#beginDate').datepicker('getDate', '+1y');
  554.                     enddate.setDate(enddate.getDate() + 365);
  555.                     $('#endDate').datepicker('setDate', enddate);
  556.                     // $('#endDate').datepicker("destroy");;
  557.  
  558.                 } else {
  559.  
  560.                     $('#endDate').prop('readonly', false);
  561.                     /*     $('#endDate').datepicker({
  562.                      dateFormat : 'dd/mm/yy',
  563.                      onSelect : function(selectedDate) {
  564.                      $("#beginDate").datepicker("option", "maxDate", selectedDate);
  565.                      }
  566.                      }); */
  567.                 }
  568.  
  569.                 $("input[name=premCal]:radio").change();
  570.  
  571.             }
  572.         });
  573.  
  574.         $('#endDate').datepicker({
  575.             dateFormat: 'dd/mm/yy',
  576.             minDate: new Date(),
  577.             onSelect: function (selectedDate) {
  578.                 $("#beginDate").datepicker("option", "maxDate", selectedDate);
  579.                 $("input[name=premCal]:radio").change();
  580.             }
  581.         });
  582.  
  583.         //$('#beginDate').datepicker( {  dateFormat: 'dd/MM/yyyy' });
  584.         //$("#beginDate").datepicker("setDate", new Date());
  585.         //$('#endDate').datepicker({  dateFormat: 'dd/mm/yyyy' });
  586.         //$('#issueDate').datepicker( {  dateFormat: 'dd/mm/yyyy' });
  587.         //$('#agreeDate').datepicker({  dateFormat: 'dd/mm/yyyy' });
  588.  
  589.         $('#beginDate').change(function () {
  590.             var date1 = $('#beginDate').datepicker('getDate');
  591.             var date = new Date(Date.parse(date1));
  592.             date.setFullYear(date.getFullYear() + 1);
  593.  
  594.             var newDate = date.toDateString();
  595.             newDate = new Date(Date.parse(newDate));
  596.  
  597.             $('#date2').datepicker('setDate', newDate);
  598.         })
  599.  
  600.         $('#beginDate').on('change', function () {
  601.  
  602.         });
  603.  
  604.         $("#regId").blur(function () {
  605.  
  606.             if ($('input[name=insureType]:checked').val() == 'P' && !check_idcard(this.value)) {
  607.                 alert('α╕½α╕íα╕▓α╕óα╣Çα╕Ñα╕éα╕Üα╕▒α╕òα╕úα╣äα╕íα╣êα╕ûα╕╣α╕üα╕òα╣ëα╕¡α╕çα╕üα╕úα╕╕α╕ôα╕▓α╕òα╕úα╕ºα╕êα╕¬α╕¡α╕Üα╕¡α╕╡α╕üα╕äα╕úα╕▒α╣ëα╕ç');
  608.                 $("#regId").focus();
  609.             }
  610.  
  611.         });
  612.  
  613.         $('#tambol').on('change', function () {
  614.             $.ajax({
  615.                 type: "GET",
  616.                 dataType: "json",
  617.                 url: 'tambol?amphurCode=' + $('#amphur option:selected').val() + '&provCode=' + $('#province option:selected').val() + '&tambolCode=' + this.value,
  618.                 success: function (data) {
  619.  
  620.                     $('#zipcode').val(data.tabolZipcode);
  621.  
  622.                 },
  623.                 error: function (xhr, ajaxOptions, thrownError) {
  624.                     alert(xhr.status);
  625.                     alert(thrownError);
  626.                 }
  627.             });
  628.  
  629.         });
  630.  
  631.         $('#amphur').on('change', function () {
  632.             $.ajax({
  633.                 type: "GET",
  634.                 dataType: "json",
  635.                 url: 'tambol-list?amphurCode=' + this.value + '&provCode=' + $('#province option:selected').val(),
  636.                 success: function (data) {
  637.  
  638.                     $('#tambol').find('option').remove().end();
  639.                     $.each(data, function () {
  640.                         $('#tambol').append(new Option(this.tambolName, this.tambolCode));
  641.                     });
  642.                     $('#tambol').change();
  643.  
  644.                 },
  645.                 error: function (xhr, ajaxOptions, thrownError) {
  646.                     alert(xhr.status);
  647.                     alert(thrownError);
  648.                 }
  649.             });
  650.  
  651.         });
  652.  
  653.         $('#province').on('change', function () {
  654.  
  655.             $.ajax({
  656.                 type: "GET",
  657.                 dataType: "json",
  658.                 url: 'amphur-list?provCode=' + this.value,
  659.                 success: function (data) {
  660.  
  661.                     $('#amphur').find('option').remove().end();
  662.                     $('#tambol').find('option').remove().end();
  663.  
  664.                     $.each(data, function () {
  665.                         $('#amphur').append(new Option(this.amphurName, this.amphurCode));
  666.                     });
  667.                     $('#amphur').change();
  668.                 },
  669.                 error: function (xhr, ajaxOptions, thrownError) {
  670.                     alert(xhr.status);
  671.                     alert(thrownError);
  672.                 }
  673.             });
  674.  
  675.         });
  676.          $('#vehSize').on('change', function () {
  677.  
  678.             $.ajax({
  679.                 type: "GET",
  680.                 dataType: "json",
  681.                 url: 'veh-model-list?vehmCode=' + this.value,
  682.                 success: function (data) {
  683.                     $('#vehChassisModel').find('option').remove().end();
  684.  
  685.                     $.each(data, function () {
  686.                         $('#vehChassisModel').append(new Option(this.vehmDesc, this.vehmType));
  687.                     });
  688.  
  689.                 },
  690.                 error: function (xhr, ajaxOptions, thrownError) {
  691.                     alert(xhr.status);
  692.                     alert(thrownError);
  693.                 }
  694.             });
  695.         });
  696.  
  697.         $('#vehBrand').on('change', function () {
  698.  
  699.             $('#vehBrandmodel').find('option').remove().end();
  700.  
  701.             if (packageCode.allBrand != 'Y') {
  702.                 $.each(vehBrandmodel, function () {
  703.  
  704.                     if ($('#vehBrand option:selected').val() == this.brand) {
  705.  
  706.                         $('#vehBrandmodel').append(new Option(this.model, this.model));
  707.                     }
  708.  
  709.                 });
  710.             } else {
  711.  
  712.                 $.each(vehBrandmodel, function () {
  713.  
  714.                     if ($('#vehBrand option:selected').val() == this.brandId) {
  715.  
  716.                         $('#vehBrandmodel').append(new Option(this.modelName, this.modelName));
  717.                     }
  718.  
  719.                 });
  720.  
  721.             }
  722.  
  723.         });
  724.         $('#packageCode').on('change', function () {
  725.  
  726.             $.ajax({
  727.                 type: "GET",
  728.                 dataType: "json",
  729.                 url: 'get-packageH-detail?packageCode=' + encodeURIComponent(this.value),
  730.                 success: function (data) {
  731.  
  732.                     packageCode = data;
  733.                     //brand Model
  734.  
  735.                     //    data.totalPremium;
  736.  
  737.                     $('#vehBrand').find('option').remove().end();
  738.  
  739.                     vehBrandmodel = data.brandmodels;
  740.                     vehBrand = {};
  741.  
  742.                     if (data.allBrand != 'Y') {
  743.                         $.each(vehBrandmodel, function () {
  744.  
  745.                             if (!(this.brand in vehBrand)) {
  746.                                 $('#vehBrand').append(new Option(this.brand, this.brand));
  747.                                 vehBrand[this.brand] = this.brand;
  748.                             }
  749.  
  750.                         });
  751.                     } else {
  752.  
  753.                         $.ajax({
  754.                             type: "GET",
  755.                             dataType: "json",
  756.                             url: 'vehBrandmodel-list',
  757.                             success: function (data2) {
  758.                                 vehBrandmodel = data2;
  759.                                 $.each(data2, function () {
  760.  
  761.                                     if (!(this.brandId in vehBrand)) {
  762.                                         $('#vehBrand').append(new Option(this.brandId, this.brandId));
  763.                                         vehBrand[this.brandId] = this.brandId;
  764.                                     }
  765.  
  766.                                 });
  767.  
  768.                                 $('#vehBrand').change();
  769.                             }
  770.                         });
  771.  
  772.                     }
  773.  
  774.  
  775.  
  776.                     //vehSize
  777.                     $('#vehSize').find('option').remove().end();
  778.  
  779.  
  780.  
  781.                     if (data.allVehCode != 'Y') {
  782.                          $('#vehSize').append(new Option("", ""));
  783.                         $.each(data.vehSizeBeans, function () {
  784.                             $('#vehSize').append(new Option(this.vehSizeDesc, this.vehSize + "|" + this.vehCode));
  785.                         });
  786.  
  787.                     } else {
  788.  
  789.                         $.ajax({
  790.                             type: "GET",
  791.                             dataType: "json",
  792.                             url: 'veh-size-list',
  793.                             success: function (data2) {
  794.                                 vehBrandmodel = data2;
  795.                                  $('#vehSize').append(new Option("", ""));
  796.                                 $.each(data2, function () {
  797.                                     $('#vehSize').append(new Option(this.vehSizeDesc, this.vehSize + "|" + this.vehCode));
  798.                                 });
  799.                             }
  800.                         });
  801.  
  802.                     }
  803.  
  804.                     //cover Table
  805.                     coverages = data.coverages;
  806.                     var coveragesTable = '';
  807.  
  808.                     $.each(coverages, function () {
  809.  
  810.                         coveragesTable += '<tr class="odd">';
  811.  
  812.                         coveragesTable += '<td class="span4 text-left">' + this.covCode + ':' + this.covName;
  813.  
  814.                         coveragesTable += '</td>';
  815.                         coveragesTable += '<td class=" "> ';
  816.  
  817.                         if (!this.enableSumOfPol) {
  818.                             coveragesTable += '-';
  819.  
  820.                         } else {
  821.                             coveragesTable += this.sumOfPol.toLocaleString();
  822.                         }
  823.  
  824.                         coveragesTable += '</td>';
  825.                         coveragesTable += '<td class="center ">';
  826.                         if (!this.enableSumOfTimes) {
  827.                             coveragesTable += '-';
  828.  
  829.                         } else {
  830.                             coveragesTable += this.sumOfTimes.toLocaleString();
  831.                         }
  832.                         coveragesTable += '</td>';
  833.                         coveragesTable += '<td class="center ">';
  834.                         if (!this.enableSumOfPerson) {
  835.                             coveragesTable += '-';
  836.  
  837.                         } else {
  838.                             coveragesTable += this.sumOfPerson.toLocaleString();
  839.                         }
  840.                         coveragesTable += '</td>';
  841.                         coveragesTable += '<td class="center ">';
  842.                         if (!this.enableNoPerson) {
  843.                             coveragesTable += '-';
  844.  
  845.                         } else {
  846.                             coveragesTable += this.noPerson.toLocaleString();
  847.                         }
  848.                         coveragesTable += '</td>';
  849.                         coveragesTable += '<td class="center ">';
  850.                         if (!this.enableDeduct) {
  851.                             coveragesTable += '-';
  852.  
  853.                         } else {
  854.                             coveragesTable += this.deduct.toLocaleString();
  855.                         }
  856.  
  857.                         coveragesTable += '</td>';
  858.  
  859.                         coveragesTable += '</tr>';
  860.  
  861.                     });
  862.                     $('#coverContent').html("");
  863.                     $(coveragesTable).appendTo('#coverContent');
  864.                     //end cover table;
  865.  
  866.                     //driver tab
  867.  
  868.                     $(".driverT").prop('disabled', !(data.drivrers == 'Y'));
  869.  
  870.                     if (data.annualFlag == 'Y') {
  871.  
  872.                         $('#premCalA').prop('checked', true);
  873.                         $('#premCalP').prop('disabled', true);
  874.                         $('#premCalS').prop('disabled', true);
  875.  
  876.                         $("#endDate").prop('readonly', true);
  877.  
  878.                     } else {
  879.                         //$("input[type=radio]").attr('disabled', false);
  880.                         $('#premCalP').prop('disabled', !(data.prorata == 'Y'));
  881.                         $('#premCalS').prop('disabled', !(data.shortrate == 'Y'));
  882.  
  883.                     }
  884.                     if (data.insureType == 'Y') {
  885.                         $('#insureTypeP').prop('checked', true);
  886.                         $('#insureTypeO').prop('disabled', true);
  887.                         $('#insureTypeC').prop('disabled', true);
  888.  
  889.                     } else {
  890.                         // $('#insureTypeP').prop('checked', true);
  891.                         $('#insureTypeO').prop('disabled', false);
  892.                         $('#insureTypeC').prop('disabled', false);
  893.  
  894.                     }
  895.  
  896.                     //                        data.allVehCode;
  897.                     //                        data.allBrand;
  898.                     //                        data.allGroup;
  899.                     //                        data.prorata;
  900.                     //                        data.shortrate;
  901.                     //                        ; 
  902.  
  903.                     $('#vehBrand').change();
  904.  
  905.                     //premium
  906.                     $("input[name=premCal]:radio").change();
  907.                     /* if ($('#premCalA').prop('checked')) {
  908.                      
  909.                      $('#annualPrem').val(data.totalPremium);
  910.                      $('#netPremium').val(data.netPremium);
  911.                      $('#totalPremium').val(data.totalPremium);
  912.                      $('#feeAmt').val(data.fee);
  913.                      $('#vatAmt').val(data.vatAmt);
  914.                      
  915.                      } else if ($('#premCalP').prop('checked')) {
  916.                      
  917.                      var netPremium = data.netPremium;
  918.                      var bDate = ('#beginDate').datepicker("getDate") ;
  919.                      var eDate = ('#endDate').datepicker("getDate");
  920.                      //alert((eDate- bDate) /( 86400 * 1000));
  921.                      
  922.                      $('#annualPrem').val(data.totalPremium);
  923.                      $('#netPremium').val(data.netPremium);
  924.                      $('#totalPremium').val(data.totalPremium);
  925.                      $('#feeAmt').val(data.fee);
  926.                      $('#vatAmt').val(data.vatAmt);
  927.                      
  928.                      } else if ($('#premCalS').prop('checked')) {
  929.                      
  930.                      
  931.                      $('#annualPrem').val(data.totalPremium);
  932.                      $('#netPremium').val(data.netPremium);
  933.                      $('#totalPremium').val(data.totalPremium);
  934.                      $('#feeAmt').val(data.fee);
  935.                      $('#vatAmt').val(data.vatAmt);
  936.                      }
  937.                      */
  938.                     $('.autoNumber').autoNumeric('init', {
  939.                         aSep: ',',
  940.                         aDec: '.',
  941.                         vMin: '0.00',
  942.                         vMax: '1000000000.00'
  943.                     });
  944.  
  945.                     //documents
  946.                     if (data.loadDoc != 'Y') {
  947.  
  948.                         //disable loaddocs
  949.                     }
  950.  
  951.                 },
  952.                 error: function (xhr, ajaxOptions, thrownError) {
  953.                     alert(xhr.status);
  954.                     alert(thrownError);
  955.                 }
  956.             });
  957.  
  958.         });
  959.         
  960.         $('#insureTypeP').on('change', function () {
  961.             $.ajax({
  962.                 type: "GET",
  963.                 dataType: "json",
  964.                 url: 'title-list?type=P',
  965.                 success: function (data) {
  966.  
  967.                     $('#insureTitle').find('option').remove().end();
  968.                     $.each(data, function () {
  969.                         $('#insureTitle').append(new Option(this.refDesc1, this.refCode));
  970.                     });
  971.                     ;
  972.                 },
  973.                 error: function (xhr, ajaxOptions, thrownError) {
  974.                     alert(xhr.status);
  975.                     alert(thrownError);
  976.                 }
  977.             });
  978.         });
  979.  
  980.         $('#insureTypeC').on('change', function () {
  981.             $.ajax({
  982.                 type: "GET",
  983.                 dataType: "json",
  984.                 url: 'title-list?type=C',
  985.                 success: function (data) {
  986.  
  987.                     $('#insureTitle').find('option').remove().end();
  988.                     $.each(data, function () {
  989.                         $('#insureTitle').append(new Option(this.refDesc1, this.refCode));
  990.                     });
  991.                     ;
  992.                 },
  993.                 error: function (xhr, ajaxOptions, thrownError) {
  994.                     alert(xhr.status);
  995.                     alert(thrownError);
  996.                 }
  997.             });
  998.         });
  999.  
  1000.         $('#insureTypeO').on('change', function () {
  1001.             $.ajax({
  1002.                 type: "GET",
  1003.                 dataType: "json",
  1004.                 url: 'title-list?type=O',
  1005.                 success: function (data) {
  1006.  
  1007.                     $('#insureTitle').find('option').remove().end();
  1008.                     $.each(data, function () {
  1009.                         $('#insureTitle').append(new Option(this.refDesc1, this.refCode));
  1010.                     });
  1011.                     ;
  1012.                 },
  1013.                 error: function (xhr, ajaxOptions, thrownError) {
  1014.                     alert(xhr.status);
  1015.                     alert(thrownError);
  1016.                 }
  1017.             });
  1018.         });
  1019.  
  1020.         $('#reciptionName').on('change', function () {
  1021.  
  1022.  
  1023.             if ($('#reciptionName').prop('checked')) {
  1024.  
  1025.                 $('#receiptName').val($('#insureTitle option:selected').text() + $('#insureName').val());
  1026.                 $('#receiptAddress1').val($('#address').val());
  1027.                 if ($('#province option:selected').text() == 'α╕üα╕úα╕╕α╕çα╣Çα╕ùα╕₧α╕íα╕½α╕▓α╕Öα╕äα╕ú') {
  1028.                     $('#receiptAddress2').val(" α╣üα╕éα╕ºα╕ç" + $('#tambol option:selected').text() + " α╣Çα╕éα╕ò" + $('#amphur option:selected').text() + " " + $('#province option:selected').text());
  1029.  
  1030.                 } else {
  1031.                     $('#receiptAddress2').val(" α╕òα╕│α╕Üα╕Ñ" + $('#tambol option:selected').text() + " α╕¡α╕│α╣Çα╕áα╕¡" + $('#amphur option:selected').text() + " α╕êα╕▒α╕çα╕½α╕ºα╕▒α╕ö" + $('#province option:selected').text());
  1032.  
  1033.                 }
  1034.                 $('#receiptName').prop('readonly', true);
  1035.                 $('#receiptAddress1').prop('readonly', true);
  1036.                 $('#receiptAddress2').prop('readonly', true);
  1037.             } else {
  1038.  
  1039.                 /* $('#receiptName').val('');
  1040.                  $('#receiptAddress1').val('');
  1041.                  $('#receiptAddress2').val(''); */
  1042.                 $('#receiptName').prop('readonly', false);
  1043.                 $('#receiptAddress1').prop('readonly', false);
  1044.                 $('#receiptAddress2').prop('readonly', false);
  1045.  
  1046.  
  1047.             }
  1048.  
  1049.         });
  1050.  
  1051.         $("input[name=premCal]:radio").change(function () {
  1052.  
  1053.             var freeAmt;
  1054.             var vatAmt;
  1055.             var totalPremium;
  1056.             var netP;
  1057.             var netPremium;
  1058.  
  1059.             if ($("input[name=premCal]:checked").val() == 'P') {
  1060.  
  1061.                 netPremium = packageCode.netPremium;
  1062.                 var bDate = $('#beginDate').datepicker("getDate");
  1063.                 var eDate = $('#endDate').datepicker("getDate");
  1064.                 var difDate = (eDate - bDate) / (86400 * 1000);
  1065.                 netPremium = difDate * netPremium / 365;
  1066.  
  1067.             } else if ($("input[name=premCal]:checked").val() == 'S') {
  1068.  
  1069.                 var bDate = $('#beginDate').datepicker("getDate");
  1070.                 var eDate = $('#endDate').datepicker("getDate");
  1071.                 var difDate = 1 + (eDate - bDate) / (86400 * 1000);
  1072.                 netPremium = packageCode.netPremium;
  1073.  
  1074.                 $.ajax({
  1075.                     type: "GET",
  1076.                     dataType: "json",
  1077.                     url: 'get-short-rate?days=' + difDate,
  1078.                     success: function (moShtRntBean) {
  1079.                         netPremium = netPremium * moShtRntBean.srShtPercent / 100;
  1080.                     }
  1081.                 });
  1082.  
  1083.  
  1084.  
  1085.             } else {
  1086.  
  1087.                 $('#annualPrem').val(packageCode.totalPremium);
  1088.                 $('#netPremium').val(packageCode.netPremium);
  1089.                 netPremium = packageCode.netPremium;
  1090.             }
  1091.  
  1092.             freeAmt = (feeRate * netPremium / 100.00);
  1093.             vatAmt = (netPremium + feeRate) * vatRate / 100.00;
  1094.             totalPremium = netP + freeAmt + vatAmt;
  1095.  
  1096.             var f = (netPremium * feeRate);
  1097.             var free = Math.ceil(f);
  1098.  
  1099.             $('#netPremium').val(netPremium);
  1100.             $("#feeAmt").val(free);
  1101.             var vat = Math.ceil((parseFloat(netPremium) + parseInt(free)) * vatRate) / 100;
  1102.             $("#vatAmt").val(vat);
  1103.             var total = parseFloat(netPremium) + parseFloat(free) + parseFloat(vat);
  1104.             $("#totalPremium").val(total);
  1105.  
  1106.  
  1107.             /*     $('.autoNumber').autoNumeric('update', {
  1108.              aSep : ',',
  1109.              aDec : '.',
  1110.              vMin : '0.00',
  1111.              vMax : '1000000000.00'
  1112.              }); */
  1113.  
  1114.         });
  1115.  
  1116.         $('#province').change();
  1117.  
  1118.         $('#packageCode').change();
  1119.  
  1120.         $("#packageCode").select2({
  1121.             width: 'resolve'
  1122.         });
  1123.  
  1124.         $("#driver1OccuCode").select2({
  1125.             width: 'resolve'
  1126.         });
  1127.         $("#driver2OccuCode").select2({
  1128.             width: 'resolve'
  1129.         });
  1130.         $("#driver1Title").select2({
  1131.             width: 'resolve'
  1132.         });
  1133.         $("#driver2Title").select2({
  1134.             width: 'resolve'
  1135.         });
  1136.         $("#occuCode").select2({
  1137.             width: 'resolve'
  1138.         });
  1139.         $("#insureTitle").select2({
  1140.             width: 'resolve'
  1141.         });
  1142.         $("#province").select2({
  1143.             width: 'resolve'
  1144.         });
  1145.         $("#amphur").select2({
  1146.             width: 'resolve'
  1147.         });
  1148.         $("#tambol").select2({
  1149.             width: 'resolve'
  1150.         });
  1151.  
  1152.         $('#driver1DateofBirth').datepicker({
  1153.             dateFormat: 'dd/mm/yy',
  1154.             minDate: new Date()
  1155.         });
  1156.         $('driver2DateofBirth').datepicker({
  1157.             dateFormat: 'dd/mm/yy',
  1158.             minDate: new Date()
  1159.         });
  1160.         $('.autoInt').autoNumeric('init', {
  1161.             aSep: '',
  1162.             aPad: false,
  1163.             vMin: '0',
  1164.             vMax: '99999'
  1165.         });
  1166.         //$("#frmPolicy").preventDoubleSubmission();
  1167.  
  1168.     <%if (request.getParameter("policyNo") == null) {%>
  1169.  
  1170.     <%} else {%>
  1171.         alert('α╕öα╕╣α╕úα╕▓α╕óα╕Ñα╕░α╣Çα╕¡α╕╡α╕óα╕ö');
  1172.         $('#amphur').val('${policyBean.tambol}');
  1173.         //$('#amphur').change();
  1174.         $('#tambol').val('${policyBean.amphur}');
  1175.         $('#vehBrand').val('${policyBean.vehBrand}');
  1176.         $('#vehBrand').change();
  1177.         $('#vehBrandmodel').val('${policyBean.vehBrandmodel}');
  1178.         //$('#vehBrandmodel').change();
  1179.         //$('#vehSize option:selected').val('${policyBean.vehSize}|${policyBean.vehCode}'); 
  1180.     <%}%>
  1181.  
  1182.  
  1183.         $("#frmPolicy").submit(function () {
  1184.  
  1185.             $('#saveBtn').click(function () {
  1186.                 return false;
  1187.             });
  1188.  
  1189.             var form = $(this);
  1190.             $('input').each(function (i) {
  1191.                 var self = $(this);
  1192.                 try {
  1193.                     var v = self.autoNumeric('get');
  1194.                     self.autoNumeric('destroy');
  1195.                     self.val(v);
  1196.                 } catch (err) {
  1197.                     console.log("Not an autonumeric field: " + self.attr("name"));
  1198.                 }
  1199.             });
  1200.  
  1201.             //$("saveBtn").prop('disabled', true);
  1202.             var url = "updatePolicy";
  1203.             $.ajax({
  1204.                 type: "POST",
  1205.                 url: url,
  1206.                 data: $("#frmPolicy").serialize(),
  1207.                 success: function (data) {
  1208.  
  1209.                     $('#grid').trigger("reloadGrid", [{
  1210.                             page: 1
  1211.                         }]);
  1212.                     //$('#tableFrm').dialog('close');
  1213.                     $("#saveBtn").unbind();
  1214.                     $('#saveBtn').click(function () {
  1215.                         return true;
  1216.                     });
  1217.  
  1218.                     updateCreditMenu();
  1219.  
  1220.  
  1221.                     $('#tableFrm').dialog('close');
  1222.                 },
  1223.                 error: function (xhr, ajaxOptions, thrownError) {
  1224.  
  1225.                     var obj = JSON.parse(xhr.responseText);
  1226.                     alert(obj.errorMessages);
  1227.                     $("#saveBtn").unbind();
  1228.                     $('#saveBtn').click(function () {
  1229.                         return true;
  1230.                     });
  1231.                 }
  1232.             });
  1233.  
  1234.             return false;
  1235.         });
  1236.  
  1237.     });
  1238. </script>