Pilih :
+-
+
- +
- +
- +
diff --git a/app/Controllers/Rapor.php b/app/Controllers/Rapor.php index 4846ce6a..b04f4ffd 100644 --- a/app/Controllers/Rapor.php +++ b/app/Controllers/Rapor.php @@ -308,4 +308,76 @@ class Rapor extends BaseController return redirect()->to('auth'); } } + + + + function deltabyr() + { + if (session('isLogin')) { + + $model = new Mrapor(); + $modelref = new Mref(); + + if (session('tpkantor') == 'KPDJP') { + $kwl = $this->request->getPost('kwl') ?? '090'; + $kpp = $this->request->getPost('kpp') ?? 'SEMUA'; + $seksi = $this->request->getPost('seksi') ?? 'SEMUA'; + $nip = $this->request->getPost('nip') ?? 'SEMUA'; + } else if (session('tpkantor') == 'Kanwil') { + $kwl = session('kwladm'); + $kpp = $this->request->getPost('kpp') ?? 'SEMUA'; + $seksi = $this->request->getPost('seksi') ?? 'SEMUA'; + $nip = $this->request->getPost('nip') ?? 'SEMUA'; + } else { + $kwl = session('kwladm'); + $kpp = session('kppadm'); + $seksi = $this->request->getPost('seksi') ?? 'SEMUA'; + $nip = $this->request->getPost('nip') ?? 'SEMUA'; + } + $ptahun = $this->request->getPost('tahun'); + $pbulan = $this->request->getPost('bulan'); + $ybulan = $this->request->getPost('bulan1'); + + if (empty($ptahun)) { + $tahun = date('Y'); + } else { + $tahun = $ptahun; + } + if (empty($pbulan)) { + $bulan = date('m'); + } else { + $bulan = $pbulan; + } + + if(empty($ybulan)){ + $bulan1 = '1'; + }else{ + $bulan1 = $ybulan; + } + $tahunl = $tahun - 1; + $param = array('kwl' => $kwl, 'kpp' => $kpp, 'tahun' => $tahun, 'bln' => $bulan, 'seksi' => $seksi, 'nip' => $nip); + $p['kwlx'] = $kwl; + $p['kppx'] = $kpp; + $p['seksix'] = $seksi; + $p['nipx'] = $nip; + $p['tahunx'] = $tahun; + $p['tahunlx'] = $tahunl; + $p['bulanx'] = $bulan1; + $p['bulany'] = $bulan; + $p['selkwl'] = $modelref->selKwl('')->getResult(); + $p['selkpp'] = $modelref->selKpp($kwl)->getResult(); + $p['selseksi'] = $modelref->selSeksi($kpp)->getResult(); + $p['refbulan'] = $modelref->getBln(); + $p['data'] = $model->; + + + echo view('inc/head'); + echo view('inc/navbar'); + echo view('inc/sidebar'); + echo view('rapor/deltabyr', $p); + echo view('inc/footer'); + } else { + return redirect()->to('auth'); + } + } } diff --git a/app/Models/Mbyrlpr.php b/app/Models/Mbyrlpr.php index 298af9eb..03c2202d 100644 --- a/app/Models/Mbyrlpr.php +++ b/app/Models/Mbyrlpr.php @@ -18,12 +18,30 @@ class Mbyrlpr extends Model $seksi = $param['seksi']; $nip = $param['nip']; $pilihan = $param['pilihan']; + + if ($kpp == "SEMUA") { + $cekkpp = ""; + } else { + $cekkpp = "AND KPPADM = '" . $kpp . "'"; + } + + if ($seksi == "SEMUA") { + $cekseksi = ""; + } else { + $cekseksi = + "AND KODESIE = '" . $seksi . "'"; + } + if ($nip == "SEMUA") { + $ceknip = ""; + } else { + $ceknip = "AND NIP = '" . $nip . "'"; + } if ($pilihan == '1') { $cekpil = "AND JMLBYR IS NOT NULL AND BYRLALU IS NULL"; } else if ($pilihan == '2') { $cekpil = "AND JMLBYR IS NULL AND BYRLALU IS NOT NULL"; } - $query = $this->db->query("SELECT COUNT(1) NUMROWS FROM DASHBOARD_BYRLPR WHERE TAHUN = '" . $tahun . "' AND KWLADM = '" . $kwl . "' AND KPPADM = '" . $kpp . "' AND KODESIE = '" . $seksi . "' AND NIP_AR = '" . $nip . "' $cekpil "); + $query = $this->db->query("SELECT COUNT(1) NUMROWS FROM DASHBOARD_BYRLPR WHERE TAHUN = '" . $tahun . "' AND KWLADM = '" . $kwl . "' $cekpil $cekkpp $cekseksi $ceknip"); return $query; } @@ -47,12 +65,25 @@ class Mbyrlpr extends Model $jmlbyrp = "BYRLALU IS NOT NULL"; } + if ($kpp == "SEMUA" && $seksi == "SEMUA" && $nip == "SEMUA") { + $array + = ['KWLADM' => $kwl ]; + } else if($kpp != "SEMUA" && $seksi == "SEMUA" && $nip == "SEMUA") { + $array + = [ 'KWLADM' => $kwl, 'KPPADM' => $kpp]; + }else if ($kpp != "SEMUA" && $seksi != "SEMUA" && $nip == "SEMUA"){ + $array + = [ 'KWLADM' => $kwl, 'KPPADM' => $kpp, 'KODESIE' => $seksi]; + } + + else if ($kpp != "SEMUA" && $seksi != "SEMUA" && $nip != "SEMUA") { + $array + = [ 'KWLADM' => $kwl, 'KODESIE' => $seksi, 'NIP_AR' => $nip]; + } + $this->builder() ->where('TAHUN', $tahun) - ->where('KWLADM', $kwl) - ->where('KPPADM', $kpp) - ->where('KODESIE', $seksi) - ->where('NIP_AR', $nip) + ->where($array) ->where($jmlbyrn) ->where($jmlbyrp) ->limit($limit, $offset); diff --git a/app/Models/Mdetkat.php b/app/Models/Mdetkat.php index e46200ae..0e5e005a 100644 --- a/app/Models/Mdetkat.php +++ b/app/Models/Mdetkat.php @@ -19,15 +19,30 @@ class Mdetkat extends Model $seksi = $param['seksi']; $nip = $param['nip']; $kategori = $param['kategori']; + + if ($kpp == "SEMUA") { + $cekkpp = ""; + } else { + $cekkpp = "AND KPPADM = '" . $kpp . "'"; + } + + if ($seksi == "SEMUA") { + $cekseksi = ""; + } else { + $cekseksi = + "AND KODESIE = '" . $seksi . "'"; + } + if ($nip == "SEMUA") { + $ceknip = ""; + } else { + $ceknip = "AND NIP = '" . $nip . "'"; + } $query = $this->db->query("SELECT NPWP,NAMA,KATEGORI,TOTAL FROM DASHBOARD_BESAR_MAPKJS WHERE THNBYR = '" . $tahun . "' AND KWLADM = '" . $kwl . "' AND BLNBYR <= '" . $bln . "' - AND KPPADM='" . $kpp . "' - AND KODESIE='" . $seksi . "' - AND NIP='" . $nip . "' - AND KATEGORI='" . $kategori . "' "); + AND KATEGORI='" . $kategori . "' $cekkpp $cekseksi $ceknip"); return $query; } @@ -43,17 +58,31 @@ class Mdetkat extends Model $offset = $param['page']; $limit = $param['perPage']; $kategori = $param['kategori']; + + + if ($kpp == "SEMUA" && $seksi == "SEMUA" && $nip == "SEMUA") { + $array + = ['KWLADM' => $kwl ]; + } else if($kpp != "SEMUA" && $seksi == "SEMUA" && $nip == "SEMUA") { + $array + = [ 'KWLADM' => $kwl, 'KPPADM' => $kpp]; + }else if ($kpp != "SEMUA" && $seksi != "SEMUA" && $nip == "SEMUA"){ + $array + = [ 'KWLADM' => $kwl, 'KPPADM' => $kpp, 'KODESIE' => $seksi]; + } + + else if ($kpp != "SEMUA" && $seksi != "SEMUA" && $nip != "SEMUA") { + $array + = [ 'KWLADM' => $kwl, 'KODESIE' => $seksi, 'NIP' => $nip]; + } $this->builder() ->select('NPWP,NAMA') ->selectSum('TOTAL') - ->where('THNBYR', $tahun) - ->where('KWLADM', $kwl) - ->where('KPPADM', $kpp) - ->where('KODESIE', $seksi) - ->where('NIP', $nip) + ->where('THNBYR' ,$tahun) ->where('KATEGORI', $kategori) - ->where('BLNBYR <=', $bln) + ->where('BLNBYR <=', $bln) + ->where($array) ->groupBy('NPWP,NAMA') ->limit($limit, $offset); diff --git a/app/Models/Mdetpaycomp.php b/app/Models/Mdetpaycomp.php index 48027919..d00d5325 100644 --- a/app/Models/Mdetpaycomp.php +++ b/app/Models/Mdetpaycomp.php @@ -18,9 +18,26 @@ class Mdetpaycomp extends Model $seksi = $param['seksi']; $nip = $param['nip']; $jmlbln = $param['jmlbln']; + if ($kpp == "SEMUA") { + $cekkpp = ""; + } else { + $cekkpp = "AND KPPADM = '" . $kpp . "'"; + } + + if ($seksi == "SEMUA") { + $cekseksi = ""; + } else { + $cekseksi = + "AND KODESIE = '" . $seksi . "'"; + } + if ($nip == "SEMUA") { + $ceknip = ""; + } else { + $ceknip = "AND NIP = '" . $nip . "'"; + } $query = $this->db->query("SELECT NPWP,NAMA,SUM(TOTAL) FROM( SELECT NPWP, NAMA, TOTAL,COUNT(1) JMLBLN - FROM DASHBOARD_WP_BLN WHERE TAHUN = '" . $tahun . "' AND KWLADM = '" . $kwl . "' AND KPPADM = '" . $kpp . "' AND KODESIE = '" . $seksi . "' AND NIP = '" . $nip . "' + FROM DASHBOARD_WP_BLN WHERE TAHUN = '" . $tahun . "' AND KWLADM = '" . $kwl . "'$cekkpp $cekseksi $ceknip GROUP BY NPWP,NAMA,TOTAL) WHERE JMLBLN = '" . $jmlbln . "' GROUP BY NPWP,NAMA "); return $query; @@ -38,15 +55,28 @@ class Mdetpaycomp extends Model $offset = $param['page']; $limit = $param['perPage']; + if ($kpp == "SEMUA" && $seksi == "SEMUA" && $nip == "SEMUA") { + $array + = ['KWLADM' => $kwl ]; + } else if($kpp != "SEMUA" && $seksi == "SEMUA" && $nip == "SEMUA") { + $array + = [ 'KWLADM' => $kwl, 'KPPADM' => $kpp]; + }else if ($kpp != "SEMUA" && $seksi != "SEMUA" && $nip == "SEMUA"){ + $array + = [ 'KWLADM' => $kwl, 'KPPADM' => $kpp, 'KODESIE' => $seksi]; + } + + else if ($kpp != "SEMUA" && $seksi != "SEMUA" && $nip != "SEMUA") { + $array + = [ 'KWLADM' => $kwl, 'KODESIE' => $seksi, 'NIP' => $nip]; + } + $this->builder() ->select('NPWP,NAMA') ->selectSum('TOTAL') ->selectCount('1', 'JMLBLN') ->where('TAHUN', $tahun) - ->where('KWLADM', $kwl) - ->where('KPPADM', $kpp) - ->where('KODESIE', $seksi) - ->where('NIP', $nip) + ->where($array) ->groupBy('NPWP,NAMA') ->having('COUNT(1)', $jmlbln, TRUE) ->limit($limit, $offset); diff --git a/app/Models/Mseksi.php b/app/Models/Mseksi.php index acb00c80..de4bbb90 100644 --- a/app/Models/Mseksi.php +++ b/app/Models/Mseksi.php @@ -627,11 +627,24 @@ class Mseksi extends Model } else if ($lapisan == 9) { $saylapisan = "> 10000000"; } + + if ($kpp == "SEMUA" && $seksi == "SEMUA" && $nip == "SEMUA") { + $array + = ['KWLADM' => $kwl ]; + } else if($kpp != "SEMUA" && $seksi == "SEMUA" && $nip == "SEMUA") { + $array + = [ 'KWLADM' => $kwl, 'KPPADM' => $kpp]; + }else if ($kpp != "SEMUA" && $seksi != "SEMUA" && $nip == "SEMUA"){ + $array + = [ 'KWLADM' => $kwl, 'KPPADM' => $kpp, 'KODESIE' => $seksi]; + } + + else if ($kpp != "SEMUA" && $seksi != "SEMUA" && $nip != "SEMUA") { + $array + = [ 'KWLADM' => $kwl, 'KODESIE' => $seksi, 'NIP' => $nip]; + } $this->builder()->where('TAHUN', $tahun) - ->where('KWLADM', $kwl) - ->where('KPPADM', $kpp) - ->where('KODESIE', $seksi) - ->where('NIP', $nip) + ->where($array) ->where('ROUND(TOTAL) ' . $saylapisan . '') ->limit($limit, $offset); @@ -669,13 +682,25 @@ class Mseksi extends Model } else if ($lapisan == 9) { $saylapisan = "> 10000000"; } + if ($kpp == "SEMUA" && $seksi == "SEMUA" && $nip == "SEMUA") { + $array + = ['KWLADM' => $kwl ]; + } else if($kpp != "SEMUA" && $seksi == "SEMUA" && $nip == "SEMUA") { + $array + = [ 'KWLADM' => $kwl, 'KPPADM' => $kpp]; + }else if ($kpp != "SEMUA" && $seksi != "SEMUA" && $nip == "SEMUA"){ + $array + = [ 'KWLADM' => $kwl, 'KPPADM' => $kpp, 'KODESIE' => $seksi]; + } + + else if ($kpp != "SEMUA" && $seksi != "SEMUA" && $nip != "SEMUA") { + $array + = [ 'KWLADM' => $kwl, 'KODESIE' => $seksi, 'NIP' => $nip]; + } $builder = $this->db->table('DASHBOARD_WP'); $builder->where('TAHUN', $tahun); - $builder->where('KWLADM', $kwl); - $builder->where('KPPADM', $kpp); - $builder->where('KODESIE', $seksi); - $builder->where('NIP', $nip); + $builder->where($array); $builder->where('ROUND(TOTAL) ' . $saylapisan . ''); $builder->limit($limit, $offset); diff --git a/app/Views/kanwil/vseksiar.php b/app/Views/kanwil/vseksiar.php index ccf6d07e..98e19306 100644 --- a/app/Views/kanwil/vseksiar.php +++ b/app/Views/kanwil/vseksiar.php @@ -487,17 +487,14 @@ $totalwpall = $wpbaru + $wplama;