home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
61.19.244.139
/
61.19.244.139.zip
/
61.19.244.139
/
2015-02-19
/
views
/
carsizetable.jsp
< prev
next >
Wrap
Text File
|
2015-02-19
|
14KB
|
296 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"%>
<div class="nonboxy-widget span6">
<div class="widget-head">
<h5 class="pull-left"><i class="black-icons list_images"></i> ลักษณะรถ <%= request.getParameter("vehCode")%> </h5>
</div>
<a id="plus_carsize" class="list-add btn btn-info" href="#">
<i class="icon-plus"></i>
ขนาดรถ
</a>
<div id="DataTables_Table_0_wrapper" class="dataTables_wrapper" role="grid"><div class="table_top clearfix">
<div class="table_content"><table class="data-tbl-striped table table-striped table-bordered dataTable" id="DataTables_Table_0">
<thead>
<tr role="row">
<th class="center sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 60px;" >รหัสรถ </th>
<th class="sorting_disabled" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="width:60px;" > ขนาด </th>
<th class="center sorting_disabled" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="width: 60px;" > ขั้นต่ำ </th>
<th class="center sorting_disabled" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="width: 60px;" > ขั้นสูง </th>
<th class="center sorting_disabled" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="width: 250px;" > คำอธิบาย </th>
<th class="center sorting_disabled" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="width: 40px;" > ลบ/แก้ไข </th>
</thead>
<tfoot>
</tfoot>
<tbody role="alert" aria-live="polite" aria-relevant="all">
<c:if test="${not empty vehSizeBeanList}">
<c:forEach var="listValue" items="${vehSizeBeanList}">
<tr class="even">
<td class=" sorting_1"> ${listValue.vehCode} </td>
<td class=" "> ${listValue.vehSize} </td>
<td class="center "> ${listValue.sizeMin} </td>
<td class="center "> ${listValue.sizeMax} </td>
<td class="center "> ${listValue.vehSizeDesc} </td>
<td class="center "> <div class="btn-group pull-right">
<button data-toggle="dropdown" class="btn dropdown-toggle"><i class="icon-cog"></i><span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="#" class="editVsize" vehCode='${listValue.vehCode}' vehSize='${listValue.vehSize}' sizeMin='${listValue.sizeMin}' sizeMax='${listValue.sizeMax}' vehSizeDesc='${listValue.vehSizeDesc}'><i class="icon-edit"></i> แก้ไขรายการนี้</a></li>
<li><a href="#" class="deleteVsize" vehCode='${listValue.vehCode}' vehSize='${listValue.vehSize}' ><i class="icon-trash"></i>ลบรายการ</a></li>
</ul>
</div> </td>
</tr>
</c:forEach>
</c:if>
</tbody></table></div>
</div>
</div>
<!--Begin-->
<div class="widget-head">
<h5 class="pull-left"><i class="black-icons list_images"></i> แบบตัวถังรถ <%= request.getParameter("vehCode")%> </h5>
</div>
<a id="plus_carModel" class="list-add btn btn-info" href="#">
<i class="icon-plus"></i>
แบบตัวถัง
</a>
<div id="DataTables_Table_1_wrapper" class="dataTables_wrapper" role="grid"><div class="table_top clearfix">
<div class="table_content"><table class="data-tbl-striped table table-striped table-bordered dataTable" id="DataTables_Table_1">
<thead>
<tr role="row">
<th class="center sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 40px;" >รหัสรถ </th>
<th class="center sorting_disabled" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="width:40px;" > ประเภทตัวถัง </th>
<th class="center sorting_disabled" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="width: 200px;" > แบบตัวถัง </th>
<th class="center sorting_disabled" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" style="width: 20px;" > ลบ/แก้ไข </th>
</thead>
<tfoot>
</tfoot>
<tbody role="alert" aria-live="polite" aria-relevant="all">
<c:if test="${not empty moVehModelList}">
<c:forEach var="listValue" items="${moVehModelList}">
<tr class="even">
<td class="sorting_1"> ${listValue.vehmCode} </td>
<td class="center "> ${listValue.vehmType} </td>
<td class=" "> ${listValue.vehmDesc} </td>
<td class="center ">
<div class="btn-group pull-right">
<button data-toggle="dropdown" class="btn dropdown-toggle"><i class="icon-cog"></i><span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="#" class="editModel" vehmCode='${listValue.vehmCode}' vehmType='${listValue.vehmType}' vehmDesc='${listValue.vehmDesc}'><i class="icon-edit"></i> แก้ไขรายการ</a></li>
<li><a href="#" class="deleteModel" vehmCode='${listValue.vehmCode}' vehmType='${listValue.vehmType}' ><i class="icon-trash"></i>ลบรายการ</a></li>
</ul>
</div>
</td>
</tr>
</c:forEach>
</c:if>
</tbody></table></div>
</div>
</div>
<!--END-->
</div>
<form id="frmUpdateVsize" name="frmUpdateVsize">
<div style="display: none" class="edit-Size" id="edit-Size">
<div class="control-group">
<label class="control-label" for="input02">ขนาดรถ</label>
<div class="controls">
<input type="hidden" name="vehCode" id="edit_vehCode">
<input class="input-small" type="text" id="edit_vehSize" name="vehSize" placeholder="ขนาดรถ" maxlength="1" />
ขั้นต่ำ:<input class="input-small" type="text" id="edit_sizeMin" name="sizeMin" placeholder="ขั้นต่ำ"/>
ขั้นสูง:<input class="input-small" type="text" id="edit_sizeMax"name="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="edit_vehSizeDesc" name="vehSizeDesc" placeholder="คำอธิบาย"/>
</div>
</div>
<button class="btn btn-success" name="saveBtnVsize" id="saveBtnVsize">ตกลง</button>
<a class="btn" id="cancelBtn" onClick="$('#edit-Size').hide();">ยกเลิก/ปิด</a>
<hr />
</div>
</form>
<form id="frmUpdateModel" name="frmUpdateModel">
<div style="display: none" class="edit-Model" id="edit-Model">
<div class="control-group">
<label class="control-label" for="input02">แบบตัวถัง</label>
<div class="controls">
<input type="hidden" name="vehmCode" id="edit_vehmCode">
ประเภทตัวถัง : <input class="input-small" type="text" id="edit_vehmType" name="vehmType" placeholder="ประเภทตัวถัง" maxlength="2" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="input02">แบบตัวถัง</label>
<div class="controls">
<input class="input-xxlarge" type="text" id="edit_vehmDesc" name="vehmDesc" placeholder="แบบตัวถัง"/>
</div>
</div>
<button class="btn btn-success" name="saveBtnModel" id="saveBtnModel">ตกลง</button>
<a class="btn" id="cancelBtn" onClick="$('#edit-Model').hide();">ยกเลิก/ปิด</a>
<hr />
</div>
</form>
<script>
$(function () {
$('#plus_carsize').click(function () {
$('#edit_vehSize').prop('readonly', false);
$('#edit_vehCode').val($("#grid").jqGrid('getGridParam', 'selrow'));
$('#edit_vehSize').val('');
$('#edit_sizeMin').val('');
$('#edit_sizeMax').val('');
$('#edit_vehSizeDesc').val('');
$('#edit-Size').show('slow');
return false;
});
$('#plus_carModel').click(function () {
$('#edit_vehmCode').val($("#grid").jqGrid('getGridParam', 'selrow'));
$('#edit_vehmType').prop('readonly', false);
$('#edit_vehmType').val('');
$('#edit_vehmDesc').val('');
$('#edit-Model').show('slow');
return false;
});
$('.editModel').click(function () {
$('#edit_vehmCode').val($(this).attr('vehmCode'));
$('#edit_vehmType').prop('readonly', true);
$('#edit_vehmType').val($(this).attr('vehmType'));
$('#edit_vehmDesc').val($(this).attr('vehmDesc'));
$('#edit-Model').show('slow');
return false;
});
$('.deleteModel').click(function () {
var vehmCode = $(this).attr('vehmCode');
var vehmType = $(this).attr('vehmType');
if (confirm('ยืนยันการลบข้อมูล')) {
$.get("delete-car-model?vehCode=" + vehmCode + "&vehtype=" + vehmType, function (data1) {
$('#tableDetail').html(data1);
});
}
});
$("#frmUpdateModel").submit(function () {
var form = $(this);
var url = "updateVehModel";
$.ajax({
type: "POST",
url: url,
data: $("#frmUpdateModel").serialize(),
success: function (data)
{
$('#tableDetail').html(data);
},
error: function (xhr, ajaxOptions, thrownError) {
var obj = JSON.parse(xhr.responseText);
alert(obj.errorMessages);
}
});
return false;
});
$('.deleteVsize').click(function () {
var vehCode = $(this).attr('vehCode');
var vehSize = $(this).attr('vehSize');
if (confirm('ยืนยันการลบข้อมูล')) {
$.get("delete-car-size?vehCode=" + vehCode + "&vehSize=" + vehSize, function (data1) {
$('#tableDetail').html(data1);
});
}
});
$('.editVsize').click(function () {
//$('#edit_vehSize').attr('vehCode')
$('#edit_vehSize').prop('readonly', true);
$('#edit_vehCode').val($(this).attr('vehCode'));
$('#edit_vehSize').val($(this).attr('vehSize'));
$('#edit_sizeMin').val($(this).attr('sizeMin'));
$('#edit_sizeMax').val($(this).attr('sizeMax'));
$('#edit_vehSizeDesc').val($(this).attr('vehSizeDesc'));
$('#edit-Size').show('slow');
return false;
});
$("#frmUpdateVsize").submit(function () {
var form = $(this);
var url = "updateVehSize";
$.ajax({
type: "POST",
url: url,
data: $("#frmUpdateVsize").serialize(),
success: function (data)
{
$('#tableDetail').html(data);
},
error: function (xhr, ajaxOptions, thrownError) {
var obj = JSON.parse(xhr.responseText);
alert(obj.errorMessages);
}
});
return false;
});
}
);
</script>