db->query("select * from buku_a where kdfakultas = $kdfakultas and id_thn_akad = $id_thn_akad and id_bulan = $id_bulan"); return $query; } /* manajemen akun */ function list_buku_b($kdfakultas, $id_thn_akad, $id_bulan){ $query = $this->db->query("select * from buku_b where kdfakultas = $kdfakultas and id_thn_akad = $id_thn_akad and id_bulan = $id_bulan"); return $query; } function simpan_buku_a($data){ $this->db->insert('buku_a', $data); } function simpan_buku_b($data){ $this->db->insert('buku_b', $data); } function hitung_buku_a($kdfakultas, $id_thn_akad, $id_bulan){ $query = $this->db->query("SELECT sum(nominal) AS total_buku_a from buku_a where id_thn_akad = '$id_thn_akad' and kdfakultas = '$kdfakultas' and id_bulan = '$id_bulan' "); foreach ($query->result() as $row) { $total_buku_a = $row->total_buku_a; return $total_buku_a; } } function hitung_buku_b($kdfakultas, $id_thn_akad, $id_bulan){ $query = $this->db->query("SELECT sum(nominal) AS total_buku_b from buku_b where id_thn_akad = '$id_thn_akad' and kdfakultas = '$kdfakultas' and id_bulan = '$id_bulan' "); foreach ($query->result() as $row) { $total_buku_b = $row->total_buku_b; return $total_buku_b; } } function detail_a($id_a){ $query = $this->db->query("SELECT kdfakultas, id_thn_akad, id_bulan, id_mtagr, kelas, angkatan, tgl_trans, no_bukti, ket, nominal, urut_mtagr, via FROM buku_a WHERE id_a = '$id_a' "); return $query; } function detail_b($id_b){ $query = $this->db->query("SELECT kdfakultas, id_thn_akad, id_bulan, id_mtagr, tgl_trans, no_bukti, ket, nominal FROM buku_b WHERE id_b = '$id_b' "); return $query; } function update_buku_a($id, $data){ $this->db->where('id_a', $id); $this->db->update('buku_a', $data); } function update_buku_b($id, $data){ $this->db->where('id_b', $id); $this->db->update('buku_b', $data); } function delete_buku_a($id){ $this->db->where('id_a',$id); $this->db->delete('buku_a'); } function delete_buku_b($id){ $this->db->where('id_b',$id); $this->db->delete('buku_b'); } function list_buku_c_11($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_mtagr = m.kd_mtagr),0) AS tot_tahun , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '9' AND a.id_mtagr = m.kd_mtagr),0) AS tot_sept , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '10' AND a.id_mtagr = m.kd_mtagr),0) AS tot_okt , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '11' AND a.id_mtagr = m.kd_mtagr),0) AS tot_nov , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '12' AND a.id_mtagr = m.kd_mtagr),0) AS tot_des , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '1' AND a.id_mtagr = m.kd_mtagr),0) AS tot_jan , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '2' AND a.id_mtagr = m.kd_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '3' AND a.id_mtagr = m.kd_mtagr),0) AS tot_mar , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '4' AND a.id_mtagr = m.kd_mtagr),0) AS tot_apr , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '5' AND a.id_mtagr = m.kd_mtagr),0) AS tot_mei , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '6' AND a.id_mtagr = m.kd_mtagr),0) AS tot_juni , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '7' AND a.id_mtagr = m.kd_mtagr),0) AS tot_juli , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '8' AND a.id_mtagr = m.kd_mtagr),0) AS tot_agst FROM mata_anggaran_2019 AS m WHERE m.master_mtagr = '2'"); return $query; } function list_buku_c_12($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_mtagr = m.kd_mtagr),0) AS tot_tahun , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '9' AND a.id_mtagr = m.kd_mtagr),0) AS tot_sept , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '10' AND a.id_mtagr = m.kd_mtagr),0) AS tot_okt , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '11' AND a.id_mtagr = m.kd_mtagr),0) AS tot_nov , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '12' AND a.id_mtagr = m.kd_mtagr),0) AS tot_des , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '1' AND a.id_mtagr = m.kd_mtagr),0) AS tot_jan , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '2' AND a.id_mtagr = m.kd_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '3' AND a.id_mtagr = m.kd_mtagr),0) AS tot_mar , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '4' AND a.id_mtagr = m.kd_mtagr),0) AS tot_apr , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '5' AND a.id_mtagr = m.kd_mtagr),0) AS tot_mei , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '6' AND a.id_mtagr = m.kd_mtagr),0) AS tot_juni , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '7' AND a.id_mtagr = m.kd_mtagr),0) AS tot_juli , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '8' AND a.id_mtagr = m.kd_mtagr),0) AS tot_agst FROM mata_anggaran_2019 AS m WHERE m.master_mtagr = '20'"); return $query; } function list_buku_c_13($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_mtagr = m.kd_mtagr),0) AS tot_tahun , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '9' AND a.id_mtagr = m.kd_mtagr),0) AS tot_sept , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '10' AND a.id_mtagr = m.kd_mtagr),0) AS tot_okt , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '11' AND a.id_mtagr = m.kd_mtagr),0) AS tot_nov , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '12' AND a.id_mtagr = m.kd_mtagr),0) AS tot_des , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '1' AND a.id_mtagr = m.kd_mtagr),0) AS tot_jan , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '2' AND a.id_mtagr = m.kd_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '3' AND a.id_mtagr = m.kd_mtagr),0) AS tot_mar , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '4' AND a.id_mtagr = m.kd_mtagr),0) AS tot_apr , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '5' AND a.id_mtagr = m.kd_mtagr),0) AS tot_mei , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '6' AND a.id_mtagr = m.kd_mtagr),0) AS tot_juni , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '7' AND a.id_mtagr = m.kd_mtagr),0) AS tot_juli , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '$kdfakultas' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '8' AND a.id_mtagr = m.kd_mtagr),0) AS tot_agst FROM mata_anggaran_2019 AS m WHERE m.master_mtagr = '27'"); return $query; } function list_buku_c_21($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_mtagr = m.kd_mtagr),0) AS tot_tahun , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '9' AND b.id_mtagr = m.kd_mtagr),0) AS tot_sept , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '10' AND b.id_mtagr = m.kd_mtagr),0) AS tot_okt , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '11' AND b.id_mtagr = m.kd_mtagr),0) AS tot_nov , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '12' AND b.id_mtagr = m.kd_mtagr),0) AS tot_des , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '1' AND b.id_mtagr = m.kd_mtagr),0) AS tot_jan , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '2' AND b.id_mtagr = m.kd_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '3' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mar , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '4' AND b.id_mtagr = m.kd_mtagr),0) AS tot_apr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '5' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mei , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '6' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juni , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '7' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juli , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '8' AND b.id_mtagr = m.kd_mtagr),0) AS tot_agst FROM mata_anggaran_2019 AS m WHERE m.master_mtagr = '30'"); return $query; } function list_buku_c21_thn($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_thn_21 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND m.master_mtagr = '30'"); foreach ($query->result() as $row) { $tot_thn_c21 = $row->tot_thn_21; return $tot_thn_c21; }; } function list_buku_c21_sept($kdfakultas, $id_thn_akad){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT sum(nominal) AS tot_sept_21 FROM buku_b AS b JOIN $tbl AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '9' AND m.master_mtagr = '50'"); foreach ($query->result() as $row) { $tot_sept_c21 = $row->tot_sept_21; return $tot_sept_c21; }; } function list_buku_c21_okt($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_okt_21 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '10' AND m.master_mtagr = '30'"); foreach ($query->result() as $row) { $tot_okt_c21 = $row->tot_okt_21; return $tot_okt_c21; }; } function list_buku_c21_nov($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_nov_21 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '11' AND m.master_mtagr = '30'"); foreach ($query->result() as $row) { $tot_nov_c21 = $row->tot_nov_21; return $tot_nov_c21; }; } function list_buku_c21_des($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_des_21 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '12' AND m.master_mtagr = '30'"); foreach ($query->result() as $row) { $tot_des_c21 = $row->tot_des_21; return $tot_des_c21; }; } function list_buku_c21_jan($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_jan_21 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '1' AND m.master_mtagr = '30'"); foreach ($query->result() as $row) { $tot_jan_c21 = $row->tot_jan_21; return $tot_jan_c21; }; } function list_buku_c21_feb($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_feb_21 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '2' AND m.master_mtagr = '30'"); foreach ($query->result() as $row) { $tot_feb_c21 = $row->tot_feb_21; return $tot_feb_c21; }; } function list_buku_c21_mar($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_mar_21 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '3' AND m.master_mtagr = '30'"); foreach ($query->result() as $row) { $tot_mar_c21 = $row->tot_mar_21; return $tot_mar_c21; }; } function list_buku_c21_apr($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_apr_21 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '4' AND m.master_mtagr = '30'"); foreach ($query->result() as $row) { $tot_apr_c21 = $row->tot_apr_21; return $tot_apr_c21; }; } function list_buku_c21_mei($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_mei_21 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '5' AND m.master_mtagr = '30'"); foreach ($query->result() as $row) { $tot_mei_c21 = $row->tot_mei_21; return $tot_mei_c21; }; } function list_buku_c21_juni($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_juni_21 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '6' AND m.master_mtagr = '30'"); foreach ($query->result() as $row) { $tot_juni_c21 = $row->tot_juni_21; return $tot_juni_c21; }; } function list_buku_c21_juli($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_juli_21 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '7' AND m.master_mtagr = '30'"); foreach ($query->result() as $row) { $tot_juli_c21 = $row->tot_juli_21; return $tot_juli_c21; }; } function list_buku_c21_agst($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_agst_21 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '8' AND m.master_mtagr = '30'"); foreach ($query->result() as $row) { $tot_agst_c21 = $row->tot_agst_21; return $tot_agst_c21; }; } function list_buku_c_22($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_mtagr = m.kd_mtagr),0) AS tot_tahun , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '9' AND b.id_mtagr = m.kd_mtagr),0) AS tot_sept , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '10' AND b.id_mtagr = m.kd_mtagr),0) AS tot_okt , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '11' AND b.id_mtagr = m.kd_mtagr),0) AS tot_nov , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '12' AND b.id_mtagr = m.kd_mtagr),0) AS tot_des , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '1' AND b.id_mtagr = m.kd_mtagr),0) AS tot_jan , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '2' AND b.id_mtagr = m.kd_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '3' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mar , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '4' AND b.id_mtagr = m.kd_mtagr),0) AS tot_apr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '5' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mei , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '6' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juni , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '7' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juli , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '8' AND b.id_mtagr = m.kd_mtagr),0) AS tot_agst FROM mata_anggaran_2019 AS m WHERE m.master_mtagr = '46'"); return $query; } function list_buku_c22_thn($kdfakultas, $id_thn_akad){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT sum(nominal) AS tot_thn_22 FROM buku_b AS b JOIN $tbl AS m ON m.no_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND m.master_mtagr = '50'"); foreach ($query->result() as $row) { $tot_thn_c22 = $row->tot_thn_22; return $tot_thn_c22; }; } function list_buku_c22_sept($kdfakultas, $id_thn_akad){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT sum(nominal) AS tot_sept_22 FROM buku_b AS b JOIN $tbl AS m ON m.no_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '9' AND b.urut_mtagr = '22'"); foreach ($query->result() as $row) { $tot_sept_c22 = $row->tot_sept_22; return $tot_sept_c22; }; } function list_buku_c22_okt($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_okt_22 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '10' AND m.master_mtagr = '46'"); foreach ($query->result() as $row) { $tot_okt_c22 = $row->tot_okt_22; return $tot_okt_c22; }; } function list_buku_c22_nov($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_nov_22 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '11' AND m.master_mtagr = '46'"); foreach ($query->result() as $row) { $tot_nov_c22 = $row->tot_nov_22; return $tot_nov_c22; }; } function list_buku_c22_des($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_des_22 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '12' AND m.master_mtagr = '46'"); foreach ($query->result() as $row) { $tot_des_c22 = $row->tot_des_22; return $tot_des_c22; }; } function list_buku_c22_jan($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_jan_22 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '1' AND m.master_mtagr = '46'"); foreach ($query->result() as $row) { $tot_jan_c22 = $row->tot_jan_22; return $tot_jan_c22; }; } function list_buku_c22_feb($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_feb_22 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '2' AND m.master_mtagr = '46'"); foreach ($query->result() as $row) { $tot_feb_c22 = $row->tot_feb_22; return $tot_feb_c22; }; } function list_buku_c22_mar($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_mar_22 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '3' AND m.master_mtagr = '46'"); foreach ($query->result() as $row) { $tot_mar_c22 = $row->tot_mar_22; return $tot_mar_c22; }; } function list_buku_c22_apr($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_apr_22 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '4' AND m.master_mtagr = '46'"); foreach ($query->result() as $row) { $tot_apr_c22 = $row->tot_apr_22; return $tot_apr_c22; }; } function list_buku_c22_mei($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_mei_22 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '5' AND m.master_mtagr = '46'"); foreach ($query->result() as $row) { $tot_mei_c22 = $row->tot_mei_22; return $tot_mei_c22; }; } function list_buku_c22_juni($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_juni_22 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '6' AND m.master_mtagr = '46'"); foreach ($query->result() as $row) { $tot_juni_c22 = $row->tot_juni_22; return $tot_juni_c22; }; } function list_buku_c22_juli($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_juli_22 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '7' AND m.master_mtagr = '46'"); foreach ($query->result() as $row) { $tot_juli_c22 = $row->tot_juli_22; return $tot_juli_c22; }; } function list_buku_c22_agst($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_agst_22 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '8' AND m.master_mtagr = '46'"); foreach ($query->result() as $row) { $tot_agst_c22 = $row->tot_agst_22; return $tot_agst_c22; }; } /* manajemen akun */ function list_buku_c_23($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_mtagr = m.kd_mtagr),0) AS tot_tahun , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '9' AND b.id_mtagr = m.kd_mtagr),0) AS tot_sept , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '10' AND b.id_mtagr = m.kd_mtagr),0) AS tot_okt , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '11' AND b.id_mtagr = m.kd_mtagr),0) AS tot_nov , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '12' AND b.id_mtagr = m.kd_mtagr),0) AS tot_des , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '1' AND b.id_mtagr = m.kd_mtagr),0) AS tot_jan , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '2' AND b.id_mtagr = m.kd_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '3' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mar , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '4' AND b.id_mtagr = m.kd_mtagr),0) AS tot_apr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '5' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mei , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '6' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juni , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '7' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juli , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '8' AND b.id_mtagr = m.kd_mtagr),0) AS tot_agst FROM mata_anggaran_2019 AS m WHERE m.master_mtagr = '115'"); return $query; } function list_buku_c23_thn($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_thn_23 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND m.master_mtagr = '115'"); foreach ($query->result() as $row) { $tot_thn_c23 = $row->tot_thn_23; return $tot_thn_c23; }; } function list_buku_c23_sept($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_sept_23 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '9' AND m.master_mtagr = '115'"); foreach ($query->result() as $row) { $tot_sept_c23 = $row->tot_sept_23; return $tot_sept_c23; }; } function list_buku_c23_okt($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_okt_23 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '10' AND m.master_mtagr = '115'"); foreach ($query->result() as $row) { $tot_okt_c23 = $row->tot_okt_23; return $tot_okt_c23; }; } function list_buku_c23_nov($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_nov_23 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '11' AND m.master_mtagr = '115'"); foreach ($query->result() as $row) { $tot_nov_c23 = $row->tot_nov_23; return $tot_nov_c23; }; } function list_buku_c23_des($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_des_23 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '12' AND m.master_mtagr = '115'"); foreach ($query->result() as $row) { $tot_des_c23 = $row->tot_des_23; return $tot_des_c23; }; } function list_buku_c23_jan($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_jan_23 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '1' AND m.master_mtagr = '115'"); foreach ($query->result() as $row) { $tot_jan_c23 = $row->tot_jan_23; return $tot_jan_c23; }; } function list_buku_c23_feb($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_feb_23 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '2' AND m.master_mtagr = '115'"); foreach ($query->result() as $row) { $tot_feb_c23 = $row->tot_feb_23; return $tot_feb_c23; }; } function list_buku_c23_mar($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_mar_23 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '3' AND m.master_mtagr = '115'"); foreach ($query->result() as $row) { $tot_mar_c23 = $row->tot_mar_23; return $tot_mar_c23; }; } function list_buku_c23_apr($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_apr_23 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '4' AND m.master_mtagr = '115'"); foreach ($query->result() as $row) { $tot_apr_c23 = $row->tot_apr_23; return $tot_apr_c23; }; } function list_buku_c23_mei($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_mei_23 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '5' AND m.master_mtagr = '115'"); foreach ($query->result() as $row) { $tot_mei_c23 = $row->tot_mei_23; return $tot_mei_c23; }; } function list_buku_c23_juni($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_juni_23 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '6' AND m.master_mtagr = '115'"); foreach ($query->result() as $row) { $tot_juni_c23 = $row->tot_juni_23; return $tot_juni_c23; }; } function list_buku_c23_juli($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_juli_23 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '7' AND m.master_mtagr = '115'"); foreach ($query->result() as $row) { $tot_juli_c23 = $row->tot_juli_23; return $tot_juli_c23; }; } function list_buku_c23_agst($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT sum(nominal) AS tot_agst_23 FROM buku_b AS b JOIN mata_anggaran_2019 AS m ON m.kd_mtagr = b.id_mtagr WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '8' AND m.master_mtagr = '115'"); foreach ($query->result() as $row) { $tot_agst_c23 = $row->tot_agst_23; return $tot_agst_c23; }; } /* manajemen akun */ function list_buku_c_24($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_mtagr = m.kd_mtagr),0) AS tot_tahun , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '9' AND b.id_mtagr = m.kd_mtagr),0) AS tot_sept , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '10' AND b.id_mtagr = m.kd_mtagr),0) AS tot_okt , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '11' AND b.id_mtagr = m.kd_mtagr),0) AS tot_nov , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '12' AND b.id_mtagr = m.kd_mtagr),0) AS tot_des , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '1' AND b.id_mtagr = m.kd_mtagr),0) AS tot_jan , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '2' AND b.id_mtagr = m.kd_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '3' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mar , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '4' AND b.id_mtagr = m.kd_mtagr),0) AS tot_apr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '5' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mei , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '6' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juni , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '7' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juli , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '8' AND b.id_mtagr = m.kd_mtagr),0) AS tot_agst FROM mata_anggaran_2019 AS m WHERE m.master_mtagr = '131'"); return $query; } /* manajemen akun */ function list_buku_c_25($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_mtagr = m.kd_mtagr),0) AS tot_tahun , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '9' AND b.id_mtagr = m.kd_mtagr),0) AS tot_sept , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '10' AND b.id_mtagr = m.kd_mtagr),0) AS tot_okt , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '11' AND b.id_mtagr = m.kd_mtagr),0) AS tot_nov , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '12' AND b.id_mtagr = m.kd_mtagr),0) AS tot_des , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '1' AND b.id_mtagr = m.kd_mtagr),0) AS tot_jan , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '2' AND b.id_mtagr = m.kd_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '3' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mar , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '4' AND b.id_mtagr = m.kd_mtagr),0) AS tot_apr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '5' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mei , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '6' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juni , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '7' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juli , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '8' AND b.id_mtagr = m.kd_mtagr),0) AS tot_agst FROM mata_anggaran_2019 AS m WHERE m.master_mtagr = '154'"); return $query; } /* manajemen akun */ function list_buku_c_26($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_mtagr = m.kd_mtagr),0) AS tot_tahun , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '9' AND b.id_mtagr = m.kd_mtagr),0) AS tot_sept , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '10' AND b.id_mtagr = m.kd_mtagr),0) AS tot_okt , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '11' AND b.id_mtagr = m.kd_mtagr),0) AS tot_nov , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '12' AND b.id_mtagr = m.kd_mtagr),0) AS tot_des , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '1' AND b.id_mtagr = m.kd_mtagr),0) AS tot_jan , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '2' AND b.id_mtagr = m.kd_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '3' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mar , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '4' AND b.id_mtagr = m.kd_mtagr),0) AS tot_apr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '5' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mei , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '6' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juni , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '7' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juli , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '8' AND b.id_mtagr = m.kd_mtagr),0) AS tot_agst FROM mata_anggaran_2019 AS m WHERE m.master_mtagr = '191'"); return $query; } /* manajemen akun */ function list_buku_c_27($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_mtagr = m.kd_mtagr),0) AS tot_tahun , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '9' AND b.id_mtagr = m.kd_mtagr),0) AS tot_sept , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '10' AND b.id_mtagr = m.kd_mtagr),0) AS tot_okt , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '11' AND b.id_mtagr = m.kd_mtagr),0) AS tot_nov , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '12' AND b.id_mtagr = m.kd_mtagr),0) AS tot_des , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '1' AND b.id_mtagr = m.kd_mtagr),0) AS tot_jan , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '2' AND b.id_mtagr = m.kd_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '3' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mar , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '4' AND b.id_mtagr = m.kd_mtagr),0) AS tot_apr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '5' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mei , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '6' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juni , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '7' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juli , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '8' AND b.id_mtagr = m.kd_mtagr),0) AS tot_agst FROM mata_anggaran_2019 AS m WHERE m.master_mtagr = '201'"); return $query; } /* manajemen akun */ function list_buku_c_28($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_mtagr = m.kd_mtagr),0) AS tot_tahun , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '9' AND b.id_mtagr = m.kd_mtagr),0) AS tot_sept , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '10' AND b.id_mtagr = m.kd_mtagr),0) AS tot_okt , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '11' AND b.id_mtagr = m.kd_mtagr),0) AS tot_nov , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '12' AND b.id_mtagr = m.kd_mtagr),0) AS tot_des , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '1' AND b.id_mtagr = m.kd_mtagr),0) AS tot_jan , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '2' AND b.id_mtagr = m.kd_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '3' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mar , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '4' AND b.id_mtagr = m.kd_mtagr),0) AS tot_apr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '5' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mei , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '6' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juni , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '7' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juli , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '8' AND b.id_mtagr = m.kd_mtagr),0) AS tot_agst FROM mata_anggaran_2019 AS m WHERE m.master_mtagr = '261'"); return $query; } /* manajemen akun */ function list_buku_c_29($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_mtagr = m.kd_mtagr),0) AS tot_tahun , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '9' AND b.id_mtagr = m.kd_mtagr),0) AS tot_sept , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '10' AND b.id_mtagr = m.kd_mtagr),0) AS tot_okt , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '11' AND b.id_mtagr = m.kd_mtagr),0) AS tot_nov , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '12' AND b.id_mtagr = m.kd_mtagr),0) AS tot_des , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '1' AND b.id_mtagr = m.kd_mtagr),0) AS tot_jan , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '2' AND b.id_mtagr = m.kd_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '3' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mar , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '4' AND b.id_mtagr = m.kd_mtagr),0) AS tot_apr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '5' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mei , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '6' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juni , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '7' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juli , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '8' AND b.id_mtagr = m.kd_mtagr),0) AS tot_agst FROM mata_anggaran_2019 AS m WHERE m.master_mtagr = '262'"); return $query; } /* manajemen akun */ function list_buku_c_30($kdfakultas, $id_thn_akad){ $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_mtagr = m.kd_mtagr),0) AS tot_tahun , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '9' AND b.id_mtagr = m.kd_mtagr),0) AS tot_sept , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '10' AND b.id_mtagr = m.kd_mtagr),0) AS tot_okt , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '11' AND b.id_mtagr = m.kd_mtagr),0) AS tot_nov , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '12' AND b.id_mtagr = m.kd_mtagr),0) AS tot_des , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '1' AND b.id_mtagr = m.kd_mtagr),0) AS tot_jan , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '2' AND b.id_mtagr = m.kd_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '3' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mar , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '4' AND b.id_mtagr = m.kd_mtagr),0) AS tot_apr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '5' AND b.id_mtagr = m.kd_mtagr),0) AS tot_mei , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '6' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juni , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '7' AND b.id_mtagr = m.kd_mtagr),0) AS tot_juli , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '$kdfakultas' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '8' AND b.id_mtagr = m.kd_mtagr),0) AS tot_agst FROM mata_anggaran_2019 AS m WHERE m.master_mtagr = '282'"); return $query; } function list_buku_d_all($id_thn_akad, $id_bulan){ $query = $this->db->query("select sum(nominal) as tot_dall from buku_b where id_thn_akad = '$id_thn_akad' and id_bulan = '$id_bulan'"); return $query; } function list_buku_d_all_thn($id_thn_akad){ $query = $this->db->query("select sum(nominal) as tot_dall from buku_b where id_thn_akad = '$id_thn_akad'"); return $query; } function list_buku_d11($id_thn_akad, $id_bulan){ if($id_thn_akad == '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE NOT a.kdfakultas = '8' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_all , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '7' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_rektorat , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '1' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_fh , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '2' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '3' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_fisip , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '4' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_fkip , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '5' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_ft , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '6' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_pasca FROM $tbl AS m WHERE m.master_mtagr = '2'"); return $query; } function list_buku_d12($id_thn_akad, $id_bulan){ if($id_thn_akad == '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE NOT a.kdfakultas = '8' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_all , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '7' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_rektorat , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '1' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_fh , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '2' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '3' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_fisip , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '4' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_fkip , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '5' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_ft , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '6' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_pasca FROM $tbl AS m WHERE m.master_mtagr = '22'"); return $query; } function list_buku_d13($id_thn_akad, $id_bulan){ if($id_thn_akad == '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE NOT a.kdfakultas = '8' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_all , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '7' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_rektorat , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '1' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_fh , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '2' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '3' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_fisip , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '4' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_fkip , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '5' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_ft , ifnull((SELECT sum(nominal) FROM buku_a AS a WHERE a.kdfakultas = '6' AND a.id_thn_akad = '$id_thn_akad' AND a.id_bulan = '$id_bulan' AND a.id_mtagr = m.no_mtagr),0) AS tot_pasca FROM $tbl AS m WHERE m.master_mtagr = '29'"); return $query; } function list_buku_d21($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_all , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_rektorat , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fh , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fisip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fkip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_ft , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_pasca FROM $tbl AS m WHERE m.master_mtagr = '33'"); return $query; } function list_totbuku_d21($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '21'),0) AS tot_all21 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '21'),0) AS tot_rektorat21 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '21'),0) AS tot_fh21 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '21'),0) AS tot_feb21 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '21'),0) AS tot_fisip21 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '21'),0) AS tot_fkip21 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '21'),0) AS tot_ft21 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '21'),0) AS tot_pasca21 FROM $tbl AS m WHERE m.master_mtagr = '33'"); return $query; } function list_buku_d22($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_all , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_rektorat , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fh , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fisip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fkip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_ft , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_pasca FROM $tbl AS m WHERE m.master_mtagr = '50'"); return $query; } function list_totbuku_d22($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '22'),0) AS tot_all22 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '22'),0) AS tot_rektorat22 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '22'),0) AS tot_fh22 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '22'),0) AS tot_feb22 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '22'),0) AS tot_fisip22 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '22'),0) AS tot_fkip22 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '22'),0) AS tot_ft22 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '22'),0) AS tot_pasca22 FROM $tbl AS m WHERE m.master_mtagr = '50'"); return $query; } function list_buku_d23($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_all , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_rektorat , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fh , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fisip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fkip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_ft , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_pasca FROM $tbl AS m WHERE m.master_mtagr = '186'"); return $query; } function list_totbuku_d23($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '23'),0) AS tot_all23 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '23'),0) AS tot_rektorat23 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '23'),0) AS tot_fh23 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '23'),0) AS tot_feb23 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '23'),0) AS tot_fisip23 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '23'),0) AS tot_fkip23 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '23'),0) AS tot_ft23 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '23'),0) AS tot_pasca23 FROM $tbl AS m WHERE m.master_mtagr = '186'"); return $query; } function list_buku_d24($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_all , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_rektorat , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fh , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fisip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fkip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_ft , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_pasca FROM $tbl AS m WHERE m.master_mtagr = '216'"); return $query; } function list_totbuku_d24($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '24'),0) AS tot_all24 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '24'),0) AS tot_rektorat24 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '24'),0) AS tot_fh24 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '24'),0) AS tot_feb24 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '24'),0) AS tot_fisip24 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '24'),0) AS tot_fkip24 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '24'),0) AS tot_ft24 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '24'),0) AS tot_pasca24 FROM $tbl AS m WHERE m.master_mtagr = '216'"); return $query; } function list_buku_d25($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_all , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_rektorat , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fh , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fisip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fkip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_ft , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_pasca FROM $tbl AS m WHERE m.master_mtagr = '244'"); return $query; } function list_totbuku_d25($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '25'),0) AS tot_all25 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '25'),0) AS tot_rektorat25 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '25'),0) AS tot_fh25 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '25'),0) AS tot_feb25 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '25'),0) AS tot_fisip25 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '25'),0) AS tot_fkip25 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '25'),0) AS tot_ft25 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '25'),0) AS tot_pasca25 FROM $tbl AS m WHERE m.master_mtagr = '244'"); return $query; } function list_buku_d26($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_all , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_rektorat , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fh , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fisip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fkip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_ft , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_pasca FROM $tbl AS m WHERE m.master_mtagr = '282'"); return $query; } function list_totbuku_d26($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '26'),0) AS tot_all26 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '26'),0) AS tot_rektorat26 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '26'),0) AS tot_fh26 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '26'),0) AS tot_feb26 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '26'),0) AS tot_fisip26 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '26'),0) AS tot_fkip26 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '26'),0) AS tot_ft26 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '26'),0) AS tot_pasca26 FROM $tbl AS m WHERE m.master_mtagr = '282'"); return $query; } function list_buku_d27($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_all , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_rektorat , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fh , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fisip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fkip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_ft , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_pasca FROM $tbl AS m WHERE m.master_mtagr = '292'"); return $query; } function list_totbuku_d27($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '27'),0) AS tot_all27 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '27'),0) AS tot_rektorat27 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '27'),0) AS tot_fh27 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '27'),0) AS tot_feb27 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '27'),0) AS tot_fisip27 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '27'),0) AS tot_fkip27 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '27'),0) AS tot_ft27 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '27'),0) AS tot_pasca27 FROM $tbl AS m WHERE m.master_mtagr = '292'"); return $query; } function list_buku_d28($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_all , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_rektorat , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fh , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fisip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fkip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_ft , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_pasca FROM $tbl AS m WHERE m.master_mtagr = '478'"); return $query; } function list_totbuku_d28($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '28'),0) AS tot_all28 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '28'),0) AS tot_rektorat28 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '28'),0) AS tot_fh28 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '28'),0) AS tot_feb28 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '28'),0) AS tot_fisip28 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '28'),0) AS tot_fkip28 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '28'),0) AS tot_ft28 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '28'),0) AS tot_pasca28 FROM $tbl AS m WHERE m.master_mtagr = '478'"); return $query; } function list_buku_d29($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_all , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_rektorat , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fh , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fisip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fkip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_ft , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_pasca FROM $tbl AS m WHERE m.master_mtagr = '481'"); return $query; } function list_totbuku_d29($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '29'),0) AS tot_all29 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '29'),0) AS tot_rektorat29 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '29'),0) AS tot_fh29 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '29'),0) AS tot_feb29 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '29'),0) AS tot_fisip29 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '29'),0) AS tot_fkip29 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '29'),0) AS tot_ft29 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '29'),0) AS tot_pasca29 FROM $tbl AS m WHERE m.master_mtagr = '481'"); return $query; } function list_buku_d30($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_all , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_rektorat , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fh , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_feb , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fisip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_fkip , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_ft , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.id_mtagr = m.no_mtagr),0) AS tot_pasca FROM $tbl AS m WHERE m.master_mtagr = '501'"); return $query; } function list_totbuku_d30($id_thn_akad, $id_bulan){ if($id_thn_akad >= '5'){ $tbl = "mata_anggaran_2020"; }else{ $tbl = "mata_anggaran_2019"; } $query = $this->db->query("SELECT m.no_mtagr , m.nama_mtagr , m.kd_mtagr , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE NOT b.kdfakultas = '8' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND b.urut_mtagr = '210'),0) AS tot_all30 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '7' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '210'),0) AS tot_rektorat30 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '1' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '210'),0) AS tot_fh30 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '2' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '210'),0) AS tot_feb30 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '3' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '210'),0) AS tot_fisip30 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '4' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '210'),0) AS tot_fkip30 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '5' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '210'),0) AS tot_ft30 , ifnull((SELECT sum(nominal) FROM buku_b AS b WHERE b.kdfakultas = '6' AND b.id_thn_akad = '$id_thn_akad' AND b.id_bulan = '$id_bulan' AND urut_mtagr = '210'),0) AS tot_pasca30 FROM $tbl AS m WHERE m.master_mtagr = '501'"); return $query; } function list_anggaran($num, $offset){ $query = $this->db->query("SELECT a.id_akun, o.nama_otoritas, a.userid, a.namauser FROM akun_unlasys as a JOIN otoritas as o ON o.id_otoritas = a.id_otoritas WHERE a.id_akun != 1 ORDER BY a.id_akun LIMIT $num OFFSET $offset"); return $query; } function nmfakultas($kdfakultas){ $query = $this->db->query("SELECT nmfakultas FROM fakultas where kdfakultas = $kdfakultas"); foreach ($query->result() as $row){ $nmfakultas = $row->nmfakultas; return $nmfakultas; } } function nmbulan($id_bulan){ $query = $this->db->query("SELECT nm_bulan FROM bulan where id_bulan = $id_bulan"); foreach ($query->result() as $row){ $nm_bulan = $row->nm_bulan; return $nm_bulan; } } function master_mtagr($id_ma){ $query = $this->db->query("SELECT master_mtagr FROM mata_anggaran_2019 where kd_mtagr = $id_ma"); foreach ($query->result() as $row) { $master_mtagr = $row->master_mtagr; return $master_mtagr; } } function list_kompilasi($thn_akad){ $query = $this->db->query("SELECT ak.total_realisasi FROM anggaran_kompilasi as ak WHERE id_thn_akad = $thn_akad ORDER BY ak.id_mtagr"); return $query; } function list_dppallprodi(){ $KEDUA = $this->load->database('second', TRUE); $query = $KEDUA->query("CALL sp_getdppallprodinew('4','20191')"); return $query; } function list_dppallprodi_genap(){ $KEDUA = $this->load->database('second', TRUE); $query = $KEDUA->query("CALL sp_getdppallprodinew('4','20192')"); return $query; } function list_dppfakultas($kdfakultas){ $KEDUA = $this->load->database('second', TRUE); $query = $KEDUA->query("CALL sp_getdppprodi('$kdfakultas','4','20191')"); return $query; } function list_dppfakultas_genap($kdfakultas){ $KEDUA = $this->load->database('second', TRUE); $query = $KEDUA->query("CALL sp_getdppprodi('$kdfakultas','4','20192')"); return $query; } function list_dpkallprodi(){ $KEDUA = $this->load->database('second', TRUE); $query = $KEDUA->query("CALL sp_getdpkallprodi('2019', '4')"); return $query; } function list_dpkfakultas($kdfakultas){ $KEDUA = $this->load->database('second', TRUE); $query = $KEDUA->query("CALL sp_getDpkfakultas_chart('2019','4',$kdfakultas)"); return $query; } function list_agr_rapb($id_thn_akad, $kd_fakultas, $master_mtagr, $id_sub){ $query = $this->db->query("select *, ma.no_mtagr, ma.nama_mtagr, ma.isi_mtagr, i.nama_satuan, st.stat_ajuan from anggaran_detail as ad join mata_anggaran_2019 as ma on ma.id_mtagr = ad.id_mtagr join inv_satuan as i on i.id_satuan = ad.id_satuan join st_ajuan as st on st.id_st_ajuan = ad.stat_agr where ad.id_thn_akad = '$id_thn_akad' and ad.kdfakultas = '$kd_fakultas' and ma.master_mtagr = '$master_mtagr' and ad.sub_agr = '$id_sub'"); return $query; } function list_rapb($id_thn_akad, $kd_fakultas, $master_mtagr, $id_sub){ $query = $this->db->query("select *, ma.no_mtagr, ma.nama_mtagr, i.nama_satuan, st.stat_ajuan from anggaran_detail as ad join mata_anggaran_2019 as ma on ma.id_mtagr = ad.id_mtagr join inv_satuan as i on i.id_satuan = ad.id_satuan join st_ajuan as st on st.id_st_ajuan = ad.stat_realisasi where ad.id_thn_akad = '$id_thn_akad' and ad.kdfakultas = '$kd_fakultas' and ma.master_mtagr = '$master_mtagr' and ad.sub_agr = '$id_sub'"); return $query; } function hitung_agr($id_thn_akad, $kd_fakultas, $master_mtagr, $id_sub){ $query = $this->db->query("SELECT sum(ad.total) AS total from anggaran_detail as ad join mata_anggaran_2019 as ma on ma.id_mtagr = ad.id_mtagr where ad.id_thn_akad = '$id_thn_akad' and ad.kdfakultas = '$kd_fakultas' and ma.master_mtagr = '$master_mtagr' and ad.sub_agr = '$id_sub' and ad.stat_agr != '1'"); foreach ($query->result() as $row) { $total_agr = $row->total; return $total_agr; } } function hitung_total($id_thn_akad, $kd_fakultas, $master_mtagr, $id_sub){ $query = $this->db->query("SELECT sum(ad.total) AS total, sum(ad.pengajuan) AS total_real from anggaran_detail as ad join mata_anggaran_2019 as ma on ma.id_mtagr = ad.id_mtagr where ad.id_thn_akad = '$id_thn_akad' and ad.kdfakultas = '$kd_fakultas' and ma.master_mtagr = '$master_mtagr' and ad.sub_agr = '$id_sub' and ad.stat_realisasi != '1'"); return $query; } function hitung_real($id_thn_akad, $kd_fakultas, $master_mtagr, $id_sub){ $query = $this->db->query("SELECT sum(ad.pengajuan) AS total_realisasi from anggaran_detail as ad join mata_anggaran_2019 as ma on ma.id_mtagr = ad.id_mtagr where ad.id_thn_akad = '$id_thn_akad' and ad.kdfakultas = '$kd_fakultas' and ma.master_mtagr = '$master_mtagr' and ad.sub_agr = '$id_sub' and ad.stat_realisasi != '1'"); foreach ($query->result() as $row) { $total_real = $row->total_realisasi; return $total_real; } } function get_rapb_agr($id_detail){ $query = $this->db->query("select *, ma.no_mtagr, ma.nama_mtagr, i.nama_satuan, st.id_st_ajuan, st.stat_ajuan from anggaran_detail as ad join mata_anggaran_2019 as ma on ma.id_mtagr = ad.id_mtagr join inv_satuan as i on i.id_satuan = ad.id_satuan join st_ajuan as st on st.id_st_ajuan = ad.stat_agr where ad.id_detail = '$id_detail'"); return $query; } function get_rapb($id_detail){ $query = $this->db->query("select *, ma.no_mtagr, ma.nama_mtagr, i.nama_satuan, st.id_st_ajuan, st.stat_ajuan from anggaran_detail as ad join mata_anggaran_2019 as ma on ma.id_mtagr = ad.id_mtagr join inv_satuan as i on i.id_satuan = ad.id_satuan join st_ajuan as st on st.id_st_ajuan = ad.stat_realisasi where ad.id_detail = '$id_detail'"); return $query; } function list_d($thn_akad){ $query = $this->db->query("SELECT ma.no_mtagr, ma.nama_mtagr, ad.total, ad.total_k FROM anggaran_detail as ad JOIN mata_anggaran_2019 as ma on ma.id_mtagr = ad.id_mtagr WHERE ad.id_thn_akad = $thn_akad ORDER BY ad.id_mtagr"); return $query; } function list_d_fak($thn_akad, $kdfakultas){ $query = $this->db->query("SELECT ma.no_mtagr, ma.nama_mtagr, ad.total FROM anggaran_detail as ad JOIN mata_anggaran_2019 as ma on ma.id_mtagr = ad.id_mtagr WHERE ad.id_thn_akad = $thn_akad and ad.kdfakultas = $kdfakultas ORDER BY ad.id_mtagr"); return $query; } function update_ajuan_realisasi($id_detail, $data) { $this->db->where("id_detail", $id_detail) ->update("anggaran_detail", $data); } function update_agr_kompilasi($id_mtagr, $id_thn_akad, $kdfakultas, $data) { $this->db->where("id_mtagr", $id_mtagr) ->where("id_thn_akad", $id_thn_akad) ->where("kdfakultas", $kdfakultas) ->update("anggaran_kompilasi", $data); } function save_batch($data) { return $this->db->insert_batch('anggaran_detail', $data); } /* manajemen akun */ function detail_thn_akad($thn_akad){ $query = $this->db->query("SELECT id_thn_akad, thn_akad FROM thn_akad where id_thn_akad = $thn_akad"); return $query; } public function get_drop_st_ajuan(){ $query = $this->db->query('SELECT id_st_ajuan, stat_ajuan FROM st_ajuan ORDER BY id_st_ajuan asc')->result(); return $query; } public function get_drop_thn_akad(){ $query = $this->db->query('SELECT id_thn_akad, thn_akad FROM thn_akad ORDER BY id_thn_akad asc')->result(); return $query; } public function get_drop_fak(){ $query = $this->db->query('SELECT kdfakultas, nmfakultas FROM fakultas WHERE urut_fak !=0 ORDER BY urut_fak asc')->result(); return $query; } public function get_drop_bulan(){ $query = $this->db->query('SELECT id_bulan, nm_bulan FROM bulan ORDER BY urut_bulan asc')->result(); return $query; } function get_drop_satuan(){ $query = $this->db->query('SELECT id_satuan, nama_satuan FROM inv_satuan ORDER BY id_satuan asc')->result(); return $query; } function get_drop_proses($level_id){ $query = $this->db->query("SELECT id_st_ajuan, stat_ajuan FROM st_ajuan where otoritas = $level_id ORDER BY id_st_ajuan asc")->result(); return $query; } function detail_akun($id_akun){ $query = $this->db->query("SELECT id_akun, userid, id_otoritas, passwd FROM akun_unlasys WHERE id_akun = '$id_akun' "); return $query; } function simpan_akun($data){ $this->db->insert('akun_unlasys', $data); } function update_akun($id, $data){ $this->db->where('id_akun', $id); $this->db->update('akun_unlasys', $data); } function delete_akun($id){ $this->db->where('id_akun',$id); $this->db->delete('akun_unlasys'); } /* otoritas akun */ function list_menu(){ $this->db->select("id_menu, kode_menu, nama_menu, parent_menu, url"); $this->db->from("menu"); $this->db->order_by("kode_menu", "ASC"); return $this->db->get()->result(); } function cek_menu_id($otoritas_id, $menu_id){ $sql = "SELECT COUNT(*) AS hasil FROM otoritas_menu WHERE id_otoritas='$otoritas_id' AND id_menu='$menu_id'"; $query = $this->db->query($sql)->result(); $hasil = ''; foreach ($query as $row){ $hasil = $row->hasil; } if ($hasil>0){ return "ADA"; }else{ return "KOSONG"; } } function cek_ubah($otoritas_id, $menu_id){ $sql = "SELECT ubah FROM otoritas_menu WHERE id_otoritas='$otoritas_id' AND id_menu='$menu_id'"; $query = $this->db->query($sql)->result(); $ubah = ''; foreach ($query as $row){ $ubah = $row->ubah; } if ($ubah=="T"){ return "ADA"; }else if($ubah=="F"){ return "KOSONG"; }else{ return "BELUM"; //--Jika belum di setting TRUE atau FALSE--// } } function cek_hapus($otoritas_id, $menu_id){ $sql = "SELECT hapus FROM otoritas_menu WHERE id_otoritas='$otoritas_id' AND id_menu='$menu_id'"; $query = $this->db->query($sql)->result(); $hapus = ''; foreach ($query as $row){ $hapus = $row->hapus; } if ($hapus=="T"){ return "ADA"; }else if($hapus=="F"){ return "KOSONG"; }else{ return "BELUM"; //--Jika belum di setting TRUE atau FALSE--// } } function simpan_otoritas_akun($data){ $this->db->insert("otoritas_menu", $data); } function delete_otoritas_akun($id_otoritas, $id_menu){ $this->db->where("id_otoritas", $id_otoritas) ->where("id_menu", $id_menu); $this->db->delete("otoritas_menu"); } function update_ubah_hapus($id_otoritas, $id_menu, $data){ $this->db->where("id_otoritas", $id_otoritas) ->where("id_menu", $id_menu) ->update("otoritas_menu", $data); } }