@@ -55,15 +55,29 @@ class CalculateStatisticCompound extends Command | |||
$dataS->modul = 'all'; | |||
$dataS->save(); | |||
} | |||
//calculate compound [modul = 02, status = Belum Bayar] | |||
$n1 = ReportOverallCompound::where('status','Belum Bayar')->where('department','all')->where('modul','02')->first(); | |||
if(!empty($n1)){ | |||
$n1->total = count(Compound::where('modul','02')->where('status','Belum Bayar')->get()); | |||
$n1->save(); | |||
}else { | |||
$dataB = new ReportOverallCompound; | |||
$dataB->total = count(Compound::where('modul','02')->where('status','Belum Bayar')->get()); | |||
$dataB->status = 'Belum Bayar'; | |||
$dataB->department = 'all'; | |||
$dataB->modul = '02'; | |||
$dataB->save(); | |||
} | |||
//calculate compound [modul = 03, status = Belum Bayar] | |||
$b1 = ReportOverallCompound::where('status','Belum Bayar')->where('department','all')->where('modul','03')->first(); | |||
$b1 = ReportOverallCompound::where('status','Belum Bayar')->where('department','all')->where('modul','03')->orWhere('modul','02')->first(); | |||
if(!empty($b1)){ | |||
$b1->total = count(Compound::where('modul','03')->where('status','Belum Bayar')->get()); | |||
$b1->total = count(Compound::where('modul','03')->orWhere('modul','02')->where('status','Belum Bayar')->get()); | |||
$b1->save(); | |||
}else { | |||
$dataB = new ReportOverallCompound; | |||
$dataB->total = count(Compound::where('modul','03')->where('status','Belum Bayar')->get()); | |||
$dataB->total = count(Compound::where('modul','03')->orWhere('modul','02')->where('status','Belum Bayar')->get()); | |||
$dataB->status = 'Belum Bayar'; | |||
$dataB->department = 'all'; | |||
$dataB->modul = '03'; | |||
@@ -161,8 +175,22 @@ class CalculateStatisticCompound extends Command | |||
$dataJS1->save(); | |||
} | |||
//calcculate compound by department [status = Belum Bayar, modul = 02] | |||
$n2 = ReportOverallCompound::where('status','Belum Bayar')->where('department',$d->_id)->where('modul','02')->orWhere('modul','02')->first(); | |||
if(!empty($n2)){ | |||
$n2->total = count(Compound::where('jbkod',$d->_id)->where('modul','02')->where('status','Belum Bayar')->get()); | |||
$n2->save(); | |||
}else { | |||
$dataJB1 = new ReportOverallCompound; | |||
$dataJB1->total = count(Compound::where('jbkod',$d->_id)->where('modul','02')->where('status','Belum Bayar')->get()); | |||
$dataJB1->status = 'Belum Bayar'; | |||
$dataJB1->department = $d->_id; | |||
$dataJB1->modul = '03'; | |||
$dataJB1->save(); | |||
} | |||
//calcculate compound by department [status = Belum Bayar, modul = 03] | |||
$b2 = ReportOverallCompound::where('status','Belum Bayar')->where('department',$d->_id)->where('modul','03')->first(); | |||
$b2 = ReportOverallCompound::where('status','Belum Bayar')->where('department',$d->_id)->where('modul','03')->orWhere('modul','02')->first(); | |||
if(!empty($b2)){ | |||
$b2->total = count(Compound::where('jbkod',$d->_id)->where('modul','03')->where('status','Belum Bayar')->get()); | |||
$b2->save(); |
@@ -19,6 +19,7 @@ use App\Model\Module\Memo; | |||
use App\Model\Module\Attachment; | |||
use App\Jobs\StoreCompound; | |||
use App\Jobs\StoreNotice; | |||
use App\Jobs\StoreCompoundEPBT; | |||
use App\Jobs\UpdateCompoundPrice; | |||
use App\Http\Resources\CompoundResource; | |||
@@ -58,14 +59,20 @@ class CompoundResourceController extends BaseController | |||
} | |||
$compound = Compound::where('jenis', $jenis)->whereBetween('created_at', array($start, $end)); | |||
if($modul == 'All'){ | |||
$compound = $compound; | |||
}else if($modul == '06-07'){ | |||
$compound = $compound->where(function($q){ | |||
$q->where(function($query){ | |||
$query->where('modul', '06')->orWhere('modul','07'); | |||
}); | |||
// $q->where(function($query){ | |||
$q->where('modul', '06')->orWhere('modul','07'); | |||
// }); | |||
}); | |||
}else if(($modul == '03') || ($modul == '02')){ | |||
$compound = $compound->where(function($q){ | |||
// $q->where(function($query){ | |||
$q->where('modul', '02')->orWhere('modul', '03'); | |||
// }); | |||
}); | |||
}else { | |||
$compound = $compound->where('modul', $modul); | |||
@@ -92,6 +99,10 @@ class CompoundResourceController extends BaseController | |||
$query->where('modul', '06')->orWhere('modul','07'); | |||
}); | |||
}); | |||
}else if($modul == '03'){ | |||
$compound = $compound->where(function($q){ | |||
$q->where('modul', '02')->orWhere('modul', '03'); | |||
}); | |||
}else { | |||
$compound = $compound->where('modul', $modul); | |||
} | |||
@@ -106,6 +117,7 @@ class CompoundResourceController extends BaseController | |||
} | |||
private function filterCompoundByEnforcer($enforcer,$jenis,$modul,$status,$start_date,$end_date){ | |||
if(!empty($start_date)){ | |||
$compound = $this->searchCompoundAll($jenis,$modul,$status,$start_date,$end_date); | |||
}else{ | |||
@@ -208,7 +220,7 @@ class CompoundResourceController extends BaseController | |||
// $per_page = ''; | |||
// $kpd = ''; | |||
// $modul = 'All'; | |||
// $modul = '02'; | |||
// $status = 'All'; | |||
// $jenis = 'Pelbagai_JPB'; | |||
// if(!empty($request->department)){ | |||
@@ -216,8 +228,8 @@ class CompoundResourceController extends BaseController | |||
// }else { | |||
// $department = []; | |||
// } | |||
// $start_date = '2020-07-18'; | |||
// $end_date = '2020-08-14'; | |||
// $start_date = '2020-08-18'; | |||
// $end_date = '2020-09-20'; | |||
// $enforcer = 'All'; | |||
// $faulty = 'All'; | |||
@@ -328,7 +340,7 @@ class CompoundResourceController extends BaseController | |||
} | |||
/** | |||
* Store a newly created resource in storage. | |||
* Store a created compound from notice. | |||
* | |||
* @param \Illuminate\Http\Request $request | |||
* @return \Illuminate\Http\Response | |||
@@ -407,14 +419,6 @@ class CompoundResourceController extends BaseController | |||
$kpd = $request->kpd; | |||
// $no_siri = date('yn').'-'.filter_var($kpd, FILTER_SANITIZE_NUMBER_INT); | |||
// $fileData = [ | |||
// 'no_siri' => $no_siri, | |||
// ]; | |||
// $file = ConfidentialFile::create($fileData); | |||
$compound = Compound::where('jenis', $request->jenis)->where('kpd', $kpd)->first(); | |||
if (!empty($compound)) { | |||
@@ -559,6 +563,9 @@ class CompoundResourceController extends BaseController | |||
} | |||
/********************************************* | |||
| Store a newly created notice | |||
*********************************************/ | |||
public function storeNotice(Request $request) | |||
{ | |||
$staff = Staff::with('StaffDetail')->where('api_token',$request->api_token)->first(); | |||
@@ -769,7 +776,7 @@ class CompoundResourceController extends BaseController | |||
// }else{ | |||
// $tawaran = $compound->jumlah_asal_kompaun; | |||
// } | |||
$this->dispatch(new StoreCompound($request->all(), $kpd, $staff->_id, $no_siri)); | |||
$this->dispatch(new StoreNotice($request->all(), $kpd, $staff->_id, $no_siri)); | |||
array_push($data, array('kpd' => $kpd)); | |||
return $this->sendResponse($data, 'Berjaya simpan rekod notis!'); | |||
@@ -779,6 +786,242 @@ class CompoundResourceController extends BaseController | |||
} | |||
} | |||
/** | |||
* Store a newly created compound (parkir, KT, JPB). | |||
* | |||
* @param \Illuminate\Http\Request $request | |||
* @return \Illuminate\Http\Response | |||
*/ | |||
public function storeCompound(Request $request) | |||
{ | |||
$staff = Staff::with('StaffDetail')->where('api_token',$request->api_token)->first(); | |||
if(empty($staff)){ | |||
return $this->sendError('Invalid', 'Staff not existed'); | |||
}else { | |||
$data = array(); | |||
$faulty = Faulty::where('_id',$request->get('seksyen'))->first(); | |||
if(!empty($faulty)){ | |||
$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') | |||
{ | |||
//only for compound parkir | |||
$compoundData = [ | |||
'jenis' => 'Parkir', | |||
'kpd' => $kpd, | |||
'nama' => '-', | |||
'identity' => '-', | |||
'alamat' => '-', | |||
"no_plate" => strtolower($request->no_plate), | |||
"no_cukai_jalan" => $request->noCukaijalan, | |||
"jenis_kenderaan" => $request->jenisKenderaan, | |||
"model_kenderaan" => $request->modelKenderaan, | |||
"warna_kenderaan" => $request->warnakenderaan, | |||
"nama_kawasan" => $request->namaKawasan, | |||
"nama_taman" => $request->namaTaman, | |||
"nama_jalan" => $request->namaJalan, | |||
"no_parking" => $request->noParking, | |||
"catatan" => $request->catatan, | |||
"lokasi_kejadian" => '-', | |||
'latlong' => $request->Latlong, | |||
'jbkod' => $request->jabatan, | |||
'akta' => $faulty->deed_law_id, | |||
'seksyen_kesalahan' => $faulty->_id, | |||
'jumlah_asal_kompaun' => $faulty->amount, | |||
'jumlah_kemaskini_kompaun' => '', | |||
'dikeluarkan' => $staff->_id, | |||
"status" => 'Belum Bayar', | |||
"amount_payment" => '', | |||
"receipt" => '', | |||
"modul" => '03', | |||
"penguatkuasa" => '', | |||
"cpn_created" => Carbon::now()->toDateTimeString(), | |||
]; | |||
} | |||
if ($request->jenis == 'Pelbagai_KT') { | |||
$compoundData = [ | |||
'jenis' => $request->jenis, | |||
'kpd' => $kpd, | |||
'nama' => $request->namaP, | |||
'identity' => $request->noIc, | |||
'nama_syarikat' => $request->namaS, | |||
'no_daftar_syarikat' => strtolower($request->daftarNo), | |||
'alamat' => $request->alamat, | |||
"no_plate" => $request->no_plate, | |||
"no_cukai_jalan" => $request->no_cukai_jalan, | |||
"nama_kawasan" => $request->namaKawasan, | |||
"nama_taman" => $request->namaTaman, | |||
"nama_jalan" => $request->namaJalan, | |||
"catatan" => $request->catatan, | |||
"lokasi_kejadian" => '-', | |||
'latlong' => $request->Latlong, | |||
'jbkod' => $request->jabatan, | |||
'akta' => $faulty->deed_law_id, | |||
'seksyen_kesalahan' => $faulty->_id, | |||
'jumlah_asal_kompaun' => $faulty->amount, | |||
'jumlah_kemaskini_kompaun' => '', | |||
'dikeluarkan' => $staff->_id, | |||
"status" => 'Belum Bayar', | |||
"amount_payment" => '', | |||
"receipt" => '', | |||
"modul" => $request->modul, | |||
"penguatkuasa" => '', | |||
"no_telefon" => $request->tel, | |||
"no_akaun_lesen" => $request->lesen, | |||
"maklumat_tambahan" => '-', | |||
"tindakan" => $request->tindakan, | |||
"tempoh" => $request->tempoh, | |||
"notis_created" => Carbon::now()->toDateTimeString(), | |||
]; | |||
} | |||
elseif ($request->jenis == 'Pelbagai_JPB') { | |||
$compoundData = [ | |||
'jenis' => $request->jenis, | |||
'kpd' => $kpd, | |||
'nama' => $request->namaP, | |||
'identity' => $request->noIc, | |||
'nama_syarikat' => $request->namaS, | |||
'no_daftar_syarikat' => strtolower($request->daftarNo), | |||
'alamat' => $request->alamat, | |||
"no_plate" => $request->no_plate, | |||
"no_cukai_jalan" => $request->no_cukai_jalan, | |||
"nama_kawasan" => $request->namaKawasan, | |||
"nama_taman" => $request->namaTaman, | |||
"nama_jalan" => $request->namaJalan, | |||
"catatan" => $request->catatan, | |||
"lokasi_kejadian" => '-', | |||
'latlong' => $request->Latlong, | |||
'jbkod' => $request->jabatan, | |||
'akta' => $faulty->deed_law_id, | |||
'seksyen_kesalahan' => $faulty->_id, | |||
'jumlah_asal_kompaun' => $faulty->amount, | |||
'jumlah_kemaskini_kompaun' => '', | |||
'dikeluarkan' => $staff->_id, | |||
"status" => 'Belum Bayar', | |||
"amount_payment" => '', | |||
"receipt" => '', | |||
"modul" => $request->modul, | |||
"penguatkuasa" => '', | |||
"no_telefon" => $request->tel, | |||
"no_akaun_lesen" => $request->lesen, | |||
"maklumat_tambahan" => '-', | |||
"tindakan" => $request->tindakan, | |||
"tempoh" => $request->tempoh, | |||
"notis_created" => Carbon::now()->toDateTimeString(), | |||
]; | |||
} | |||
elseif ($request->jenis == 'Pelbagai_LESEN') { | |||
$compoundData = [ | |||
'jenis' => $request->jenis, | |||
'kpd' => $kpd, | |||
'nama' => $request->namaP, | |||
'identity' => $request->noIc, | |||
'nama_syarikat' => $request->namaS, | |||
'no_daftar_syarikat' => strtolower($request->daftarNo), | |||
'alamat' => $request->alamat, | |||
"no_plate" => $request->no_plate, | |||
"no_cukai_jalan" => $request->no_cukai_jalan, | |||
"nama_kawasan" => $request->namaKawasan, | |||
"nama_taman" => $request->namaTaman, | |||
"nama_jalan" => $request->namaJalan, | |||
"catatan" => $request->catatan, | |||
"lokasi_kejadian" => '-', | |||
'latlong' => $request->Latlong, | |||
'jbkod' => $request->jabatan, | |||
'akta' => $faulty->deed_law_id, | |||
'seksyen_kesalahan' => $faulty->_id, | |||
'jumlah_asal_kompaun' => $faulty->amount, | |||
'jumlah_kemaskini_kompaun' => '', | |||
'dikeluarkan' => $staff->_id, | |||
"status" => 'Belum Bayar', | |||
"amount_payment" => '', | |||
"receipt" => '', | |||
"modul" => $request->modul, | |||
"penguatkuasa" => '', | |||
"no_telefon" => $request->tel, | |||
"no_akaun_lesen" => $request->lesen, | |||
"maklumat_tambahan" => '-', | |||
"notis_created" => Carbon::now()->toDateTimeString(), | |||
]; | |||
} | |||
else if($request->jenis == 'Pelbagai_PA'){ | |||
$compoundData = [ | |||
'jenis' => $request->jenis, | |||
'kpd' => $kpd, | |||
'nama' => $request->namaP, | |||
'identity' => $request->noIc, | |||
'nama_syarikat' => $request->namaS, | |||
'no_daftar_syarikat' => strtolower($request->daftarNo), | |||
'alamat' => $request->alamat, | |||
"no_plate" => $request->no_plate, | |||
"no_cukai_jalan" => $request->no_cukai_jalan, | |||
"nama_kawasan" => $request->namaKawasan, | |||
"nama_taman" => $request->namaTaman, | |||
"nama_jalan" => $request->namaJalan, | |||
"catatan" => $request->catatan, | |||
"lokasi_kejadian" => '-', | |||
'latlong' => $request->Latlong, | |||
'jbkod' => $request->jabatan, | |||
'akta' => $faulty->deed_law_id, | |||
'seksyen_kesalahan' => $faulty->_id, | |||
'jumlah_asal_kompaun' => $faulty->amount, | |||
'jumlah_kemaskini_kompaun' => '', | |||
'dikeluarkan' => $staff->_id, | |||
"status" => 'Belum Bayar', | |||
"amount_payment" => '', | |||
"receipt" => '', | |||
"modul" => $request->modul, | |||
"penguatkuasa" => '', | |||
"no_telefon" => $request->tel, | |||
"no_akaun_lesen" => $request->lesen, | |||
"maklumat_tambahan" => '-', | |||
"bil_haiwan" => $request->bil_haiwan, | |||
"notis_created" => Carbon::now()->toDateTimeString(), | |||
]; | |||
} | |||
$file = ConfidentialFile::create($fileData); | |||
$saved = $file->compound()->create($compoundData); | |||
} | |||
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!'); | |||
// } | |||
} | |||
} | |||
} | |||
/** | |||
* Display the specified resource. |
@@ -44,6 +44,7 @@ class CompoundController extends Controller | |||
if(count($user->StaffDetail->department_ids) > 1){ | |||
$overall = ReportOverallCompound::where('department','all')->where('modul','all')->where('status','all')->first(); | |||
// $n = ReportOverallCompound::where('department','all')->where('modul','02')->where('status','Belum Bayar')->first(); | |||
$b = ReportOverallCompound::where('department','all')->where('modul','03')->where('status','Belum Bayar')->first(); | |||
$pk = ReportOverallCompound::where('department','all')->where('modul','04')->where('status','Belum Bayar')->first(); | |||
$na = ReportOverallCompound::where('department','all')->where('modul','05')->where('status','Belum Bayar')->first(); | |||
@@ -51,6 +52,7 @@ class CompoundController extends Controller | |||
$by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first(); | |||
}else { | |||
$overall = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','all')->where('status','all')->first(); | |||
// $n = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','02')->where('status','Belum Bayar')->first(); | |||
$b = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','03')->where('status','Belum Bayar')->first(); | |||
$pk = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','04')->where('status','Belum Bayar')->first(); | |||
$na = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','05')->where('status','Belum Bayar')->first(); | |||
@@ -59,6 +61,7 @@ class CompoundController extends Controller | |||
} | |||
$semua = $overall->total; | |||
// $pre_notice = $n->total; | |||
$baru = $b->total; | |||
$invest = $pk->total; | |||
$notice = $na->total; | |||
@@ -75,12 +78,53 @@ class CompoundController extends Controller | |||
return view('main-dashboard.compound.compound_index', compact('user','site','staff','deedlaw','now','modul','semua','baru','invest','notice','inven','collap','comp')); | |||
} | |||
public function pre_notice_index(){ | |||
$id = Auth::guard('sadmin')->id(); | |||
$user = Staff::with('StaffDetail')->find($id); | |||
if(count($user->StaffDetail->department_ids) > 1){ | |||
$overall = ReportOverallCompound::where('department','all')->where('modul','all')->where('status','all')->first(); | |||
// $n = ReportOverallCompound::where('department','all')->where('modul','02')->where('status','Belum Bayar')->first(); | |||
$b = ReportOverallCompound::where('department','all')->where('modul','03')->where('status','Belum Bayar')->first(); | |||
$pk = ReportOverallCompound::where('department','all')->where('modul','04')->where('status','Belum Bayar')->first(); | |||
$na = ReportOverallCompound::where('department','all')->where('modul','05')->where('status','Belum Bayar')->first(); | |||
$si = ReportOverallCompound::where('department','all')->where('modul','06-07')->where('status','Belum Bayar')->first(); | |||
$by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first(); | |||
}else { | |||
$overall = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','all')->where('status','all')->first(); | |||
// $n = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','02')->where('status','Belum Bayar')->first(); | |||
$b = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','03')->where('status','Belum Bayar')->first(); | |||
$pk = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','04')->where('status','Belum Bayar')->first(); | |||
$na = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','05')->where('status','Belum Bayar')->first(); | |||
$si = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','06-07')->where('status','Belum Bayar')->first(); | |||
$by = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('status','Berbayar')->first(); | |||
} | |||
$semua = $overall->total; | |||
// $pre_notice = $n->total; | |||
$baru = $b->total; | |||
$invest = $pk->total; | |||
$notice = $na->total; | |||
$inven = $si->total; | |||
$collap = 0; | |||
$comp = $by->total; | |||
$site = SiteSetting::first(); | |||
$staff = StaffDetail::where('roles_access','PenguatKuasa')->whereIn('department_ids',$user->StaffDetail->department_ids)->get(); | |||
$deedlaw = Deedlaw::with('Faulty')->whereIn('department_ids',$user->StaffDetail->department_ids)->get(); | |||
$now = Carbon::now()->format('Y-m-d'); | |||
$modul = '03'; | |||
return view('main-dashboard.compound.new_index', compact('user','site','staff','deedlaw','now','modul','semua','baru','invest','notice','inven','collap','comp')); | |||
} | |||
public function new_index(){ | |||
$id = Auth::guard('sadmin')->id(); | |||
$user = Staff::with('StaffDetail')->find($id); | |||
if(count($user->StaffDetail->department_ids) > 1){ | |||
$overall = ReportOverallCompound::where('department','all')->where('modul','all')->where('status','all')->first(); | |||
// $n = ReportOverallCompound::where('department','all')->where('modul','02')->where('status','Belum Bayar')->first(); | |||
$b = ReportOverallCompound::where('department','all')->where('modul','03')->where('status','Belum Bayar')->first(); | |||
$pk = ReportOverallCompound::where('department','all')->where('modul','04')->where('status','Belum Bayar')->first(); | |||
$na = ReportOverallCompound::where('department','all')->where('modul','05')->where('status','Belum Bayar')->first(); | |||
@@ -88,6 +132,7 @@ class CompoundController extends Controller | |||
$by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first(); | |||
}else { | |||
$overall = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','all')->where('status','all')->first(); | |||
// $n = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','02')->where('status','Belum Bayar')->first(); | |||
$b = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','03')->where('status','Belum Bayar')->first(); | |||
$pk = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','04')->where('status','Belum Bayar')->first(); | |||
$na = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','05')->where('status','Belum Bayar')->first(); | |||
@@ -96,6 +141,7 @@ class CompoundController extends Controller | |||
} | |||
$semua = $overall->total; | |||
// $pre_notice = $n->total; | |||
$baru = $b->total; | |||
$invest = $pk->total; | |||
$notice = $na->total; | |||
@@ -118,6 +164,7 @@ class CompoundController extends Controller | |||
if(count($user->StaffDetail->department_ids) > 1){ | |||
$overall = ReportOverallCompound::where('department','all')->where('modul','all')->where('status','all')->first(); | |||
// $n = ReportOverallCompound::where('department','all')->where('modul','02')->where('status','Belum Bayar')->first(); | |||
$b = ReportOverallCompound::where('department','all')->where('modul','03')->where('status','Belum Bayar')->first(); | |||
$pk = ReportOverallCompound::where('department','all')->where('modul','04')->where('status','Belum Bayar')->first(); | |||
$na = ReportOverallCompound::where('department','all')->where('modul','05')->where('status','Belum Bayar')->first(); | |||
@@ -125,6 +172,7 @@ class CompoundController extends Controller | |||
$by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first(); | |||
}else { | |||
$overall = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','all')->where('status','all')->first(); | |||
// $n = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','02')->where('status','Belum Bayar')->first(); | |||
$b = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','03')->where('status','Belum Bayar')->first(); | |||
$pk = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','04')->where('status','Belum Bayar')->first(); | |||
$na = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','05')->where('status','Belum Bayar')->first(); | |||
@@ -133,6 +181,7 @@ class CompoundController extends Controller | |||
} | |||
$semua = $overall->total; | |||
// $pre_notice = $n->total; | |||
$baru = $b->total; | |||
$invest = $pk->total; | |||
$notice = $na->total; | |||
@@ -155,6 +204,7 @@ class CompoundController extends Controller | |||
if(count($user->StaffDetail->department_ids) > 1){ | |||
$overall = ReportOverallCompound::where('department','all')->where('modul','all')->where('status','all')->first(); | |||
// $n = ReportOverallCompound::where('department','all')->where('modul','02')->where('status','Belum Bayar')->first(); | |||
$b = ReportOverallCompound::where('department','all')->where('modul','03')->where('status','Belum Bayar')->first(); | |||
$pk = ReportOverallCompound::where('department','all')->where('modul','04')->where('status','Belum Bayar')->first(); | |||
$na = ReportOverallCompound::where('department','all')->where('modul','05')->where('status','Belum Bayar')->first(); | |||
@@ -162,6 +212,7 @@ class CompoundController extends Controller | |||
$by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first(); | |||
}else { | |||
$overall = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','all')->where('status','all')->first(); | |||
// $n = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','02')->where('status','Belum Bayar')->first(); | |||
$b = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','03')->where('status','Belum Bayar')->first(); | |||
$pk = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','04')->where('status','Belum Bayar')->first(); | |||
$na = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','05')->where('status','Belum Bayar')->first(); | |||
@@ -170,6 +221,7 @@ class CompoundController extends Controller | |||
} | |||
$semua = $overall->total; | |||
// $pre_notice = $n->total; | |||
$baru = $b->total; | |||
$invest = $pk->total; | |||
$notice = $na->total; | |||
@@ -192,6 +244,7 @@ class CompoundController extends Controller | |||
if(count($user->StaffDetail->department_ids) > 1){ | |||
$overall = ReportOverallCompound::where('department','all')->where('modul','all')->where('status','all')->first(); | |||
// $n = ReportOverallCompound::where('department','all')->where('modul','02')->where('status','Belum Bayar')->first(); | |||
$b = ReportOverallCompound::where('department','all')->where('modul','03')->where('status','Belum Bayar')->first(); | |||
$pk = ReportOverallCompound::where('department','all')->where('modul','04')->where('status','Belum Bayar')->first(); | |||
$na = ReportOverallCompound::where('department','all')->where('modul','05')->where('status','Belum Bayar')->first(); | |||
@@ -199,6 +252,7 @@ class CompoundController extends Controller | |||
$by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first(); | |||
}else { | |||
$overall = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','all')->where('status','all')->first(); | |||
// $n = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','02')->where('status','Belum Bayar')->first(); | |||
$b = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','03')->where('status','Belum Bayar')->first(); | |||
$pk = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','04')->where('status','Belum Bayar')->first(); | |||
$na = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','05')->where('status','Belum Bayar')->first(); | |||
@@ -207,6 +261,7 @@ class CompoundController extends Controller | |||
} | |||
$semua = $overall->total; | |||
// $pre_notice = $n->total; | |||
$baru = $b->total; | |||
$invest = $pk->total; | |||
$notice = $na->total; | |||
@@ -229,6 +284,7 @@ class CompoundController extends Controller | |||
if(count($user->StaffDetail->department_ids) > 1){ | |||
$overall = ReportOverallCompound::where('department','all')->where('modul','all')->where('status','all')->first(); | |||
// $n = ReportOverallCompound::where('department','all')->where('modul','02')->where('status','Belum Bayar')->first(); | |||
$b = ReportOverallCompound::where('department','all')->where('modul','03')->where('status','Belum Bayar')->first(); | |||
$pk = ReportOverallCompound::where('department','all')->where('modul','04')->where('status','Belum Bayar')->first(); | |||
$na = ReportOverallCompound::where('department','all')->where('modul','05')->where('status','Belum Bayar')->first(); | |||
@@ -236,6 +292,7 @@ class CompoundController extends Controller | |||
$by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first(); | |||
}else { | |||
$overall = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','all')->where('status','all')->first(); | |||
// $n = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','02')->where('status','Belum Bayar')->first(); | |||
$b = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','03')->where('status','Belum Bayar')->first(); | |||
$pk = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','04')->where('status','Belum Bayar')->first(); | |||
$na = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','05')->where('status','Belum Bayar')->first(); | |||
@@ -244,6 +301,7 @@ class CompoundController extends Controller | |||
} | |||
$semua = $overall->total; | |||
// $pre_notice = $n->total; | |||
$baru = $b->total; | |||
$invest = $pk->total; | |||
$notice = $na->total; | |||
@@ -264,6 +322,7 @@ class CompoundController extends Controller | |||
if(count($user->StaffDetail->department_ids) > 1){ | |||
$overall = ReportOverallCompound::where('department','all')->where('modul','all')->where('status','all')->first(); | |||
// $n = ReportOverallCompound::where('department','all')->where('modul','02')->where('status','Belum Bayar')->first(); | |||
$b = ReportOverallCompound::where('department','all')->where('modul','03')->where('status','Belum Bayar')->first(); | |||
$pk = ReportOverallCompound::where('department','all')->where('modul','04')->where('status','Belum Bayar')->first(); | |||
$na = ReportOverallCompound::where('department','all')->where('modul','05')->where('status','Belum Bayar')->first(); | |||
@@ -271,6 +330,7 @@ class CompoundController extends Controller | |||
$by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first(); | |||
}else { | |||
$overall = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','all')->where('status','all')->first(); | |||
// $n = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','02')->where('status','Belum Bayar')->first(); | |||
$b = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','03')->where('status','Belum Bayar')->first(); | |||
$pk = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','04')->where('status','Belum Bayar')->first(); | |||
$na = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','05')->where('status','Belum Bayar')->first(); | |||
@@ -279,6 +339,7 @@ class CompoundController extends Controller | |||
} | |||
$semua = $overall->total; | |||
// $pre_notice = $n->total; | |||
$baru = $b->total; | |||
$invest = $pk->total; | |||
$notice = $na->total; |
@@ -25,9 +25,11 @@ | |||
</div> | |||
<div class="panel-body"> | |||
<div class="{{ Request::is('main/compound') ? 'menu-active' : 'menu' }}"><a href="/main/compound">Semua Kompaun</a> <label class="badge badge-success">{{ $semua }} </label></div> | |||
<div class="{{ Request::is('main/compound') ? 'menu-active' : 'menu' }}"><a href="/main/compound">Semua Kompaun & Notis</a> <label class="badge badge-success">{{ $semua }} </label></div> | |||
<div class="{{ Request::is('main/compound/new') ? 'menu-active' : 'menu' }}"><a href="/main/compound/new">Baru (02-03)</a> <label class="badge badge-success">{{ $baru }}</label></div> | |||
<!-- <div class="{{ Request::is('main/pre-notice/new') ? 'menu-active' : 'menu' }}"><a href="/main/pre-notice/new">Notis (02)</a> <label class="badge badge-success">{{ $baru }}</label></div> | |||
--> | |||
<div class="{{ Request::is('main/compound/new') ? 'menu-active' : 'menu' }}"><a href="/main/compound/new">Baru (03)</a> <label class="badge badge-success">{{ $baru }}</label></div> | |||
<div class="{{ Request::is('main/compound/investigation') ? 'menu-active' : 'menu' }}"><a href="/main/compound/investigation">Pengesahan Kompaun (04)</a> <label class="badge badge-success">{{ $invest }}</label></div> | |||
@@ -27,6 +27,7 @@ Route::group(['middleware' => 'mobileapps'], function() { | |||
Route::post('/mobile/staff/notice/today/list', 'Api\CompoundController@viewNoticeToday'); | |||
Route::post('/mobile/store/compound', 'Api\CompoundResourceController@store'); | |||
Route::post('/mobile/store/notice', 'Api\CompoundResourceController@storeNotice'); | |||
Route::post('/mobile/store', 'Api\CompoundResourceController@storeCompound'); | |||
Route::post('/mobile/store/compound/picture', 'Api\CompoundController@storeCompoundAttachment'); | |||
Route::post('/mobile/store/acceptance/compound', 'Api\CompoundController@storeAcceptanceCompound'); | |||
/*------------------------------------------------------------------------- |
@@ -73,6 +73,7 @@ Route::group(['middleware' => 'sysadminauth'], function () { | |||
| Compound | |||
|-------------------------------------------------------------------------*/ | |||
Route::get('/main/compound', ['uses' => 'Main\CompoundController@index', 'as' => 'compound']); | |||
Route::get('/main/pre-notice/new', ['uses' => 'Main\CompoundController@pre_notice_index', 'as' => 'noticeN']); | |||
Route::get('/main/compound/new', ['uses' => 'Main\CompoundController@new_index', 'as' => 'compoundN']); | |||
Route::get('/main/compound/investigation', ['uses' => 'Main\CompoundController@investigation_index', 'as' => 'investL']); | |||
Route::get('/main/compound/notice', ['uses' => 'Main\CompoundController@notice_index', 'as' => 'noticeL']); |