浏览代码

split 02

master
Siti Rahayu 4 年前
父节点
当前提交
5b3334d971

+ 0
- 10
app/Http/Controllers/Api/CompoundResourceController.php 查看文件

$q->where('modul', '06')->orWhere('modul','07'); $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 { }else {
$compound = $compound->where('modul', $modul); $compound = $compound->where('modul', $modul);
} }
$query->where('modul', '06')->orWhere('modul','07'); $query->where('modul', '06')->orWhere('modul','07');
}); });
}); });
}else if($modul == '03'){
$compound = $compound->where(function($q){
$q->where('modul', '02')->orWhere('modul', '03');
});
}else { }else {
$compound = $compound->where('modul', $modul); $compound = $compound->where('modul', $modul);
} }

+ 32
- 32
app/Http/Controllers/Main/CompoundController.php 查看文件

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();
$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();
$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;
$pre_notice = $n->total;
$baru = $b->total; $baru = $b->total;
$invest = $pk->total; $invest = $pk->total;
$notice = $na->total; $notice = $na->total;
$now = Carbon::now()->format('Y-m-d'); $now = Carbon::now()->format('Y-m-d');
$modul = 'All'; $modul = 'All';
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','pre_notice','baru','invest','notice','inven','collap','comp'));
} }
public function pre_notice_index(){ public function pre_notice_index(){
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();
$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();
$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;
$pre_notice = $n->total;
$baru = $b->total; $baru = $b->total;
$invest = $pk->total; $invest = $pk->total;
$notice = $na->total; $notice = $na->total;
$now = Carbon::now()->format('Y-m-d'); $now = Carbon::now()->format('Y-m-d');
$modul = '03'; $modul = '03';
return view('main-dashboard.compound.new_index', compact('user','site','staff','deedlaw','now','modul','semua','baru','invest','notice','inven','collap','comp'));
return view('main-dashboard.compound.prenotice_index', compact('user','site','staff','deedlaw','now','modul','semua','pre_notice','baru','invest','notice','inven','collap','comp'));
} }
public function new_index(){ public function new_index(){
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();
$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();
$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;
$pre_notice = $n->total;
$baru = $b->total; $baru = $b->total;
$invest = $pk->total; $invest = $pk->total;
$notice = $na->total; $notice = $na->total;
$now = Carbon::now()->format('Y-m-d'); $now = Carbon::now()->format('Y-m-d');
$modul = '03'; $modul = '03';
return view('main-dashboard.compound.new_index', compact('user','site','staff','deedlaw','now','modul','semua','baru','invest','notice','inven','collap','comp'));
return view('main-dashboard.compound.new_index', compact('user','site','staff','deedlaw','now','modul','semua','pre_notice','baru','invest','notice','inven','collap','comp'));
} }
public function investigation_index(){ public function investigation_index(){
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();
$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();
$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;
$pre_notice = $n->total;
$baru = $b->total; $baru = $b->total;
$invest = $pk->total; $invest = $pk->total;
$notice = $na->total; $notice = $na->total;
$now = Carbon::now()->format('Y-m-d'); $now = Carbon::now()->format('Y-m-d');
$modul = '04'; $modul = '04';
return view('main-dashboard.compound.investigation_index', compact('user','site','staff','deedlaw','now','modul','semua','baru','invest','notice','inven','collap','comp'));
return view('main-dashboard.compound.investigation_index', compact('user','site','staff','deedlaw','now','modul','semua','pre_notice','baru','invest','notice','inven','collap','comp'));
} }
public function notice_index(){ public function notice_index(){
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();
$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();
$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;
$pre_notice = $n->total;
$baru = $b->total; $baru = $b->total;
$invest = $pk->total; $invest = $pk->total;
$notice = $na->total; $notice = $na->total;
$now = Carbon::now()->format('Y-m-d'); $now = Carbon::now()->format('Y-m-d');
$modul = '05'; $modul = '05';
return view('main-dashboard.compound.notice_index', compact('user','site','staff','deedlaw','now','modul','semua','baru','invest','notice','inven','collap','comp'));
return view('main-dashboard.compound.notice_index', compact('user','site','staff','deedlaw','now','modul','semua','pre_notice','baru','invest','notice','inven','collap','comp'));
} }
public function confiscated_index(){ public function confiscated_index(){
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();
$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();
$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;
$pre_notice = $n->total;
$baru = $b->total; $baru = $b->total;
$invest = $pk->total; $invest = $pk->total;
$notice = $na->total; $notice = $na->total;
$now = Carbon::now()->format('Y-m-d'); $now = Carbon::now()->format('Y-m-d');
$modul = '06-07'; $modul = '06-07';
return view('main-dashboard.compound.confiscated_index', compact('user','site','staff','deedlaw','now','modul','semua','baru','invest','notice','inven','collap','comp'));
return view('main-dashboard.compound.confiscated_index', compact('user','site','staff','deedlaw','now','modul','semua','pre_notice','baru','invest','notice','inven','collap','comp'));
} }
public function collapsed_index(){ public function collapsed_index(){
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();
$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();
$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;
$pre_notice = $n->total;
$baru = $b->total; $baru = $b->total;
$invest = $pk->total; $invest = $pk->total;
$notice = $na->total; $notice = $na->total;
$staff = StaffDetail::where('roles_access','PenguatKuasa')->whereIn('department_ids',$user->StaffDetail->department_ids)->get(); $staff = StaffDetail::where('roles_access','PenguatKuasa')->whereIn('department_ids',$user->StaffDetail->department_ids)->get();
$faulty = Deedlaw::with('Faulty')->whereIn('department_ids',$user->StaffDetail->department_ids)->get(); $faulty = Deedlaw::with('Faulty')->whereIn('department_ids',$user->StaffDetail->department_ids)->get();
return view('main-dashboard.compound.collapsed_index', compact('user','site','staff','faulty','baru','invest','notice','inven','collap','comp'));
return view('main-dashboard.compound.collapsed_index', compact('user','site','staff','faulty','pre_notice','baru','invest','notice','inven','collap','comp'));
} }
public function completed_index(){ public function completed_index(){
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();
$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();
$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;
$pre_notice = $n->total;
$baru = $b->total; $baru = $b->total;
$invest = $pk->total; $invest = $pk->total;
$notice = $na->total; $notice = $na->total;
$now = Carbon::now()->format('Y-m-d'); $now = Carbon::now()->format('Y-m-d');
$modul = 'All'; $modul = 'All';
return view('main-dashboard.compound.completed_index', compact('user','site','staff','deedlaw','now','modul','semua','baru','invest','notice','inven','collap','comp'));
return view('main-dashboard.compound.completed_index', compact('user','site','staff','deedlaw','now','modul','semua', 'pre_notice','baru','invest','notice','inven','collap','comp'));
} }

