Browse Source

split 02

master
Siti Rahayu 4 years ago
parent
commit
ec83455de9

+ 30
- 2
app/Console/Commands/CalculateStatisticCompound.php View File

$dataS->modul = 'all'; $dataS->modul = 'all';
$dataS->save(); $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] //calculate compound [modul = 03, status = Belum Bayar]
$b1 = ReportOverallCompound::where('status','Belum Bayar')->where('department','all')->where('modul','03')->orWhere('modul','02')->first(); $b1 = ReportOverallCompound::where('status','Belum Bayar')->where('department','all')->where('modul','03')->orWhere('modul','02')->first();
$dataJS1->save(); $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] //calcculate compound by department [status = Belum Bayar, modul = 03]
$b2 = ReportOverallCompound::where('status','Belum Bayar')->where('department',$d->_id)->where('modul','03')->orWhere('modul','02')->first(); $b2 = ReportOverallCompound::where('status','Belum Bayar')->where('department',$d->_id)->where('modul','03')->orWhere('modul','02')->first();
if(!empty($b2)){ if(!empty($b2)){
$b2->total = count(Compound::where('jbkod',$d->_id)->where('modul','03')->orWhere('modul','02')->where('status','Belum Bayar')->get());
$b2->total = count(Compound::where('jbkod',$d->_id)->where('modul','03')->where('status','Belum Bayar')->get());
$b2->save(); $b2->save();
}else { }else {
$dataJB1 = new ReportOverallCompound; $dataJB1 = new ReportOverallCompound;
$dataJB1->total = count(Compound::where('jbkod',$d->_id)->where('modul','03')->orWhere('modul','02')->where('status','Belum Bayar')->get());
$dataJB1->total = count(Compound::where('jbkod',$d->_id)->where('modul','03')->where('status','Belum Bayar')->get());
$dataJB1->status = 'Belum Bayar'; $dataJB1->status = 'Belum Bayar';
$dataJB1->department = $d->_id; $dataJB1->department = $d->_id;
$dataJB1->modul = '03'; $dataJB1->modul = '03';

+ 7
- 11
app/Http/Controllers/Api/CompoundResourceController.php View File

use App\Model\Module\Attachment; use App\Model\Module\Attachment;


use App\Jobs\StoreCompound; use App\Jobs\StoreCompound;
use App\Jobs\StoreNotice;
use App\Jobs\StoreCompoundEPBT; use App\Jobs\StoreCompoundEPBT;
use App\Jobs\UpdateCompoundPrice; use App\Jobs\UpdateCompoundPrice;
use App\Http\Resources\CompoundResource; use App\Http\Resources\CompoundResource;
} }


/** /**
* Store a newly created resource in storage.
* Store a created compound from notice.
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response


$kpd = $request->kpd; $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(); $compound = Compound::where('jenis', $request->jenis)->where('kpd', $kpd)->first();
if (!empty($compound)) { if (!empty($compound)) {
} }




/*********************************************
| Store a newly created notice
*********************************************/
public function storeNotice(Request $request) public function storeNotice(Request $request)
{ {
$staff = Staff::with('StaffDetail')->where('api_token',$request->api_token)->first(); $staff = Staff::with('StaffDetail')->where('api_token',$request->api_token)->first();
// }else{ // }else{
// $tawaran = $compound->jumlah_asal_kompaun; // $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)); array_push($data, array('kpd' => $kpd));


return $this->sendResponse($data, 'Berjaya simpan rekod notis!'); return $this->sendResponse($data, 'Berjaya simpan rekod notis!');
} }


