root vor 4 Jahren
Ursprung
Commit
c475e889fd

+ 3
- 2
app/Http/Controllers/Api/CompoundResourceController.php Datei anzeigen

// } // }
// // $start_date = ''; // // $start_date = '';
// // $end_date = ''; // // $end_date = '';
// $start_date = '2020-08-29';
// $end_date = '2020-08-29';
// $start_date = '2020-09-29';
// $end_date = '2020-10-01';


// $enforcer = 'All'; // $enforcer = 'All';
// $faulty = 'All'; // $faulty = 'All';
return $html; return $html;
})->addColumn('status_kemaskini', function($row) { })->addColumn('status_kemaskini', function($row) {
$data = ''; $data = '';

if($row['status'] == 'Berbayar'){ if($row['status'] == 'Berbayar'){


if ($row['modul'] == '02') { if ($row['modul'] == '02') {

+ 10
- 2
app/Http/Resources/CompoundResource.php Datei anzeigen

*/ */
public function toArray($request) public function toArray($request)
{ {
if($this->faulty != null && $this->staffdetail != null){ if($this->faulty != null && $this->staffdetail != null){


if($this->modul == '02' && (!empty($this->non)))
{
$kpd = $this->non;
}
else{
$kpd = $this->kpd;
}

return [ return [
'_id' => $this->_id, '_id' => $this->_id,
'modul' => $this->modul, 'modul' => $this->modul,
'jenis' => $this->jenis, 'jenis' => $this->jenis,
'kpd' => $this->kpd,
'kpd' => $kpd,
'no_plate' => $this->no_plate, 'no_plate' => $this->no_plate,
'nric' => $this->identity, 'nric' => $this->identity,
'no_daftar_syarikat' => $this->no_daftar_syarikat, 'no_daftar_syarikat' => $this->no_daftar_syarikat,

+ 7
- 7
public/js/dataPelbagai.js Datei anzeigen

{ "data": "enforcer", "name": "enforcer" }, { "data": "enforcer", "name": "enforcer" },
{ "data": "status_kemaskini","name": "status", orderable: false, searchable: false }, { "data": "status_kemaskini","name": "status", orderable: false, searchable: false },
{ "data": "_id", "name": "action", orderable: false, searchable: false }, { "data": "_id", "name": "action", orderable: false, searchable: false },
],
],
"columnDefs": [ "columnDefs": [
{
{
"render": function ( data, type, row, meta ) { "render": function ( data, type, row, meta ) {
if (data != '') { if (data != '') {
return '<label class="label label-success">'+data+'</label>&nbsp;'+(meta.row+1); return '<label class="label label-success">'+data+'</label>&nbsp;'+(meta.row+1);
{ {
"render": function ( data, type, row ) { "render": function ( data, type, row ) {
return '<div style="text-align:center"><a target="_blank" href="'+SITEURL+'/main/compound/'+row.kpd+'/index" class="btn btn-info btn-sm waves-effect waves-light">TERUSKAN</a>' return '<div style="text-align:center"><a target="_blank" href="'+SITEURL+'/main/compound/'+row.kpd+'/index" class="btn btn-info btn-sm waves-effect waves-light">TERUSKAN</a>'
+'<button onclick="getDetail(\''+data+'\')" class="btn btn-primary btn-sm waves-effect waves-light">KEMASKINI STATUS</button></div>';
+'<button onclick="getDetail(\''+data+'\')" class="btn btn-primary btn-sm waves-effect waves-light">KEMASKINI STATUS</button></div>';
}, },
"targets": 12, "targets": 12,
},
},
], ],
"drawCallback": function(settings) { "drawCallback": function(settings) {
var api = this.api(); var api = this.api();
} }
}); });
} }
},
},
"language": { "language": {
"paginate": { "paginate": {
"previous": "Sebelum", "previous": "Sebelum",
"info": "Tunjuk _START_ hingga _END_ daripada _TOTAL_ entri", "info": "Tunjuk _START_ hingga _END_ daripada _TOTAL_ entri",
"sSearch": "Cari:", "sSearch": "Cari:",
} }
});
});
});
});

Laden…
Abbrechen
Speichern