+ 4
- 2
resources/views/main-dashboard/compound/_part/menu_category.blade.php 查看文件

<div class="panel-body"> <div class="panel-body">
<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') ? '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/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/pre-notice/new') ? 'menu-active' : 'menu' }}"><a href="/main/pre-notice/new">Notis (02)</a>&nbsp;<label class="badge badge-success">{{ $pre_notice }}</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/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>
<div class="card-body"> <div class="card-body">
@if(Request::is('main/compound')) @if(Request::is('main/compound'))
<i><b>Semua</b> status kompaun termasuk <b>semua</b> modul</i> <i><b>Semua</b> status kompaun termasuk <b>semua</b> modul</i>
@elseif(Request::is('main/pre-notice/new'))
<i>Senarai <b>notis</b> yang telah dikeluarkan dan <b>belum ditukar status</b> ke kompaun</i>
@elseif(Request::is('main/compound/new')) @elseif(Request::is('main/compound/new'))
<i>Senarai kompaun yang <b>belum bayar / batal</b> dan dalam kategori modul <b>Baru (03)</b> sahaja</i> <i>Senarai kompaun yang <b>belum bayar / batal</b> dan dalam kategori modul <b>Baru (03)</b> sahaja</i>
@elseif(Request::is('main/compound/investigation')) @elseif(Request::is('main/compound/investigation'))

+ 311
- 0
resources/views/main-dashboard/compound/prenotice_index.blade.php 查看文件

@extends('layout.master', ['uid' => $user->_id, 'token' => $user->token_firebase])
@section('page_title', 'Kompaun')
@section('sub_page_title', '')
@section('name', $user->StaffDetail->full_name)
@section('img_profile', $user->StaffDetail->profile_img)

@section('content')
<style type="text/css">
select.form-control, select.form-control:focus, select.form-control:hover {
border: 1px solid #ccc !important;
height: auto !important;
}

