home *** CD-ROM | disk | FTP | other *** search
/ 61.19.244.139 / 61.19.244.139.zip / 61.19.244.139 / MortorEpolicy / entry-policy.jsp < prev    next >
Text File  |  2015-01-22  |  22KB  |  537 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. <spring:url value="/bui/get-policy-list" var="get_policy_listUrl" htmlEscape="true" />
  7. <tiles:insertDefinition name="defaultTemplate">
  8.     <tiles:putAttribute name="body">
  9.         <ul class="breadcrumb">
  10.             <li><a href="#">α╕½α╕Öα╣ëα╕▓α╕½α╕Ñα╕▒α╕ü</a><span class="divider">»</span></li>
  11.             <li class="active">α╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î </li>
  12.         </ul>
  13.         <div class="row-fluid">
  14.             <div class="span12 ">
  15.                 <div class=" widget-block">
  16.                     <div class="widget-head">
  17.                         <h5>
  18.                             <i class="black-icons  documents"></i> α╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î
  19.                         </h5>
  20.                     </div>
  21.                     <div class="widget-content">
  22.  
  23.                         <div class="widget-searchbox">
  24.  
  25.                             <ul>
  26.                                 <li class="row-counts"><a class="btn btn-success" id="addBtn" href="#frm-box"> <i class="icon-plus icon-white"></i> α╕Üα╕▒α╕Öα╕ùα╕╢α╕üα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣îα╣âα╕½α╕íα╣ê
  27.                                     </a>
  28.                                     <a class="btn btn-primary" id="editBtn"> <i class="icon-pencil icon-white"></i> α╣üα╕üα╣ëα╣äα╕é
  29.                                     </a>
  30.                                     <a class="btn btn-primary" id="uploadBtn"> <i class="icon-upload icon-white"></i> α╣üα╕Öα╕Üα╣Çα╕¡α╕üα╕¬α╕▓α╕ú
  31.                                     </a>
  32.  
  33.                                     <a class="btn btn-primary" id="printBtn"> <i class="icon-print icon-white"></i> α╕₧α╕┤α╕íα╕₧α╣îα╣Çα╕¡α╕üα╕¬α╕▓α╕ú
  34.                                     </a>
  35.                                 </li>
  36.                                 <li class="right">
  37.  
  38.                                     <fieldset>
  39.  
  40.                                         <div class="control-group">
  41.                                             <div class="controls">
  42.  
  43.                                                 α╕ºα╕▒α╕Öα╕ùα╕╡α╣êα╣Çα╕úα╕┤α╣êα╕íα╕äα╕╕α╣ëα╕íα╕äα╕úα╕¡α╕ç    <input type="text" name="startDateSearch" id="startDateSearch"  class="input-small form-control clsDatePicker" placeholder="dd/mm/yyyy"  />
  44.                                                 <span class="input-group-addon"><i id="calIconTourDateDetails" class="glyphicon glyphicon-th"></i></span> -
  45.                                                 <input id="endDateSearch" name="endDateSearch" class="input-small" type="text" placeholder="dd/mm/yyyy" />
  46.  
  47.  
  48.                                             </div>
  49.                                             <div class="controls">
  50.                                                 α╕ºα╕▒α╕Öα╕ùα╕╡α╣êα╕¡α╕¡α╕üα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î  <input type="text" name="issuseDateStartSearch" id="issuseDateStartSearch"  class="input-small form-control clsDatePicker" placeholder="dd/mm/yyyy"  />
  51.                                                 <span class="input-group-addon"><i id="calIconTourDateDetails" class="glyphicon glyphicon-th"></i></span> -
  52.                                                 <input id="issuseDateEndSearch" name="issuseDateEndSearch" class="input-small" type="text" placeholder="dd/mm/yyyy" />
  53.  
  54.                                             </div>
  55.  
  56.                                             <div class="controls">                                              
  57.                                                α╕½α╕íα╕▓α╕óα╣Çα╕Ñα╕éα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î <input class="input-small" type="text" id="policyNoStartSearch" name="policyNoStartSearch" placeholder="α╕½α╕íα╕▓α╕óα╣Çα╕Ñα╕éα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î"> 
  58.                                                 - <input id="policyNoEndSearch" name="policyNoEndSearch" class="input-small" type="text" placeholder="α╕½α╕íα╕▓α╕óα╣Çα╕Ñα╕éα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î"> 
  59.  
  60.  
  61.                                                 <a class="btn btn-info" id="btSearch"> <i class="icon-search icon-white"></i> α╕äα╣ëα╕Öα╕½α╕▓</a>
  62.  
  63.  
  64.  
  65.                                             </div>
  66.                                             <div class="controls">
  67.                                                  <input class="input-small" type="text" id="idCardSearch" name="idCardSearch" placeholder="α╣Çα╕Ñα╕éα╕Üα╕▒α╕òα╕ú"> 
  68.                                                 <input id="registerSearch" name="registerSearch" class="input-small" type="text" placeholder="α╕ùα╕░α╣Çα╕Üα╕╡α╕óα╕Öα╕úα╕û"> 
  69.                                                 <input id="chassisSearch" name="chassisSearch" class="input-small" type="text" placeholder="α╣Çα╕Ñα╕éα╕òα╕▒α╕ºα╕ûα╕▒α╕ç"> 
  70.  
  71.  
  72.  
  73.                                             </div>
  74.                                         </div>
  75.  
  76.                                     </fieldset>
  77.  
  78.                                 </li>
  79.                             </ul>
  80.                         </div>
  81.                         <div class="widget-box">
  82.                             <div align="center" id='jqgrid'>
  83.                                 <table id='grid'></table>
  84.                                 <div id='pager'></div>
  85.                             </div>
  86.                         </div>
  87.  
  88.                     </div>
  89.                 </div>
  90.             </div>
  91.         </div>
  92.  
  93.  
  94.         <br/>
  95.  
  96.         <br/>
  97.  
  98.         <br/>
  99.         <div id="tableFrm"></div>
  100.     </tiles:putAttribute>
  101.     <tiles:putAttribute name="customScript">
  102.  
  103.     </tiles:putAttribute>
  104.  
  105.     <tiles:putAttribute name="customScript">
  106.         <script type="text/javascript">
  107.  
  108.  
  109.             /*     
  110.              $('#premCalP').on('click', function() {
  111.                      
  112.              }); */
  113.  
  114.             function successFormat(cellvalue, options, rowObject) {
  115.                 return '<span class="label label-warning">' + cellvalue + '</span>';
  116.  
  117.             }
  118.  
  119.  
  120.  
  121.             $(function () {
  122.  
  123.  
  124.  
  125.  
  126.  
  127.                 $('#printBtn').click(function () {
  128.                     var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  129.                     if (selr) {
  130.  
  131.                         $.get("print?policyNo=" + encodeURIComponent(selr), function (data1) {
  132.                             $('#tableFrm').html(data1);
  133.  
  134.  
  135.                             $("#tableFrm").dialog({
  136.                                 maxWidth: 700,
  137.                                 maxHeight: 450,
  138.                                 width: 700,
  139.                                 height: 450,
  140.                                 modal: true,
  141.                                 close: function () {
  142.                                     $('#sidebar').removeClass('side-hide');
  143.                                     $('.top-nav').removeClass('full-fluid');
  144.                                     $('#main-content').removeClass('full-fluid');
  145.                                 }
  146.                             });
  147.  
  148.                             $('#sidebar').addClass('side-hide');
  149.                             $('.top-nav').addClass('full-fluid');
  150.                             $('#main-content').addClass('full-fluid');
  151.  
  152.                         });
  153.  
  154.  
  155.                     } else {
  156.  
  157.                         alert('α╕üα╕úα╕╕α╕ôα╣Çα╕Ñα╕╖α╕¡α╕ü α╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î');
  158.  
  159.                     }
  160.  
  161.                 });
  162.  
  163.                 $('#delBtn').click(function () {
  164.                     var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  165.                     if (selr && confirm("α╕óα╕╖α╕Öα╕óα╕▒α╕Öα╕üα╕▓α╕úα╕Ñα╕Üα╕éα╣ëα╕¡α╕íα╕╣α╕Ñ α╕úα╕▓α╕óα╕Ñα╕░α╣Çα╕¡α╕╡α╕óα╕öα╕äα╕ºα╕▓α╕íα╕äα╕╕α╣ëα╕íα╕äα╕úα╕¡α╕ç α╕úα╕½α╕▒α╕¬ " + selr))
  166.                         var url = "?covCode=" + selr;
  167.  
  168.                     $.ajax({
  169.                         type: "GET",
  170.                         url: url,
  171.                         success: function (data) {
  172.                             $('#grid').trigger("reloadGrid", [{
  173.                                     page: 1
  174.                                 }]);
  175.                         },
  176.                         error: function (xhr, ajaxOptions, thrownError) {
  177.                             alert(xhr.status);
  178.                             alert(thrownError);
  179.                         }
  180.                     });
  181.  
  182.                 });
  183.  
  184.                         $("#grid").jqGrid({
  185.                     url: '${get_policy_listUrl}',
  186.                     datatype: 'json',
  187.                     mtype: 'GET',
  188.                     colNames: ['α╕½α╕íα╕▓α╕óα╣Çα╕Ñα╕éα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î', 'α╕úα╕½α╕▒α╕¬ Package', 'α╕ºα╕▒α╕Öα╣Çα╕úα╕┤α╣êα╕íα╕äα╕╕α╣ëα╕íα╕äα╕úα╕¡α╕ç', 'α╕ºα╕▒α╕Öα╕¬α╕┤α╣ëα╕Öα╕¬α╕╕α╕öα╕äα╕╕α╣ëα╕íα╕äα╕úα╕¡α╕ç', 'α╕äα╕úα╕Üα╕üα╕│α╕½α╕Öα╕öα╕èα╕│α╕úα╕░', 'α╕¢α╕úα╕░α╣Çα╕áα╕ùα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î', 'α╣Çα╕Üα╕╡α╣ëα╕óα╕¢α╕úα╕░α╕üα╕▒α╕Öα╕áα╕▒α╕óα╕úα╕ºα╕í', 'α╕£α╕╣α╣ëα╣Çα╕¡α╕▓α╕¢α╕úα╕░α╕üα╕▒α╕Öα╕áα╕▒α╕ó'],
  189.                     colModel: [{
  190.                             name: 'policyNo',
  191.                             index: 'policyNo',
  192.                             width: 25,
  193.                             hidden: false
  194.                         }, {
  195.                             name: 'packageCode',
  196.                             index: 'packageCode',
  197.                             width: 10,
  198.                             hidden: false,
  199.                             align: 'left'
  200.                         }, {
  201.                             name: 'beginDate',
  202.                             index: 'beginDate',
  203.                             width: 10,
  204.                             datefmt: "d-M-Y",
  205.                             formatoptions: {newformat: 'd/m/Y'},
  206.                             formatter: function (cellval, opts, rowObject, action) {
  207.                                 return $.fn.fmatter.call(
  208.                                         this,
  209.                                         "date",
  210.                                         new Date(cellval),
  211.                                         $.extend({}, $.jgrid.formatter.date, opts),
  212.                                         rowObject,
  213.                                         action);
  214.                             },
  215.                             align: 'center'
  216.                         }, {
  217.                             name: 'endDate',
  218.                             index: 'endDate',
  219.                             width: 10,
  220.                             hidden: false,
  221.                             datefmt: "d-M-Y",
  222.                             formatoptions: {newformat: 'd/m/Y'},
  223.                             formatter: function (cellval, opts, rowObject, action) {
  224.                                 return $.fn.fmatter.call(
  225.                                         this,
  226.                                         "date",
  227.                                         new Date(cellval),
  228.                                         $.extend({}, $.jgrid.formatter.date, opts),
  229.                                         rowObject,
  230.                                         action);
  231.                             },
  232.                             align: 'center'
  233.                         }, {
  234.                             name: 'payDueDate',
  235.                             index: 'payDueDate',
  236.                             width: 10,
  237.                             hidden: false,
  238.                             datefmt: "d-M-Y",
  239.                             formatoptions: {newformat: 'd/m/Y'},
  240.                             formatter: function (cellval, opts, rowObject, action) {
  241.                                 return $.fn.fmatter.call(
  242.                                         this,
  243.                                         "date",
  244.                                         new Date(cellval),
  245.                                         $.extend({}, $.jgrid.formatter.date, opts),
  246.                                         rowObject,
  247.                                         action);
  248.                             },
  249.                             align: 'center'
  250.                         }, {
  251.                             name: 'polType',
  252.                             index: 'polType',
  253.                             width: 10,
  254.                             hidden: false,
  255.                             align: 'left'
  256.                         }, {
  257.                             name: 'totalPremium',
  258.                             index: 'totalPremium',
  259.                             width: 10,
  260.                             formatter: "number", sorttype: "number", align: "right"
  261.  
  262.                         }, {
  263.                             name: 'insureName',
  264.                             index: 'insureName',
  265.                             width: 30,
  266.                             align: 'left'
  267.                         }],
  268.                     postData: {},
  269.                     rowNum: 20,
  270.                     rowList: [10, 20, 40, 60],
  271.                     height: 340,
  272.                     autowidth: true,
  273.                     rownumbers: true,
  274.                     pager: '#pager',
  275.                     sortname: 'policyNo',
  276.                     viewrecords: true,
  277.                     sortorder: "asc",
  278.                     emptyrecords: "Empty records",
  279.                     loadonce: false,
  280.                     loadComplete: function () {
  281.                     },
  282.                     jsonReader: {
  283.                         root: "rows",
  284.                         page: "page",
  285.                         total: "total",
  286.                         records: "records",
  287.                         repeatitems: false,
  288.                         cell: "cell",
  289.                         id: "policyNo"
  290.                     }
  291.                 });
  292.             });
  293.  
  294.             $('#btSearch').click(function () {
  295.  
  296.                 var f = {
  297.                     groupOp: "AND",
  298.                     rules: []
  299.                 };
  300.                 f.rules.push({
  301.                     field: "policyNoStartSearch",
  302.                     op: "cn",
  303.                     data: $('#policyNoStartSearch').val()
  304.                 });
  305.                 f.rules.push({
  306.                     field: "policyNoEndSearch",
  307.                     op: "cn",
  308.                     data: $('#policyNoEndSearch').val()
  309.                 });
  310.                 
  311.                  f.rules.push({
  312.                     field: "startDateSearch",
  313.                     op: "cn",
  314.                     data: $('#startDateSearch').val()
  315.                 });
  316.  
  317.                 f.rules.push({
  318.                     field: "endDateSearch",
  319.                     op: "cn",
  320.                     data: $('#endDateSearch').val()
  321.                 });
  322.  
  323.                 f.rules.push({
  324.                     field: "issuseDateStartSearch",
  325.                     op: "cn",
  326.                     data: $('#issuseDateStartSearch').val()
  327.                 });
  328.  
  329.                 f.rules.push({
  330.                     field: "issuseDateEndSearch",
  331.                     op: "cn",
  332.                     data: $('#issuseDateEndSearch').val()
  333.                 });            
  334.  
  335.                 f.rules.push({
  336.                     field: "idCardSearch",
  337.                     op: "cn",
  338.                     data: $('#idCardSearch').val()
  339.                 });
  340.  
  341.                 f.rules.push({
  342.                     field: "registerSearch",
  343.                     op: "cn",
  344.                     data: $('#registerSearch').val()
  345.                 });
  346.  
  347.                 f.rules.push({
  348.                     field: "chassisSearch",
  349.                     op: "cn",
  350.                     data: $('#chassisSearch').val()
  351.                 });
  352.  
  353.                 
  354.                 
  355.                 var grid = $('#grid');
  356.                 grid[0].p.search = f.rules.length > 0;
  357.                 $.extend(grid[0].p.postData, {
  358.                     filters: JSON.stringify(f)
  359.                 });
  360.                 grid.trigger("reloadGrid", [{
  361.                         page: 1
  362.                     }]);
  363.             });
  364.  
  365.             //box
  366.  
  367.  
  368.             $('#uploadBtn').click(function () {
  369.  
  370.                 var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  371.                 if (selr) {
  372.                     $.get("upload-files?policyNo=" + encodeURIComponent(selr), function (data1) {
  373.                         $('#tableFrm').html(data1);
  374.  
  375.                     });
  376.                     $("#tableFrm").dialog({
  377.                         maxWidth: 700,
  378.                         maxHeight: 450,
  379.                         width: 700,
  380.                         height: 450,
  381.                         modal: true,
  382.                         close: function () {
  383.                             $('#sidebar').removeClass('side-hide');
  384.                             $('.top-nav').removeClass('full-fluid');
  385.                             $('#main-content').removeClass('full-fluid');
  386.  
  387.                         }
  388.                     });
  389.                     $('#sidebar').addClass('side-hide');
  390.                     $('.top-nav').addClass('full-fluid');
  391.                     $('#main-content').addClass('full-fluid');
  392.  
  393.                 } else {
  394.                     alert('α╕üα╕úα╕╕α╕ôα╕▓α╣Çα╕Ñα╕╖α╕¡α╕üα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î');
  395.                 }
  396.                 return false;
  397.             });
  398.  
  399.  
  400.             $('#addBtn').click(function () {
  401.  
  402.                 var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  403.  
  404.                 $.get("entry-policy-add", function (data1) {
  405.                     $('#tableFrm').html(data1);
  406.                     $("#tableFrm").dialog({
  407.                         maxWidth: 900,
  408.                         maxHeight: 650,
  409.                         width: 900,
  410.                         height: 650,
  411.                         modal: true,
  412.                         close: function () {
  413.  
  414.                             $('#sidebar').removeClass('side-hide');
  415.                             $('.top-nav').removeClass('full-fluid');
  416.                             $('#main-content').removeClass('full-fluid');
  417.                             $('#tableFrm').html('');
  418.                         }
  419.                     });
  420.  
  421.                     $('#sidebar').addClass('side-hide');
  422.                     $('.top-nav').addClass('full-fluid');
  423.                     $('#main-content').addClass('full-fluid');
  424.  
  425.                 });
  426.  
  427.  
  428.                 return false;
  429.  
  430.             });
  431.               $('#startDateSearch').datepicker({dateFormat: 'dd/mm/yy', onSelect: function (selectedDate) {
  432.                     $("#endDateSearch").datepicker("option", "minDate", selectedDate);
  433.                 }});
  434.             $('#endDateSearch').datepicker({dateFormat: 'dd/mm/yy', onSelect: function (selectedDate) {
  435.                     $("#startDateSearch").datepicker("option", "maxDate", selectedDate);
  436.                 }});
  437.  
  438.  
  439.             $('#issuseDateStartSearch').datepicker({dateFormat: 'dd/mm/yy', onSelect: function (selectedDate) {
  440.                     $("#issuseDateEndSearch").datepicker("option", "minDate", selectedDate);
  441.                 }});
  442.             $('#issuseDateEndSearch').datepicker({dateFormat: 'dd/mm/yy', onSelect: function (selectedDate) {
  443.                     $("#issuseDateStartSearch").datepicker("option", "maxDate", selectedDate);
  444.                 }});
  445.  
  446.  
  447.             $('#editBtn').click(function () {
  448.  
  449.                 var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  450.  
  451.                 $.get("entry-policy-edit?policyNo=" + encodeURIComponent(selr), function (data1) {
  452.                     $('#tableFrm').html(data1);
  453.                     $("#tableFrm").dialog({
  454.                         maxWidth: 900,
  455.                         maxHeight: 650,
  456.                         width: 900,
  457.                         height: 650,
  458.                         modal: true,
  459.                         close: function () {
  460.  
  461.                             $('#sidebar').removeClass('side-hide');
  462.                             $('.top-nav').removeClass('full-fluid');
  463.                             $('#main-content').removeClass('full-fluid');
  464.                             $('#tableFrm').html('');
  465.                         }
  466.                     });
  467.  
  468.                     $('#sidebar').addClass('side-hide');
  469.                     $('.top-nav').addClass('full-fluid');
  470.                     $('#main-content').addClass('full-fluid');
  471.  
  472.                 });
  473.  
  474.  
  475.                 return false;
  476.  
  477.             });
  478.  
  479.             /* 
  480.              $('#delBtn').click(function() {
  481.              var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  482.              if (selr && confirm("α╕óα╕╖α╕Öα╕óα╕▒α╕Öα╕üα╕▓α╕úα╕Ñα╕Üα╕éα╣ëα╕¡α╕íα╕╣α╕Ñ α╕äα╕ºα╕▓α╕íα╕äα╕╕α╣ëα╕íα╕äα╕úα╕¡α╕ç α╕úα╕½α╕▒α╕¬ " + selr))
  483.              alert(selr);
  484.                      
  485.              }); */
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.         </script>
  493.  
  494.  
  495.     </tiles:putAttribute>
  496. </tiles:insertDefinition>
  497.  
  498.  
  499. <%
  500.     if (request.getParameter("policyNo") != null) {
  501. %>
  502.  
  503. <script>
  504.     $(function () {
  505.  
  506.  
  507.         function getUrlParameter(sParam)
  508.         {
  509.             var sPageURL = window.location.search.substring(1);
  510.             var sURLVariables = sPageURL.split('&');
  511.             for (var i = 0; i < sURLVariables.length; i++)
  512.             {
  513.                 var sParameterName = sURLVariables[i].split('=');
  514.                 if (sParameterName[0] == sParam)
  515.                 {
  516.                     return sParameterName[1];
  517.                 }
  518.             }
  519.         }
  520.  
  521.         $.get("upload-files?policyNo=" + getUrlParameter('policyNo'), function (data1) {
  522.             $('#tableFrm').html(data1);
  523.             $("#tableFrm").dialog({
  524.                 maxWidth: 700,
  525.                 maxHeight: 450,
  526.                 width: 700,
  527.                 height: 450,
  528.                 modal: true,
  529.                 close: function () {
  530.                 }
  531.             })
  532.         });
  533.         ;
  534.     });
  535. </script>
  536.  
  537. <%}%>