root 4 年前
父节点
当前提交
8bf8d79f7a

+ 195
- 78
app/Http/Controllers/Api/CompoundResourceController.php 查看文件

* *
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function create()
public function generateCompoundNumber($jenis, $tag)
{ {
//
//check if theres no 001, start fresh with 0001
if (empty(Compound::where('jenis', $jenis)->where('kpd', $tag.'0001')->first())) {

$kpd = $tag.'0001';

}
else{

//check the lastest compound number stored in dbase filtered by jenis
$compound = Compound::where('jenis', $jenis)->withTrashed()->latest()->first();
//sanitize compound number to return only integer
$kpd = filter_var($compound['kpd'], FILTER_SANITIZE_NUMBER_INT);

//compulsory increment to store new compound number, WHILE number is found, keep looping
do{

(int)$kpd += 1;

//add 0s at the fornt if number is less than 1000
if ((strlen((string) $kpd)) == 1) {

$kpd = '000'.$kpd;

}elseif ((strlen((string)$kpd)) == 2){

$kpd = '00'.$kpd;

}elseif ((strlen((string)$kpd )) == 3) {

$kpd = '0'.$kpd;
}

}while(!empty(Compound::where('jenis', $jenis)->where('kpd', $tag.$kpd)->first()));
}

return $kpd;
} }


