@@ -140,8 +140,6 @@ class CompoundResourceController extends BaseController | |||
$compound = $this->searchCompoundAllWithoutDate($jenis,$modul,$status,$day3, $day7); | |||
} | |||
// dd($compound->get()); | |||
if($enforcer == 'All'){ | |||
return $compound; | |||
}else { | |||
@@ -154,6 +152,7 @@ class CompoundResourceController extends BaseController | |||
$compound = $this->filterCompoundByEnforcer($enforcer,$jenis,$modul,$status,$start_date,$end_date,$day3, $day7); | |||
if($faulty == 'All'){ | |||
$compound = $compound->whereIn('jbkod', $department); | |||
return $compound; | |||
@@ -246,9 +245,9 @@ class CompoundResourceController extends BaseController | |||
// $per_page = ''; | |||
// $kpd = ''; | |||
// $modul = '02'; | |||
// $modul = '03'; | |||
// $status = 'All'; | |||
// $jenis = 'Notis_NHN'; | |||
// $jenis = 'Pelbagai_KT'; | |||
// if(!empty($request->department)){ | |||
// $department = array ( | |||
// 0 => '5df355f891d6e66b9c5e626d', | |||
@@ -260,7 +259,7 @@ class CompoundResourceController extends BaseController | |||
// }else { | |||
// $department = []; | |||
// } | |||
// ["5df355f891d6e66b9c5e626d","5df721c5cde7fd741433c6b2","5df722a24636f4594f4a3c3d","5f17a31795dbfd3320761bfe","5f3b872fea58cb3c1b0e7b8d"] | |||
// // ["5df355f891d6e66b9c5e626d","5df721c5cde7fd741433c6b2","5df722a24636f4594f4a3c3d","5f17a31795dbfd3320761bfe","5f3b872fea58cb3c1b0e7b8d"] | |||
// $start_date = ''; | |||
// $end_date = ''; | |||
// // $start_date = '2020-09-29'; | |||
@@ -316,6 +315,7 @@ class CompoundResourceController extends BaseController | |||
$nested_data = array(); | |||
$compound = $this->searchCompanyName($enforcer,$faulty,$jenis,$modul,$status,$start_date,$end_date,$department,$plate_no,$kpd,$company_no,$nric,$license,$namaP,$company_name, $day3, $day7)->orderBy('created_at','ASC')->get(); | |||
// dd($compound); | |||
info($compound); | |||
@@ -24,6 +24,8 @@ class ExportCompound extends Controller | |||
$location = 'public/uploads/cache/'.$file.'.json'; | |||
$data = json_decode(file_get_contents(base_path($location), true), true); | |||
dd($location); | |||
$final_data = array(); | |||
if($jenis != 'Parkir'){ | |||
@@ -125,6 +127,7 @@ class ExportCompound extends Controller | |||
public function getData(Request $request) | |||
{ | |||
info(json_encode($request)); | |||
$data = $request->data; | |||
$filename = time(); | |||
$location = 'public/uploads/cache/'.$filename.'.json'; |
@@ -51,14 +51,16 @@ $(document).ready( function () { | |||
var api = this.api(); | |||
// Output the data for the visible rows to the browser's console | |||
var data = api.rows( {page:'current'} ).data().toArray(); | |||
console.log(data); | |||
console.log(data); | |||
if (data && data.length > 0) { | |||
for(var i=0;i<data.length;i++){ | |||
data[i].status_kemaskini = '-'; | |||
data[i].kesalahan = '-'; | |||
} | |||
} | |||
var final_data = JSON.stringify(data); | |||
// console.log(final_data); | |||
console.log(final_data); | |||
$.ajax({ | |||
type: "POST", | |||
url: SITEURL+'/get/datatable', |
@@ -6,7 +6,7 @@ | |||
@section('content') | |||
<style type="text/css"> | |||
select.form-control, select.form-control:focus, select.form-control:hover { | |||
select.form-control, select.form-control:focus, select.form-control:hover { | |||
border: 1px solid #ccc !important; | |||
height: auto !important; | |||
} | |||
@@ -86,7 +86,7 @@ | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -152,7 +152,7 @@ | |||
var SITEURL = '{{URL::to('')}}'; | |||
var tableP, tablePl; | |||
var queryString1 = '', queryString2 = '', token = "{{ csrf_token() }}"; | |||
$('#viewParkir').hide(); $('#link').hide(); | |||
$('#viewPelbagai').hide(); $('#link1').hide(); | |||
</script> | |||
@@ -162,7 +162,7 @@ | |||
<script type="text/javascript"> | |||
$('#tapis').on('click', function (e) { | |||
e.preventDefault(); | |||
var form = $("#filter_form")[0]; | |||
var form = $("#filter_form")[0]; | |||
if(form.checkValidity() === false) { | |||
e.stopPropagation(); | |||
var isValid = form.reportValidity(); | |||
@@ -213,48 +213,31 @@ | |||
$('#viewParkir').show(); | |||
tableP.ajax.url(SITEURL +'/api/list/compound'+ queryString1).load(); | |||
}else if($('#type_C').val() == "Pelbagai"){ | |||
queryString2 = '?'+form_data; | |||
$('#viewPelbagai').show(); | |||
$('#viewParkir').hide(); | |||
tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
}else if($('#type_C').val() == "Pelbagai_JPB"){ | |||
queryString2 = '?'+form_data; | |||
$('#viewPelbagai').show(); | |||
$('#viewParkir').hide(); | |||
tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
}else if($('#type_C').val() == "Pelbagai_KT"){ | |||
tableP2.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
queryString2 = '?'+form_data; | |||
$('#viewPelbagai').show(); | |||
$('#viewParkir').hide(); | |||
tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
}else if($('#type_C').val() == "Pelbagai_PA"){ | |||
queryString2 = '?'+form_data; | |||
$('#viewPelbagai').show(); | |||
$('#viewParkir').hide(); | |||
tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
}else if($('#type_C').val() == "Pelbagai_LESEN"){ | |||
}else if($('#type_C').val() == "Pelbagai_KT"){ | |||
queryString2 = '?'+form_data; | |||
$('#viewPelbagai').show(); | |||
$('#viewParkir').hide(); | |||
tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
tableP2.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load(); | |||
} | |||
console.log(SITEURL +'/api/list/compound'+ queryString1); | |||
console.log(SITEURL +'/api/list/compound'+ queryString2); | |||
} | |||
} | |||
return false; | |||
}); | |||
$('#submit').on('click', function (e) { | |||
e.preventDefault(); | |||
var form = $("#updateSt")[0]; | |||
var form = $("#updateSt")[0]; | |||
if(form.checkValidity() === false) { | |||
e.stopPropagation(); | |||
var isValid = form.reportValidity(); | |||
@@ -298,7 +281,7 @@ | |||
alert('Kemaskini status dibatalkan'); | |||
$('#kemaskiniC').modal('hide'); | |||
} | |||
} | |||
} | |||
}); | |||
function getDetail(id) { | |||
@@ -308,4 +291,4 @@ | |||
}) | |||
}; | |||
</script> | |||
@endsection | |||
@endsection |