root 4 years ago
parent
commit
c790f0a006
1 changed files with 19 additions and 30 deletions
  1. 19
    30
      app/Http/Controllers/Api/CompoundResourceController.php

+ 19
- 30
app/Http/Controllers/Api/CompoundResourceController.php View File

"receipt" => '-', "receipt" => '-',
"modul" => '03', "modul" => '03',
"penguatkuasa" => '-', "penguatkuasa" => '-',
"cpn_created" => Carbon::now(),
"created_c" => Carbon::now()->toISOString(),
]; ];


$file = ConfidentialFile::create($fileData); $file = ConfidentialFile::create($fileData);
$compound->status = 'Belum Bayar'; $compound->status = 'Belum Bayar';
$compound->modul = '03'; $compound->modul = '03';
$compound->no_akaun_lesen = $request->lesen; $compound->no_akaun_lesen = $request->lesen;
$compound->created_c = Carbon::now();
$compound->created_c = Carbon::now()->toISOString();




}elseif($request->jenis == 'Pelbagai_JPB'){ }elseif($request->jenis == 'Pelbagai_JPB'){
$compound->status = 'Belum Bayar'; $compound->status = 'Belum Bayar';
$compound->modul = '03'; $compound->modul = '03';
$compound->no_akaun_lesen = $request->lesen; $compound->no_akaun_lesen = $request->lesen;
$compound->created_c = Carbon::now();
$compound->created_c = Carbon::now()->toISOString();


} }




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



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


// dd(Carbon::now()->addDays(5)->toISOString());

$data = array(); $data = array();


$non = ''; $non = '';
// "maklumat_tambahan" => $request->butiran_kesalahan, // "maklumat_tambahan" => $request->butiran_kesalahan,
"tindakan" => $request->tindakan, "tindakan" => $request->tindakan,
"tempoh" => $request->tempoh, "tempoh" => $request->tempoh,
"tempoh_tarikh" => Carbon::now()->addDays($request->tempoh),
"created_n" => Carbon::now(),
"tempoh_tarikh" => Carbon::now()->addDays($request->tempoh)->toISOString(),
"created_n" => Carbon::now()->toISOString(),
]; ];
}elseif($request->jenis == 'Notis_NMH'){ }elseif($request->jenis == 'Notis_NMH'){


// "maklumat_tambahan" => $request->butiran_kesalahan, // "maklumat_tambahan" => $request->butiran_kesalahan,
"tindakan" => $request->tinadkan, "tindakan" => $request->tinadkan,
"tempoh" => $request->tempoh, "tempoh" => $request->tempoh,
"tempoh_tarikh" => Carbon::now()->addDays($request->tempoh),
"created_n" => Carbon::now(),
"tempoh_tarikh" => Carbon::now()->addDays($request->tempoh)->toISOString(),
"created_n" => Carbon::now()->toISOString(),
]; ];
} }
elseif($request->jenis == 'Notis_NHN'){ elseif($request->jenis == 'Notis_NHN'){
// "maklumat_tambahan" => $request->butiran_kesalahan, // "maklumat_tambahan" => $request->butiran_kesalahan,
// "tindakan" => $request->tindakan, // "tindakan" => $request->tindakan,
"tempoh" => $request->tempoh, "tempoh" => $request->tempoh,
"tempoh_tarikh" => Carbon::now()->addDays($request->tempoh),
"created_n" => Carbon::now(),
"tempoh_tarikh" => Carbon::now()->addDays($request->tempoh)->toISOString(),
"created_n" => Carbon::now()->toISOString(),
]; ];
} }
elseif($request->jenis == 'Notis_PA'){ elseif($request->jenis == 'Notis_PA'){
// "maklumat_tambahan" => $request->butiran_kesalahan, // "maklumat_tambahan" => $request->butiran_kesalahan,
"tindakan" => $request->tindakan, "tindakan" => $request->tindakan,
"tempoh" => $request->tempoh, "tempoh" => $request->tempoh,
"tempoh_tarikh" => Carbon::now()->addDays($request->tempoh),
"created_n" => Carbon::now(),
"tempoh_tarikh" => Carbon::now()->addDays($request->tempoh)->toISOString(),
"created_n" => Carbon::now()->toISOString(),
"bil_haiwan" => $request->bil_haiwan, "bil_haiwan" => $request->bil_haiwan,
]; ];
}elseif($request->jenis == 'Notis_NPPM'){ }elseif($request->jenis == 'Notis_NPPM'){
// "maklumat_tambahan" => $request->butiran_kesalahan, // "maklumat_tambahan" => $request->butiran_kesalahan,
"tindakan" => $request->tindakan, "tindakan" => $request->tindakan,
"tempoh" => $request->tempoh, "tempoh" => $request->tempoh,
"tempoh_tarikh" => Carbon::now()->addDays($request->tempoh),
"created_n" => Carbon::now(),
"tempoh_tarikh" => Carbon::now()->addDays($request->tempoh)->toISOString(),
"created_n" => Carbon::now()->toISOString(),
]; ];
} }


$kpd = ''; $kpd = '';
$no_siri =''; $no_siri ='';


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

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

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

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


if($request->jenis == 'Parkir') if($request->jenis == 'Parkir')
{ {
//for compound numbering //for compound numbering
"receipt" => '-', "receipt" => '-',
"modul" => '03', "modul" => '03',
"penguatkuasa" => '-', "penguatkuasa" => '-',
"created_c" => Carbon::now(),
"created_c" => Carbon::now()->toISOString(),
]; ];
} }
if ($request->jenis == 'Pelbagai_KT') { if ($request->jenis == 'Pelbagai_KT') {
"modul" => $request->modul, "modul" => $request->modul,
"penguatkuasa" => '-', "penguatkuasa" => '-',
"no_akaun_lesen" => $request->lesen, "no_akaun_lesen" => $request->lesen,
"created_c" => Carbon::now(),
"created_c" => Carbon::now()->toISOString(),
]; ];
} }
elseif ($request->jenis == 'Pelbagai_JPB') { elseif ($request->jenis == 'Pelbagai_JPB') {
"modul" => $request->modul, "modul" => $request->modul,
"penguatkuasa" => '-', "penguatkuasa" => '-',
"no_akaun_lesen" => $request->lesen, "no_akaun_lesen" => $request->lesen,
"created_c" => Carbon::now(),
"created_c" => Carbon::now()->toISOString(),
]; ];
} }



Loading…
Cancel
Save