home *** CD-ROM | disk | FTP | other *** search
/ 61.19.244.139 / 61.19.244.139.zip / 61.19.244.139 / 2015-03-03 / views / view-policy.jsp < prev    next >
Text File  |  2015-03-03  |  28KB  |  652 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">
  27.  
  28.                                     <a class="btn btn-primary" id="viewBtn"> <i class="icon-pencil icon-white"></i>α╕öα╕╣α╕úα╕▓α╕óα╕Ñα╕░α╣Çα╕¡α╕╡α╕óα╕ö</a>
  29.                                     <a class="btn btn-primary" id="attBtn"> <i class="icon-upload icon-white"></i> α╣Çα╕¡α╕üα╕¬α╕▓α╕úα╣üα╕Öα╕Ü</a>
  30.                                     <a class="btn btn-primary" id="printBtn"> <i class="icon-print icon-white"></i> α╕₧α╕┤α╕íα╕₧α╣îα╣Çα╕¡α╕üα╕¬α╕▓α╕ú</a>
  31.                                     <c:if test="${Department}">                                        
  32.                                         <a class="btn btn-primary" id="policyFileBtn"> <i class="icon-print icon-white"></i>α╣Çα╕¡α╕üα╕¬α╕▓α╕úα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î</a>
  33.                                     </c:if>
  34.                                 </li>
  35.                                 <li class="right">
  36.  
  37.  
  38.                                     <fieldset>
  39.                                         <div class="control-group">
  40.                                             <div class="controls">
  41.  
  42.                                                 α╕ºα╕▒α╕Öα╕ùα╕╡α╣êα╕äα╕╕α╣ëα╕íα╕äα╕úα╕¡α╕ç  <input type="text" name="startDateSearch" id="startDateSearch"  class="input-small form-control clsDatePicker" placeholder="dd/mm/yyyy"  />
  43.                                                 <span class="input-group-addon"><i id="calIconTourDateDetails" class="glyphicon glyphicon-th"></i></span> -
  44.                                                 <input id="endDateSearch" name="endDateSearch" class="input-small" type="text" placeholder="dd/mm/yyyy" />
  45.  
  46.                                                  α╕ºα╕▒α╕Öα╕ùα╕╡α╣êα╕¡α╕¡α╕üα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î  <input type="text" name="issuseDateStartSearch" id="issuseDateStartSearch"  class="input-small form-control clsDatePicker" placeholder="dd/mm/yyyy"  />
  47.                                                 <span class="input-group-addon"><i id="calIconTourDateDetails" class="glyphicon glyphicon-th"></i></span> -
  48.                                                 <input id="issuseDateEndSearch" name="issuseDateEndSearch" class="input-small" type="text" placeholder="dd/mm/yyyy" />
  49.  
  50.                                             </div>
  51.  
  52.                                             <div class="controls">
  53.  
  54.                                                 α╕úα╕½α╕▒α╕¬α╕òα╕▒α╕ºα╣üα╕ùα╕Ö  <input class="input-small" type="text" id="agentIdStartSearch" name="agentIdStartSearch" placeholder="α╕úα╕½α╕▒α╕¬α╕òα╕▒α╕ºα╣üα╕ùα╕Ö"> 
  55.                                                 - <input id="agentIdEndSearch" name="agentIdEndSearch" class="input-small" type="text" placeholder="α╕úα╕½α╕▒α╕¬α╕òα╕▒α╕ºα╣üα╕ùα╕Ö"> 
  56.  
  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.  
  62.                                             </div>
  63.                                             <div class="controls">
  64.                                                 α╣Çα╕Ñα╕éα╕Üα╕▒α╕òα╕ú        <input class="input-small" type="text" id="idCardSearch" name="idCardSearch" placeholder="α╣Çα╕Ñα╕éα╕Üα╕▒α╕òα╕ú"> 
  65.                                                  α╕ùα╕░α╣Çα╕Üα╕╡α╕óα╕Öα╕úα╕û  <input id="registerSearch" name="registerSearch" class="input-small" type="text" placeholder="α╕ùα╕░α╣Çα╕Üα╕╡α╕óα╕Öα╕úα╕û"> 
  66.                                                  α╣Çα╕Ñα╕éα╕òα╕▒α╕ºα╕ûα╕▒α╕ç  <input id="chassisSearch" name="chassisSearch" class="input-small" type="text" placeholder="α╣Çα╕Ñα╕éα╕òα╕▒α╕ºα╕ûα╕▒α╕ç"> 
  67.  
  68.                                                 <a class="btn btn-info" id="btSearch"> <i class="icon-search icon-white"></i> α╕äα╣ëα╕Öα╕½α╕▓</a>
  69.  
  70.                                             </div>                                          
  71.  
  72.                                             <form> α╕¬α╕ûα╕▓α╕Öα╕░α╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î     
  73.                                                 <input type="radio" name="status"  value="A" onClick="setStaus('A')" checked>α╕¢α╕üα╕òα╕┤                                           
  74.                                                 <input type="radio" name="status"  value="C" onClick="setStaus('C')">α╕óα╕üα╣Çα╕Ñα╕┤α╕ü    
  75.                                                 <input type="radio" name="status"  value=" " onClick="setStaus(' ')"> α╕ùα╕▒α╣ëα╕çα╕½α╕íα╕ö
  76.  
  77.                                             </form> 
  78.  
  79.                                         </div>
  80.                                     </fieldset>
  81.  
  82.                                 </li>
  83.                             </ul>
  84.                         </div>
  85.                         <div class="widget-box">
  86.                             <div align="center" id='jqgrid'>
  87.                                 <table id='grid'></table>
  88.                                 <div id='pager'></div>
  89.                             </div>
  90.                         </div>                        
  91.                     </div>                   
  92.                 </div>
  93.                 <a class="btn btn-danger" id="btnCanclePolicy"> <i class="icon-minus icon-white"></i> α╕óα╕üα╣Çα╕Ñα╕┤α╕üα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î </a>
  94.             </div>
  95.         </div>
  96.         <br/>
  97.         <br/>
  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.             var status = '';
  119.             function setStaus(setting) {
  120.                 status = setting
  121.             }
  122.  
  123.  
  124.  
  125.             $(function () {
  126.  
  127.  
  128.  
  129.  
  130.  
  131.                 $('#printBtn').click(function () {
  132.                     var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  133.                     if (selr) {
  134.  
  135.                         $.get("print?policyNo=" + encodeURIComponent(selr), function (data1) {
  136.                             $('#tableFrm').html(data1);
  137.  
  138.  
  139.                             $("#tableFrm").dialog({
  140.                                 maxWidth: 700,
  141.                                 maxHeight: 450,
  142.                                 width: 700,
  143.                                 height: 450,
  144.                                 modal: true,
  145.                                 close: function () {
  146.                                     $('#sidebar').removeClass('side-hide');
  147.                                     $('.top-nav').removeClass('full-fluid');
  148.                                     $('#main-content').removeClass('full-fluid');
  149.                                 }
  150.                             });
  151.  
  152.                             $('#sidebar').addClass('side-hide');
  153.                             $('.top-nav').addClass('full-fluid');
  154.                             $('#main-content').addClass('full-fluid');
  155.  
  156.                         });
  157.  
  158.  
  159.                     } else {
  160.  
  161.                         alert('α╕üα╕úα╕╕α╕ôα╣Çα╕Ñα╕╖α╕¡α╕ü α╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î');
  162.  
  163.                     }
  164.  
  165.                 });
  166.  
  167.                 $('#btnCanclePolicy').click(function () {
  168.                     var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  169.                     if (selr) {
  170.                         var celeport = $("#grid").getCell(selr, 11);
  171.                         var celrec = $("#grid").getCell(selr, 10);
  172.                         if (celeport == 'Y') {
  173.  
  174.                             var mesa = 'α╕óα╕╖α╕Öα╕óα╕▒α╕Öα╕üα╕▓α╕úα╕óα╕üα╣Çα╕Ñα╕┤α╕ü α╕üα╕úα╕úα╕íα╕ÿα╕úα╕úα╕íα╣îα╣Çα╕Ñα╕éα╕ùα╕╡α╣ê ' + selr;
  175.  
  176.                             if (celrec == 'Y') { // α╕ûα╣ëα╕▓α╕íα╕╡α╕üα╕▓α╕úα╕èα╕│α╕úα╕░α╣Çα╕çα╕┤α╕Öα╣üα╕Ñα╣ëα╕º
  177.                                 mesa = 'α╕üα╕úα╕úα╕íα╕ÿα╕úα╕úα╕íα╣îα╣Çα╕Ñα╕éα╕ùα╕╡α╣ê ' + selr + '-- α╕íα╕╡α╕üα╕▓α╕úα╕úα╕▒α╕Üα╕èα╕│α╕úα╕░α╣üα╕Ñα╣ëα╕º -- α╕òα╣ëα╕¡α╕çα╕üα╕▓α╕úα╕óα╕üα╣Çα╕Ñα╕┤α╕üα╣âα╕èα╣êα╕½α╕úα╕╖α╕¡α╣äα╕íα╣ê';
  178.                             }
  179.                             if (confirm(mesa)) { // if yes Confirm
  180.  
  181.                                 $.get("cancle-policy?policyNo=" + selr, function (data, status) {
  182.                                     $('#grid').trigger("reloadGrid", [{page: 1}]);
  183.                                 });
  184.                             }
  185.                         } else {
  186.                             alert('α╕óα╕üα╣Çα╕Ñα╕┤α╕üα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣îα╣äα╕íα╣êα╣äα╕öα╣ëα╣Çα╕Öα╕╖α╣êα╕¡α╕çα╕êα╕▓α╕üα╕óα╕▒α╕çα╣äα╕íα╣ê  Export !! ');
  187.                         }
  188.                     } else {
  189.                         alert('α╕üα╕úα╕╕α╕ôα╕▓α╣Çα╕Ñα╕╖α╕¡α╕üα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î');
  190.                     }
  191.                 });
  192.  
  193.  
  194.  
  195.                 $("#grid").jqGrid({
  196.                     url: '${get_policy_listUrl}',
  197.                     datatype: 'json',
  198.                     mtype: 'GET',
  199.                     colNames: ['α╕½α╕íα╕▓α╕óα╣Çα╕Ñα╕éα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î', 'α╕úα╕½α╕▒α╕¬ Package', 'α╕ºα╕▒α╕Öα╣Çα╕úα╕┤α╣êα╕íα╕äα╕╕α╣ëα╕íα╕äα╕úα╕¡α╕ç', 'α╕ºα╕▒α╕Öα╕¬α╕┤α╣ëα╕Öα╕¬α╕╕α╕öα╕äα╕╕α╣ëα╕íα╕äα╕úα╕¡α╕ç', 'α╕äα╕úα╕Üα╕üα╕│α╕½α╕Öα╕öα╕èα╕│α╕úα╕░', 'α╕¢α╕úα╕░α╣Çα╕áα╕ùα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î', 'α╣Çα╕Üα╕╡α╣ëα╕óα╕¢α╕úα╕░α╕üα╕▒α╕Öα╕áα╕▒α╕óα╕úα╕ºα╕í', 'α╕£α╕╣α╣ëα╣Çα╕¡α╕▓α╕¢α╕úα╕░α╕üα╕▒α╕Öα╕áα╕▒α╕ó', 'α╕₧α╕┤α╕íα╕₧α╣îα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î', 'α╕₧α╕┤α╕íα╕₧α╣îα╣âα╕Üα╣Çα╕¬α╕úα╣çα╕ê', 'EXPORT', 'α╕¬α╕ûα╕▓α╕Öα╕░'],
  200.                     colModel: [{
  201.                             name: 'policyNo',
  202.                             index: 'policyNo',
  203.                             width: 15,
  204.                             hidden: false
  205.                         }, {
  206.                             name: 'packageCode',
  207.                             index: 'packageCode',
  208.                             width: 10,
  209.                             hidden: false,
  210.                             align: 'left'
  211.                         }, {
  212.                             name: 'beginDate',
  213.                             index: 'beginDate',
  214.                             width: 10,
  215.                             datefmt: "d-M-Y",
  216.                             formatoptions: {newformat: 'd/m/Y'},
  217.                             formatter: function (cellval, opts, rowObject, action) {
  218.                                 return $.fn.fmatter.call(
  219.                                         this,
  220.                                         "date",
  221.                                         new Date(cellval),
  222.                                         $.extend({}, $.jgrid.formatter.date, opts),
  223.                                         rowObject,
  224.                                         action);
  225.                             },
  226.                             align: 'center'
  227.                         }, {
  228.                             name: 'endDate',
  229.                             index: 'endDate',
  230.                             width: 10,
  231.                             hidden: false,
  232.                             datefmt: "d-M-Y",
  233.                             formatoptions: {newformat: 'd/m/Y'},
  234.                             formatter: function (cellval, opts, rowObject, action) {
  235.                                 return $.fn.fmatter.call(
  236.                                         this,
  237.                                         "date",
  238.                                         new Date(cellval),
  239.                                         $.extend({}, $.jgrid.formatter.date, opts),
  240.                                         rowObject,
  241.                                         action);
  242.                             },
  243.                             align: 'center'
  244.                         }, {
  245.                             name: 'payDueDate',
  246.                             index: 'payDueDate',
  247.                             width: 10,
  248.                             hidden: false,
  249.                             datefmt: "d-M-Y",
  250.                             formatoptions: {newformat: 'd/m/Y'},
  251.                             formatter: function (cellval, opts, rowObject, action) {
  252.                                 return $.fn.fmatter.call(
  253.                                         this,
  254.                                         "date",
  255.                                         new Date(cellval),
  256.                                         $.extend({}, $.jgrid.formatter.date, opts),
  257.                                         rowObject,
  258.                                         action);
  259.                             },
  260.                             align: 'center'
  261.                         }, {
  262.                             name: 'polType',
  263.                             index: 'polType',
  264.                             width: 10,
  265.                             hidden: false,
  266.                             align: 'left'
  267.                         }, {
  268.                             name: 'totalPremium',
  269.                             index: 'totalPremium',
  270.                             width: 10,
  271.                             formatter: "number", sorttype: "number", align: "right"
  272.  
  273.                         }, {
  274.                             name: 'insureName',
  275.                             index: 'insureName',
  276.                             width: 20,
  277.                             align: 'left'
  278.                         }, {
  279.                             name: 'printStatus',
  280.                             index: 'printStatus',
  281.                             width: 5,
  282.                             formatter: function (cellval, opts, rowObject, action) {
  283.                                 return cellval !== "N" ?
  284.                                         "Y" : "N";
  285.                             },
  286.                             align: 'center'
  287.                         }, {
  288.                             name: 'receiptNo',
  289.                             index: 'receiptNo',
  290.                             width: 5,
  291.                             formatter: function (cellval, opts, rowObject, action) {
  292.                                 return cellval !== null ?
  293.                                         "Y" : "N";
  294.                             },
  295.                             align: 'center'
  296.                         }, {
  297.                             name: 'exportStatus',
  298.                             index: 'exportStatus',
  299.                             width: 5,
  300.                             formatter: function (cellval, opts, rowObject, action) {
  301.                                 return cellval !== null ?
  302.                                         cellval : "N";
  303.                             },
  304.                             align: 'center'
  305.                         }, {
  306.                             name: 'status',
  307.                             index: 'status',
  308.                             width: 5,
  309.                             align: 'center'
  310.                         }
  311.  
  312.  
  313.                     ],
  314.                     postData: {},
  315.                     rowNum: 20,
  316.                     rowList: [10, 20, 40, 60],
  317.                     height: 340,
  318.                     autowidth: true,
  319.                     rownumbers: true,
  320.                     pager: '#pager',
  321.                     sortname: 'policyNo',
  322.                     viewrecords: true,
  323.                     sortorder: "asc",
  324.                     emptyrecords: "Empty records",
  325.                     loadonce: false,
  326.                     loadComplete: function () {
  327.                         var rowIds = $('#grid').jqGrid('getDataIDs');
  328.                         for (i = 0; i < rowIds.length; i++) {//iterate over each row                             
  329.                             var p = $("#grid").getCell(rowIds[i], 9);
  330.                             var r = $("#grid").getCell(rowIds[i], 10);
  331.                             var s = $("#grid").getCell(rowIds[i], 12);
  332.                             if (p == 'N' || r == 'N') {
  333.                                 $("#grid").jqGrid('setRowData', rowIds[i], true, {color: 'red', weightfont: 'bold ', background: 'white !important'});
  334.                             }
  335.                             if  (s == 'C' ){
  336.                                 $("#grid").jqGrid('setRowData', rowIds[i], true, {color: 'black', weightfont: 'bold', background: 'gray'});
  337.                             }
  338.  
  339.                         }
  340.                     },
  341.                     jsonReader: {
  342.                         root: "rows",
  343.                         page: "page",
  344.                         total: "total",
  345.                         records: "records",
  346.                         repeatitems: false,
  347.                         cell: "cell",
  348.                         id: "policyNo"
  349.                     }
  350.                 });
  351.             });
  352.  
  353.  
  354.             $('#btSearch').click(function () {
  355.  
  356.  
  357.                 var f = {
  358.                     groupOp: "AND",
  359.                     rules: []
  360.                 };
  361.                 f.rules.push({
  362.                     field: "policyNoStartSearch",
  363.                     op: "cn",
  364.                     data: $('#policyNoStartSearch').val()
  365.                 });
  366.                 f.rules.push({
  367.                     field: "policyNoEndSearch",
  368.                     op: "cn",
  369.                     data: $('#policyNoEndSearch').val()
  370.                 });
  371.  
  372.                 f.rules.push({
  373.                     field: "startDateSearch",
  374.                     op: "cn",
  375.                     data: $('#startDateSearch').val()
  376.                 });
  377.  
  378.                 f.rules.push({
  379.                     field: "endDateSearch",
  380.                     op: "cn",
  381.                     data: $('#endDateSearch').val()
  382.                 });
  383.  
  384.                 f.rules.push({
  385.                     field: "issuseDateStartSearch",
  386.                     op: "cn",
  387.                     data: $('#issuseDateStartSearch').val()
  388.                 });
  389.  
  390.                 f.rules.push({
  391.                     field: "issuseDateEndSearch",
  392.                     op: "cn",
  393.                     data: $('#issuseDateEndSearch').val()
  394.                 });
  395.  
  396.                 f.rules.push({
  397.                     field: "agentIdStartSearch",
  398.                     op: "cn",
  399.                     data: $('#agentIdStartSearch').val()
  400.                 });
  401.  
  402.                 f.rules.push({
  403.                     field: "agentIdEndSearch",
  404.                     op: "cn",
  405.                     data: $('#agentIdEndSearch').val()
  406.                 });
  407.  
  408.                 f.rules.push({
  409.                     field: "idCardSearch",
  410.                     op: "cn",
  411.                     data: $('#idCardSearch').val()
  412.                 });
  413.  
  414.                 f.rules.push({
  415.                     field: "registerSearch",
  416.                     op: "cn",
  417.                     data: $('#registerSearch').val()
  418.                 });
  419.  
  420.                 f.rules.push({
  421.                     field: "chassisSearch",
  422.                     op: "cn",
  423.                     data: $('#chassisSearch').val()
  424.                 });
  425.  
  426.  
  427.                 f.rules.push({
  428.                     field: "policyStaus",
  429.                     op: "cn",
  430.                     data: status
  431.                 });
  432.  
  433.                 var grid = $('#grid');
  434.                 grid[0].p.search = f.rules.length > 0;
  435.                 $.extend(grid[0].p.postData, {
  436.                     filters: JSON.stringify(f)
  437.                 });
  438.                 grid.trigger("reloadGrid", [{
  439.                         page: 1
  440.                     }]);
  441.             });
  442.  
  443.             //box
  444.  
  445.  
  446.             $('#attBtn').click(function () {
  447.  
  448.                 var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  449.                 if (selr) {
  450.                     $.get("view-policy-attach?policyNo=" + encodeURIComponent(selr), function (data1) {
  451.                         $('#tableFrm').html(data1);
  452.  
  453.                     });
  454.                     $("#tableFrm").dialog({
  455.                         maxWidth: 700,
  456.                         maxHeight: 450,
  457.                         width: 700,
  458.                         height: 450,
  459.                         modal: true,
  460.                         close: function () {
  461.                             $('#sidebar').removeClass('side-hide');
  462.                             $('.top-nav').removeClass('full-fluid');
  463.                             $('#main-content').removeClass('full-fluid');
  464.  
  465.                         }
  466.                     });
  467.                     $('#sidebar').addClass('side-hide');
  468.                     $('.top-nav').addClass('full-fluid');
  469.                     $('#main-content').addClass('full-fluid');
  470.  
  471.                 } else {
  472.                     alert('α╕üα╕úα╕╕α╕ôα╕▓α╣Çα╕Ñα╕╖α╕¡α╕üα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î');
  473.                 }
  474.                 return false;
  475.             });
  476.  
  477.  
  478.  
  479.  
  480.  
  481.             $('#policyFileBtn').click(function () {
  482.  
  483.                 var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  484.                 if (selr) {
  485.                     $.get("view-policy-file?policyNo=" + encodeURIComponent(selr), function (data1) {
  486.                         $('#tableFrm').html(data1);
  487.  
  488.                     });
  489.                     $("#tableFrm").dialog({
  490.                         maxWidth: 700,
  491.                         maxHeight: 450,
  492.                         width: 700,
  493.                         height: 450,
  494.                         modal: true,
  495.                         close: function () {
  496.                             $('#sidebar').removeClass('side-hide');
  497.                             $('.top-nav').removeClass('full-fluid');
  498.                             $('#main-content').removeClass('full-fluid');
  499.  
  500.                         }
  501.                     });
  502.                     $('#sidebar').addClass('side-hide');
  503.                     $('.top-nav').addClass('full-fluid');
  504.                     $('#main-content').addClass('full-fluid');
  505.  
  506.                 } else {
  507.                     alert('α╕üα╕úα╕╕α╕ôα╕▓α╣Çα╕Ñα╕╖α╕¡α╕üα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î');
  508.                 }
  509.                 return false;
  510.             });
  511.  
  512.  
  513.             $('#addBtn').click(function () {
  514.  
  515.                 var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  516.  
  517.                 $.get("entry-policy-add", function (data1) {
  518.                     $('#tableFrm').html(data1);
  519.                     $("#tableFrm").dialog({
  520.                         maxWidth: 900,
  521.                         maxHeight: 650,
  522.                         width: 900,
  523.                         height: 650,
  524.                         modal: true,
  525.                         close: function () {
  526.  
  527.                             $('#sidebar').removeClass('side-hide');
  528.                             $('.top-nav').removeClass('full-fluid');
  529.                             $('#main-content').removeClass('full-fluid');
  530.                             $('#tableFrm').html('');
  531.                         }
  532.                     });
  533.  
  534.                     $('#sidebar').addClass('side-hide');
  535.                     $('.top-nav').addClass('full-fluid');
  536.                     $('#main-content').addClass('full-fluid');
  537.  
  538.                 });
  539.  
  540.  
  541.                 return false;
  542.  
  543.             });
  544.  
  545.  
  546.             $('#viewBtn').click(function () {
  547.  
  548.                 var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  549.  
  550.                 $.get("entry-policy-view?policyNo=" + encodeURIComponent(selr), function (data1) {
  551.                     $('#tableFrm').html(data1);
  552.                     $("#tableFrm").dialog({
  553.                         maxWidth: 900,
  554.                         maxHeight: 650,
  555.                         width: 900,
  556.                         height: 650,
  557.                         modal: true,
  558.                         close: function () {
  559.  
  560.                             $('#sidebar').removeClass('side-hide');
  561.                             $('.top-nav').removeClass('full-fluid');
  562.                             $('#main-content').removeClass('full-fluid');
  563.                             $('#tableFrm').html('');
  564.                         }
  565.                     });
  566.  
  567.                     $('#sidebar').addClass('side-hide');
  568.                     $('.top-nav').addClass('full-fluid');
  569.                     $('#main-content').addClass('full-fluid');
  570.  
  571.                 });
  572.  
  573.  
  574.                 return false;
  575.  
  576.             });
  577.  
  578.             $('#startDateSearch').datepicker({dateFormat: 'dd/mm/yy', onSelect: function (selectedDate) {
  579.                     $("#endDateSearch").datepicker("option", "minDate", selectedDate);
  580.                 }});
  581.             $('#endDateSearch').datepicker({dateFormat: 'dd/mm/yy', onSelect: function (selectedDate) {
  582.                     $("#startDateSearch").datepicker("option", "maxDate", selectedDate);
  583.                 }});
  584.  
  585.  
  586.             $('#issuseDateStartSearch').datepicker({dateFormat: 'dd/mm/yy', onSelect: function (selectedDate) {
  587.                     $("#issuseDateEndSearch").datepicker("option", "minDate", selectedDate);
  588.                 }});
  589.             $('#issuseDateEndSearch').datepicker({dateFormat: 'dd/mm/yy', onSelect: function (selectedDate) {
  590.                     $("#issuseDateStartSearch").datepicker("option", "maxDate", selectedDate);
  591.                 }});
  592.  
  593.             /* 
  594.              $('#delBtn').click(function() {
  595.              var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  596.              if (selr && confirm("α╕óα╕╖α╕Öα╕óα╕▒α╕Öα╕üα╕▓α╕úα╕Ñα╕Üα╕éα╣ëα╕¡α╕íα╕╣α╕Ñ α╕äα╕ºα╕▓α╕íα╕äα╕╕α╣ëα╕íα╕äα╕úα╕¡α╕ç α╕úα╕½α╕▒α╕¬ " + selr))
  597.              alert(selr);
  598.              
  599.              }); */
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.         </script>
  607.  
  608.  
  609.     </tiles:putAttribute>
  610. </tiles:insertDefinition>
  611.  
  612.  
  613. <%
  614.     if (request.getParameter("policyNo") != null) {
  615. %>
  616.  
  617. <script>
  618.     $(function () {
  619.  
  620.  
  621.         function getUrlParameter(sParam)
  622.         {
  623.             var sPageURL = window.location.search.substring(1);
  624.             var sURLVariables = sPageURL.split('&');
  625.             for (var i = 0; i < sURLVariables.length; i++)
  626.             {
  627.                 var sParameterName = sURLVariables[i].split('=');
  628.                 if (sParameterName[0] == sParam)
  629.                 {
  630.                     return sParameterName[1];
  631.                 }
  632.             }
  633.         }
  634.  
  635.         $.get("upload-files?policyNo=" + getUrlParameter('policyNo'), function (data1) {
  636.             $('#tableFrm').html(data1);
  637.             $("#tableFrm").dialog({
  638.                 maxWidth: 700,
  639.                 maxHeight: 450,
  640.                 width: 700,
  641.                 height: 450,
  642.                 modal: true,
  643.                 close: function () {
  644.                 }
  645.             });
  646.         });
  647.  
  648.         ;
  649.     });
  650. </script>
  651.  
  652. <%}%>