Sebuahhobi98

fpdf

Jan 9th, 2019
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.25 KB | None | 0 0
  1. function pdf($id){
  2.         $this->load->library('cfpdf');
  3.         $pdf=new FPDF('P','cm','A4');
  4.         $pdf->SetMargins('4,0', '4,0', '3,0');
  5.         $pdf->AddPage();
  6.         $pdf->Image(base_url('assets/image/Siak.png'),20,2,30,20); //x , y , w, h
  7.         //kop
  8.         $pdf->Cell(25);
  9.         $pdf->SetFont('Arial','B','14');
  10.         $pdf->Cell(0,5,'PEMERINTAH KABUPATEN SIAK',0,1,'C'); // left, space, text, border, vertikal (0) horizontal (1), Center
  11.         $pdf->Cell(25);
  12.         $pdf->Cell(0,5,'KECAMATAN MINAS',0,1,'C');
  13.         $pdf->Cell(25);
  14.         $pdf->SetFont('Times','B','16');
  15.         $pdf->Cell(0,5,'KAMPUNG MANDIANGIN',0,1,'C');
  16.         $pdf->Cell(25);
  17.         $pdf->SetFont('Times','',' 12');
  18.         $pdf->Cell(0,5,'Alamat: Jl. Montikato RT. 001 / RK. 002 Dusun Mak Kaib Kode Pos 28885',0,1,'C');
  19.         //line
  20.         $pdf->SetLineWidth(1);
  21.         $pdf->Line(25,25,205,25);
  22.         $pdf->SetLineWidth(0);
  23.         $pdf->Line(25,26,205,26);
  24.         //end line
  25.         //end kop
  26.  
  27.         $pdf->Cell(0,5,'',0,1,'C');
  28.         $pdf->SetFont('Times','BU',' 12');
  29.         $pdf->cell(0,5, 'SURAT KETERANGAN',0,1,'C');
  30.         $pdf->SetFont('Times','',' 12');
  31.         $pdf->cell(0,5, 'Nomor : 100/SKKB/05-MA/'.date("Y").'/'.$id,0,1,'C');
  32.         //$pdf->cell(40,5,'',0,0,'');
  33.         //$pdf->cell(25,20, ,0,1,'J');
  34.         $pdf->text(35,45,'Penghulu Kampung Mandiangin Kecamatan Minas Kabupaten Siak, dengan ini menerangkan bahwa:',0);
  35.        
  36.         $get=$this->db->get_where('Surat_ket_melamar_kerja',array('id' =>$id));
  37.         foreach ($get->result() as $user) {
  38.            
  39.         }
  40.         $pdf->Ln();$pdf->Ln();$pdf->Ln();
  41.         $pdf->Cell(40,5,'',0,0,'L');
  42.         $pdf->cell(40,5, 'Nama Lengkap',0,0,'');$pdf->cell(5,5, ':',0,0,'');$pdf->SetFont('Times','B','12');
  43.         $pdf->cell(20,5, ''.strtoupper($user->nama).'',0,1,'');
  44.  
  45.         $pdf->Cell(40,5,'',0,0,'L');
  46.         $pdf->SetFont('Times','',' 12');
  47.         $pdf->cell(40,5,'Jenis Kelamin',0,0,'');     $pdf->cell(5,5, ':',0,0,''); $pdf->cell(20,5, ''.ucwords($user->jenis_kelamin=='l' ? 'Laki-laki' : 'Perempuan').'',0,1,'');
  48.  
  49.         $pdf->Cell(40,5,'',0,0,'L');
  50.         $pdf->cell(40,5,'Tempat/Tgl/Lahir',0,0,'');  $pdf->cell(5,5, ':',0,0,'');$pdf->cell(20,5, ''.ucwords($user->tempat_lahir.'/ '.tgl_indo($user->tgl_lahir)).'',0,1,'');
  51.  
  52.         $pdf->Cell(40,5,'',0,0,'L');
  53.         $pdf->cell(40,5,'Kewarganegaraan',0,0,'');   $pdf->cell(5,5, ':',0,0,'');$pdf->cell(20,5, ''.ucwords($user->kewarganegaraan).'',0,1,'');
  54.  
  55.         $pdf->Cell(40,5,'',0,0,'L');
  56.         $pdf->cell(40,5,'Agama',0,0,'');             $pdf->cell(5,5, ':',0,0,'');$pdf->cell(20,5, ''.ucwords($user->agama).'',0,1,'');
  57.  
  58.         $pdf->Cell(40,5,'',0,0,'L');
  59.         $pdf->cell(40,5,'Status Perkawinan',0,0,''); $pdf->cell(5,5, ':',0,0,'');$pdf->cell(20,5, ''.ucwords($user->status_kawin).'',0,1,'');
  60.  
  61.         $pdf->Cell(40,5,'',0,0,'L');
  62.         $pdf->cell(40,5,'Alamat',0,0,'');            $pdf->cell(5,5, ':',0,0,'');$pdf->cell(20,5, ''.ucwords($user->alamat).'',0,1,'');
  63.  
  64.         $pdf->Cell(40,5,'',0,0,'L');
  65.         $pdf->cell(40,5,'No. NIK',0,0,'');           $pdf->cell(5,5, ':',0,0,'');$pdf->cell(20,5, ''.ucwords($user->nik).'',0,1,'');
  66.  
  67.         $pdf->Cell(40,5,'',0,0,'L');
  68.         $pdf->cell(40,5,'Keterangan Lain',0,0,'');   $pdf->cell(5,5, ':',0,0,'');$pdf->cell(20,5, ''.ucwords($user->ket_lain==''? '-' : $user->ket_lain).'',0,1,'');
  69.  
  70.         $pdf->Ln();$pdf->Ln();$pdf->Ln();
  71.         $pdf->text(35,105,'Nama tersebut benar diatas adalah benar Penduduk Kampung Mandiangin Kecamatan Minas Kabup-',0);
  72.         $pdf->text(35,110,'aten Siak, menurut penelitian kami yang bersangkutan adalah Berkelakuan Baik. Belum ada atau tid-',0);
  73.         $pdf->text(35,115,'ak pernah terlibat G.30 S/PKI dan Organisasi terlarang lainnya.',0);
  74.         $pdf->text(35,120,'Dan surat keterangan berkelakuan baik ini kami perbuat dan kami berikan untuk sementara penukar-',0);
  75.         $pdf->text(35,125,'an oleh Polisi Sektor ( Polsek ) Tualang di pergunakan untuk :',0);
  76.         $pdf->Ln();$pdf->Ln();$pdf->Ln();
  77.         $pdf->SetFont('Times','B','12');
  78.         $pdf->cell(0,5,'Melamar Pekerjaan', 0,0,'C');
  79.         $pdf->SetLineWidth(1);
  80.         $pdf->Line(35,135,205,135);
  81.         $pdf->Ln();$pdf->Ln();
  82.         $pdf->text(35,140,'Demikianlah Surat Keterangan Berkelakuan Baik ini kami perbuat dan diberikan kepada ya-',0);
  83.         $pdf->text(35,145,'ng bersangkutan untuk dapat dipergunakan seperlunya.',0);
  84.         $pdf->Ln();$pdf->Ln();$pdf->Ln();
  85.  
  86.         $pdf->Cell(120,5,'',0,0,'L');
  87.         $pdf->cell(0,5,'Kampung Mandiangin,'.tgl_indo(date('Y-m-d')).'',0,1,'L');
  88.         $pdf->Cell(120,5,'',0,0,'L');
  89.         $pdf->SetFont('Times','B','12');
  90.         $pdf->cell(0,10,'PENGHULU KAMPUNG MANDIANGIN',0,0,'L');
  91.         $pdf->Ln();$pdf->Ln();$pdf->Ln();$pdf->Ln();
  92.  
  93.         $kpldesa=$this->db->get_where('perangkat_desa',array('jabatan' => 'Kepala Desa'))->result();
  94.         foreach ($kpldesa as $desa) {
  95.  
  96.         }
  97.         $pdf->SetFont('Times','BU','14');
  98.         $pdf->Cell(120,5,'',0,0,'L');
  99.         $pdf->cell(0,5,$desa->nama_kepala_desa,0,1,'L');
  100.         $pdf->Cell(120,5,'',0,0,'L');
  101.         $pdf->SetFont('Times','','12');
  102.         $pdf->cell(0,5,'Nip.'.$desa->nip,0,0,'L');
  103.         $pdf->Output();
  104.     }
Add Comment
Please, Sign In to add comment