<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Home_model extends CI_Model
{

    public $table = 'kunjungan';
    public $id = 'id_kunjungan';
    public $order = 'DESC';

    function __construct()
    {
        parent::__construct();
    }

    function insert($data)
    {
        $this->db->insert($this->table, $data);
    }

    function get_sub_tujuan($id)
    {
        $jabatan = str_replace('%20', ' ', $id);
        $this->db->order_by('id_jabatan', $this->order);
        $this->db->like('atasan_jabatan', $jabatan);
        $this->db->select('*');
        $this->db->from('jabatan');
        return $this->db->get()->result();
        // return $this->db->get($this->kabupaten)->result();
    }

    function get_by_id($id)
    {
        $this->db->where('rfid_ktp', $id);
        return $this->db->get('pegawai')->row();
    }
}
