//compulsory increment to store new compound number, WHILE number is found, keep looping | //compulsory increment to store new compound number, WHILE number is found, keep looping | ||||
do{ | do{ | ||||
dd($num); | |||||
dd($compound); | |||||
(int)$num += 1; | (int)$num += 1; | ||||
//add 0s at the fornt if number is less than 1000 | //add 0s at the fornt if number is less than 1000 |
$compound = Compound::find($request->_id); | $compound = Compound::find($request->_id); | ||||
if(!empty($compound)){ | if(!empty($compound)){ | ||||
$faulty = Faulty::with('DeedLaw','Department')->where('_id',$request->get('seksyen'))->first(); | |||||
$faulty = Faulty::with('DeedLaw','Department')->where('_id',$request->get('seksyen'))->first(); | |||||
if(!empty($faulty) && !empty($faulty->Deedlaw) && !empty($faulty->Department)){ | if(!empty($faulty) && !empty($faulty->Deedlaw) && !empty($faulty->Department)){ | ||||
$tarikh_dikeluarkan = new Carbon($request->tarikh_dikeluarkan); | $tarikh_dikeluarkan = new Carbon($request->tarikh_dikeluarkan); | ||||
$jalan = CodeMukim::where('_id', $request->namaJalan)->first(); | $jalan = CodeMukim::where('_id', $request->namaJalan)->first(); | ||||
if($compound->jenis == 'Parkir'){ | if($compound->jenis == 'Parkir'){ | ||||
$compound->created_at = new Carbon($request->tarikh_dikeluarkan); | $compound->created_at = new Carbon($request->tarikh_dikeluarkan); | ||||
$compound->save(); | $compound->save(); | ||||
return redirect()->back()->with('success_msg', 'Berjaya kemasikini!'); | |||||
// return redirect()->back()->with('success_msg', 'Berjaya kemasikini!'); | |||||
}else if($compound->jenis == 'Pelbagai_KT'){ | }else if($compound->jenis == 'Pelbagai_KT'){ | ||||
$compound->kpd = $request->kpd; | $compound->kpd = $request->kpd; | ||||
$compound->created_c = $tarikh_dikeluarkan->toDateTimeString(); | $compound->created_c = $tarikh_dikeluarkan->toDateTimeString(); | ||||
$compound->save(); | $compound->save(); | ||||
return redirect()->back()->with('success_msg', 'Berjaya kemasikini!'); | |||||
// return redirect()->back()->with('success_msg', 'Berjaya kemasikini!'); | |||||
}else if($compound->jenis == 'Pelbagai_JPB'){ | }else if($compound->jenis == 'Pelbagai_JPB'){ | ||||
$compound->kpd = $request->kpd; | $compound->kpd = $request->kpd; | ||||
$compound->butiran_kesalahan = $request->butiran_kesalahan; | $compound->butiran_kesalahan = $request->butiran_kesalahan; | ||||
$compound->created_c = $tarikh_dikeluarkan->toDateTimeString(); | $compound->created_c = $tarikh_dikeluarkan->toDateTimeString(); | ||||
$compound->save(); | $compound->save(); | ||||
return redirect()->back()->with('success_msg', 'Berjaya kemasikini!'); | |||||
} | |||||
// return redirect()->back()->with('success_msg', 'Berjaya kemasikini!'); | |||||
} | |||||
if($compound->modul == '03') | |||||
{ | |||||
// $this->dispatch(new StoreCompoundEPBT($request->all(), $kpd, $staff->StaffDetail->full_name, $staff->StaffDetail->no_badan, $faulty->nama)); | |||||
return redirect()->back()->with('success_msg', 'Berjaya kemasikini!'); | |||||
} | |||||
return redirect()->back()->with('success_msg', 'Berjaya kemasikini!'); | |||||
}else { | }else { | ||||
return redirect()->back()->withInput()->with('error_msg', '<strong>Tidak Berjaya!</strong> Rekod seksyen kesalahan tidak ditemui!'); | return redirect()->back()->withInput()->with('error_msg', '<strong>Tidak Berjaya!</strong> Rekod seksyen kesalahan tidak ditemui!'); | ||||
} | } |
use Illuminate\Contracts\Queue\ShouldQueue; | use Illuminate\Contracts\Queue\ShouldQueue; | ||||
use Illuminate\Foundation\Bus\Dispatchable; | use Illuminate\Foundation\Bus\Dispatchable; | ||||
use Illuminate\Http\Request; | use Illuminate\Http\Request; | ||||
use App\Jobs\Throwable; | |||||
use App\SiteSetting; | use App\SiteSetting; | ||||
use App\Model\Staff; | use App\Model\Staff; | ||||
use App\Model\StaffDetail; | use App\Model\StaffDetail; | ||||
} | } | ||||
array_push($k, | array_push($k, | ||||
strtoupper($this->kpd), //no kompaun | |||||
$kod_kompaun, //strtoupper($kod_kompaun), //kodKompaun | |||||
$compound->Deedlaw->akkod, //kod akta | |||||
strtoupper($compound->Faulty->nama), //keterangan kesalahan | |||||
$compound->created_at->toDateString(), //tarikh | |||||
$compound->created_at->toTimeString(), //masa | |||||
14, //tempoh | |||||
$compound->nama_jalan .' , '. $compound->nama_taman,//namajalan, namataman | |||||
$roads->JLN_MKKOD, //kodbandar | |||||
$jenis_kompaun, //jenis | |||||
strtoupper($no_akaun), //no akaun (no plat) | |||||
$compound->jumlah_asal_kompaun, //jumlah kompaun | |||||
strtoupper($this->no_badan), //no badan | |||||
'-', //no pembantu penguatkuasa | |||||
strtoupper($this->enf_nama), //nama enforcer | |||||
$now, //time created epbt | |||||
$compound->Faulty->itkod, //kod kesalahan | |||||
strtoupper($nama_pesalah), //nama pesalah | |||||
$compound->nama_jalan, //nama jalan - alamat pesalah | |||||
$compound->nama_taman, //nama taman - alamat pesalah | |||||
'81300', //postcode | |||||
$compound->nama_kawasan, //bandar | |||||
'JOHOR', //negeri | |||||
'B', //notis | |||||
'NULL', //notisamaran | |||||
$coordinate[0], //latitud | |||||
$coordinate[1], //longitud | |||||
'-', //device | |||||
$no_cukai_jalan, //no cukai jalan | |||||
$no_kereta, //no plat | |||||
'NULL', //no kupon | |||||
$jenis_kereta, //jenis kenderaan | |||||
$warna_kenderaan, //warna kenderaan | |||||
$no_petak, //no petak parking | |||||
$no_petak //kod petak | |||||
); | |||||
strtoupper($this->kpd), //no kompaun | |||||
$kod_kompaun, //strtoupper($kod_kompaun), //kodKompaun | |||||
$compound->Deedlaw->akkod, //kod akta | |||||
strtoupper($compound->Faulty->nama), //keterangan kesalahan | |||||
$compound->created_at->toDateString(), //tarikh | |||||
$compound->created_at->toTimeString(), //masa | |||||
14, //tempoh | |||||
$compound->nama_jalan .' , '. $compound->nama_taman,//namajalan, namataman | |||||
$roads->JLN_MKKOD, //kodbandar | |||||
$jenis_kompaun, //jenis | |||||
strtoupper($no_akaun), //no akaun (no plat) | |||||
$compound->jumlah_asal_kompaun, //jumlah kompaun | |||||
strtoupper($this->no_badan), //no badan | |||||
'-', //no pembantu penguatkuasa | |||||
strtoupper($this->enf_nama), //nama enforcer | |||||
$now, //time created epbt | |||||
$compound->Faulty->itkod, //kod kesalahan | |||||
strtoupper($nama_pesalah), //nama pesalah | |||||
$compound->nama_jalan, //nama jalan - alamat pesalah | |||||
$compound->nama_taman, //nama taman - alamat pesalah | |||||
'81300', //postcode | |||||
$compound->nama_kawasan, //bandar | |||||
'JOHOR', //negeri | |||||
'B', //notis | |||||
'NULL', //notisamaran | |||||
$coordinate[0], //latitud | |||||
$coordinate[1], //longitud | |||||
'-', //device | |||||
$no_cukai_jalan, //no cukai jalan | |||||
$no_kereta, //no plat | |||||
'NULL', //no kupon | |||||
$jenis_kereta, //jenis kenderaan | |||||
$warna_kenderaan, //warna kenderaan | |||||
$no_petak, //no petak parking | |||||
$no_petak //kod petak | |||||
); | |||||
$urlQueryString = ''; | $urlQueryString = ''; | ||||
info("Tidak berjaya simpan rekod kompaun ke epbt!"); | info("Tidak berjaya simpan rekod kompaun ke epbt!"); | ||||
} | } | ||||
} catch (Throwable $e) { | |||||
} catch (\Exception $e) { | |||||
report($e); | report($e); | ||||
[{"_id":"5f9b9a453686fc242e2d515f","modul":"03","jenis":"Pelbagai_JPB","kpd":"JPB0001","no_plate":null,"nric":"-","no_daftar_syarikat":"test","nama_syarikat":"test","nama":"test jpb","lesen":"-","tarikh_masa":"30/10/2020 12:44:53 PM","faulty_skter":"SEKSYEN 39 (2)","faulty_name":"MEROSAKKAN ATAU MENYEBABKAN KEROSAKKAN KEPADA MANA-MANA JALAN","enforcer":"000000, Test Enforcer","status":"Belum Bayar","kadar_kompaun":"2000","catatan_dari_admin":null,"updated_by":null,"updates_by":null,"tarikh_bayar":null,"amount_payment":"-","created_at":"2020-10-30 12:44:53","updated_at":"2020-10-30 12:44","index":"New","status_kemaskini":"-","kesalahan":"-","DT_RowIndex":1}] |