/** /**
* Store a newly created resource in storage.
* Store a newly created compound (parkir, KT, JPB).
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response

+ 61
- 0
app/Http/Controllers/Main/CompoundController.php View File

if(count($user->StaffDetail->department_ids) > 1){ if(count($user->StaffDetail->department_ids) > 1){
$overall = ReportOverallCompound::where('department','all')->where('modul','all')->where('status','all')->first(); $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(); $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(); $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(); $na = ReportOverallCompound::where('department','all')->where('modul','05')->where('status','Belum Bayar')->first();
$by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first(); $by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first();
}else { }else {
$overall = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','all')->where('status','all')->first(); $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(); $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(); $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(); $na = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','05')->where('status','Belum Bayar')->first();
} }
$semua = $overall->total; $semua = $overall->total;
// $pre_notice = $n->total;
$baru = $b->total; $baru = $b->total;
$invest = $pk->total; $invest = $pk->total;
$notice = $na->total; $notice = $na->total;
return view('main-dashboard.compound.compound_index', compact('user','site','staff','deedlaw','now','modul','semua','baru','invest','notice','inven','collap','comp')); 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(){ public function new_index(){
$id = Auth::guard('sadmin')->id(); $id = Auth::guard('sadmin')->id();
$user = Staff::with('StaffDetail')->find($id); $user = Staff::with('StaffDetail')->find($id);
if(count($user->StaffDetail->department_ids) > 1){ if(count($user->StaffDetail->department_ids) > 1){
$overall = ReportOverallCompound::where('department','all')->where('modul','all')->where('status','all')->first(); $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(); $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(); $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(); $na = ReportOverallCompound::where('department','all')->where('modul','05')->where('status','Belum Bayar')->first();
$by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first(); $by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first();
}else { }else {
$overall = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','all')->where('status','all')->first(); $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(); $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(); $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(); $na = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','05')->where('status','Belum Bayar')->first();
} }
$semua = $overall->total; $semua = $overall->total;
// $pre_notice = $n->total;
$baru = $b->total; $baru = $b->total;
$invest = $pk->total; $invest = $pk->total;
$notice = $na->total; $notice = $na->total;
if(count($user->StaffDetail->department_ids) > 1){ if(count($user->StaffDetail->department_ids) > 1){
$overall = ReportOverallCompound::where('department','all')->where('modul','all')->where('status','all')->first(); $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(); $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(); $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(); $na = ReportOverallCompound::where('department','all')->where('modul','05')->where('status','Belum Bayar')->first();
$by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first(); $by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first();
}else { }else {
$overall = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','all')->where('status','all')->first(); $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(); $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(); $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(); $na = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','05')->where('status','Belum Bayar')->first();
} }
$semua = $overall->total; $semua = $overall->total;
// $pre_notice = $n->total;
$baru = $b->total; $baru = $b->total;
$invest = $pk->total; $invest = $pk->total;
$notice = $na->total; $notice = $na->total;
if(count($user->StaffDetail->department_ids) > 1){ if(count($user->StaffDetail->department_ids) > 1){
$overall = ReportOverallCompound::where('department','all')->where('modul','all')->where('status','all')->first(); $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(); $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(); $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(); $na = ReportOverallCompound::where('department','all')->where('modul','05')->where('status','Belum Bayar')->first();
$by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first(); $by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first();
}else { }else {
$overall = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','all')->where('status','all')->first(); $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(); $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(); $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(); $na = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','05')->where('status','Belum Bayar')->first();
} }
$semua = $overall->total; $semua = $overall->total;
// $pre_notice = $n->total;
$baru = $b->total; $baru = $b->total;
$invest = $pk->total; $invest = $pk->total;
$notice = $na->total; $notice = $na->total;
if(count($user->StaffDetail->department_ids) > 1){ if(count($user->StaffDetail->department_ids) > 1){
$overall = ReportOverallCompound::where('department','all')->where('modul','all')->where('status','all')->first(); $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(); $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(); $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(); $na = ReportOverallCompound::where('department','all')->where('modul','05')->where('status','Belum Bayar')->first();
$by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first(); $by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first();
}else { }else {
$overall = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','all')->where('status','all')->first(); $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(); $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(); $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(); $na = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','05')->where('status','Belum Bayar')->first();
} }
$semua = $overall->total; $semua = $overall->total;
// $pre_notice = $n->total;
$baru = $b->total; $baru = $b->total;
$invest = $pk->total; $invest = $pk->total;
$notice = $na->total; $notice = $na->total;
if(count($user->StaffDetail->department_ids) > 1){ if(count($user->StaffDetail->department_ids) > 1){
$overall = ReportOverallCompound::where('department','all')->where('modul','all')->where('status','all')->first(); $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(); $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(); $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(); $na = ReportOverallCompound::where('department','all')->where('modul','05')->where('status','Belum Bayar')->first();
$by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first(); $by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first();
}else { }else {
$overall = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','all')->where('status','all')->first(); $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(); $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(); $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(); $na = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','05')->where('status','Belum Bayar')->first();
} }
$semua = $overall->total; $semua = $overall->total;
// $pre_notice = $n->total;
$baru = $b->total; $baru = $b->total;
$invest = $pk->total; $invest = $pk->total;
$notice = $na->total; $notice = $na->total;
if(count($user->StaffDetail->department_ids) > 1){ if(count($user->StaffDetail->department_ids) > 1){
$overall = ReportOverallCompound::where('department','all')->where('modul','all')->where('status','all')->first(); $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(); $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(); $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(); $na = ReportOverallCompound::where('department','all')->where('modul','05')->where('status','Belum Bayar')->first();
$by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first(); $by = ReportOverallCompound::where('department','all')->where('status','Berbayar')->first();
}else { }else {
$overall = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','all')->where('status','all')->first(); $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(); $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(); $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(); $na = ReportOverallCompound::where('department',$user->StaffDetail->department_ids[0])->where('modul','05')->where('status','Belum Bayar')->first();
} }
$semua = $overall->total; $semua = $overall->total;
// $pre_notice = $n->total;
$baru = $b->total; $baru = $b->total;
$invest = $pk->total; $invest = $pk->total;
$notice = $na->total; $notice = $na->total;

+ 4
- 2
resources/views/main-dashboard/compound/_part/menu_category.blade.php View File

</div> </div>


<div class="panel-body"> <div class="panel-body">
<div class="{{ Request::is('main/compound') ? 'menu-active' : 'menu' }}"><a href="/main/compound">Semua Kompaun</a>&nbsp;<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>&nbsp;<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>&nbsp;<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>&nbsp;<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>&nbsp;<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>&nbsp;<label class="badge badge-success">{{ $invest }}</label></div> <div class="{{ Request::is('main/compound/investigation') ? 'menu-active' : 'menu' }}"><a href="/main/compound/investigation">Pengesahan Kompaun (04)</a>&nbsp;<label class="badge badge-success">{{ $invest }}</label></div>



+ 1
- 0
routes/web.php View File

| Compound | Compound
|-------------------------------------------------------------------------*/ |-------------------------------------------------------------------------*/
Route::get('/main/compound', ['uses' => 'Main\CompoundController@index', 'as' => '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/new', ['uses' => 'Main\CompoundController@new_index', 'as' => 'compoundN']);
Route::get('/main/compound/investigation', ['uses' => 'Main\CompoundController@investigation_index', 'as' => 'investL']); Route::get('/main/compound/investigation', ['uses' => 'Main\CompoundController@investigation_index', 'as' => 'investL']);
Route::get('/main/compound/notice', ['uses' => 'Main\CompoundController@notice_index', 'as' => 'noticeL']); Route::get('/main/compound/notice', ['uses' => 'Main\CompoundController@notice_index', 'as' => 'noticeL']);

Loading…
Cancel
Save