$compound = $this->searchCompoundAllWithoutDate($jenis,$modul,$status,$day3, $day7); | $compound = $this->searchCompoundAllWithoutDate($jenis,$modul,$status,$day3, $day7); | ||||
} | } | ||||
// dd($compound->get()); | |||||
if($enforcer == 'All'){ | if($enforcer == 'All'){ | ||||
return $compound; | return $compound; | ||||
}else { | }else { | ||||
$compound = $this->filterCompoundByEnforcer($enforcer,$jenis,$modul,$status,$start_date,$end_date,$day3, $day7); | $compound = $this->filterCompoundByEnforcer($enforcer,$jenis,$modul,$status,$start_date,$end_date,$day3, $day7); | ||||
if($faulty == 'All'){ | if($faulty == 'All'){ | ||||
$compound = $compound->whereIn('jbkod', $department); | $compound = $compound->whereIn('jbkod', $department); | ||||
return $compound; | return $compound; | ||||
// $per_page = ''; | // $per_page = ''; | ||||
// $kpd = ''; | // $kpd = ''; | ||||
// $modul = '02'; | |||||
// $modul = '03'; | |||||
// $status = 'All'; | // $status = 'All'; | ||||
// $jenis = 'Notis_NHN'; | |||||
// $jenis = 'Pelbagai_KT'; | |||||
// if(!empty($request->department)){ | // if(!empty($request->department)){ | ||||
// $department = array ( | // $department = array ( | ||||
// 0 => '5df355f891d6e66b9c5e626d', | // 0 => '5df355f891d6e66b9c5e626d', | ||||
// }else { | // }else { | ||||
// $department = []; | // $department = []; | ||||
// } | // } | ||||
// ["5df355f891d6e66b9c5e626d","5df721c5cde7fd741433c6b2","5df722a24636f4594f4a3c3d","5f17a31795dbfd3320761bfe","5f3b872fea58cb3c1b0e7b8d"] | |||||
// // ["5df355f891d6e66b9c5e626d","5df721c5cde7fd741433c6b2","5df722a24636f4594f4a3c3d","5f17a31795dbfd3320761bfe","5f3b872fea58cb3c1b0e7b8d"] | |||||
// $start_date = ''; | // $start_date = ''; | ||||
// $end_date = ''; | // $end_date = ''; | ||||
// // $start_date = '2020-09-29'; | // // $start_date = '2020-09-29'; | ||||
$nested_data = array(); | $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(); | $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); | info($compound); | ||||
$location = 'public/uploads/cache/'.$file.'.json'; | $location = 'public/uploads/cache/'.$file.'.json'; | ||||
$data = json_decode(file_get_contents(base_path($location), true), true); | $data = json_decode(file_get_contents(base_path($location), true), true); | ||||
dd($location); | |||||
$final_data = array(); | $final_data = array(); | ||||
if($jenis != 'Parkir'){ | if($jenis != 'Parkir'){ | ||||
public function getData(Request $request) | public function getData(Request $request) | ||||
{ | { | ||||
info(json_encode($request)); | |||||
$data = $request->data; | $data = $request->data; | ||||
$filename = time(); | $filename = time(); | ||||
$location = 'public/uploads/cache/'.$filename.'.json'; | $location = 'public/uploads/cache/'.$filename.'.json'; |
var api = this.api(); | var api = this.api(); | ||||
// Output the data for the visible rows to the browser's console | // Output the data for the visible rows to the browser's console | ||||
var data = api.rows( {page:'current'} ).data().toArray(); | var data = api.rows( {page:'current'} ).data().toArray(); | ||||
console.log(data); | |||||
console.log(data); | |||||
if (data && data.length > 0) { | if (data && data.length > 0) { | ||||
for(var i=0;i<data.length;i++){ | for(var i=0;i<data.length;i++){ | ||||
data[i].status_kemaskini = '-'; | data[i].status_kemaskini = '-'; | ||||
data[i].kesalahan = '-'; | data[i].kesalahan = '-'; | ||||
} | |||||
} | |||||
var final_data = JSON.stringify(data); | var final_data = JSON.stringify(data); | ||||
// console.log(final_data); | |||||
console.log(final_data); | |||||
$.ajax({ | $.ajax({ | ||||
type: "POST", | type: "POST", | ||||
url: SITEURL+'/get/datatable', | url: SITEURL+'/get/datatable', |
@section('content') | @section('content') | ||||
<style type="text/css"> | <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; | border: 1px solid #ccc !important; | ||||
height: auto !important; | height: auto !important; | ||||
} | } | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
var SITEURL = '{{URL::to('')}}'; | var SITEURL = '{{URL::to('')}}'; | ||||
var tableP, tablePl; | var tableP, tablePl; | ||||
var queryString1 = '', queryString2 = '', token = "{{ csrf_token() }}"; | var queryString1 = '', queryString2 = '', token = "{{ csrf_token() }}"; | ||||
$('#viewParkir').hide(); $('#link').hide(); | $('#viewParkir').hide(); $('#link').hide(); | ||||
$('#viewPelbagai').hide(); $('#link1').hide(); | $('#viewPelbagai').hide(); $('#link1').hide(); | ||||
</script> | </script> | ||||
<script type="text/javascript"> | <script type="text/javascript"> | ||||
$('#tapis').on('click', function (e) { | $('#tapis').on('click', function (e) { | ||||
e.preventDefault(); | e.preventDefault(); | ||||
var form = $("#filter_form")[0]; | |||||
var form = $("#filter_form")[0]; | |||||
if(form.checkValidity() === false) { | if(form.checkValidity() === false) { | ||||
e.stopPropagation(); | e.stopPropagation(); | ||||
var isValid = form.reportValidity(); | var isValid = form.reportValidity(); | ||||
$('#viewParkir').show(); | $('#viewParkir').show(); | ||||
tableP.ajax.url(SITEURL +'/api/list/compound'+ queryString1).load(); | 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"){ | }else if($('#type_C').val() == "Pelbagai_JPB"){ | ||||
queryString2 = '?'+form_data; | queryString2 = '?'+form_data; | ||||
$('#viewPelbagai').show(); | $('#viewPelbagai').show(); | ||||
$('#viewParkir').hide(); | $('#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; | queryString2 = '?'+form_data; | ||||
$('#viewPelbagai').show(); | $('#viewPelbagai').show(); | ||||
$('#viewParkir').hide(); | $('#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'+ queryString1); | ||||
console.log(SITEURL +'/api/list/compound'+ queryString2); | console.log(SITEURL +'/api/list/compound'+ queryString2); | ||||
} | |||||
} | |||||
return false; | return false; | ||||
}); | }); | ||||
$('#submit').on('click', function (e) { | $('#submit').on('click', function (e) { | ||||
e.preventDefault(); | e.preventDefault(); | ||||
var form = $("#updateSt")[0]; | |||||
var form = $("#updateSt")[0]; | |||||
if(form.checkValidity() === false) { | if(form.checkValidity() === false) { | ||||
e.stopPropagation(); | e.stopPropagation(); | ||||
var isValid = form.reportValidity(); | var isValid = form.reportValidity(); | ||||
alert('Kemaskini status dibatalkan'); | alert('Kemaskini status dibatalkan'); | ||||
$('#kemaskiniC').modal('hide'); | $('#kemaskiniC').modal('hide'); | ||||
} | } | ||||
} | |||||
} | |||||
}); | }); | ||||
function getDetail(id) { | function getDetail(id) { | ||||
}) | }) | ||||
}; | }; | ||||
</script> | </script> | ||||
@endsection | |||||
@endsection |