home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
61.19.244.139
/
61.19.244.139.zip
/
61.19.244.139
/
MortorEpolicy
/
entry-policy.jsp
< prev
next >
Wrap
Text File
|
2015-01-22
|
22KB
|
537 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-policy-list" var="get_policy_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-primary" id="uploadBtn"> <i class="icon-upload icon-white"></i> แนบเอกสาร
</a>
<a class="btn btn-primary" id="printBtn"> <i class="icon-print icon-white"></i> พิมพ์เอกสาร
</a>
</li>
<li class="right">
<fieldset>
<div class="control-group">
<div class="controls">
วันที่เริ่มคุ้มครอง <input type="text" name="startDateSearch" id="startDateSearch" class="input-small form-control clsDatePicker" placeholder="dd/mm/yyyy" />
<span class="input-group-addon"><i id="calIconTourDateDetails" class="glyphicon glyphicon-th"></i></span> -
<input id="endDateSearch" name="endDateSearch" class="input-small" type="text" placeholder="dd/mm/yyyy" />
</div>
<div class="controls">
วันที่ออกกรมธรรม์ <input type="text" name="issuseDateStartSearch" id="issuseDateStartSearch" class="input-small form-control clsDatePicker" placeholder="dd/mm/yyyy" />
<span class="input-group-addon"><i id="calIconTourDateDetails" class="glyphicon glyphicon-th"></i></span> -
<input id="issuseDateEndSearch" name="issuseDateEndSearch" class="input-small" type="text" placeholder="dd/mm/yyyy" />
</div>
<div class="controls">
หมายเลขกรมธรรม์ <input class="input-small" type="text" id="policyNoStartSearch" name="policyNoStartSearch" placeholder="หมายเลขกรมธรรม์">
- <input id="policyNoEndSearch" name="policyNoEndSearch" class="input-small" type="text" placeholder="หมายเลขกรมธรรม์">
<a class="btn btn-info" id="btSearch"> <i class="icon-search icon-white"></i> ค้นหา</a>
</div>
<div class="controls">
<input class="input-small" type="text" id="idCardSearch" name="idCardSearch" placeholder="เลขบัตร">
<input id="registerSearch" name="registerSearch" class="input-small" type="text" placeholder="ทะเบียนรถ">
<input id="chassisSearch" name="chassisSearch" class="input-small" type="text" placeholder="เลขตัวถัง">
</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>
<br/>
<br/>
<br/>
<div id="tableFrm"></div>
</tiles:putAttribute>
<tiles:putAttribute name="customScript">
</tiles:putAttribute>
<tiles:putAttribute name="customScript">
<script type="text/javascript">
/*
$('#premCalP').on('click', function() {
}); */
function successFormat(cellvalue, options, rowObject) {
return '<span class="label label-warning">' + cellvalue + '</span>';
}
$(function () {
$('#printBtn').click(function () {
var selr = $("#grid").jqGrid('getGridParam', 'selrow');
if (selr) {
$.get("print?policyNo=" + encodeURIComponent(selr), function (data1) {
$('#tableFrm').html(data1);
$("#tableFrm").dialog({
maxWidth: 700,
maxHeight: 450,
width: 700,
height: 450,
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');
});
} else {
alert('กรุณเลือก กรมธรรม์');
}
});
$('#delBtn').click(function () {
var selr = $("#grid").jqGrid('getGridParam', 'selrow');
if (selr && confirm("ยืนยันการลบข้อมูล รายละเอียดความคุ้มครอง รหัส " + selr))
var url = "?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_policy_listUrl}',
datatype: 'json',
mtype: 'GET',
colNames: ['หมายเลขกรมธรรม์', 'รหัส Package', 'วันเริ่มคุ้มครอง', 'วันสิ้นสุดคุ้มครอง', 'ครบกำหนดชำระ', 'ประเภทกรมธรรม์', 'เบี้ยประกันภัยรวม', 'ผู้เอาประกันภัย'],
colModel: [{
name: 'policyNo',
index: 'policyNo',
width: 25,
hidden: false
}, {
name: 'packageCode',
index: 'packageCode',
width: 10,
hidden: false,
align: 'left'
}, {
name: 'beginDate',
index: 'beginDate',
width: 10,
datefmt: "d-M-Y",
formatoptions: {newformat: 'd/m/Y'},
formatter: function (cellval, opts, rowObject, action) {
return $.fn.fmatter.call(
this,
"date",
new Date(cellval),
$.extend({}, $.jgrid.formatter.date, opts),
rowObject,
action);
},
align: 'center'
}, {
name: 'endDate',
index: 'endDate',
width: 10,
hidden: false,
datefmt: "d-M-Y",
formatoptions: {newformat: 'd/m/Y'},
formatter: function (cellval, opts, rowObject, action) {
return $.fn.fmatter.call(
this,
"date",
new Date(cellval),
$.extend({}, $.jgrid.formatter.date, opts),
rowObject,
action);
},
align: 'center'
}, {
name: 'payDueDate',
index: 'payDueDate',
width: 10,
hidden: false,
datefmt: "d-M-Y",
formatoptions: {newformat: 'd/m/Y'},
formatter: function (cellval, opts, rowObject, action) {
return $.fn.fmatter.call(
this,
"date",
new Date(cellval),
$.extend({}, $.jgrid.formatter.date, opts),
rowObject,
action);
},
align: 'center'
}, {
name: 'polType',
index: 'polType',
width: 10,
hidden: false,
align: 'left'
}, {
name: 'totalPremium',
index: 'totalPremium',
width: 10,
formatter: "number", sorttype: "number", align: "right"
}, {
name: 'insureName',
index: 'insureName',
width: 30,
align: 'left'
}],
postData: {},
rowNum: 20,
rowList: [10, 20, 40, 60],
height: 340,
autowidth: true,
rownumbers: true,
pager: '#pager',
sortname: 'policyNo',
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: "policyNo"
}
});
});
$('#btSearch').click(function () {
var f = {
groupOp: "AND",
rules: []
};
f.rules.push({
field: "policyNoStartSearch",
op: "cn",
data: $('#policyNoStartSearch').val()
});
f.rules.push({
field: "policyNoEndSearch",
op: "cn",
data: $('#policyNoEndSearch').val()
});
f.rules.push({
field: "startDateSearch",
op: "cn",
data: $('#startDateSearch').val()
});
f.rules.push({
field: "endDateSearch",
op: "cn",
data: $('#endDateSearch').val()
});
f.rules.push({
field: "issuseDateStartSearch",
op: "cn",
data: $('#issuseDateStartSearch').val()
});
f.rules.push({
field: "issuseDateEndSearch",
op: "cn",
data: $('#issuseDateEndSearch').val()
});
f.rules.push({
field: "idCardSearch",
op: "cn",
data: $('#idCardSearch').val()
});
f.rules.push({
field: "registerSearch",
op: "cn",
data: $('#registerSearch').val()
});
f.rules.push({
field: "chassisSearch",
op: "cn",
data: $('#chassisSearch').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
$('#uploadBtn').click(function () {
var selr = $("#grid").jqGrid('getGridParam', 'selrow');
if (selr) {
$.get("upload-files?policyNo=" + encodeURIComponent(selr), function (data1) {
$('#tableFrm').html(data1);
});
$("#tableFrm").dialog({
maxWidth: 700,
maxHeight: 450,
width: 700,
height: 450,
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');
} else {
alert('กรุณาเลือกกรมธรรม์');
}
return false;
});
$('#addBtn').click(function () {
var selr = $("#grid").jqGrid('getGridParam', 'selrow');
$.get("entry-policy-add", function (data1) {
$('#tableFrm').html(data1);
$("#tableFrm").dialog({
maxWidth: 900,
maxHeight: 650,
width: 900,
height: 650,
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;
});
$('#startDateSearch').datepicker({dateFormat: 'dd/mm/yy', onSelect: function (selectedDate) {
$("#endDateSearch").datepicker("option", "minDate", selectedDate);
}});
$('#endDateSearch').datepicker({dateFormat: 'dd/mm/yy', onSelect: function (selectedDate) {
$("#startDateSearch").datepicker("option", "maxDate", selectedDate);
}});
$('#issuseDateStartSearch').datepicker({dateFormat: 'dd/mm/yy', onSelect: function (selectedDate) {
$("#issuseDateEndSearch").datepicker("option", "minDate", selectedDate);
}});
$('#issuseDateEndSearch').datepicker({dateFormat: 'dd/mm/yy', onSelect: function (selectedDate) {
$("#issuseDateStartSearch").datepicker("option", "maxDate", selectedDate);
}});
$('#editBtn').click(function () {
var selr = $("#grid").jqGrid('getGridParam', 'selrow');
$.get("entry-policy-edit?policyNo=" + encodeURIComponent(selr), function (data1) {
$('#tableFrm').html(data1);
$("#tableFrm").dialog({
maxWidth: 900,
maxHeight: 650,
width: 900,
height: 650,
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))
alert(selr);
}); */
</script>
</tiles:putAttribute>
</tiles:insertDefinition>
<%
if (request.getParameter("policyNo") != null) {
%>
<script>
$(function () {
function getUrlParameter(sParam)
{
var sPageURL = window.location.search.substring(1);
var sURLVariables = sPageURL.split('&');
for (var i = 0; i < sURLVariables.length; i++)
{
var sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] == sParam)
{
return sParameterName[1];
}
}
}
$.get("upload-files?policyNo=" + getUrlParameter('policyNo'), function (data1) {
$('#tableFrm').html(data1);
$("#tableFrm").dialog({
maxWidth: 700,
maxHeight: 450,
width: 700,
height: 450,
modal: true,
close: function () {
}
})
});
;
});
</script>
<%}%>