home *** CD-ROM | disk | FTP | other *** search
/ 61.19.244.139 / 61.19.244.139.zip / 61.19.244.139 / 2015-03-03 / views / agent-broker-setup.jsp < prev    next >
Text File  |  2015-03-03  |  11KB  |  357 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/agent-broker-list" var="agent_broker_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.                         <div class="widget-searchbox">
  23.                             <ul>
  24.                                 <li class="row-counts"><a class="btn btn-success" id="addBtn" href="#frm-box"> <i class="icon-plus icon-white"></i> α╣Çα╕₧α╕┤α╣êα╕í
  25.                                 </a> <a class="btn btn-primary" id="editBtn"> <i class="icon-pencil icon-white"></i> α╣üα╕üα╣ëα╣äα╕é
  26.                                 </a> <a class="btn btn-info" id="comBtn"> <i class="icon-briefcase icon-white"></i> α╕üα╕│α╕½α╕Öα╕öα╕äα╣êα╕▓α╕Üα╕│α╣Çα╕½α╕Öα╣çα╕ê
  27.                                 </a> <a class="btn btn-info" id="tempCreditBtn"> <i class="icon-briefcase icon-white"></i> α╕¡α╕Öα╕╕α╕íα╕▒α╕òα╕┤α╕ºα╕çα╣Çα╕çα╕┤α╕Öα╕èα╕▒α╣êα╕ºα╕äα╕úα╕▓α╕º
  28.                                 </a> <a class="btn  btn-danger" id="delBtn"> <i class="icon-trash icon-white"></i> α╕Ñα╕Ü
  29.                                 </a></li>
  30.                                 <li class="right">
  31.                                     <fieldset>
  32.                                         <div class="control-group">
  33.                                             <div class="controls">
  34.                                                 <input class="input-small" type="text" id="agentIdStart" name="agentIdStart" placeholder="α╕úα╕½α╕▒α╕¬ α╕òα╕▒α╕ºα╣üα╕ùα╕Ö"> - <input id="agentIdEnd" name="agentIdEnd" class="input-small" type="text"
  35.                                                     placeholder="α╕úα╕½α╕▒α╕¬ α╕òα╕▒α╕ºα╣üα╕ùα╕Ö"> <a class="btn btn-info" id="btSearch"> <i class="icon-search icon-white"></i> α╕äα╣ëα╕Öα╕½α╕▓
  36.                                                 </a>
  37.                                             </div>
  38.                                         </div>
  39.                                     </fieldset>
  40.                                 </li>
  41.                             </ul>
  42.                         </div>
  43.                         <div class="widget-box">
  44.                             <div align="center" id='jqgrid'>
  45.                                 <table id='grid'></table>
  46.                                 <div id='pager'></div>
  47.                             </div>
  48.                         </div>
  49.                     </div>
  50.                 </div>
  51.             </div>
  52.  
  53.  
  54.         </div>
  55.         <div id="tableFrm"></div>
  56.     </tiles:putAttribute>
  57.     <tiles:putAttribute name="customScript">
  58.         <script>
  59.             $(function() {
  60.                  
  61.                 $( "#agentId" ).autocomplete({
  62.                     source: function(request, response) {
  63.                         $.ajax({
  64.                             type: "GET",
  65.                             url: "agent-id-list",
  66.                             dataType: "json",
  67.                             data: {
  68.                                 term: request.term
  69.                             },
  70.                             error: function(xhr, textStatus, errorThrown) {
  71.                                 alert('Error: ' + xhr.responseText);
  72.                             },
  73.                             success: function(data) {
  74.                                 response($.map(data, function(c) {
  75.                                     return {
  76.                                         label: c.agentId+':'+c.agentName,
  77.                                         value: c.agentId  
  78.                                     }
  79.                                 }));
  80.                             }
  81.                         });
  82.                     },
  83.                     minLength: 2,
  84.                     select: function(event, ui) {
  85.                         alert('Select');
  86.                     }
  87.                 });
  88.  
  89.             $('#saveBtn').click(function() {
  90.                  
  91.                 $("#theForm").ajaxSubmit({url: 'saveAgentDetail', type: 'post'})
  92.             });
  93.  
  94.             $('#allPackage').click(function() {
  95.  
  96.                 $("#agentPackages").multiselect("disable");
  97.  
  98.             });
  99.  
  100.  
  101.             //
  102.  
  103.             $('#btSearch').click(function() {
  104.  
  105.                 var f = {
  106.                     groupOp : "AND",
  107.                     rules : []
  108.                 };
  109.                 f.rules.push({
  110.                     field : "agentIdStart",
  111.                     op : "cn",
  112.                     data : $('#agentIdStart').val()
  113.                 });
  114.                 f.rules.push({
  115.                     field : "agentIdEnd",
  116.                     op : "cn",
  117.                     data : $('#agentIdEnd').val()
  118.                 });
  119.                 var grid = $('#grid');
  120.                 grid[0].p.search = f.rules.length > 0;
  121.                 $.extend(grid[0].p.postData, {
  122.                     filters : JSON.stringify(f)
  123.                 });
  124.                 grid.trigger("reloadGrid", [ {
  125.                     page : 1
  126.                 } ]);
  127.             });
  128.  
  129.         });
  130.  
  131.         function codeFormat(cellvalue, options, rowObject) {
  132.             return '<span class="label label-success">' + cellvalue + '</span>';
  133.         }
  134.  
  135.         $("#grid").jqGrid({
  136.             url : '${agent_broker_listUrl}',
  137.             datatype : 'json',
  138.             mtype : 'GET',
  139.             colNames : [ 'α╕úα╕½α╕▒α╕¬α╕òα╕▒α╕ºα╣üα╕ùα╕Öα╕Öα╕▓α╕óα╕½α╕Öα╣ëα╕▓', 'α╕èα╕╖α╣êα╕¡α╕òα╕▒α╕ºα╣üα╕ùα╕Ö', 'α╕¢α╕úα╕░α╣Çα╕áα╕ùα╕òα╕▒α╕ºα╣üα╕ùα╕Ö', 'α╕ùα╕╡α╣êα╕¡α╕óα╕╣α╣ê', 'α╕ºα╕çα╣Çα╕çα╕┤α╕Öα╕ùα╕╡α╣êα╣äα╕öα╣ëα╕úα╕▒α╕Ü', 'α╕ºα╕çα╣Çα╕çα╕┤α╕Öα╕ùα╕╡α╣êα╣âα╕èα╣ëα╣äα╕¢', 'Credit Term'],
  140.             colModel : [ {
  141.                 name : 'agentId',
  142.                 index : 'agentId',
  143.                 width : 40,sortable: false,
  144.                 formatter : codeFormat
  145.             }, {
  146.                 name : 'agentName',
  147.                 index : 'agentName',
  148.                 width : 50, sortable: false,
  149.                 align : 'left'
  150.             }, {
  151.                 name : 'agentType',
  152.                 index : 'agentType',
  153.                 width : 30,sortable: false,
  154.                 hidden : false,
  155.                 align : 'center'
  156.             }, {
  157.                 name : 'address',
  158.                 index : 'agentId',
  159.                 width : 100,sortable: false,
  160.                 hidden : false,
  161.                 align : 'left'
  162.             }, {
  163.                                 name : 'crLimited',
  164.                 index : 'crLimited',
  165.                 width : 30,
  166.                                 formatter : 'number',
  167.                 hidden : false,
  168.                 align : 'right'
  169.                         }, {
  170.                                 name : 'crBalnace',
  171.                 index : 'crBalnace',
  172.                 width : 30,
  173.                                 formatter : 'number',
  174.                 hidden : false,
  175.                 align : 'right'
  176.                         }, {
  177.                                 name : 'crTerm',
  178.                 index : 'crTerm',
  179.                 width : 30,
  180.                                 formatter : 'number',
  181.                 hidden : false,
  182.                 align : 'right'
  183.                         }],
  184.             postData : {},
  185.             rowNum : 10,
  186.             rowList : [ 10, 20, 40, 60 ],
  187.             height : 340,
  188.             autowidth : true,
  189.             rownumbers : true,
  190.             pager : '#pager',
  191.             sortname : 'agentId',
  192.             viewrecords : true,
  193.             sortorder : "asc",
  194.  
  195.             emptyrecords : "Empty records",
  196.             loadonce : false,
  197.             loadComplete : function() {
  198.             },
  199.             jsonReader : {
  200.                 root : "rows",
  201.                 page : "page",
  202.                 total : "total",
  203.                 records : "records",
  204.                 repeatitems : false,
  205.                 cell : "cell",
  206.                 id : "agentId"
  207.             }
  208.         });
  209.  
  210.         //box
  211.         $(document).ready(function() {
  212.  
  213.              
  214.             $('#addBtn').click(function() {
  215.  
  216.  
  217.                 $.get( "agent-broker-setup-add", function( data1 ) {
  218.                       $('#tableFrm').html(data1);
  219.                       $( "#tableFrm" ).dialog({
  220.                             
  221.                             maxWidth:790,
  222.                             maxHeight: 600,
  223.                             width: 790,
  224.                             height: 600,
  225.                             modal: true,
  226.                             
  227.                             close: function() {
  228.                                 $('#sidebar').removeClass('side-hide');
  229.                                 $('.top-nav').removeClass('full-fluid');
  230.                                 $('#main-content').removeClass('full-fluid');
  231.                             }
  232.                         });
  233.                       $('#sidebar').addClass('side-hide');
  234.                         $('.top-nav').addClass('full-fluid');
  235.                         $('#main-content').addClass('full-fluid');
  236.                  });
  237.                 
  238.  
  239.                 
  240.                 return false;
  241.             });
  242.  
  243.             
  244.             $('#tempCreditBtn').click(function() {
  245.                 var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  246.                  if(selr){
  247.  
  248.                 $.get( "temp-credit-limit?agentId="+encodeURIComponent(selr), function( data1 ) {
  249.                       $('#tableFrm').html(data1);
  250.                       $( "#tableFrm" ).dialog({
  251.                             
  252.                             maxWidth:790,
  253.                             maxHeight: 500,
  254.                             width: 790,
  255.                             height: 500,
  256.                             modal: true,
  257.                             
  258.                             close: function() {
  259.                                  $('#sidebar').removeClass('side-hide');
  260.                                 $('.top-nav').removeClass('full-fluid');
  261.                                 $('#main-content').removeClass('full-fluid');
  262.                             }
  263.                         });
  264.  
  265.                       $('#sidebar').addClass('side-hide');
  266.                         $('.top-nav').addClass('full-fluid');
  267.                         $('#main-content').addClass('full-fluid');
  268.                  });
  269.                 
  270.                  
  271.                     
  272.                  }
  273.                 return false;
  274.             });
  275.  
  276.  
  277.             $('#comBtn').click(function() {
  278.                 var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  279.                  if(selr){
  280.  
  281.                 $.get( "agent-com-setup?agentId="+encodeURIComponent(selr), function( data1 ) {
  282.                       $('#tableFrm').html(data1);
  283.                       $( "#tableFrm" ).dialog({
  284.                             
  285.                             maxWidth:790,
  286.                             maxHeight: 500,
  287.                             width: 790,
  288.                             height: 500,
  289.                             modal: true,
  290.                             
  291.                             close: function() {
  292.                                 $('#sidebar').removeClass('side-hide');
  293.                                 $('.top-nav').removeClass('full-fluid');
  294.                                 $('#main-content').removeClass('full-fluid');
  295.                             }
  296.                         });
  297.  
  298.                       $('#sidebar').addClass('side-hide');
  299.                         $('.top-nav').addClass('full-fluid');
  300.                         $('#main-content').addClass('full-fluid');
  301.                  });
  302.                 
  303.  
  304.                 
  305.                  }
  306.                 return false;
  307.             });
  308.  
  309.             $('#editBtn').click(function() {
  310.                 var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  311.                  if(selr){
  312.  
  313.                 $.get( "agent-broker-setup-add?agentId="+encodeURIComponent(selr), function( data1 ) {
  314.                       $('#tableFrm').html(data1);
  315.                       $( "#tableFrm" ).dialog({
  316.                             
  317.                             maxWidth:790,
  318.                             maxHeight: 600,
  319.                             width: 790,
  320.                             height: 600,
  321.                             modal: true,
  322.                             
  323.                             close: function() {
  324.                                  $('#sidebar').removeClass('side-hide');
  325.                                 $('.top-nav').removeClass('full-fluid');
  326.                                 $('#main-content').removeClass('full-fluid');
  327.                                 $('#tableFrm').html('');
  328.                             }
  329.                         });
  330.                         
  331.                       $('#sidebar').addClass('side-hide');
  332.                         $('.top-nav').addClass('full-fluid');
  333.                         $('#main-content').addClass('full-fluid');
  334.                         
  335.                  });
  336.                 
  337.  
  338.                 
  339.                  }
  340.                 return false;
  341.             });
  342.             
  343.  
  344.             $('#delBtn').click(function() {
  345.                 var selr = $("#grid").jqGrid('getGridParam', 'selrow');
  346.                 if (selr && confirm("α╕óα╕╖α╕Öα╕óα╕▒α╕Öα╕üα╕▓α╕úα╕Ñα╕Üα╕éα╣ëα╕¡α╕íα╕╣α╕Ñ α╕òα╕▒α╕ºα╣üα╕ùα╕Öα╕Öα╕▓α╕óα╕½α╕Öα╣ëα╕▓  α╕úα╕½α╕▒α╕¬ " + selr)){ 
  347.  
  348.                       $.get("agent-delete?agentId="+selr,function(data,status){
  349.                           $('#grid').trigger("reloadGrid", [{ page: 1 }]);
  350.                           });
  351.                          
  352.                     }
  353.             }); 
  354.         });
  355.     </script>
  356.     </tiles:putAttribute>
  357. </tiles:insertDefinition>