.panel-group .panel {
margin-bottom: 0;
overflow: hidden;
border-radius: 4px;
}
.panel-default {
border-color: #ddd;
}
.panel-default>.panel-heading {
color: #333;
background-color: #f5f5f5;
border-color: #ddd;
}
.panel-title {
margin-top: 0;
margin-bottom: 0;
font-size: 16px;
color: inherit;
}

.panel-body .table>thead>tr>th, .panel-body .table>tbody>tr>th, .panel-body .table>tfoot>tr>th, .panel-body .table>thead>tr>td, .panel-body .table>tbody>tr>td, .panel-body .table>tfoot>tr>td , .panel-body div{
padding: 8px 15px;
line-height: 1.428571429;
vertical-align: top;
border-top: 1px solid #ddd;
}
.glyphicon { margin-right:10px; }
.panel-body { padding:0px; }
.panel-body table tr td { padding-left: 15px }
.panel-body table tr td a:hover , .panel-body div a:hover{ color: #d84315 !important; }
.panel-body .table, .panel-body div {margin-bottom: 0px; }

.r-padd { padding-right: 5%; }
.active { color: #d84315; }
.active:hover { color: #d84315; }

th { font-weight: 600; }
table.dataTable.nowrap th, table.dataTable.nowrap td {
white-space: pre-line !important;
}

table.nowrap th, table.nowrap td {
white-space: pre-line !important;
}
</style>

<div class="inner-page">
<div class="row">
@include('main-dashboard.compound._part.menu_category')
@include('main-dashboard.compound._part.filter_form')
</div>
<div class="row">
<div class="col-md-12">

<div class="card">
<div class="card-header">
<div class="row">
<div class="col-md-8">
<h5>Senarai Notis Yang Telah Dikeluarkan</h5>
</div>
<div class="col-md-4">
<!-- <div id="link" style="float:right"></div>
<div id="link1" style="float:right"></div> -->
</div>
</div>
</div>
<div class="card-body">
<div id="viewParkir">
@include('main-dashboard.compound._part.compound_parkir')
</div>
<div id="viewPelbagai">
@include('main-dashboard.compound._part.compound_pelbagai')
</div>
</div>
</div>
</div>
</div>

<div class="modal fade" id="kemaskiniC" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<form class="form-horizontal" id="updateSt">
<div class="modal-header">
<h5 class="modal-title">Kemaskini Status Kompaun</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<input type="hidden" name="id" id="id" value="" required/>
<input type="hidden" name="current_id" id="current_id" value="{{ $user->_id }}" required/>
<div class="form-group">
<label class="col-sm-6 control-label"><b>Status</b></label>
<div class="col-sm-12">
<select class="form-control" name="status" required>
<option value="Belum Bayar">Belum Bayar</option>
<option value="Berbayar">Berbayar</option>
<option value="Batal">Batal</option>
</select>
</div>
</div>

<div class="form-group">
<label class="col-sm-6 control-label"><b>Catatan <code>*</code></b></label>
<div class="col-sm-12">
<textarea class="form-control" name="remark"></textarea>
</div>
</div>

<div class="form-group">
<label class="col-sm-6 control-label"><b>Jumlah Dibayar <code>*</code></b></label>
<div class="col-sm-12">
<input type="text" class="form-control autonumber" name="amount" data-v-min="0.00" data-v-max="99999.00"placeholder="0.00" required/>
</div>
</div>

<div class="form-group">
<label class="col-sm-6 control-label"><b>Amaun Tunggakan</b> <code>*</code></label>
<div class="col-sm-12">
<input type="text" class="form-control autonumber" name="tunggakan" data-v-min="0.00" data-v-max="99999.00" placeholder="0.00" required/>
<code>Sekiranya tiada amaun tunggakan, sila letak 0. Amaun tunggakan ini akan diguna untuk laporan</code>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-secondary mobtn" data-dismiss="modal">Close</button>
<button id="submit" class="btn btn-sm btn-primary waves-effect waves-light">KEMASKINI</button>
</div>
</form>
</div>
</div>
</div>
</div>
@endsection

@section('external_js')
<script type="text/javascript">
var SITEURL = '{{URL::to('')}}';
var tableP, tablePl;
var queryString1 = '', queryString2 = '', token = "{{ csrf_token() }}";
$('#viewParkir').hide(); $('#link').hide();
$('#viewPelbagai').hide(); $('#link1').hide();
</script>
<script type="text/javascript" src="{{ asset('js/dataParkir.js') }}"></script>
<script type="text/javascript" src="{{ asset('js/dataPelbagai.js') }}"></script>
<script type="text/javascript" src="{{ asset('js/function_checkbox.js') }}"></script>
<script type="text/javascript">
$('#tapis').on('click', function (e) {
e.preventDefault();
var form = $("#filter_form")[0];
if(form.checkValidity() === false) {
e.stopPropagation();
var isValid = form.reportValidity();
}else {

$('#viewPelbagai').hide();
$('#viewParkir').hide();

if($('#check_kpd').prop("checked") == false){
$('#kpd').val('');
}

if($('#check_date').prop("checked") == false){
$('#start_date').val('');
$('#end_date').val('');
}

if($('#checkPlateNo').prop("checked") == false){
$('#plate_no').val('');
}

if($('#checkCompanyNo').prop("checked") == false){
$('#company_no').val('');
}

if($('#checkNric').prop("checked") == false){
$('#nric').val('');
}

if($('#checkLicense').prop("checked") == false){
$('#license').val('');
}

if($('#checkName').prop("checked") == false){
$('#nameP').val('');
}

if($('#checkCompanyName').prop("checked") == false){
$('#company_name').val('');
}

// Sumbit Search
var form_data = $('#filter_form').serialize();
if($('#type_C').val() == 'Parkir'){

queryString1 = '?'+form_data;
$('#viewPelbagai').hide();
$('#viewParkir').show();
tableP.ajax.url(SITEURL +'/api/list/compound'+ queryString1).load();

}else if($('#type_C').val() == "Pelbagai"){

queryString2 = '?'+form_data;
$('#viewPelbagai').show();
$('#viewParkir').hide();
tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
}else if($('#type_C').val() == "Pelbagai_JPB"){

queryString2 = '?'+form_data;
$('#viewPelbagai').show();
$('#viewParkir').hide();
tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
}else if($('#type_C').val() == "Pelbagai_KT"){

queryString2 = '?'+form_data;
$('#viewPelbagai').show();
$('#viewParkir').hide();
tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
}else if($('#type_C').val() == "Pelbagai_PA"){

queryString2 = '?'+form_data;
$('#viewPelbagai').show();
$('#viewParkir').hide();
tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
}else if($('#type_C').val() == "Pelbagai_LESEN"){

queryString2 = '?'+form_data;
$('#viewPelbagai').show();
$('#viewParkir').hide();
tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
}

console.log(SITEURL +'/api/list/compound'+ queryString1);
console.log(SITEURL +'/api/list/compound'+ queryString2);
}

return false;
});

$('#submit').on('click', function (e) {
e.preventDefault();
var form = $("#updateSt")[0];
if(form.checkValidity() === false) {
e.stopPropagation();
var isValid = form.reportValidity();
}else {
var input = prompt("Adakah anda pasti kemaskini status kompaun ini? \nTaip 'yes' untuk teruskan", "");
if (input == "yes") {
var form_data = $('#updateSt').serialize();
alert(form_data);

$.ajax({
type: "POST",
url: "{{ url('/api/update/compound/via-dashboard') }}",
data: form_data,
success:function(data){

if(data['success'] == true){

if($('#type_C').val() == 'Parkir'){
$('#viewPelbagai').hide();
$('#viewParkir').show();
tableP.ajax.url(SITEURL +'/api/list/compound'+ queryString1).load();
$('#kemaskiniC').modal('hide');
}else if($('#type_C').val() == "Pelbagai"){
$('#viewPelbagai').show();
$('#viewParkir').hide();
tablePl.ajax.url(SITEURL +'/api/list/compound'+ queryString2).load();
$('#kemaskiniC').modal('hide');
}

}else if(data['success'] == false){
alert(response.data.message);
$('#kemaskiniC').modal('hide');
}
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(thrownError);
// swal("Error deleting!", "Rekod tidak berjaya di buang", "error");
}
});
}else{
alert('Kemaskini status dibatalkan');
$('#kemaskiniC').modal('hide');
}
}
});

function getDetail(id) {
$('#id').val(id);
$('#kemaskiniC').modal({
show: true
})
};
</script>
@endsection

正在加载...
取消
保存