001.
<script src=
"assets/vendor/datatables/js/dataTables.bootstrap4.min.js"
></script>
003.
<script src=
"assets/vendor/datatables/js/buttons.bootstrap4.min.js"
></script>
004.
<script src=
"assets/vendor/datatables/js/data-table.js"
></script>
008.
009.
<div
class
=
"col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12"
>
010.
<div
class
=
"card"
>
011.
<div
class
=
"card-body"
>
012.
<h3>ประเภทใบงานซ่อม</h3>
013.
<form>
014.
<div
class
=
"row"
style=
"padding: 5px;"
>
015.
<button type=
"button"
name=
"tab5"
id=
"tab6"
data-toggle=
"modal"
data-target=
"#tab6_data_Modal"
class
=
"btn btn-info btn-sm"
><i
class
=
"fas fa-plus-circle"
></i> เพิ่มข้อมูล </button>
016.
<a href=
"frmcassavaFieldinsert.php"
><botton
class
=
"btn btn-primary btn-sm"
><i
class
=
"fas fa-check-circle"
></i> บันทึก </botton></a>
017.
<a href=
"frmcassavaFieldinsert.php"
><botton
class
=
"btn btn-danger btn-sm"
><i
class
=
"fas fa-times-circle"
></i> ยกเลิก </botton></a></div>
018.
<div id=
"tab6_div"
class
=
"table-responsive"
>
019.
<table id=
"tab6_table"
class
=
"table table-hoverable table-bordered first"
style=
"width: 100%;"
>
020.
<thead>
021.
<tr>
022.
<th width=
"10%"
><strong>ลำดับ</strong></th>
023.
<th width=
"50%"
><strong>ชื่อประเภทใบงานซ่อม</strong></th>
024.
<th width=
"10%"
><strong>แผนก</strong></th>
025.
<th width=
"10%"
><strong>สร้างโดย</strong></th>
026.
<th width=
"10%"
><strong>วันที่ถูกสร้าง</strong></th>
027.
<th width=
"10%"
><strong>ชื่อผู้แก้ไขล่าสุด</strong></th>
028.
<th width=
"10%"
><strong>ชื่อผู้แก้ไข</strong></th>
029.
</tr>
030.
</thead>
031.
<tbody >
032.
033.
<?php
034.
035.
$strSQL
=
"SELECT * FROM typerepair_setting ORDER BY id"
;
036.
$objQuery
= mysql_query(
$strSQL
);
037.
$i
= 1;
038.
while
(
$row
= mysql_fetch_array(
$objQuery
)){
039.
040.
echo
"<tr>
041.
<td><strong>
".$i."
</strong></td>
042.
<td><strong>
".$row['typerepair_name']."
</strong></td>
043.
<td><strong>
".$row['department_id']."
</strong></td>
044.
<td>
".$row['CreateDate']."
</td>
045.
<td>
".$row['CreateBy']."
</td>
046.
<td>
".$row['UpdateBy']."
</td>
047.
<td>
".$row['UpdateDate']."
</td>
048.
</tr>";
049.
$i
++;
050.
}
051.
?>
052.
053.
054.
</table>
055.
</div>
056.
</form>
057.
</div>
058.
</div>
059.
</div>
060.
061.
062.
063.
064.
<!-------------------------tab5------------------------------------>
065.
066.
<div id=
"tab5_data_Modal"
class
=
"modal fade"
>
067.
<div
class
=
"modal-dialog"
>
068.
<div
class
=
"modal-content"
>
069.
<div
class
=
"modal-header"
>
070.
<h4
class
=
"modal-title"
>เพิ่มสาเหตุการปฏิเสธงานซ่อม</h4>
071.
<button type=
"button"
class
=
"close"
data-dismiss=
"modal"
>×</button>
072.
</div>
073.
<div
class
=
"modal-body"
>
074.
<form method=
"post"
id=
"insert_form_tab5"
>
075.
<label>สาเหตุการปฏิเสธงานซ่อม</label>
076.
<input type=
"text"
name=
"nametab5"
id=
"nametab5"
class
=
"form-control"
/>
077.
<br />
078.
<input type=
"submit"
name=
"insert_tab5"
id=
"insert_tab5"
value=
"Inserting"
class
=
"btn btn-success"
/>
079.
080.
</form>
081.
</div>
082.
<div
class
=
"modal-footer"
>
083.
<button type=
"button"
class
=
"btn btn-default"
data-dismiss=
"modal"
>Close</button>
084.
</div>
085.
</div>
086.
</div>
087.
</div>
088.
089.
<script>
090.
$(document).ready(
function
(){
091.
$(
'#insert_form_tab5'
).on(
"submit"
,
function
(event){
092.
event.preventDefault();
093.
if
($(
'#nametab5'
).val() ==
""
)
094.
{
095.
alert(
"Name is required"
);
096.
}
097.
else
098.
{
099.
$.ajax({
100.
url:
"inserttab5.php"
,
101.
method:
"POST"
,
102.
data:$(
'#insert_form_tab5'
).serialize(),
103.
beforeSend:
function
(){
104.
$(
'#insert_tab5'
).val(
"Inserting"
);
105.
},
106.
success:
function
(data){
107.
$(
'#insert_form_tab5'
)[0].reset();
108.
$(
'#tab5_data_Modal'
).modal(
'hide'
);
109.
$(
'#tab5_div'
).html(data);
110.
111.
}
112.
113.
});
114.
}
115.
});
116.
117.
118.
});
119.
</script>
120.
121.
<!-------------------------tab5------------------------------------>