Browse Source

add no notice

master
Siti Rahayu 4 years ago
parent
commit
8ff154504b
1 changed files with 10 additions and 6 deletions
  1. 10
    6
      app/Http/Controllers/Api/CompoundResourceController.php

+ 10
- 6
app/Http/Controllers/Api/CompoundResourceController.php View File

//check if theres no 001, start fresh with 0001 //check if theres no 001, start fresh with 0001
if (empty(Compound::where('jenis', $jenis)->where('kpd', $tag.'0001')->first())) { if (empty(Compound::where('jenis', $jenis)->where('kpd', $tag.'0001')->first())) {


$kpd = $tag.'0001';
$kpd = '0001';


} }
else{ else{
$compoundData = [ $compoundData = [
'jenis' => $request->jenis, 'jenis' => $request->jenis,
'kpd' => 'KT'.$kpd, 'kpd' => 'KT'.$kpd,
'non' => 'NKG'.$kpd,
'nama' => $request->namaP, 'nama' => $request->namaP,
'identity' => $request->noIc, 'identity' => $request->noIc,
'nama_syarikat' => $request->namaS, 'nama_syarikat' => $request->namaS,
$compoundData = [ $compoundData = [
'jenis' => $request->jenis, 'jenis' => $request->jenis,
'kpd' => 'JPB'.$kpd, 'kpd' => 'JPB'.$kpd,
'non' => 'NMH'.$kpd,
'nama' => $request->namaP, 'nama' => $request->namaP,
'identity' => $request->noIc, 'identity' => $request->noIc,
'nama_syarikat' => $request->namaS, 'nama_syarikat' => $request->namaS,


$compoundData = [ $compoundData = [
'jenis' => $request->jenis, 'jenis' => $request->jenis,
'kpd' => 'NPI'.$kpd,
'kpd' => 'NHN'.$kpd,
'non' => 'NHN'.$kpd,
'nama' => $request->namaP, 'nama' => $request->namaP,
'identity' => $request->noIc, 'identity' => $request->noIc,
'nama_syarikat' => $request->namaS, 'nama_syarikat' => $request->namaS,
$compoundData = [ $compoundData = [
'jenis' => $request->jenis, 'jenis' => $request->jenis,
'kpd' => 'PA'.$kpd, 'kpd' => 'PA'.$kpd,
'non' => 'PA'.$kpd,
'nama' => $request->namaP, 'nama' => $request->namaP,
'identity' => $request->noIc, 'identity' => $request->noIc,
'nama_syarikat' => $request->namaS, 'nama_syarikat' => $request->namaS,
"maklumat_tambahan" => '-', "maklumat_tambahan" => '-',
"tindakan" => '-', "tindakan" => '-',
"tempoh" => '-', "tempoh" => '-',
"notis_created" => Carbon::now()->toDateTimeString(),
"cpn_created" => Carbon::now()->toDateTimeString(),
]; ];
} }
elseif ($request->jenis == 'Pelbagai_JPB') { elseif ($request->jenis == 'Pelbagai_JPB') {
"maklumat_tambahan" => '-', "maklumat_tambahan" => '-',
"tindakan" => '-', "tindakan" => '-',
"tempoh" => '-', "tempoh" => '-',
"notis_created" => Carbon::now()->toDateTimeString(),
"cpn_created" => Carbon::now()->toDateTimeString(),
]; ];
} }
elseif ($request->jenis == 'Pelbagai_LESEN') { elseif ($request->jenis == 'Pelbagai_LESEN') {
"no_telefon" => $request->tel, "no_telefon" => $request->tel,
"no_akaun_lesen" => $request->lesen, "no_akaun_lesen" => $request->lesen,
"maklumat_tambahan" => '-', "maklumat_tambahan" => '-',
"notis_created" => Carbon::now()->toDateTimeString(),
"cpn_created" => Carbon::now()->toDateTimeString(),
]; ];
} }
else if($request->jenis == 'Pelbagai_PA'){ else if($request->jenis == 'Pelbagai_PA'){
"no_akaun_lesen" => $request->lesen, "no_akaun_lesen" => $request->lesen,
"maklumat_tambahan" => '-', "maklumat_tambahan" => '-',
"bil_haiwan" => $request->bil_haiwan, "bil_haiwan" => $request->bil_haiwan,
"notis_created" => Carbon::now()->toDateTimeString(),
"cpn_created" => Carbon::now()->toDateTimeString(),
]; ];
} }



Loading…
Cancel
Save