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 >
Wrap
Text File
|
2015-02-19
|
8KB
|
319 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/get-coverage-list" var="get_coverage_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-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="covCodeStart" name="covCodeStart" placeholder="รหัสความคุ้มครอง"> - <input id="covCodeEnd" name="covCodeEnd" 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">
</tiles:putAttribute>
<tiles:putAttribute name="customScript">
<script>
function yesNoFormat(cellvalue, options, rowObject) {
if(cellvalue=='N'){
return '<span class="label label-important">NO</span>';
}else{ return '<span class="label label-success">YES</span>';
}
}
function successFormat(cellvalue, options, rowObject) {
return '<span class="label label-warning">'+cellvalue+'</span>';
}
$(function() {
$('#delBtn').click(function() {
var selr = $("#grid").jqGrid('getGridParam', 'selrow');
if (selr && confirm("ยืนยันการลบข้อมูล รายละเอียดความคุ้มครอง รหัส " + selr))
var url = encodeURIComponent("?covCode="+selr);
$.ajax({
type: "GET",
url: url,
success: function(data)
{
$('#grid').trigger("reloadGrid", [{ page: 1 }]);
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
}
});
});
$("#grid").jqGrid({
url : '${get_coverage_listUrl}',
datatype : 'json',
mtype : 'GET',
colNames : [ 'รหัส','ความคุ้มครอง', 'ทุนทั้งกรมธรรม์', 'ทุนต่อคน', 'ทุนต่องครั้ง', 'ความเสียหายส่วนแรก'],
colModel : [ {
name : 'covCode',
index : 'covCode',
width : 10,
//formatter : successFormat,
editable : false,
editoptions : {
readonly : true,
size : 10
},
hidden : false
}, {
name : 'covName',
index : 'covName',
width : 40,
editable : true,
editrules : {
required : true
},
editoptions : {
size : 40
},
hidden : false,
align : 'left'
}, {
name : 'sumOfPol',
index : 'sumOfPol',
width : 10,
editable : true,
editrules : {
required : true
},
formatter : yesNoFormat,
editoptions : {
size : 10
},
hidden : false,
align : 'center'
} , {
name : 'sumOfPerson',
index : 'sumOfPerson',
width : 10,
editable : true,
editrules : {
required : true
},
formatter : yesNoFormat,
editoptions : {
size : 10
},
hidden : false,
align : 'center'
} , {
name : 'sumOfTime',
index : 'sumOfTime',
width : 10,
editable : true,
editrules : {
required : true
},
formatter : yesNoFormat,
editoptions : {
size : 10
},
hidden : false,
align : 'center'
}, {
name : 'deduct',
index : 'deduct',
width : 10,
editable : true,
editrules : {
required : true
},
formatter : yesNoFormat,
editoptions : {
size : 10
},
hidden : false,
align : 'center'
} ],
postData : {},
rowNum : 10,
rowList : [ 10, 20, 40, 60 ],
height : 340,
autowidth : true,
rownumbers : true,
pager : '#pager',
sortname : 'covCode',
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 : "covCode"
}
});
});
$('#btSearch').click(function() {
var f = {
groupOp : "AND",
rules : []
};
f.rules.push({
field : "covCodeStart",
op : "cn",
data : $('#covCodeStart').val()
});
f.rules.push({
field : "covCodeEnd",
op : "cn",
data : $('#covCodeEnd').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
} ]);
});
//box
$(document).ready(function() {
$('#editBtn').click(function() {
var selr = $("#grid").jqGrid('getGridParam', 'selrow');
if (selr ){
$.get( "addCov?covCode="+encodeURIComponent(selr), function( data1 ) {
$('#tableFrm').html(data1);
$( "#tableFrm" ).dialog({
maxWidth:700,
maxHeight: 300,
width: 700,
height: 350,
modal: true,
close: function() {
}
});
});
}
return false;
});
$('#addBtn').click(function() {
$.get( "addCov", function( data1 ) {
$('#tableFrm').html(data1);
$( "#tableFrm" ).dialog({
maxWidth:700,
maxHeight: 300,
width: 700,
height: 350,
modal: true,
close: function() {
}
});
});
return false;
});
$('#delBtn').click(function() {
var selr = $("#grid").jqGrid('getGridParam', 'selrow');
if (selr && confirm("ยืนยันการลบข้อมูล ความคุ้มครอง รหัส " + selr))
alert(selr);
});
});
</script>
</tiles:putAttribute>
</tiles:insertDefinition>