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);
- $pdf->SetFont('Times','B','12');
- $pdf->Cell(17,0.5,'',0,0,'C');
- $pdf->Ln();
- $pdf->Ln();
- $pdf->Cell(17,0.5,'ABSENSI RE-ORGANISASI FTIK ',0,0,'C');
- $pdf->Ln();
- $pdf->Cell(17,0.5,'Tahun Akademik 2012-2013 ',0,0,'C');
- $pdf->Ln();
- $pdf->SetFont('Times','B','14');
- $pdf->Line(2,3.5,19,3.5);
- $pdf->Line(2,3.37,19,3.37);
- $pdf->Ln();
- $pdf->SetFont('Times','','12');
- $pdf->Cell(17,0.5,'',0,1,'C');
- $pdf->Cell(17,0.5,'Biodata Diri Anda',0,1,'C');
- $pdf->Ln();
- $pdf->SetFont('Times','B','12');
- $pdf->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');
- $query = $this->pelamar_model->caridata($no_urut);
- $this->load->helper('chapps');
- // create new PDF document
- $pdf = new TCPDF('P','cm','A4');
- // add a page
- $pdf->AddPage();
- // set document information
- $pdf->SetCreator(PDF_CREATOR);
- $pdf->SetAuthor('Emprit');
- $pdf->SetTitle('Biodata Pelamar');
- $pdf->SetSubject('Biodata untuk '.$this->session->userdata('username'));
- //set margins
- $pdf->SetMargins(2,5,2);
- $pdf->setPrintHeader(true);
- $this->Header($pdf);
- $pdf->setPrintFooter(false);
- // set certificate file
- $certificate = 'localhost/karyawan/application/third_party/tcpdf/images/tcpdf.crt';
- // set additional information
- $info = array(
- 'Name' => 'Gudang Emprit',
- 'Location' => 'Office',
- 'Reason' => 'keaslian cetakan',
- 'ContactInfo' => 'http://www.rifa.asia',
- );
- // set document signature
- $pdf->setSignature($certificate, $certificate, 'tcpdfdemo', '', 2, $info);
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- // *** set signature appearance ***
- // create content for signature (image and/or text)
- $pdf->Image('localhost/karyawan/img/ge.jpg', 180, 60, 15, 15, 'JPG');
- // define active area for signature appearance
- $pdf->setSignatureAppearance(180, 60, 15, 15);
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- // *** set an empty signature appearance ***
- $pdf->addEmptySignatureAppearance(180, 80, 15, 15);
- $pdf->SetFont('times', '', 12);
- $row=$query->row();
- $pdf->Cell(5,0.5,'No Urut Pelamar',0,0,'L');
- $pdf->Cell(0.2,0.5,':',0,0,'C');
- $pdf->Cell(10,0.5,'GE_'.$row->no_urut,0,1,'L');
- $pdf->Cell(5,0.5,'No KTP',0,0,'L');
- $pdf->Cell(0.2,0.5,':',0,0,'C');
- $pdf->Cell(17,0.5,$row->noktp,0,1,'L');
- $pdf->Cell(5,0.5,'Nama Lengkap',0,0,'L');
- $pdf->Cell(0.2,0.5,':',0,0,'C');
- $pdf->Cell(17,0.5,$row->nama_lengkap,0,1,'L');
- $pdf->Cell(5,0.5,'Tempat, Tanggal Lahir',0,0,'L');
- $pdf->Cell(0.2,0.5,':',0,0,'C');
- $pdf->Cell(15,0.5,$row->tempat_lahir.', '.chappsdate($row->tgl_lahir),0,1,'L');
- $pdf->Cell(5,0.5,'Jenis Kelamin',0,0,'L');
- $pdf->Cell(0.2,0.5,':',0,0,'C');
- $pdf->Cell(17,0.5,$row->jk,0,1,'L');
- $pdf->Cell(5,0.5,'Alamat',0,0,'L');
- $pdf->Cell(0.2,0.5,':',0,0,'C');
- $pdf->Cell(17,0.5,$row->alamat,0,1,'L');
- $pdf->Cell(5,0.5,'Kota',0,0,'L');
- $pdf->Cell(0.2,0.5,':',0,0,'C');
- $pdf->Cell(10,0.5,$row->kota,0,1,'L');
- $pdf->Cell(5,0.5,'Negara',0,0,'L');
- $pdf->Cell(0.2,0.5,':',0,0,'C');
- $pdf->Cell(10,0.5,$row->country,0,1,'L');
- $pdf->Cell(5,0.5,'Kode POS',0,0,'L');
- $pdf->Cell(0.2,0.5,':',0,0,'C');
- $pdf->Cell(10,0.5,$row->kodepos,0,1,'L');
- $pdf->Cell(5,0.5,'Agama',0,0,'L');
- $pdf->Cell(0.2,0.5,':',0,0,'C');
- $pdf->Cell(7,0.5,$row->agama,0,1,'L');
- $pdf->Cell(5,0.5,'Golongan Darah',0,0,'L');
- $pdf->Cell(0.2,0.5,':',0,0,'C');
- $pdf->Cell(2,0.5,$row->goldar,0,1,'L');
- $pdf->Cell(5,0.5,'Telephone',0,0,'L');
- $pdf->Cell(0.2,0.5,':',0,0,'C');
- $pdf->Cell(7,0.5,$row->telp,0,1,'L');
- $pdf->Cell(5,0.5,'Status',0,0,'L');
- $pdf->Cell(0.2,0.5,':',0,0,'C');
- $pdf->Cell(7,0.5,$row->status,0,1,'L');
- $pdf->Cell(5,0.5,'Email',0,0,'L');
- $pdf->Cell(0.2,0.5,':',0,0,'C');
- $pdf->Cell(7,0.5,$row->email,0,1,'L');
- $pdf->Output("Biodata-".$this->session->userdata('username') .".pdf","D");
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment