emprit

print_pelamar

Nov 2nd, 2012
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.02 KB | None | 0 0
  1. <?php
  2. class Cetak_biodata_pelamar extends CI_Controller {
  3.  
  4. function Header($pdf)
  5.         {      
  6.            $pdf->Image('logo.php',2,1,2);
  7.            $this->SetFont('Times','B','12');
  8.             $this->Cell(17,0.5,'',0,0,'C');
  9.             $this->Ln();
  10.             $this->Ln();
  11.             $this->Cell(17,0.5,'ABSENSI RE-ORGANISASI FTIK ',0,0,'C');
  12.             $this->Ln();
  13.             $this->Cell(17,0.5,'Tahun Akademik 2012-2013 ',0,0,'C');
  14.             $this->Ln();
  15.             $this->SetFont('Times','B','14');
  16.             $this->Line(2,3.5,19,3.5);
  17.             $this->Line(2,3.37,19,3.37);
  18.             $this->Ln();
  19.             $this->SetFont('Times','','12');
  20.             $this->Cell(17,0.5,'',0,1,'C');
  21.             $this->Cell(17,0.5,'Daftar Absensi',0,1,'C');
  22.             $this->Ln();
  23.             $this->SetFont('Times','B','12');
  24.             $this->Ln();
  25.        }   
  26.    
  27.     function index(){
  28.         require_once(APPPATH . 'third_party/tcpdf/config/lang/eng.php');
  29.         require_once(APPPATH . 'third_party/tcpdf/tcpdf.php');
  30.        
  31.         $no_urut = $this->session->userdata('no_urut');
  32.         $detail = $this->pelamar_model->caridata($no_urut);
  33. // create new PDF document
  34. $pdf = new TCPDF('P','cm','A4');
  35.  
  36. // set document information
  37. $pdf->SetCreator(PDF_CREATOR);
  38. $pdf->SetAuthor('Emprit');
  39. $pdf->SetTitle('Biodata Pelamar');
  40. $pdf->SetSubject('Biodata untuk '.$this->session->userdata('username'));
  41.  
  42. $pdf->setPrintHeader(true);
  43. $this->Header($pdf);
  44. $pdf->setPrintFooter(false);
  45.  
  46. // set default monospaced font
  47. $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
  48.  
  49. //set margins
  50. $pdf->SetMargins(2,4.5,2);
  51.  
  52. //set auto page breaks
  53. $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
  54.  
  55. //set image scale factor
  56. $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
  57.  
  58. //set some language-dependent strings
  59. $pdf->setLanguageArray($l);
  60. // ---------------------------------------------------------
  61.  
  62. // add a page
  63. $pdf->AddPage();
  64. $pdf->SetFont('times', '', 12);
  65.  
  66. $row = $query->row();
  67. $pdf->Cell(0.7,0.5,'No Urut Pelamar',1,0,'C');
  68. $pdf->Cell(0.2,0.5,':',1,0,'C');
  69. $pdf->Cell(0.7,0.5,$row->no_urut,1,1,'C');
  70.  
  71.  
  72. $pdf->Output("Biodata-".$this->session->userdata('username') ."pdf","D");
  73.     }
  74. }
  75. ?>
Advertisement
Add Comment
Please, Sign In to add comment