Advertisement
Roy_Iwan_Pasaribu

laporan ci

Dec 21st, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.49 KB | None | 0 0
  1. <?php
  2. Class Laporanpajak extends CI_Controller{
  3.    
  4.     function __construct() {
  5.         parent::__construct();
  6.         $this->load->library('pdf');
  7.     }
  8.    
  9.     function index(){
  10.         $pdf = new FPDF('L','cm','Legal', 'C');
  11.         $pdf->AddPage();
  12.         $pdf->SetFont('Helvetica','',14, 'C');
  13.  
  14.         $pdf->SetFont('Arial','B',12, 'C');
  15.        
  16.         $pdf->cell(33.5,2, 'LAPORAN',1,0,'C');
  17.         $pdf->Ln();
  18.        
  19.         $pdf->SetFont('Arial','B',10, 'C');
  20.         $pdf->Cell(6,1,'Tanggal',1,0, 'C');
  21.         $pdf->Cell(7,1,'Nomor ',1,0, 'C');
  22.         $pdf->Cell(7,1,'Nama ',1,0, 'C');
  23.         $pdf->Cell(7,1,'Pendapatan ',1,1, 'C');
  24.        
  25.  
  26.         $pdf->SetFont('Arial','',10, 'C');
  27.    
  28.         $pajak = $this->db->get('pajak')->result();
  29.         $no=0;
  30.         foreach ($pajak as $row){
  31.            
  32.             $pdf->Cell(6,1,$row->tanggal,1,0, 'C');
  33.             $pdf->Cell(7,1,$row->nomor,1,0, 'C');
  34.             $pdf->Cell(7,1,$row->nama,1,0, 'C');
  35.             $pdf->Cell(7,1,'Rp.'.$row->pendapatan,1,1, 'C');
  36.            
  37.         }
  38.        
  39.        $pdf->cell(20,0.8, 'Total',1,0,'C');
  40.         $pdf->cell(7,0.8, 'Rp.'.$row->pendapatan,1,0, 'C');
  41.        
  42.         $pdf->Ln();$no=0;
  43.         $pdf->Ln();
  44.         $pdf->SetFont('Helvetica','',12);
  45.         $pdf->cell(0.5,0.5, 'Bidang Akutansi Dan Pelap. Keuangan');$pdf->cell(7);
  46.         $pdf->cell(0.5,0.5, '');$pdf->cell(7);
  47.         $pdf->cell(0.5,0.5, '');$pdf->cell(4);$pdf->Ln(1.5);$pdf->Ln(1.5);
  48.         $pdf->cell(0.5,0.5, "Drs.");$pdf->cell(7);
  49.         $pdf->Output();
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement