ceklog(); $this->load->library('pdf_dpp'); $this->load->library('rhrpt'); $this->load->library('rhlib'); } function ceklog() { $user = $this->session->userdata("user_id1unla"); if($user==""){ redirect('user/login'); } } function get_bilangan($num){ return $this->rhlib->get_bilangan($num); } function get_par_val($table,$fieldName,$condition){ return $this->rhlib->get_par_val($table,$fieldName,$condition); } function get_row_pars($table,$fields,$condition){ return $this->rhlib->get_row_pars($table,$fields,$condition); } function get_all_mhs_dpp($kdstsemester,$idklsmhs) { $KEDUA= $this->load->database('second', TRUE); $data = $KEDUA->query("SELECT s.nim , p.kdprodi , cast(ifnull(ifnull(ks.jmlbayar, 0) * 100 / (ifnull(sb.biaya, 0) - ifnull(ds.diskon, 0)), 0) AS UNSIGNED) AS persenbayar FROM prodi p LEFT JOIN fakultas f ON p.kdfakultas = f.kdfakultas LEFT JOIN ( SELECT kdkodtbkod AS kdjenjangstudi , nmkodtbkod AS nmjenjangstudi FROM tbkod WHERE kdapltbkod = 4) jnj ON p.kdjenjangstudi = jnj.kdjenjangstudi LEFT JOIN mahasiswa m ON m.kdprodi = p.kdprodi JOIN stmhssemester s ON s.nim = m.nim AND s.kdstsemester = '$kdstsemester' LEFT JOIN ( SELECT idklsmhs , idjnskls FROM klsmhs WHERE CASE WHEN '$idklsmhs' = 4 THEN idklsmhs <> '$idklsmhs' WHEN '$idklsmhs' <> 4 THEN idklsmhs = '$idklsmhs' END) kls ON kls.idklsmhs = m.idklsmhs LEFT JOIN setbiaya sb ON sb.kdprodi = m.kdprodi AND sb.tahunmsk = m.thnmasuk AND sb.idjnskls = kls.idjnskls AND sb.idjnsbiaya = 1 AND sb.kdstsemester = '$kdstsemester' AND sb.idstatus = 1 LEFT JOIN diskonmhs ds ON ds.nim = s.nim AND ds.idsetbiaya = sb.idsetbiaya AND ds.kdstsemester = '$kdstsemester' LEFT JOIN ( SELECT k.nim , k.kdstsemester , k.idstkuitansi , k.idjnsbiaya , sum(k.jmlbayar) AS jmlbayar FROM kuitansi k WHERE k.idstkuitansi = 1 AND k.kdstsemester = '$kdstsemester' GROUP BY k.nim , k.idjnsbiaya ) ks ON ks.nim = s.nim AND ks.idjnsbiaya = sb.idjnsbiaya ORDER BY p.kdfakultas , p.nourutprodi; ")->result(); return $data; } function get_rows($kdstsemester,$idklsmhs){ $all_mhs_dpp = $this->get_all_mhs_dpp($kdstsemester,$idklsmhs); $KEDUA= $this->load->database('second', TRUE); $data = $KEDUA->query("SELECT v_prodi.kdfakultas AS kdfakultas , v_prodi.nmfakultas AS nmfakultas , v_prodi.kdprodi AS kdprodi , v_prodi.nmprodi AS nmprodi , v_prodi.nmjenjangstudi AS nmjenjangstudi , v_prodi.nourutprodi AS nourutprodi , (SELECT count(k.nim) AS cnim FROM kuitansi k LEFT JOIN mahasiswa m ON k.nim = m.nim WHERE CASE WHEN ('$idklsmhs' <> '4') THEN k.idjnsbiaya=6 AND m.kdprodi=v_prodi.kdprodi AND k.kdstsemester='$kdstsemester' AND m.idklsmhs = '$idklsmhs' WHEN ('$idklsmhs' = '4') THEN k.idjnsbiaya=6 AND m.kdprodi=v_prodi.kdprodi AND k.kdstsemester='$kdstsemester' END) AS dp9 FROM v_prodi WHERE v_prodi.nmjenjangstudi <> 'S-2' ORDER BY v_prodi.kdfakultas")->result(); $no=0; $p0=0; $p1to49=0; $p50=0; $p51to79=0; $p80=0; $p81to99=0; $p100=0; $persent=0; $dp9=0; $total=0; $tp0=0; $tp1to49=0; $tp50=0; $tp51to79=0; $tp80=0; $tp81to99=0; $tp100=0; $tpersent=0; $tdp9=0; $ttotal=0; $rows = ""; foreach($data as $row) { $no = $no + 1; foreach($all_mhs_dpp as $rowx) { if ($rowx->kdprodi == $row->kdprodi && $rowx->persenbayar == 0) { $p0 = $p0 + 1; } if ($rowx->kdprodi == $row->kdprodi && ($rowx->persenbayar >= 1 && $rowx->persenbayar <= 49)) { $p1to49 = $p1to49 + 1; } if ($rowx->kdprodi == $row->kdprodi && $rowx->persenbayar == 50) { $p50 = $p50 + 1; } if ($rowx->kdprodi == $row->kdprodi && ($rowx->persenbayar >= 51 && $rowx->persenbayar <= 79)) { $p51to79 = $p51to79 + 1; } if ($rowx->kdprodi == $row->kdprodi && $rowx->persenbayar == 80) { $p80 = $p80 + 1; } if ($rowx->kdprodi == $row->kdprodi && ($rowx->persenbayar >= 81 && $rowx->persenbayar <= 99)) { $p81to99 = $p81to99 + 1; } if ($rowx->kdprodi == $row->kdprodi && $rowx->persenbayar == 100) { $p100 = $p100 + 1; } } $persent = $p100 * 100 / ($p0 + $p1to49 + $p50 + $p51to79 + $p80 + $p81to99 + $p100); $dp9=$dp9 + $row->dp9; $total = $p0 + $p1to49 + $p50 + $p51to79 + $p80 + $p81to99 + $p100; $rows .= "
KODE | PROGRAM STUDI | 0 % | 1 % - 49 % | 50 % | 51 % - 79 % | 80 % | 81 % - 99 % | 100 % | % LUNAS | OVER SMT | TOTAL |
---|