/** /**
$no_siri = ''; $no_siri = '';
$data = array(); $data = array();


$faulty = Faulty::where('_id',$request->get('seksyen'))->first();

if($request->jenis == 'Parkir') if($request->jenis == 'Parkir')
{ {


$faulty = Faulty::where('_id',$request->get('seksyen'))->first();
if(!empty($faulty)){ if(!empty($faulty)){
$countKPD = $this->compound->withTrashed()->count(); $countKPD = $this->compound->withTrashed()->count();
//only for compound parkir //only for compound parkir
$compoundData = [ $compoundData = [
'jenis' => 'Parkir', 'jenis' => 'Parkir',
'kpd' => $kpd,
'kpd' => 'KPD'.$kpd,
'nama' => '-', 'nama' => '-',
'identity' => '-', 'identity' => '-',
'alamat' => '-', 'alamat' => '-',
$saved = $file->compound()->create($compoundData); $saved = $file->compound()->create($compoundData);
} }
}elseif(($request->jenis == 'Pelbagai_KT') || ($request->jenis == 'Pelbagai_JPB') || ($request->jenis == 'Pelbagai_PA') ||
($request->jenis == 'Pelbagai_LESEN')){
}elseif(($request->jenis == 'Pelbagai_KT') || ($request->jenis == 'Pelbagai_JPB') || ($request->jenis == 'Pelbagai_PA') || ($request->jenis == 'Pelbagai_LESEN')){


$kpd = $request->kpd; $kpd = $request->kpd;


if (!empty($compound)) { if (!empty($compound)) {


if(!($compound->modul == '03'))
$saved = '';

if($compound->modul != '03'))
{ {
if($request->jenis == 'Pelbagai_KT'){ if($request->jenis == 'Pelbagai_KT'){
else else
{ {
return $this->sendResponse('', 'Kompaun ini telah dikeluarkan!'); return $this->sendResponse('', 'Kompaun ini telah dikeluarkan!');
}
}
}
}


if($saved){
// $compound = Compound::with('ConfidentialFile')->where('kpd',$kpd)->first();
// if(!empty($compound)){
dispatch(new UpdateCompoundPrice($kpd));
// $tawaran = '';
// if($compound->jumlah_kemaskini_kompaun != ''){
// $tawaran = $compound->jumlah_kemaskini_kompaun;
// }else{
// $tawaran = $compound->jumlah_asal_kompaun;
// }
$this->dispatch(new StoreCompound($request->all(), $kpd, $staff->_id, $no_siri));
array_push($data, array('kpd' => $kpd));
// $this->dispatch(new StoreCompoundEPBT($request->all(), $kpd, $staff->StaffDetail->full_name, $staff->StaffDetail->no_badan, $faulty->nama));
if($saved){
// $compound = Compound::with('ConfidentialFile')->where('kpd',$kpd)->first();
// if(!empty($compound)){
dispatch(new UpdateCompoundPrice($kpd));
// $tawaran = '';
// if($compound->jumlah_kemaskini_kompaun != ''){
// $tawaran = $compound->jumlah_kemaskini_kompaun;
// }else{
// $tawaran = $compound->jumlah_asal_kompaun;
// }
$this->dispatch(new StoreCompound($request->all(), $kpd, $staff->_id, $no_siri));
array_push($data, array('kpd' => $kpd));

$this->dispatch(new StoreCompoundEPBT($request->all(), $kpd, $staff->StaffDetail->full_name, $staff->StaffDetail->no_badan, $faulty->nama));

return $this->sendResponse($data, 'Berjaya simpan rekod kompaun!');
// }
}
}


return $this->sendResponse($data, 'Berjaya simpan rekod kompaun!');
// }
}
return $this->sendResponse('', 'Kompaun ini tidak dijumpai!');
}
} }
} }




/*********************************************
| Store a newly created notice
*********************************************/
/**
*
* Store a newly created notice
*
**/
public function storeNotice(Request $request) public function storeNotice(Request $request)
{ {
$staff = Staff::with('StaffDetail')->where('api_token',$request->api_token)->first(); $staff = Staff::with('StaffDetail')->where('api_token',$request->api_token)->first();

if(empty($staff)){ if(empty($staff)){

return $this->sendError('Invalid', 'Staff not existed'); return $this->sendError('Invalid', 'Staff not existed');

}else { }else {

$faulty = Faulty::where('_id',$request->get('seksyen'))->first(); $faulty = Faulty::where('_id',$request->get('seksyen'))->first();

if(!empty($faulty)){ if(!empty($faulty)){


$data = array(); $data = array();
$countKPD = $this->compound->withTrashed()->count();


do {
$countKPD = $countKPD + 1;
} while (Compound::where("kpd", "=", 'KP'.$countKPD)->first() instanceof Compound);
$kpd = '';
$no_siri ='';


$kpd = 'KP'.$countKPD;
$no_siri = date('yn').'-'.$countKPD;
// $countKPD = $this->compound->withTrashed()->count(); //for parking numbering


$fileData = [
'no_siri' => $no_siri,
];
// do {
// $kpd = $kpd + 1;
// } while (Compound::where("kpd", "=", 'KP'.$countKPD)->first() instanceof Compound);

// $kpd = 'KP'.$countKPD;
// $no_siri = date('yn').'-'.$countKPD;

// $fileData = [
// 'no_siri' => $no_siri,
// ];


if($request->jenis == 'Parkir'){ if($request->jenis == 'Parkir'){

//for compound numbering
$countKPD = $this->compound->withTrashed()->count();

$no_siri = date('yn').'-'.$countKPD.'-0';
$compoundData = [ $compoundData = [
'jenis' => 'Parkir', 'jenis' => 'Parkir',
'kpd' => $kpd,
'kpd' => 'KPD'.$countKPD,
'nama' => '-', 'nama' => '-',
'identity' => '-', 'identity' => '-',
'alamat' => '-', 'alamat' => '-',
"notis_created" => Carbon::now()->toDateTimeString(), "notis_created" => Carbon::now()->toDateTimeString(),
]; ];
}elseif($request->jenis == 'Pelbagai_KT'){ }elseif($request->jenis == 'Pelbagai_KT'){

$kpd = $this->generateCompoundNumber($request->jenis, 'KT');

$no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-1';

$compoundData = [ $compoundData = [
'jenis' => $request->jenis, 'jenis' => $request->jenis,
'kpd' => $kpd,
'kpd' => 'KT'.$kpd,
'nama' => $request->namaP, 'nama' => $request->namaP,
'identity' => $request->noIc, 'identity' => $request->noIc,
'nama_syarikat' => $request->namaS, 'nama_syarikat' => $request->namaS,
"notis_created" => Carbon::now()->toDateTimeString(), "notis_created" => Carbon::now()->toDateTimeString(),
]; ];
}elseif($request->jenis == 'Pelbagai_JPB'){ }elseif($request->jenis == 'Pelbagai_JPB'){

$kpd = $this->generateCompoundNumber($request->jenis, 'JPB');

$no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-2';

$compoundData = [ $compoundData = [
'jenis' => $request->jenis, 'jenis' => $request->jenis,
'kpd' => $kpd,
'kpd' => 'JPB'.$kpd,
'nama' => $request->namaP, 'nama' => $request->namaP,
'identity' => $request->noIc, 'identity' => $request->noIc,
'nama_syarikat' => $request->namaS, 'nama_syarikat' => $request->namaS,
]; ];
} }
elseif($request->jenis == 'Pelbagai_LESEN'){ elseif($request->jenis == 'Pelbagai_LESEN'){

$kpd = $this->generateCompoundNumber($request->jenis, 'NHN');

$no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-3';

$compoundData = [ $compoundData = [
'jenis' => $request->jenis, 'jenis' => $request->jenis,
'kpd' => $kpd,
'kpd' => 'NPI'.$kpd,
'nama' => $request->namaP, 'nama' => $request->namaP,
'identity' => $request->noIc, 'identity' => $request->noIc,
'nama_syarikat' => $request->namaS, 'nama_syarikat' => $request->namaS,
]; ];
} }
elseif($request->jenis == 'Pelbagai_PA'){ elseif($request->jenis == 'Pelbagai_PA'){

$kpd = $this->generateCompoundNumber($request->jenis, 'PA');

$no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-4';

$compoundData = [ $compoundData = [
'jenis' => $request->jenis, 'jenis' => $request->jenis,
'kpd' => $kpd,
'kpd' => 'PA'.$kpd,
'nama' => $request->namaP, 'nama' => $request->namaP,
'identity' => $request->noIc, 'identity' => $request->noIc,
'nama_syarikat' => $request->namaS, 'nama_syarikat' => $request->namaS,
]; ];
} }


$fileData = [
'no_siri' => $no_siri,
];


$file = ConfidentialFile::create($fileData); $file = ConfidentialFile::create($fileData);
$saved = $file->compound()->create($compoundData); $saved = $file->compound()->create($compoundData);
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function storeCompound(Request $request)
public function storeNewCompound(Request $request)
{ {


$staff = Staff::with('StaffDetail')->where('api_token',$request->api_token)->first(); $staff = Staff::with('StaffDetail')->where('api_token',$request->api_token)->first();
$data = array(); $data = array();


$faulty = Faulty::where('_id',$request->get('seksyen'))->first(); $faulty = Faulty::where('_id',$request->get('seksyen'))->first();
if(!empty($faulty)){
if(!empty($faulty)){

$kpd = '';
$no_siri ='';
$countKPD = $this->compound->withTrashed()->count();
// $countKPD = $this->compound->withTrashed()->count();


do {
$countKPD = $countKPD + 1;
} while (Compound::where("kpd", "=", 'KP'.$countKPD)->first() instanceof Compound);
// do {
// $countKPD = $countKPD + 1;
// } while (Compound::where("kpd", "=", 'KP'.$countKPD)->first() instanceof Compound);


$kpd = 'KP'.$countKPD;
$no_siri = date('yn').'-'.$countKPD;
// $kpd = $countKPD;
// $no_siri = date('yn').'-'.$countKPD;


$fileData = [
'no_siri' => $no_siri,
];
// $fileData = [
// 'no_siri' => $no_siri,
// ];


if($request->jenis == 'Parkir') if($request->jenis == 'Parkir')
{ {
//for compound numbering
$countKPD = $this->compound->withTrashed()->count();

$no_siri = date('yn').'-'.$countKPD.'-0';


//only for compound parkir //only for compound parkir
$compoundData = [ $compoundData = [
'jenis' => 'Parkir', 'jenis' => 'Parkir',
'kpd' => $kpd,
'kpd' => 'KPD'.$countKPD,
'nama' => '-', 'nama' => '-',
'identity' => '-', 'identity' => '-',
'alamat' => '-', 'alamat' => '-',
]; ];
} }
if ($request->jenis == 'Pelbagai_KT') { if ($request->jenis == 'Pelbagai_KT') {

$kpd = $this->generateCompoundNumber($request->jenis, 'KT');

$no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-1';

$compoundData = [ $compoundData = [
'jenis' => $request->jenis, 'jenis' => $request->jenis,
'kpd' => $kpd,
'kpd' => 'KT'.$kpd,
'nama' => $request->namaP, 'nama' => $request->namaP,
'identity' => $request->noIc, 'identity' => $request->noIc,
'nama_syarikat' => $request->namaS, 'nama_syarikat' => $request->namaS,
"no_telefon" => $request->tel, "no_telefon" => $request->tel,
"no_akaun_lesen" => $request->lesen, "no_akaun_lesen" => $request->lesen,
"maklumat_tambahan" => '-', "maklumat_tambahan" => '-',
"tindakan" => $request->tindakan,
"tempoh" => $request->tempoh,
"tindakan" => '',
"tempoh" => '',
"notis_created" => Carbon::now()->toDateTimeString(), "notis_created" => Carbon::now()->toDateTimeString(),
]; ];
} }
elseif ($request->jenis == 'Pelbagai_JPB') { elseif ($request->jenis == 'Pelbagai_JPB') {

$kpd = $this->generateCompoundNumber($request->jenis, 'JPB');

$no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-2';

$compoundData = [ $compoundData = [
'jenis' => $request->jenis, 'jenis' => $request->jenis,
'kpd' => $kpd,
'kpd' => 'JPB'.$kpd,
'nama' => $request->namaP, 'nama' => $request->namaP,
'identity' => $request->noIc, 'identity' => $request->noIc,
'nama_syarikat' => $request->namaS, 'nama_syarikat' => $request->namaS,
"no_telefon" => $request->tel, "no_telefon" => $request->tel,
"no_akaun_lesen" => $request->lesen, "no_akaun_lesen" => $request->lesen,
"maklumat_tambahan" => '-', "maklumat_tambahan" => '-',
"tindakan" => $request->tindakan,
"tempoh" => $request->tempoh,
"tindakan" => '',
"tempoh" => '',
"notis_created" => Carbon::now()->toDateTimeString(), "notis_created" => Carbon::now()->toDateTimeString(),
]; ];
} }
elseif ($request->jenis == 'Pelbagai_LESEN') { elseif ($request->jenis == 'Pelbagai_LESEN') {

$kpd = $this->generateCompoundNumber($request->jenis, 'HN');

$no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-3';

$compoundData = [ $compoundData = [
'jenis' => $request->jenis, 'jenis' => $request->jenis,
'kpd' => $kpd,
'kpd' => 'NHN'.$kpd,
'nama' => $request->namaP, 'nama' => $request->namaP,
'identity' => $request->noIc, 'identity' => $request->noIc,
'nama_syarikat' => $request->namaS, 'nama_syarikat' => $request->namaS,
]; ];
} }
else if($request->jenis == 'Pelbagai_PA'){ else if($request->jenis == 'Pelbagai_PA'){

$kpd = $this->generateCompoundNumber($request->jenis, 'PA');

$no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT).'-4';

$compoundData = [ $compoundData = [
'jenis' => $request->jenis, 'jenis' => $request->jenis,
'kpd' => $kpd,
'kpd' => 'PA'.$kpd,
'nama' => $request->namaP, 'nama' => $request->namaP,
'identity' => $request->noIc, 'identity' => $request->noIc,
'nama_syarikat' => $request->namaS, 'nama_syarikat' => $request->namaS,
"notis_created" => Carbon::now()->toDateTimeString(), "notis_created" => Carbon::now()->toDateTimeString(),
]; ];
} }

$fileData = [
'no_siri' => $no_siri,
];
$file = ConfidentialFile::create($fileData); $file = ConfidentialFile::create($fileData);
$saved = $file->compound()->create($compoundData); $saved = $file->compound()->create($compoundData);
}


if($saved){
// $compound = Compound::with('ConfidentialFile')->where('kpd',$kpd)->first();
// if(!empty($compound)){
if($saved){
// $compound = Compound::with('ConfidentialFile')->where('kpd',$kpd)->first();
// if(!empty($compound)){

dispatch(new UpdateCompoundPrice($kpd)); dispatch(new UpdateCompoundPrice($kpd));
// $tawaran = '';
// if($compound->jumlah_kemaskini_kompaun != ''){
// $tawaran = $compound->jumlah_kemaskini_kompaun;
// }else{
// $tawaran = $compound->jumlah_asal_kompaun;
// }

// $tawaran = '';
// if($compound->jumlah_kemaskini_kompaun != ''){
// $tawaran = $compound->jumlah_kemaskini_kompaun;
// }else{
// $tawaran = $compound->jumlah_asal_kompaun;
// }

$this->dispatch(new StoreCompound($request->all(), $kpd, $staff->_id, $no_siri)); $this->dispatch(new StoreCompound($request->all(), $kpd, $staff->_id, $no_siri));
array_push($data, array('kpd' => $kpd)); array_push($data, array('kpd' => $kpd));
// $this->dispatch(new StoreCompoundEPBT($request->all(), $kpd, $staff->StaffDetail->full_name, $staff->StaffDetail->no_badan, $faulty->nama));
$this->dispatch(new StoreCompoundEPBT($request->all(), $kpd, $staff->StaffDetail->full_name, $staff->StaffDetail->no_badan, $faulty->nama));


return $this->sendResponse($data, 'Berjaya simpan rekod kompaun!'); return $this->sendResponse($data, 'Berjaya simpan rekod kompaun!');
// }
}
}
}
return $this->sendResponse('Tidak Berjaya!', 'Kesalahan tidak dijumpai!');
} }
} }



+ 14
- 0
app/Http/Controllers/Api/LoginController.php 查看文件

use App\Model\Module\Department; use App\Model\Module\Department;
use App\Model\User; use App\Model\User;
use App\Model\UserDetail; use App\Model\UserDetail;
use App\Model\Module\Compound;
use App\Jobs\StoreCompound;
use App\Jobs\StoreNotice;
class LoginController extends BaseController class LoginController extends BaseController
{ {
// } // }
// } // }
public function testing(Request $request)
{
$test = '02399'; //filter_var('000099', FILTER_SANITIZE_NUMBER_INT);
(int)$test += 1;
dd($test);
}
} }

+ 65
- 0
app/Http/Controllers/Main/TaskController.php 查看文件

return redirect()->back()->withInput()->with('error_msg','<strong>Tidak Berjaya!</strong> Kompaun ini sudah berada di dalam kategori modul '.$roles->name); return redirect()->back()->withInput()->with('error_msg','<strong>Tidak Berjaya!</strong> Kompaun ini sudah berada di dalam kategori modul '.$roles->name);
}else{ }else{
// if($request->categori_modul == '03' && $compound->modul == '02')
// {
// $this->dispatch(new StoreCompoundEPBT($request->all(), $compound->kpd, $user->StaffDetail->full_name, $user->StaffDetail->no_badan, $compound->seksyen_kesalahan));
// }
$reg_id = array(); $reg_id = array();
if(!empty($roles->staff_detail_ids)){ if(!empty($roles->staff_detail_ids)){
foreach($roles->staff_detail_ids as $s){ foreach($roles->staff_detail_ids as $s){
} }
} }
public function requestUpdateToCourt(Request $request)
{
$id = Auth::guard('sadmin')->id();
$user = Staff::with('StaffDetail')->find($id);
$compound = Compound::with('ConfidentialFile')->where('kpd',$request->kpd)->first();
$file = ConfidentialFile::where('no_siri',$compound->ConfidentialFile->no_siri)->first();
$jbkod = $compound->jbkod;
$now = Carbon::now();
$gDate = $now->format('F Y');
if($request->dashboard == "true"){
if(!isset($compound->tarikh_mahkamah) )
{
$reg_id = array();
if(!empty($roles->staff_detail_ids)){
foreach($roles->staff_detail_ids as $s){
$staff = Staff::with(['StaffDetail' => function($q) use($jbkod){
$q->where('jbkod', $jbkod);
}])->where('_id', $s)->first();
if(!empty($staff->StaffDetail)){
if($staff->token_firebase != ''){
$reg_id[] = $staff->token_firebase;
}
}
}
}
$compound->tarikh_mahkamah = $request->start_date;
$compound->save();
$historyData = [
'tarikh_kumpulan' => $gDate,
];
$subHistory = [
'no_siri' => $compound->ConfidentialFile->no_siri,
'tajuk' => "Serahan Tarikh Mahkamah",
'huraian' => $compound->kpd. " diserahkan ke mahkamah pada ".$request->start_date,
];
$groupByDate = History::where('tarikh_kumpulan', $gDate)->first();
if(!empty($groupByDate)){
$groupByDate->subhistory()->create($subHistory);
$compound->ConfidentialFile->history()->attach($groupByDate);
}else{
$history = History::create($historyData);
$history->subhistory()->create($subHistory);
$compound->ConfidentialFile->history()->attach($history);
}
return redirect()->back()->with('success_msg', 'Berjaya kemaskini tarikh serahan ke mahkamah untuk kompaun ' . $compound->kpd);
}
else{
return redirect()->back()->withInput()->with('error_msg','<strong>Tidak Berjaya!</strong> Pindahan tarikh ke mahkamah telah dilakukan untuk kompaun ini!');
}
}
}
public function requestViewAllPdf($kpd) { public function requestViewAllPdf($kpd) {
$ready_view_pdf = false; $ready_view_pdf = false;

+ 139
- 240
app/Jobs/StoreCompoundEPBT.php 查看文件

use App\Model\Module\SubHistory; use App\Model\Module\SubHistory;
use App\Model\Module\Memo; use App\Model\Module\Memo;
use App\Model\Module\Attachment; use App\Model\Module\Attachment;
use App\Model\Module\CodeMukim;


use App\Jobs\UpdateCompoundPrice; use App\Jobs\UpdateCompoundPrice;


{ {
// $faulty = Faulty::with('DeedLaw', 'Department')->where('_id', $this->seksyen_kesalahan)->first(); // $faulty = Faulty::with('DeedLaw', 'Department')->where('_id', $this->seksyen_kesalahan)->first();
$compound = Compound::with('Department','DeedLaw','Faulty')->where('kpd',$this->kpd)->first(); $compound = Compound::with('Department','DeedLaw','Faulty')->where('kpd',$this->kpd)->first();
// $compound = Compound::with('Department','DeedLaw','Faulty')->where('kpd', 'KP43932')->first();

$now = Carbon::now()->toDateTimeString();
$coordinate = explode(" , ",$compound->latlong);


//get ePBT MBIP faulty lists //get ePBT MBIP faulty lists
$client = new \GuzzleHttp\Client(); $client = new \GuzzleHttp\Client();
$result = $client->request('GET', 'http://218.208.81.239:81/appsepbtkompaun_ws/getinfokompaun/infokompaun?infokompaun[]=352405067769401&infokompaun[]=ekpn_kesalahan');
$response = json_decode($result->getBody()->getContents());
$now = Carbon::now()->toDateTimeString();
$epbt_faulty_ = $client->request('GET', 'http://218.208.81.239:81/appsepbtkompaun_ws/getinfokompaun/infokompaun?infokompaun[]=352405067769401&infokompaun[]=ekpn_kesalahan');
$epbt_faulty = json_decode($epbt_faulty_->getBody()->getContents());
if(!empty($response))
{
if(!empty($epbt_faulty)){

$k = []; $k = [];
foreach($response as $key => $r)
{
$kod_kompaun = '-';
$jenis_kompaun = 'kt';
$no_akaun = '-';
$nama_pesalah = '-';
$no_kereta = '-';
$jenis_kereta = '-';
$no_petak = '-';
$no_cukai_jalan = '-';
$warna_kenderaan = '-';
//search if epbt kesalahan match db kesalahan
$faulty = $compound->Faulty->nama;
$epbt_faulty = array_pluck($epbt_faulty, "kesalahan");
$epbt_faulty = array_where($epbt_faulty, function($key, $value) use ($faulty){
if($key == $faulty){
return true;
}
return false;
});

if($epbt_faulty){

info($epbt_faulty[0]->kesalahan);
//if($this->kesalahan == $r->kesalahan)
if($this->kesalahan == $this->kesalahan)
$roads = CodeMukim::where('MKM_MNAMA', $compound['nama_kawasan'])->first();
if($compound->jenis == 'Parkir')
{ {
if($compound->jenis == 'Parkir')
{
array_push($k,
$this->kpd, //no kompaun
'KPD', //jenis kompaun
$r->fk_akta, //kod akta
strtoupper($r->kesalahan), //keterangan kesalahan
$compound->created_at->toDateString(), //tarikh
$compound->created_at->toTimeString(), //masa
14, //tempoh
$compound->nama_jalan .' , '. $compound->nama_taman,//namajalan, namataman
10,//kodbandar
'K',//jenis
strtoupper($compound->plate_no), //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
$r->kod, //kod kesalahan
$compound->nama, //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
'NULL', //latitud
'NULL', //longitud
'NULL', //device
strtoupper($compound->no_cukai_jalan), //mo cukai jalan
strtoupper($compound->plate_no), //no plat
'NULL', //no kupon
strtoupper($compound->jenis_kenderaan), //jenis kenderaan
strtoupper($compound->warna_kenderaan), //warna kenderaan
strtoupper($compound->no_parking), //no petak parking
'NULL' //kod petak
$kod_kompaun = 'KPD';
$jenis_kompaun = 'K';
$no_akaun = $compound->no_plate;
$nama_pesalah = $compound->no_plate;
$no_kereta = $compound->no_plate;
$jenis_kereta = $compo->model_kenderaan;
$no_petak = $compound->no_parking;
$no_cukai_jalan = $compound->no_cukai_jalan;
$warna_kenderaan= $compound->warna_kenderaan;


);
}
elseif($compound->jenis == 'Pelbagai_KT')
{
array_push($k,
$this->kpd, //no kompaun
'KPD', //jenis kompaun
$r->fk_akta, //kod akta
strtoupper($r->kesalahan), //keterangan kesalahan
$compound->created_at->toDateString(), //tarikh
$compound->created_at->toTimeString(), //masa
14, //tempoh
$compound->nama_jalan .' , '. $compound->nama_taman,//namajalan, namataman
10,//kodbandar
'K',//jenis
strtoupper($compound->plate_no), //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
$r->kod, //kod kesalahan
$compound->nama, //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
'NULL', //latitud
'NULL', //longitud
'NULL', //device
strtoupper($compound->no_cukai_jalan), //mo cukai jalan
strtoupper($compound->plate_no), //no plat
'NULL', //no kupon
strtoupper($compound->jenis_kenderaan), //jenis kenderaan
strtoupper($compound->warna_kenderaan), //warna kenderaan
strtoupper($compound->no_parking), //no petak parking
'NULL' //kod petak
}
elseif($compound->jenis == 'Pelbagai_KT'){


);
}
elseif($compound->jenis == 'Pelbagai_JPB')
{
array_push($k,
$this->kpd, //no kompaun
'KPD', //jenis kompaun
$r->fk_akta, //kod akta
strtoupper($r->kesalahan), //keterangan kesalahan
$compound->created_at->toDateString(), //tarikh
$compound->created_at->toTimeString(), //masa
14, //tempoh
$compound->nama_jalan .' , '. $compound->nama_taman,//namajalan, namataman
10,//kodbandar
'K',//jenis
strtoupper($compound->plate_no), //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
$r->kod, //kod kesalahan
$compound->nama, //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
'NULL', //latitud
'NULL', //longitud
'NULL', //device
strtoupper($compound->no_cukai_jalan), //mo cukai jalan
strtoupper($compound->plate_no), //no plat
'NULL', //no kupon
strtoupper($compound->jenis_kenderaan), //jenis kenderaan
strtoupper($compound->warna_kenderaan), //warna kenderaan
strtoupper($compound->no_parking), //no petak parking
'NULL' //kod petak
$kod_kompaun = 'kt';
$jenis_kompaun = 'P';
$no_akaun = $compound->no_akaun_lesen;
$nama_pesalah = $compound->nama;
}
else if($compound->jenis == 'Pelbagai_JPB'){


);
}
elseif($compound->jenis == 'Pelbagai_PA')
{
array_push($k,
$this->kpd, //no kompaun
'KPD', //jenis kompaun
$r->fk_akta, //kod akta
strtoupper($r->kesalahan), //keterangan kesalahan
$compound->created_at->toDateString(), //tarikh
$compound->created_at->toTimeString(), //masa
14, //tempoh
$compound->nama_jalan .' , '. $compound->nama_taman,//namajalan, namataman
10,//kodbandar
'K',//jenis
strtoupper($compound->plate_no), //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
$r->kod, //kod kesalahan
$compound->nama, //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
'NULL', //latitud
'NULL', //longitud
'NULL', //device
strtoupper($compound->no_cukai_jalan), //mo cukai jalan
strtoupper($compound->plate_no), //no plat
'NULL', //no kupon
strtoupper($compound->jenis_kenderaan), //jenis kenderaan
strtoupper($compound->warna_kenderaan), //warna kenderaan
strtoupper($compound->no_parking), //no petak parking
'NULL' //kod petak
$kod_kompaun = 'jpb';
$jenis_kompaun = 'P';
$no_akaun = $compound->no_akaun_lesen;
$nama_pesalah = $compound->nama;
}
elseif ($compound->jenis == 'Pelbagai_LESEN'){


);
$kod_kompaun = 'KT1';
$jenis_kompaun = 'P';
$no_akaun = $compound->no_akaun_lesen;
$nama_pesalah = $compound->nama;
}

array_push($k,
strtoupper($this->kpd), //no kompaun
'TES' //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 = '';

for ($i=0; $i < count($k); $i++){

if($i == 0)
{
$urlQueryString = $urlQueryString . '?';
} }
elseif($compound->jenis == 'Pelbagai_LESEN')
else
{ {
array_push($k,
$this->kpd, //no kompaun
'KPD', //jenis kompaun
$r->fk_akta, //kod akta
strtoupper($r->kesalahan), //keterangan kesalahan
$compound->created_at->toDateString(), //tarikh
$compound->created_at->toTimeString(), //masa
14, //tempoh
$compound->nama_jalan .' , '. $compound->nama_taman,//namajalan, namataman
10,//kodbandar
'K',//jenis
strtoupper($compound->plate_no), //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
$r->kod, //kod kesalahan
$compound->nama, //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
'NULL', //latitud
'NULL', //longitud
'NULL', //device
strtoupper($compound->no_cukai_jalan), //mo cukai jalan
strtoupper($compound->plate_no), //no plat
'NULL', //no kupon
strtoupper($compound->jenis_kenderaan), //jenis kenderaan
strtoupper($compound->warna_kenderaan), //warna kenderaan
strtoupper($compound->no_parking), //no petak parking
'NULL' //kod petak

);
$urlQueryString = $urlQueryString . '&';
} }


$urlQueryString = '';
$urlQueryString = $urlQueryString . 'KompaunDetails[]=' . $k[$i];
}

try {
$client = new \GuzzleHttp\Client();


for ($i=0; $i < count($k); $i++) {
//121.120.88.133:8077 ip testing
$result = $client->request('GET', 'http://218.208.81.239:81/appsepbtkompaun_ws/registerkompaun/registerkompaunDetails' . $urlQueryString);


if($i == 0)
{
$urlQueryString = $urlQueryString . '?';
}
else
{
$urlQueryString = $urlQueryString . '&';
}
$response = json_decode($result->getBody());


$urlQueryString = $urlQueryString . 'KompaunDetails[]=' . $k[$i];
// bla/bla/my/registerkompaunDetails?KompaunDetails[]=KP45&KompaunDetails[]=ayu
if ($response->status) {
info("Berjaya simpan rekod kompaun ke epbt!");
}
else{
info("Tidak berjaya simpan rekod kompaun ke epbt!");
} }


try {
$client = new \GuzzleHttp\Client();
$result = $client->request('GET', 'http://218.208.81.239:81/appsepbtkompaun_ws/registerkompaun/registerkompaunDetails' . $urlQueryString);
} catch (Throwable $e) {
report($e);
} catch (Throwable $e) {


return true;
}
report($e);

info($e);


// return true;
} }
else
{
Log::info("Rekod kesalahan tidak dijumpai!");
}
}
}
else
{
Log::info("Gagal untuk mendapatkan senarai kesalahan ePBT MBIP!");
}
else{
info("Kesalahan tiada di dalam epbt");
}
} }
else{


info("Gagal untuk mendapatkan senarai kesalahan ePBT MBIP!");
}
} }

} }

+ 2
- 2
resources/views/include/horizontal-menu.blade.php 查看文件

<li class="pcoded-hasmenu {{ Request::is('main/compound','main/compound/investigation','main/compound/notice','main/compound/confiscated','main/compound/collapsed','main/compound/completed','main/compound/*/index','main/compound/*/memo','main/compound/*/memo/*/edit','main/compound/*','main/compound/*/investigation','main/compound/investigation/*/detail/view','main/compound/*/notice','main/compound/*/inventory','main/compound/*/inventory/pdf','main/compound/*/inventory/auction','main/compound/*/pdf','main/compound/*/task','main/manual/compound') ? 'active' : '' }}"> <li class="pcoded-hasmenu {{ Request::is('main/compound','main/compound/investigation','main/compound/notice','main/compound/confiscated','main/compound/collapsed','main/compound/completed','main/compound/*/index','main/compound/*/memo','main/compound/*/memo/*/edit','main/compound/*','main/compound/*/investigation','main/compound/investigation/*/detail/view','main/compound/*/notice','main/compound/*/inventory','main/compound/*/inventory/pdf','main/compound/*/inventory/auction','main/compound/*/pdf','main/compound/*/task','main/manual/compound') ? 'active' : '' }}">
<a href="javascript:void(0)" class="waves-effect waves-dark"> <a href="javascript:void(0)" class="waves-effect waves-dark">
<span class="pcoded-micon"><i class="ti-files"></i><b>KM</b></span> <span class="pcoded-micon"><i class="ti-files"></i><b>KM</b></span>
<span class="pcoded-mtext">Kompaun</span>
<span class="pcoded-mtext">Notis & Kompaun</span>
<span class="pcoded-mcaret"></span> <span class="pcoded-mcaret"></span>
</a> </a>
<ul class="pcoded-submenu"> <ul class="pcoded-submenu">
<li class="{{ Request::is('main/compound') ? 'active' : '' }}"> <li class="{{ Request::is('main/compound') ? 'active' : '' }}">
<a href="{{ url('/main/compound') }}" class="waves-effect waves-dark"> <a href="{{ url('/main/compound') }}" class="waves-effect waves-dark">
<span class="pcoded-micon"><i class="ti-receipt"></i></span> <span class="pcoded-micon"><i class="ti-receipt"></i></span>
<span class="pcoded-mtext">Senarai Kompaun</span>
<span class="pcoded-mtext">Senarai Notis/Kompaun</span>
<span class="pcoded-mcaret"></span> <span class="pcoded-mcaret"></span>
</a> </a>
</li> </li>

+ 36
- 1
resources/views/main-dashboard/compound_detail/compound_job.blade.php 查看文件

</div> </div>
</form> </form>
@if($compound->modul != '03' && $compound->modul != '04')
@if(!isset($compound->tarikh_mahkamah)){
<form method="POST" action="{{ url('/main/compound/update/court') }}" enctype="multipart/form-data">
<div class="row">
<div class="col-lg-12 col-md-12">
<div class="card">
<div class="card-header">
<h5>Serahan Kompaun Kepada Pegawai</h5>
</div>
<div class="card-block">
<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
<input type="hidden" name="kpd" value="{{ $compound->kpd }}">
<input type="hidden" name="dashboard" value="true">
<div class="row">
<div class="col-lg-12 col-md-12">
<div class="form-group form-primary">
<label class="float-label"><b>Serahan Ke Mahkamah<code>('dashboard')</code></b></label>
<div class="col-lg-3">
<input type="date" class=" form-control form-control-sm" name="start_date" id="start_date" required/>
</div>
</div>
</div>
</div>
<hr>
<div class="md-group-add-on"></div>
<div class="f-right">
<button type="submit" class="btn btn-sm btn-outline-danger waves-effect waves-light">Sahkan Tarikh</button>
</div>
</div>
</div>
</div>
</div>
</form>
}
@endif
@if($compound->modul != '02' && $compound->modul != '03' && $compound->modul != '04')
<form method="POST" action="{{ url('/main/compound/update/action') }}"> <form method="POST" action="{{ url('/main/compound/update/action') }}">
<div class="row"> <div class="row">
<div class="col-lg-12 col-md-12"> <div class="col-lg-12 col-md-12">

+ 3
- 3
resources/views/main-dashboard/compound_detail/memo_detail.blade.php 查看文件

<label class="float-label"><b>Jenis Memo/Nota <code>*</code></b></label> <label class="float-label"><b>Jenis Memo/Nota <code>*</code></b></label>
<select id="jenis_memo" name="jenis_memo" class="form-control" required> <select id="jenis_memo" name="jenis_memo" class="form-control" required>
<option value="">Pilih Jenis Memo</option> <option value="">Pilih Jenis Memo</option>
<option value="Tambahan">Tambahan Harga</option>
<!-- <option value="Tambahan">Tambahan Harga</option> -->
<option value="Lain-lain">Lain-lain</option> <option value="Lain-lain">Lain-lain</option>
</select> </select>
<span class="form-bar"></span> <span class="form-bar"></span>
<span class="form-bar"></span> <span class="form-bar"></span>
</div> </div>
</div> </div>
<div class="col-lg-6 col-md-12">
<!-- <div class="col-lg-6 col-md-12">
<div class="form-group form-primary"> <div class="form-group form-primary">
<label class="float-label"><b>Tawaran Kompaun Baru <code>*</code></b></label> <label class="float-label"><b>Tawaran Kompaun Baru <code>*</code></b></label>
<input type="text" name="tawaran" class="form-control" value="{{ old('tawaran')}}" placeholder="5%"> <input type="text" name="tawaran" class="form-control" value="{{ old('tawaran')}}" placeholder="5%">
<span class="form-bar"></span> <span class="form-bar"></span>
<small style="color: red;">Format tawaran kompaun mesti dalam bentuk <b>peratus (%)</b></small> <small style="color: red;">Format tawaran kompaun mesti dalam bentuk <b>peratus (%)</b></small>
</div> </div>
</div>
</div> -->
</div> </div>
<div class="row"> <div class="row">

+ 5
- 1
routes/api.php 查看文件

Route::post('/mobile/staff/notice/today/list', 'Api\CompoundController@viewNoticeToday'); Route::post('/mobile/staff/notice/today/list', 'Api\CompoundController@viewNoticeToday');
Route::post('/mobile/store/compound', 'Api\CompoundResourceController@store'); Route::post('/mobile/store/compound', 'Api\CompoundResourceController@store');
Route::post('/mobile/store/notice', 'Api\CompoundResourceController@storeNotice'); Route::post('/mobile/store/notice', 'Api\CompoundResourceController@storeNotice');
Route::post('/mobile/store', 'Api\CompoundResourceController@storeCompound');
Route::post('/mobile/store', 'Api\CompoundResourceController@storeNewCompound');
Route::post('/mobile/store/compound/picture', 'Api\CompoundController@storeCompoundAttachment'); Route::post('/mobile/store/compound/picture', 'Api\CompoundController@storeCompoundAttachment');
Route::post('/mobile/store/acceptance/compound', 'Api\CompoundController@storeAcceptanceCompound'); Route::post('/mobile/store/acceptance/compound', 'Api\CompoundController@storeAcceptanceCompound');
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
Route::get('/code/bandar', 'Api\EpbtController@getCodeBandar'); Route::get('/code/bandar', 'Api\EpbtController@getCodeBandar');
Route::post('/code/taman', 'Api\EpbtController@getCodeTaman'); Route::post('/code/taman', 'Api\EpbtController@getCodeTaman');
Route::post('/code/jalan', 'Api\EpbtController@getCodeJalan'); Route::post('/code/jalan', 'Api\EpbtController@getCodeJalan');
/*---------------------------------------------------------------------------
| TEST
|----------------------------------------------------------------------------*/
Route::post('data/testing', 'Api\LoginController@testing');
}); });



+ 1
- 0
routes/web.php 查看文件

Route::get('/main/compound/{kpd}/pdf', ['uses' => 'Main\TaskController@requestViewAllPdf', 'as' => 'pdfD']); Route::get('/main/compound/{kpd}/pdf', ['uses' => 'Main\TaskController@requestViewAllPdf', 'as' => 'pdfD']);
Route::get('/main/compound/{kpd}/task', ['uses' => 'Main\CompoundController@viewTaskIndex', 'as' => 'taskD']); Route::get('/main/compound/{kpd}/task', ['uses' => 'Main\CompoundController@viewTaskIndex', 'as' => 'taskD']);
Route::post('/main/compound/update/action', ['uses' => 'Main\TaskController@requestUpdateTask']); Route::post('/main/compound/update/action', ['uses' => 'Main\TaskController@requestUpdateTask']);
Route::post('/main/compound/update/court', ['uses' => 'Main\TaskController@requestUpdateToCourt']);
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
| Setting | Setting
|-------------------------------------------------------------------------*/ |-------------------------------------------------------------------------*/

正在加载...
取消
保存