home *** CD-ROM | disk | FTP | other *** search
/ 61.19.244.139 / 61.19.244.139.zip / 61.19.244.139 / 2015-02-19 / views / coverage.jsp < prev    next >
Text File  |  2015-02-19  |  8KB  |  319 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-coverage-list" var="get_coverage_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> <a class="btn btn-primary" id="editBtn"> <i class="icon-pencil icon-white"></i> α╣üα╕üα╣ëα╣äα╕é
  28.                                     </a> 
  29.                                     
  30.                                     <!-- <a class="btn  btn-danger" id="delBtn"> <i class="icon-trash icon-white"></i> α╕Ñα╕Ü
  31.                                     </a> -->
  32.                                     
  33.                                     </li>
  34.                                     <li class="right">
  35.                                     
  36.                                             <fieldset>
  37.  
  38.                                                 <div class="control-group">
  39.                                                     <div class="controls">
  40.                                                         <input class="input-small" type="text" id="covCodeStart" name="covCodeStart" placeholder="α╕úα╕½α╕▒α╕¬α╕äα╕ºα╕▓α╕íα╕äα╕╕α╣ëα╕íα╕äα╕úα╕¡α╕ç"> - <input id="covCodeEnd" name="covCodeEnd" class="input-small"
  41.                                                             type="text" placeholder="α╕úα╕½α╕▒α╕¬α╕äα╕ºα╕▓α╕íα╕äα╕╕α╣ëα╕íα╕äα╕úα╕¡α╕ç"> <a class="btn btn-info" id="btSearch"  > <i class="icon-search icon-white"></i> α╕äα╣ëα╕Öα╕½α╕▓
  42.                                                         </a>
  43.                                                     </div>
  44.                                                 </div>
  45.  
  46.                                             </fieldset>    
  47.                                         
  48.                                     </li>
  49.                                 </ul>
  50.                             </div>
  51.                             <div class="widget-box">
  52.                                 <div align="center" id='jqgrid'>
  53.                                     <table id='grid'></table>
  54.                                     <div id='pager'></div>
  55.                                 </div>
  56.                             </div>
  57.  
  58.                         </div>
  59.                     </div>
  60.                 </div>
  61.         </div>
  62.  
  63.  
  64.          <div id="tableFrm">
  65.          
  66.          </div>
  67.     </tiles:putAttribute>
  68.     <tiles:putAttribute name="customScript">
  69.  
  70.     </tiles:putAttribute>
  71.     
  72.         <tiles:putAttribute name="customScript">
  73.         <script>
  74.          
  75.  
  76.         function yesNoFormat(cellvalue, options, rowObject) {
  77.             if(cellvalue=='N'){
  78.                 return '<span class="label label-important">NO</span>';
  79.                 }else{    return '<span class="label label-success">YES</span>';
  80.                     
  81.                 }
  82.         }
  83.  
  84.         function successFormat(cellvalue, options, rowObject) {
  85.              return '<span class="label label-warning">'+cellvalue+'</span>';
  86.                  
  87.         }
  88.         
  89.         $(function() {
  90.         
  91.         $('#delBtn').click(function() {
  92.             var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  93.             if (selr && confirm("α╕óα╕╖α╕Öα╕óα╕▒α╕Öα╕üα╕▓α╕úα╕Ñα╕Üα╕éα╣ëα╕¡α╕íα╕╣α╕Ñ α╕úα╕▓α╕óα╕Ñα╕░α╣Çα╕¡α╕╡α╕óα╕öα╕äα╕ºα╕▓α╕íα╕äα╕╕α╣ëα╕íα╕äα╕úα╕¡α╕ç α╕úα╕½α╕▒α╕¬ " + selr))
  94.  
  95.                  
  96.  
  97.                  var url = encodeURIComponent("?covCode="+selr);  
  98.  
  99.             $.ajax({
  100.                    type: "GET",
  101.                    url: url,
  102.                    success: function(data)
  103.                    { 
  104.                        $('#grid').trigger("reloadGrid", [{ page: 1 }]);
  105.                    },
  106.                    error: function (xhr, ajaxOptions, thrownError) {
  107.                        alert(xhr.status);
  108.                        alert(thrownError);
  109.                      }
  110.                  });
  111.                  
  112.         });
  113.         
  114.         
  115.         $("#grid").jqGrid({
  116.             url : '${get_coverage_listUrl}',
  117.             datatype : 'json',
  118.             mtype : 'GET',
  119.             colNames : [ 'α╕úα╕½α╕▒α╕¬','α╕äα╕ºα╕▓α╕íα╕äα╕╕α╣ëα╕íα╕äα╕úα╕¡α╕ç', 'α╕ùα╕╕α╕Öα╕ùα╕▒α╣ëα╕çα╕üα╕úα╕íα╕ÿα╕úα╕úα╕íα╣î', 'α╕ùα╕╕α╕Öα╕òα╣êα╕¡α╕äα╕Ö', 'α╕ùα╕╕α╕Öα╕òα╣êα╕¡α╕çα╕äα╕úα╕▒α╣ëα╕ç', 'α╕äα╕ºα╕▓α╕íα╣Çα╕¬α╕╡α╕óα╕½α╕▓α╕óα╕¬α╣êα╕ºα╕Öα╣üα╕úα╕ü'],
  120.             colModel : [ {
  121.                 name : 'covCode',
  122.                 index : 'covCode',
  123.                 width : 10,
  124.                 //formatter : successFormat,
  125.                 editable : false,
  126.                 editoptions : {
  127.                     readonly : true,
  128.                     size : 10
  129.                 },
  130.                 hidden : false 
  131.             }, {
  132.                 name : 'covName',
  133.                 index : 'covName',
  134.                 width : 40,
  135.                 editable : true,
  136.                 editrules : {
  137.                     required : true
  138.                 },
  139.                 editoptions : {
  140.                     size : 40
  141.                 },
  142.                 hidden : false,
  143.  
  144.                 align : 'left'
  145.             }, {
  146.                 name : 'sumOfPol',
  147.                 index : 'sumOfPol',
  148.                 width : 10,
  149.                 editable : true,
  150.                 editrules : {
  151.                     required : true
  152.                 },
  153.                 formatter : yesNoFormat,
  154.                 editoptions : {
  155.                     size : 10
  156.                 },
  157.                 hidden : false,
  158.  
  159.                 align : 'center'
  160.             } , {
  161.                 name : 'sumOfPerson',
  162.                 index : 'sumOfPerson',
  163.                 width : 10,
  164.                 editable : true,
  165.                 editrules : {
  166.                     required : true
  167.                 },
  168.                 formatter : yesNoFormat,
  169.                 editoptions : {
  170.                     size : 10
  171.                 },
  172.                 hidden : false,
  173.  
  174.                 align : 'center'
  175.             } , {
  176.                 name : 'sumOfTime',
  177.                 index : 'sumOfTime',
  178.                 width : 10,
  179.                 editable : true,
  180.                 editrules : {
  181.                     required : true
  182.                 },
  183.                 formatter : yesNoFormat,
  184.                 editoptions : {
  185.                     size : 10
  186.                 },
  187.                 hidden : false,
  188.  
  189.                 align : 'center'
  190.             }, {
  191.                 name : 'deduct',
  192.                 index : 'deduct',
  193.                 width : 10,
  194.                 editable : true,
  195.                 editrules : {
  196.                     required : true
  197.                 },
  198.                 formatter : yesNoFormat,
  199.                 editoptions : {
  200.                     size : 10
  201.                 },
  202.                 hidden : false,
  203.  
  204.                 align : 'center'
  205.             }  ],
  206.             postData : {},
  207.             rowNum : 10,
  208.             rowList : [ 10, 20, 40, 60 ],
  209.             height : 340,
  210.             autowidth : true,
  211.             rownumbers : true,
  212.             pager : '#pager',
  213.             sortname : 'covCode',
  214.             viewrecords : true,
  215.             sortorder : "asc",
  216.  
  217.             emptyrecords : "Empty records",
  218.             loadonce : false,
  219.             loadComplete : function() {
  220.             },
  221.             jsonReader : {
  222.                 root : "rows",
  223.                 page : "page",
  224.                 total : "total",
  225.                 records : "records",
  226.                 repeatitems : false,
  227.                 cell : "cell",
  228.                 id : "covCode"
  229.             }
  230.         });
  231.         });
  232.  
  233.  
  234.         
  235.  
  236.         $('#btSearch').click(function() {
  237.  
  238.             var f = {
  239.                 groupOp : "AND",
  240.                 rules : []
  241.             };
  242.             f.rules.push({
  243.                 field : "covCodeStart",
  244.                 op : "cn",
  245.                 data : $('#covCodeStart').val()
  246.             });
  247.             f.rules.push({
  248.                 field : "covCodeEnd",
  249.                 op : "cn",
  250.                 data : $('#covCodeEnd').val()
  251.             });
  252.             var grid = $('#grid');
  253.             grid[0].p.search = f.rules.length > 0;
  254.             $.extend(grid[0].p.postData, {
  255.                 filters : JSON.stringify(f)
  256.             });
  257.             grid.trigger("reloadGrid", [ {
  258.                 page : 1
  259.             } ]);
  260.         });
  261.         
  262.         //box
  263.         $(document).ready(function() {
  264.  
  265.          
  266.             
  267.  
  268.             $('#editBtn').click(function() {
  269.  
  270.                 var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  271.                 if (selr ){
  272.                 $.get( "addCov?covCode="+encodeURIComponent(selr), function( data1 ) {
  273.                       $('#tableFrm').html(data1);
  274.                       $( "#tableFrm" ).dialog({
  275.                             
  276.                             maxWidth:700,
  277.                             maxHeight: 300,
  278.                             width: 700,
  279.                             height: 350,
  280.                             modal: true,
  281.                             close: function() {
  282.                             }
  283.                         });
  284.                  });
  285.                     }
  286.                     return false;
  287.             });
  288.             $('#addBtn').click(function() {
  289.  
  290.  
  291.                 $.get( "addCov", function( data1 ) {
  292.                       $('#tableFrm').html(data1);
  293.                       $( "#tableFrm" ).dialog({
  294.                             
  295.                             maxWidth:700,
  296.                             maxHeight: 300,
  297.                             width: 700,
  298.                             height: 350,
  299.                             modal: true,
  300.                             
  301.                             close: function() {
  302.                             }
  303.                         });
  304.                  });
  305.                  
  306.                 return false;
  307.             });
  308.  
  309.             $('#delBtn').click(function() {
  310.                 var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  311.                 if (selr && confirm("α╕óα╕╖α╕Öα╕óα╕▒α╕Öα╕üα╕▓α╕úα╕Ñα╕Üα╕éα╣ëα╕¡α╕íα╕╣α╕Ñ α╕äα╕ºα╕▓α╕íα╕äα╕╕α╣ëα╕íα╕äα╕úα╕¡α╕ç α╕úα╕½α╕▒α╕¬ " + selr))
  312.                     alert(selr);
  313.  
  314.             });
  315.  
  316.         });
  317.         </script>
  318.         </tiles:putAttribute>
  319. </tiles:insertDefinition>