Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require('../../plugin/fpdf/fpdf.php');
- include('../../system/class.php');
- $mimin = new Admin();
- $data = $mimin->getDataPeminjam();
- $name = "Mohammad Entol Rizky Muslimin";
- $npk = "171810195";
- class myPDF extends FPDF
- {
- function Header()
- {
- $this->Image("../../assets/icon/logo.png",15,6,20,20);
- $this->SetFont('Arial','B',10);
- $this->Cell(200,4,"PERPUSTAKAAN SMK TELEKOMUNIKASI TELESANDI BEKASI",0,0,"C");
- $this->Ln();
- $this->setFont('Times','',10);
- $this->cell(200,4,'Mekarsari Raya Jl. KH.Mochammad, Tambun Selatan, Bekasi, Indonesia.',0,0,"C");
- $this->Ln();
- $this->cell(200,4,'(+62)21 88332404 (Telp) | (021) 88323429 (Fax) | (+62)821-1978-8898 (Whatsapp)',0,0,"C");
- $this->SetDash();
- $this->Line(5, 30, 205, 30);
- $this->Ln(10);
- }
- function Footer()
- {
- $this->SetY(-15);
- $this->Line(5,280,205,280);
- $this->Ln();
- $this->setFont('Arial','',8);
- $this->Cell(0,10,'Bagian Perpustakaan '.realDate(),0,0,'L');
- $this->Cell(0,10,'Halaman '.$this->PageNo().'/{nb}',0,0,'R');
- }
- function judul()
- {
- $this->Ln();
- $this->SetFont("Times","B",14);
- $this->Cell(200,5,'LAPORAN REKAPITULASI DATA PEMINJAM',0,0,'C');
- $this->Ln(10);
- }
- function headerTable()
- {
- $this->SetFont("Times","B",8);
- $this->Cell(25,10,"NIS",1,0,"C");
- $this->Cell(40,10,"NAMA",1,0,"C");
- $this->Cell(30,10,"KELAS",1,0,"C");
- $this->Cell(30,10,"ALAMAT",1,0,"C");
- $this->Cell(30,10,"NO HANPHONE",1,0,"C");
- $this->Cell(35,10,"EMAIL",1,0,"C");
- $this->Ln();
- // $this->SetWidths(array(25,40,30,30,30,35));
- // $this->Row(array(
- // 'NIS',
- // 'Nama',
- // 'Kelas',
- // 'Alamat',
- // 'No Handphone',
- // 'Email'
- // ));
- }
- function viewTable($data)
- {
- $this->SetFont('Times','',8);
- foreach ($data as $key => $value) {
- $this->SetWidths(array(25,40,30,30,30,35));
- $this->Row(array(
- $value['nis'],
- $value['nama'],
- $value['kelas'],
- $value['alamat'],
- $value['no_hp'],
- $value['email']
- ));
- }
- }
- function knowby($name,$npk)
- {
- $this->SetFont("Times","B",12);
- $this->Ln(10);
- $this->Cell(162,10,"Mengetahui",0,0,'R');
- $this->Ln(5);
- $this->SetFont("Times","",10);
- $this->Cell(170,10,"Kepala Perpustakaan",0,0,'R');
- $this->Ln(20);
- $this->SetFont("Times","U",10);
- $this->Cell(190,30,$name,0,0,'R');
- $this->Ln(20);
- $this->SetFont("Times","",9);
- $this->Cell(164,0,"NPK : ". $npk,0,0,'R');
- }
- }
- $pdf = new myPDF();
- $pdf->AliasNbPages();
- $pdf->AddPage('P','A4',0);
- $pdf->judul();
- $pdf->headerTable();
- $pdf->viewTable($data);
- $pdf->knowby($name,$npk);
- ob_end_clean();
- $pdf->output();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment