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 >
Wrap
Text File
|
2015-03-03
|
11KB
|
357 lines
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<spring:url value="/bui/agent-broker-list" var="agent_broker_listUrl" htmlEscape="true" />
<tiles:insertDefinition name="defaultTemplate">
<tiles:putAttribute name="body">
<ul class="breadcrumb">
<li><a href="#">α╕½α╕Öα╣ëα╕▓α╕½α╕Ñα╕▒α╕ü</a><span class="divider">»</span></li>
<li class="active">กำหนดรายละเอียดตัวแทน</li>
</ul>
<div class="row-fluid">
<div class="span12 ">
<div class=" widget-block">
<div class="widget-head">
<h5>
<i class="black-icons documents"></i>
</h5>
</div>
<div class="widget-content">
<div class="widget-searchbox">
<ul>
<li class="row-counts"><a class="btn btn-success" id="addBtn" href="#frm-box"> <i class="icon-plus icon-white"></i> เพิ่ม
</a> <a class="btn btn-primary" id="editBtn"> <i class="icon-pencil icon-white"></i> แก้ไข
</a> <a class="btn btn-info" id="comBtn"> <i class="icon-briefcase icon-white"></i> กำหนดค่าบำเหน็จ
</a> <a class="btn btn-info" id="tempCreditBtn"> <i class="icon-briefcase icon-white"></i> อนุมัติวงเงินชั่วคราว
</a> <a class="btn btn-danger" id="delBtn"> <i class="icon-trash icon-white"></i> ลบ
</a></li>
<li class="right">
<fieldset>
<div class="control-group">
<div class="controls">
<input class="input-small" type="text" id="agentIdStart" name="agentIdStart" placeholder="รหัส ตัวแทน"> - <input id="agentIdEnd" name="agentIdEnd" class="input-small" type="text"
placeholder="รหัส ตัวแทน"> <a class="btn btn-info" id="btSearch"> <i class="icon-search icon-white"></i> ค้นหา
</a>
</div>
</div>
</fieldset>
</li>
</ul>
</div>
<div class="widget-box">
<div align="center" id='jqgrid'>
<table id='grid'></table>
<div id='pager'></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="tableFrm"></div>
</tiles:putAttribute>
<tiles:putAttribute name="customScript">
<script>
$(function() {
$( "#agentId" ).autocomplete({
source: function(request, response) {
$.ajax({
type: "GET",
url: "agent-id-list",
dataType: "json",
data: {
term: request.term
},
error: function(xhr, textStatus, errorThrown) {
alert('Error: ' + xhr.responseText);
},
success: function(data) {
response($.map(data, function(c) {
return {
label: c.agentId+':'+c.agentName,
value: c.agentId
}
}));
}
});
},
minLength: 2,
select: function(event, ui) {
alert('Select');
}
});
$('#saveBtn').click(function() {
$("#theForm").ajaxSubmit({url: 'saveAgentDetail', type: 'post'})
});
$('#allPackage').click(function() {
$("#agentPackages").multiselect("disable");
});
//
$('#btSearch').click(function() {
var f = {
groupOp : "AND",
rules : []
};
f.rules.push({
field : "agentIdStart",
op : "cn",
data : $('#agentIdStart').val()
});
f.rules.push({
field : "agentIdEnd",
op : "cn",
data : $('#agentIdEnd').val()
});
var grid = $('#grid');
grid[0].p.search = f.rules.length > 0;
$.extend(grid[0].p.postData, {
filters : JSON.stringify(f)
});
grid.trigger("reloadGrid", [ {
page : 1
} ]);
});
});
function codeFormat(cellvalue, options, rowObject) {
return '<span class="label label-success">' + cellvalue + '</span>';
}
$("#grid").jqGrid({
url : '${agent_broker_listUrl}',
datatype : 'json',
mtype : 'GET',
colNames : [ 'รหัสตัวแทนนายหน้า', 'ชื่อตัวแทน', 'ประเภทตัวแทน', 'ที่อยู่', 'วงเงินที่ได้รับ', 'วงเงินที่ใช้ไป', 'Credit Term'],
colModel : [ {
name : 'agentId',
index : 'agentId',
width : 40,sortable: false,
formatter : codeFormat
}, {
name : 'agentName',
index : 'agentName',
width : 50, sortable: false,
align : 'left'
}, {
name : 'agentType',
index : 'agentType',
width : 30,sortable: false,
hidden : false,
align : 'center'
}, {
name : 'address',
index : 'agentId',
width : 100,sortable: false,
hidden : false,
align : 'left'
}, {
name : 'crLimited',
index : 'crLimited',
width : 30,
formatter : 'number',
hidden : false,
align : 'right'
}, {
name : 'crBalnace',
index : 'crBalnace',
width : 30,
formatter : 'number',
hidden : false,
align : 'right'
}, {
name : 'crTerm',
index : 'crTerm',
width : 30,
formatter : 'number',
hidden : false,
align : 'right'
}],
postData : {},
rowNum : 10,
rowList : [ 10, 20, 40, 60 ],
height : 340,
autowidth : true,
rownumbers : true,
pager : '#pager',
sortname : 'agentId',
viewrecords : true,
sortorder : "asc",
emptyrecords : "Empty records",
loadonce : false,
loadComplete : function() {
},
jsonReader : {
root : "rows",
page : "page",
total : "total",
records : "records",
repeatitems : false,
cell : "cell",
id : "agentId"
}
});
//box
$(document).ready(function() {
$('#addBtn').click(function() {
$.get( "agent-broker-setup-add", function( data1 ) {
$('#tableFrm').html(data1);
$( "#tableFrm" ).dialog({
maxWidth:790,
maxHeight: 600,
width: 790,
height: 600,
modal: true,
close: function() {
$('#sidebar').removeClass('side-hide');
$('.top-nav').removeClass('full-fluid');
$('#main-content').removeClass('full-fluid');
}
});
$('#sidebar').addClass('side-hide');
$('.top-nav').addClass('full-fluid');
$('#main-content').addClass('full-fluid');
});
return false;
});
$('#tempCreditBtn').click(function() {
var selr = $("#grid").jqGrid('getGridParam', 'selrow');
if(selr){
$.get( "temp-credit-limit?agentId="+encodeURIComponent(selr), function( data1 ) {
$('#tableFrm').html(data1);
$( "#tableFrm" ).dialog({
maxWidth:790,
maxHeight: 500,
width: 790,
height: 500,
modal: true,
close: function() {
$('#sidebar').removeClass('side-hide');
$('.top-nav').removeClass('full-fluid');
$('#main-content').removeClass('full-fluid');
}
});
$('#sidebar').addClass('side-hide');
$('.top-nav').addClass('full-fluid');
$('#main-content').addClass('full-fluid');
});
}
return false;
});
$('#comBtn').click(function() {
var selr = $("#grid").jqGrid('getGridParam', 'selrow');
if(selr){
$.get( "agent-com-setup?agentId="+encodeURIComponent(selr), function( data1 ) {
$('#tableFrm').html(data1);
$( "#tableFrm" ).dialog({
maxWidth:790,
maxHeight: 500,
width: 790,
height: 500,
modal: true,
close: function() {
$('#sidebar').removeClass('side-hide');
$('.top-nav').removeClass('full-fluid');
$('#main-content').removeClass('full-fluid');
}
});
$('#sidebar').addClass('side-hide');
$('.top-nav').addClass('full-fluid');
$('#main-content').addClass('full-fluid');
});
}
return false;
});
$('#editBtn').click(function() {
var selr = $("#grid").jqGrid('getGridParam', 'selrow');
if(selr){
$.get( "agent-broker-setup-add?agentId="+encodeURIComponent(selr), function( data1 ) {
$('#tableFrm').html(data1);
$( "#tableFrm" ).dialog({
maxWidth:790,
maxHeight: 600,
width: 790,
height: 600,
modal: true,
close: function() {
$('#sidebar').removeClass('side-hide');
$('.top-nav').removeClass('full-fluid');
$('#main-content').removeClass('full-fluid');
$('#tableFrm').html('');
}
});
$('#sidebar').addClass('side-hide');
$('.top-nav').addClass('full-fluid');
$('#main-content').addClass('full-fluid');
});
}
return false;
});
$('#delBtn').click(function() {
var selr = $("#grid").jqGrid('getGridParam', 'selrow');
if (selr && confirm("ยืนยันการลบข้อมูล ตัวแทนนายหน้า รหัส " + selr)){
$.get("agent-delete?agentId="+selr,function(data,status){
$('#grid').trigger("reloadGrid", [{ page: 1 }]);
});
}
});
});
</script>
</tiles:putAttribute>
</tiles:insertDefinition>