|
|
|
@@ -97,6 +97,7 @@ |
|
|
|
<tr>
|
|
|
|
<th>JbKod</th>
|
|
|
|
<th>AkKod</th>
|
|
|
|
<th>nAkKod</th>
|
|
|
|
<th>Seksyen</th>
|
|
|
|
<th>Nama</th>
|
|
|
|
<th width="60">Kadar 7</th>
|
|
|
|
@@ -109,6 +110,7 @@ |
|
|
|
<tr>
|
|
|
|
<th>JbKod</th>
|
|
|
|
<th>AkKod</th>
|
|
|
|
<th>nAkKod</th>
|
|
|
|
<th>Seksyen</th>
|
|
|
|
<th>Nama</th>
|
|
|
|
<th width="60">Kadar 7</th>
|
|
|
|
@@ -384,15 +386,16 @@ |
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
var groupColumn = 2;
|
|
|
|
var table = $('#faulty').DataTable({
|
|
|
|
"ordering": false,
|
|
|
|
"serverSide": true,
|
|
|
|
"processing": true,
|
|
|
|
"autoWidth": false,
|
|
|
|
"ajax": "{{ url('api/faulty/list') }}",
|
|
|
|
"ajax": "{{ url('api/faulty/list') }}/{{ $user->_id}}",
|
|
|
|
"columns": [
|
|
|
|
{ "data": "jbkod", "name": "jbkod"},
|
|
|
|
{ "data": "akkod","name": "akkod"},
|
|
|
|
{ "data": "nakkod","name": "nakkod"},
|
|
|
|
{ "data": "sketr", "name": "sketr" },
|
|
|
|
{ "data": "nama", "name": "nama"},
|
|
|
|
{ "data": "amount14", "name": "amount14"},
|
|
|
|
@@ -416,12 +419,28 @@ |
|
|
|
"render": function ( data, type, row ) {
|
|
|
|
var link = "{{ url('/main/faulty') }}"+"/"+row.itkod+"/edit";
|
|
|
|
return '<div class="btn-group btn-group-sm" style="float: none;"><a onclick="getDetail(\''+data+'\')" class="tabledit-edit-button btn btn-primary waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Kemaskini Seksyen/Kesalahan"><span class="icofont icofont-ui-edit" style="color:white"></span></a> <a onclick="deleteA(\''+data+'\',\'' + row.sketr + '\')" data-toggle="tooltip" data-placement="top" title="Buang Seksyen/Kesalahan" class="tabledit-delete-button btn btn-danger waves-effect waves-light" style="float: none;"><span class="icofont icofont-ui-delete" style="color:white"></span></a></div>';
|
|
|
|
|
|
|
|
// <a href="'+link+'" class="tabledit-edit-button btn btn-primary waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Kemaskini Seksyen/Kesalahan"><span class="icofont icofont-ui-edit" style="color:white"></span></a>
|
|
|
|
},
|
|
|
|
"targets": 7,
|
|
|
|
"targets": 8,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
{ "visible": false, "targets": 2 }
|
|
|
|
],
|
|
|
|
"order": [[ groupColumn, 'asc' ]],
|
|
|
|
"displayLength": 25,
|
|
|
|
"drawCallback": function ( settings ) {
|
|
|
|
var api = this.api();
|
|
|
|
var rows = api.rows( {page:'current'} ).nodes();
|
|
|
|
var last=null;
|
|
|
|
|
|
|
|
api.column(groupColumn, {page:'current'} ).data().each( function ( group, i ) {
|
|
|
|
if ( last !== group ) {
|
|
|
|
$(rows).eq( i ).before(
|
|
|
|
'<tr class="group" style="background-color: #f8f8f8; color: #333; text-align:center"><td colspan="8"><b>'+group+'</b></td></tr>'
|
|
|
|
);
|
|
|
|
|
|
|
|
last = group;
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
},
|
|
|
|
"language": {
|
|
|
|
"paginate": {
|
|
|
|
"previous": "Sebelum",
|
|
|
|
@@ -436,6 +455,17 @@ |
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Order by the grouping
|
|
|
|
$('#faulty tbody').on( 'click', 'tr.group', function () {
|
|
|
|
var currentOrder = table.order()[0];
|
|
|
|
if ( currentOrder[0] === groupColumn && currentOrder[1] === 'asc' ) {
|
|
|
|
table.order( [ groupColumn, 'desc' ] ).draw();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
table.order( [ groupColumn, 'asc' ] ).draw();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
function deleteA(cid,kesalahan) {
|
|
|
|
var cid = cid;
|
|
|
|
var kesalahan = kesalahan;
|
|
|
|
@@ -468,7 +498,7 @@ |
|
|
|
closeOnConfirm: true
|
|
|
|
},
|
|
|
|
function(){
|
|
|
|
table.ajax.url("{{ url('api/faulty/list') }}").load();
|
|
|
|
table.ajax.url("{{ url('api/faulty/list') }}/{{ $user->_id}}").load();
|
|
|
|
});
|
|
|
|
}else if(data['status'] == "false"){
|
|
|
|
swal({
|
|
|
|
@@ -480,7 +510,7 @@ |
|
|
|
closeOnConfirm: true
|
|
|
|
},
|
|
|
|
function(){
|
|
|
|
table.ajax.url("{{ url('api/faulty/list') }}").load();
|
|
|
|
table.ajax.url("{{ url('api/faulty/list') }}/{{ $user->_id}}").load();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
@@ -539,61 +569,6 @@ |
|
|
|
$('[data-toggle="tooltip"]').tooltip();
|
|
|
|
});
|
|
|
|
|
|
|
|
// $('#jbkod').change(function(){
|
|
|
|
// if( $(this).val()==""){
|
|
|
|
// $('#showAkta').hide();
|
|
|
|
|
|
|
|
// $("#akkod").prop("checked", false);
|
|
|
|
// $('#akkod').empty();
|
|
|
|
// $('#akkod').append('<option value="">Sila pilih akta/uuk</option>');
|
|
|
|
// }
|
|
|
|
// else {
|
|
|
|
// $("#akkod").empty();
|
|
|
|
// $('#akkod').append('<option value="">Sila pilih akta/uuk</option>');
|
|
|
|
// $.ajax({
|
|
|
|
// type: "GET",
|
|
|
|
// url: "{{ url('api/deed-law') }}"+"/"+$(this).val()+"/list",
|
|
|
|
// success: function(result){
|
|
|
|
// $.each(result.data, function(i, d) {
|
|
|
|
// $('#akkod').append('<option value="' + d.akkod + '">' + d.nama + '</option>');
|
|
|
|
// $('#showAkta').show();
|
|
|
|
// $('#akkod').prop('required',true);
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
|
|
|
|
// $('#jbkod1').change(function(){
|
|
|
|
// if( $(this).val()==""){
|
|
|
|
// $('#showAkta1').hide();
|
|
|
|
|
|
|
|
// $("#akkod1").prop("checked", false);
|
|
|
|
// $('#akkod1').empty();
|
|
|
|
// $('#akkod1').append('<option value="">Sila pilih akta/uuk</option>');
|
|
|
|
// }
|
|
|
|
// else {
|
|
|
|
// $("#akkod1").empty();
|
|
|
|
// $('#akkod1').append('<option value="">Sila pilih akta/uuk</option>');
|
|
|
|
// $.ajax({
|
|
|
|
// type: "GET",
|
|
|
|
// url: "{{ url('api/deed-law') }}"+"/"+$(this).val()+"/list",
|
|
|
|
// success: function(result){
|
|
|
|
// $.each(result.data, function(i, d) {
|
|
|
|
// if(akkod == d.akkod){
|
|
|
|
// $('#akkod1').append('<option value="' + d.akkod + '" selected>' + d.nama + '</option>');
|
|
|
|
// }else{
|
|
|
|
// $('#akkod1').append('<option value="' + d.akkod + '">' + d.nama + '</option>');
|
|
|
|
// }
|
|
|
|
// $('#showAkta1').show();
|
|
|
|
// $('#akkod1').prop('required',true);
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
// Multi Select
|
|
|
|
$(".js-department-multiple").select2();
|
|
|
|
});
|