home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
61.19.244.139
/
61.19.244.139.zip
/
61.19.244.139
/
2015-02-19
/
views
/
car-type-setup-add.jsp
< prev
next >
Wrap
Text File
|
2015-02-19
|
6KB
|
136 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"%>
<form:form cssClass="form-horizontal well" method="Post" action="saveVehCode" modelAttribute="vehCodeForm" id="frmSaveVehCode" name="frmSaveVehCode" >
<fieldset>
<div class="control-group">
<label class="control-label" for="input01">ประเภทรถยนต์</label>
<div class="controls">
<form:select cssClass="span3" path="vehType" name="vehType" id="vehType" multiple="false" itemLabel="vehType" itemValue="vehType">
<form:options items="${vehTypeList}" itemValue="refCode" itemLabel="refDesc1"/>
</form:select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="input01" >ลักษณะการใช้รถรถยนต์</label>
<div class="controls">
<form:select cssClass="span3" path="vehUsage" name="vehUsage" id="vehUsage" multiple="false" >
<form:options items="${vehUsageList}" itemValue="refCode" itemLabel="refDesc1"/>
</form:select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="input01">รหัสรถยนต์</label>
<div class="controls">
<form:input cssClass="input-small" type="text" placeholder="รหัสรถยนต์" name="vehCode" id="vehCode" path="vehCode"/>
</div>
</div>
<div class="control-group">
<label class="control-label" for="input01">ขนาดรถยนต์:</label>
<div class="controls">
<form:radiobutton path="vehSizeFlag" name="vehSizeFlag" value="C" /> CC <form:radiobutton path="vehSizeFlag" name="vehSizeFlag" value="S" /> Seat <form:radiobutton path="vehSizeFlag" name="vehSizeFlag" value="W" /> Weight
</div>
</div>
<div class="control-group">
<label class="control-label" for="input02">ข้อความหน้าตารางกรมธรรม์</label>
<div class="controls">
<form:input cssClass="input-xlarge" type="text" id="vehPrintPol" name="vehPrintPol" path="vehPrintPol"
placeholder="ข้อความหน้าตารางกรมธรรม์"/>
</div>
</div>
<hr/>
<div id="carSizeForm">
<div class="list-item">
<div class="control-group">
<label class="control-label" for="input02">ขนาดรถ</label>
<div class="controls">
<input class="input-small" type="text" id="vehSizeBeans[0].vehSize" name="vehSizeBeans[0].vehSize"
placeholder="ขนาดรถ" maxlength="1">
<!-- <select class="span1" name="vehSizeBeans[0].vehSizeFlag" id="vehSizeBeans[0].vehSizeFlag">
<option value="C">CC</option>
<option value="S">Seat</option>
<option value="W">Weight</option>
</select> -->
ขั้นต่ำ:<input class="input-small" type="text" id="vehSizeBeans[0].sizeMin" name="vehSizeBeans[0].sizeMin"
placeholder="ขั้นต่ำ">
ขั้นสูง:<input class="input-small" type="text" id="vehSizeBeans[0].sizeMax" name="vehSizeBeans[0].sizeMax"
placeholder="ขั้นสูง">
</div>
</div>
<div class="control-group">
<label class="control-label" for="input02">คำอธิบาย</label>
<div class="controls">
<input class="input-xlarge" type="text" id="vehSizeBeans[0].vehSizeDesc" name="vehSizeBeans[0].vehSizeDesc"
placeholder="คำอธิบาย">
<a href="#" class="list-remove btn btn-dange" id="minus2"><i class="icon-minus"></i>ขนาดรถ</a>
</div>
</div> <hr/>
</div>
<a href="#" class="list-add btn btn-info" id="plus2"><i class="icon-plus"></i>ขนาดรถ</a>
</div>
<br/>
<br/>
<%
if (request.getParameter("vehCode") == null) {
%>
<button class="btn btn-success" name="saveBtn" id="saveBtn">บันทึก</button>
<%
} else {
%>
<button class="btn btn-primary" name="editBtn" id="editBtn">แก้ไข</button>
<%
}
%>
<a class="btn" id="cancelBtn" onClick="$('#tableFrm').dialog('close');">ยกเลิก/ปิด</a>
</fieldset>
</form:form>
<script>
$(function() {
$("#vehType").select2({ width: 'resolve' });
$("#vehUsage").select2({ width: 'resolve' });
$(document).ready(function() {
$("#carSizeForm").dynamiclist();
});
$("#frmSaveVehCode").submit(function() {
var url = "saveVehCode";
$.ajax({
type: "POST",
url: url,
data: $("#frmSaveVehCode").serialize(),
success: function(data)
{
$('#grid').trigger("reloadGrid", [{ page: 1 }]);
$('#tableFrm').dialog('close');
},
error: function (xhr, ajaxOptions, thrownError) {
var obj = JSON.parse( xhr.responseText);
alert(obj.errorMessages ) ;
}
});
return false;
});
});
</script>