Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Controller
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- class Karyawan extends CI_Controller {
- function __construct(){
- parent:: __construct();
- $this->load->model(array('m_karyawan','m_kontrak','m_keluarga','m_anak','m_pengalaman'));
- $this->load->library(array('upload'));
- }
- public function index()
- {
- $isi['content']='karyawan/f_eks_karyawan';
- $isi['data']= $this->m_karyawan->tampil_eks_karyawan()->result();
- $this->load->view('template',$isi);
- }
- }
- //Model
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- class M_karyawan extends CI_model {
- public function tampil_eks_karyawan(){
- $query=$this->db->join('tb_kontrak k','k.id_karyawan=d.id_karyawan')->join('tb_nonaktif n','n.id_karyawan=d.id_karyawan')->where('d.aktif'=0)->get('tb_karyawan d');
- return $query;
- }
- }
- //view
- <table class="table table-striped table-bordered table-hover table-full-width" id="sample_1">
- <thead>
- <tr>
- <th width="60">No</th>
- <th width="120">Foto</th>
- <th width="230">Nama</th>
- <th width="150">Jabatan</th>
- </tr>
- </thead>
- <tbody>
- <?php $no=1;
- foreach ($data as $r) { ?>
- <tr>
- <td><?php echo $no++; ?></td>
- <td><?php echo $r->nama_karyawan; ?></a></td>
- <td><?php echo $r->jabatan_karyawan; ?></td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment