emprit

cetak_sertified

Nov 4th, 2012
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.14 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.            $pdf->SetFont('Times','B','12');
  8.             $pdf->Cell(17,0.5,'',0,0,'C');
  9.             $pdf->Ln();
  10.             $pdf->Ln();
  11.             $pdf->Cell(17,0.5,'ABSENSI RE-ORGANISASI FTIK ',0,0,'C');
  12.             $pdf->Ln();
  13.             $pdf->Cell(17,0.5,'Tahun Akademik 2012-2013 ',0,0,'C');
  14.             $pdf->Ln();
  15.             $pdf->SetFont('Times','B','14');
  16.             $pdf->Line(2,3.5,19,3.5);
  17.             $pdf->Line(2,3.37,19,3.37);
  18.             $pdf->Ln();
  19.             $pdf->SetFont('Times','','12');
  20.             $pdf->Cell(17,0.5,'',0,1,'C');
  21.             $pdf->Cell(17,0.5,'Biodata Diri Anda',0,1,'C');
  22.             $pdf->Ln();
  23.             $pdf->SetFont('Times','B','12');
  24.             $pdf->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.         $query = $this->pelamar_model->caridata($no_urut);
  33.         $this->load->helper('chapps');     
  34.        
  35. // create new PDF document
  36. $pdf = new TCPDF('P','cm','A4');
  37.  
  38. // add a page
  39. $pdf->AddPage();
  40.  
  41. // set document information
  42. $pdf->SetCreator(PDF_CREATOR);
  43. $pdf->SetAuthor('Emprit');
  44. $pdf->SetTitle('Biodata Pelamar');
  45. $pdf->SetSubject('Biodata untuk '.$this->session->userdata('username'));
  46.  
  47.  
  48.  
  49. //set margins
  50. $pdf->SetMargins(2,5,2);
  51.  
  52. $pdf->setPrintHeader(true);
  53. $this->Header($pdf);
  54. $pdf->setPrintFooter(false);
  55.  
  56. // set certificate file
  57. $certificate = 'localhost/karyawan/application/third_party/tcpdf/images/tcpdf.crt';
  58.  
  59. // set additional information
  60. $info = array(
  61.     'Name' => 'Gudang Emprit',
  62.     'Location' => 'Office',
  63.     'Reason' => 'keaslian cetakan',
  64.     'ContactInfo' => 'http://www.rifa.asia',
  65.     );
  66.  
  67. // set document signature
  68. $pdf->setSignature($certificate, $certificate, 'tcpdfdemo', '', 2, $info);
  69.  
  70.  
  71. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  72. // *** set signature appearance ***
  73.  
  74. // create content for signature (image and/or text)
  75. $pdf->Image('localhost/karyawan/img/ge.jpg', 180, 60, 15, 15, 'JPG');
  76.  
  77. // define active area for signature appearance
  78. $pdf->setSignatureAppearance(180, 60, 15, 15);
  79.  
  80. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  81.  
  82. // *** set an empty signature appearance ***
  83. $pdf->addEmptySignatureAppearance(180, 80, 15, 15);
  84.  
  85. $pdf->SetFont('times', '', 12);
  86.  
  87. $row=$query->row();
  88. $pdf->Cell(5,0.5,'No Urut Pelamar',0,0,'L');
  89. $pdf->Cell(0.2,0.5,':',0,0,'C');
  90. $pdf->Cell(10,0.5,'GE_'.$row->no_urut,0,1,'L');
  91.  
  92. $pdf->Cell(5,0.5,'No KTP',0,0,'L');
  93. $pdf->Cell(0.2,0.5,':',0,0,'C');
  94. $pdf->Cell(17,0.5,$row->noktp,0,1,'L');
  95.  
  96. $pdf->Cell(5,0.5,'Nama Lengkap',0,0,'L');
  97. $pdf->Cell(0.2,0.5,':',0,0,'C');
  98. $pdf->Cell(17,0.5,$row->nama_lengkap,0,1,'L');
  99.  
  100. $pdf->Cell(5,0.5,'Tempat, Tanggal Lahir',0,0,'L');
  101. $pdf->Cell(0.2,0.5,':',0,0,'C');
  102. $pdf->Cell(15,0.5,$row->tempat_lahir.', '.chappsdate($row->tgl_lahir),0,1,'L');
  103.  
  104. $pdf->Cell(5,0.5,'Jenis Kelamin',0,0,'L');
  105. $pdf->Cell(0.2,0.5,':',0,0,'C');
  106. $pdf->Cell(17,0.5,$row->jk,0,1,'L');
  107.  
  108. $pdf->Cell(5,0.5,'Alamat',0,0,'L');
  109. $pdf->Cell(0.2,0.5,':',0,0,'C');
  110. $pdf->Cell(17,0.5,$row->alamat,0,1,'L');
  111.  
  112. $pdf->Cell(5,0.5,'Kota',0,0,'L');
  113. $pdf->Cell(0.2,0.5,':',0,0,'C');
  114. $pdf->Cell(10,0.5,$row->kota,0,1,'L');
  115.  
  116. $pdf->Cell(5,0.5,'Negara',0,0,'L');
  117. $pdf->Cell(0.2,0.5,':',0,0,'C');
  118. $pdf->Cell(10,0.5,$row->country,0,1,'L');
  119.  
  120. $pdf->Cell(5,0.5,'Kode POS',0,0,'L');
  121. $pdf->Cell(0.2,0.5,':',0,0,'C');
  122. $pdf->Cell(10,0.5,$row->kodepos,0,1,'L');
  123.  
  124. $pdf->Cell(5,0.5,'Agama',0,0,'L');
  125. $pdf->Cell(0.2,0.5,':',0,0,'C');
  126. $pdf->Cell(7,0.5,$row->agama,0,1,'L');
  127.  
  128. $pdf->Cell(5,0.5,'Golongan Darah',0,0,'L');
  129. $pdf->Cell(0.2,0.5,':',0,0,'C');
  130. $pdf->Cell(2,0.5,$row->goldar,0,1,'L');
  131.  
  132. $pdf->Cell(5,0.5,'Telephone',0,0,'L');
  133. $pdf->Cell(0.2,0.5,':',0,0,'C');
  134. $pdf->Cell(7,0.5,$row->telp,0,1,'L');
  135.  
  136. $pdf->Cell(5,0.5,'Status',0,0,'L');
  137. $pdf->Cell(0.2,0.5,':',0,0,'C');
  138. $pdf->Cell(7,0.5,$row->status,0,1,'L');
  139.  
  140. $pdf->Cell(5,0.5,'Email',0,0,'L');
  141. $pdf->Cell(0.2,0.5,':',0,0,'C');
  142. $pdf->Cell(7,0.5,$row->email,0,1,'L');
  143.  
  144. $pdf->Output("Biodata-".$this->session->userdata('username') .".pdf","D");
  145.     }
  146. }
  147. ?>
Advertisement
Add Comment
Please, Sign In to add comment