Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------VIEW---------------
- <?php
- $i=0;
- foreach ($query as $row){
- $i++;
- echo "<tr class='odd gradeX'>";
- echo "<td><center>$i</center></td>";
- echo "<td>GE_$row->no_urut</td>";
- echo "<td>$row->nama_lengkap</td>";
- echo "<td>$row->tempat_lahir, $row->tgl_lahir</td>";
- echo "<td>$row->jk</td>";
- echo "<td>$row->alamat</td>";
- echo "<td>$row->kota, $row->country</td>";
- echo "<td>$row->agama</td>";
- echo "<td>$row->telp</td>";
- echo "<td>$row->email</td>";
- echo "<td><a href='cetak_admin/{$row->no_urut}'>Cetak</a></td>";
- echo "</tr>";
- }
- ?>
- ----------Controller-----------
- function cetak_admin($no_urut){
- 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->data_pelamar($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'));
- $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');
- --------------MODEL------------------
- public function data_pelamar($no_urut) {
- $query=$this->db->where('no_urut',$no_urut)->get('biodata_pelamar');
- return $query->result();
- }
Advertisement
Add Comment
Please, Sign In to add comment