root 4 years ago
parent
commit
3ddc19b0cd

+ 5
- 2
app/Http/Controllers/Api/CompoundResourceController.php View File



//for compound numbering //for compound numbering
$countKPD = $this->compound->withTrashed()->count(); $countKPD = $this->compound->withTrashed()->count();
$kpd = 'KPD'.$countKPD;
$non = 'KPD'.$countKPD;


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


$compoundData = [ $compoundData = [
'jenis' => 'Parkir', 'jenis' => 'Parkir',
'kpd' => 'KPD'.$countKPD,
'kpd' => $kpd,
'non' => $non,
'nama' => '-', 'nama' => '-',
'identity' => '-', 'identity' => '-',
'alamat' => '-', 'alamat' => '-',
// }else{ // }else{
// $tawaran = $compound->jumlah_asal_kompaun; // $tawaran = $compound->jumlah_asal_kompaun;
// } // }
$this->dispatch(new StoreNotice($request->all(), $kpd, $staff->_id, $no_siri));
$this->dispatch(new StoreNotice($request->all(), $non, $staff->_id, $no_siri));


//mobile already accept 'kpd' string, so no need to change string name to 'notis'. //mobile already accept 'kpd' string, so no need to change string name to 'notis'.
array_push($data, array('kpd' => $non)); array_push($data, array('kpd' => $non));

+ 3
- 3
app/Jobs/StoreNotice.php View File

// dispatch(new UpdateCompoundPrice($this->kpd)); // dispatch(new UpdateCompoundPrice($this->kpd));


$staff = Staff::with('StaffDetail')->where('_id', $this->no_badan)->first(); $staff = Staff::with('StaffDetail')->where('_id', $this->no_badan)->first();
$compound = Compound::with('ConfidentialFile','Attachment','CompoundInvestigation')->where('kpd',$this->kpd)->first();
$compound = Compound::with('ConfidentialFile','Attachment','CompoundInvestigation')->where('kpd',$this->non)->first();


$site = SiteSetting::first(); $site = SiteSetting::first();
$faulty = Faulty::with('DeedLaw')->where('_id',$compound->seksyen_kesalahan)->first(); $faulty = Faulty::with('DeedLaw')->where('_id',$compound->seksyen_kesalahan)->first();
]; ];
$subHistory = [ $subHistory = [
'no_siri' => $compound->ConfidentialFile->no_siri, 'no_siri' => $compound->ConfidentialFile->no_siri,
'tajuk' => "Penguatkuasa ".$staff->StaffDetail->full_name." mengeluarkan notis ".$this->kpd,
'huraian' => "Notis ".$this->kpd." telah dikeluarkan oleh penguatkuasa <a href='".url('/main/staff')."/".$staff->_id."/profile'>".$staff->StaffDetail->full_name."</a> di bawah akta seksyen kesalahan [".$faulty->sketr."] ".$faulty->nama,
'tajuk' => "Penguatkuasa ".$staff->StaffDetail->full_name." mengeluarkan notis ".$this->non,
'huraian' => "Notis ".$this->non." telah dikeluarkan oleh penguatkuasa <a href='".url('/main/staff')."/".$staff->_id."/profile'>".$staff->StaffDetail->full_name."</a> di bawah akta seksyen kesalahan [".$faulty->sketr."] ".$faulty->nama,
]; ];


$groupByDate = History::where('tarikh_kumpulan', $gDate)->first(); $groupByDate = History::where('tarikh_kumpulan', $gDate)->first();

Loading…
Cancel
Save