| public function viewCompoundHistoryDetail($kpd){ | public function viewCompoundHistoryDetail($kpd){ | ||||
| $id = Auth::guard('sadmin')->id(); | $id = Auth::guard('sadmin')->id(); | ||||
| $user = Staff::with('StaffDetail')->find($id); | $user = Staff::with('StaffDetail')->find($id); | ||||
| $compound = Compound::with('ConfidentialFile')->where('kpd',$kpd)->first(); | $compound = Compound::with('ConfidentialFile')->where('kpd',$kpd)->first(); | ||||
| if(empty($compound)) | |||||
| { | |||||
| $kpd = (int)$kpd; | |||||
| $compound = Compound::with('ConfidentialFile')->where('kpd',$kpd)->first(); | |||||
| } | |||||
| $file = ConfidentialFile::with('History','History.SubHistory')->where('no_siri',$compound->ConfidentialFile->no_siri)->first(); | $file = ConfidentialFile::with('History','History.SubHistory')->where('no_siri',$compound->ConfidentialFile->no_siri)->first(); | ||||
| $role = Roles::where('kod',$file->modul)->first(); | $role = Roles::where('kod',$file->modul)->first(); | ||||
| $site = SiteSetting::first(); | $site = SiteSetting::first(); |