ceklog(); $this->load->library('pdf_dpk'); $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_data_dosen($thnsemester,$nidu){ $KEDUA= $this->load->database('second', TRUE); $query = $KEDUA->query("SELECT *, nmdosdgngelar AS nmdos FROM dosen WHERE nidu = $nidu"); $result = array(); if ($query->num_rows() > 0) { $result = $query->result(); } return $result; } function get_data($thnsemester,$nidu){ $KEDUA= $this->load->database('second', TRUE); $query = $KEDUA->query("CALL sp_getPerwalian (?,?)",array($thnsemester,$nidu)); $result = array(); if ($query->num_rows() > 0) { $result = $query->result(); } return $result; } function get_rows($thnsemester,$nidu){ $data = $this->get_data($thnsemester,$nidu); $rows = ""; $no = 1; foreach($data as $item){ $rows .= " ".$no.". ".$item->tglkrs." ".$item->nim." ".$item->nmmhs." ".$item->kdjnskelamin." ".$item->thnmasuk." ".$item->nmstawalmhs." ".$item->nmstkrs." ".number_format($item->bayardpp , 2 , ',' , '.' )." ".number_format($item->persendpp , 0 , ',' , '.' )." % "; $no++; } return $rows; } function get_perwalian($thnsemester,$nidu){ $row_thnakasmt = $this->get_row_pars("v_tahunakademik","nmthnakademik","kdstsemester='$thnsemester'"); $thnakasmt = $row_thnakasmt->nmthnakademik; $data = $this->get_data_dosen($thnsemester,$nidu); $nmdosen = ""; foreach($data as $item){ $nmdosen = $item->nmdos; } $this->pdf_dpk->SetCreator(PDF_CREATOR); //$image_file = base_url().'resources/img/report.png'; // set default header data $this->pdf_dpk->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH,PDF_HEADER_TITLE,PDF_HEADER_STRING); $this->pdf_dpk->setPrintHeader(true); $this->pdf_dpk->setPrintFooter(false); // set header and footer fonts $this->pdf_dpk->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', 10)); $this->pdf_dpk->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // set default monospaced font $this->pdf_dpk->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // set margins $this->pdf_dpk->SetMargins('5', '40', '20'); $this->pdf_dpk->SetHeaderMargin('10'); $this->pdf_dpk->SetFooterMargin(PDF_MARGIN_FOOTER); // set auto page breaks $this->pdf_dpk->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $this->pdf_dpk->setImageScale(PDF_IMAGE_SCALE_RATIO); // set some language-dependent strings (optional) // --------------------------------------------------------- // set font $this->pdf_dpk->SetFont('helvetica', 'B', 10); $this->pdf_dpk->SetCellPadding(0); // add a page $this->pdf_dpk->AddPage('L','F4'); $this->pdf_dpk->Write(0, 'DAFTAR MAHASISWA PERWALIAN', '', 0, 'C', true, 0, false, false, 0); $this->pdf_dpk->Write(0, 'TAHUN AKADEMIK/ SEMESTER '.$thnakasmt, '', 0, 'C', true, 0, false, false, 0); $this->pdf_dpk->Write(0, 'DOSEN : '.strtoupper($nmdosen), '', 0, 'C', true, 0, false, false, 0); $this->pdf_dpk->Write(0, 'NIDU : '.strtoupper($nidu), '', 0, 'C', true, 0, false, false, 0); //$this->pdf_dpk->Cell(0,10,'',0,1,'L'); // untuk memberi space $this->pdf_dpk->SetFont('helvetica', 'B', 10); $rows_perwalian = $this->get_rows($thnsemester,$nidu); $tbl = <<
$rows_perwalian
NO. TGL.KRS NPM NAMA MAHASISWA (L/P) TAHUN
MASUK
STATUS PENDAFTAR STATUS KRS BAYAR DPP PERSEN BAYAR DPP

EOD; $this->pdf_dpk->writeHTML($tbl,true,false,false,false); $this->pdf_dpk->Output('rpt_perwalian.pdf', 'I'); } } ?>