Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Cetak_biodata_pelamar extends CI_Controller {
- function Header($pdf)
- {
- $pdf->Image('logo.php',2,1,2);
- $this->SetFont('Times','B','12');
- $this->Cell(17,0.5,'',0,0,'C');
- $this->Ln();
- $this->Ln();
- $this->Cell(17,0.5,'ABSENSI RE-ORGANISASI FTIK ',0,0,'C');
- $this->Ln();
- $this->Cell(17,0.5,'Tahun Akademik 2012-2013 ',0,0,'C');
- $this->Ln();
- $this->SetFont('Times','B','14');
- $this->Line(2,3.5,19,3.5);
- $this->Line(2,3.37,19,3.37);
- $this->Ln();
- $this->SetFont('Times','','12');
- $this->Cell(17,0.5,'',0,1,'C');
- $this->Cell(17,0.5,'Daftar Absensi',0,1,'C');
- $this->Ln();
- $this->SetFont('Times','B','12');
- $this->Ln();
- }
- function index(){
- require_once(APPPATH . 'third_party/tcpdf/config/lang/eng.php');
- require_once(APPPATH . 'third_party/tcpdf/tcpdf.php');
- $no_urut = $this->session->userdata('no_urut');
- $detail = $this->pelamar_model->caridata($no_urut);
- // create new PDF document
- $pdf = new TCPDF('P','cm','A4');
- // set document information
- $pdf->SetCreator(PDF_CREATOR);
- $pdf->SetAuthor('Emprit');
- $pdf->SetTitle('Biodata Pelamar');
- $pdf->SetSubject('Biodata untuk '.$this->session->userdata('username'));
- $pdf->setPrintHeader(true);
- $this->Header($pdf);
- $pdf->setPrintFooter(false);
- // set default monospaced font
- $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
- //set margins
- $pdf->SetMargins(2,4.5,2);
- //set auto page breaks
- $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
- //set image scale factor
- $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
- //set some language-dependent strings
- $pdf->setLanguageArray($l);
- // ---------------------------------------------------------
- // add a page
- $pdf->AddPage();
- $pdf->SetFont('times', '', 12);
- $row = $query->row();
- $pdf->Cell(0.7,0.5,'No Urut Pelamar',1,0,'C');
- $pdf->Cell(0.2,0.5,':',1,0,'C');
- $pdf->Cell(0.7,0.5,$row->no_urut,1,1,'C');
- $pdf->Output("Biodata-".$this->session->userdata('username') ."pdf","D");
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment