<?php
defined('BASEPATH') or exit('No direct script access allowed');

class Peldate_m extends CI_Model
{

    public function get($id = null)
    {

        if ($id != null) {
            $this->db->from('tb_pel');
            $this->db->order_by('id_pel', 'asc');
            $this->db->where('id_pel', $id);
        } elseif (isset($_GET['Cab'])) {
            //    $cab = $_GET['Cab'];
            $this->db->from('tb_kattb_pelbrg');
            //   $this->db->where('id_cabang', $cab);
            $this->db->order_by('id_pel', 'asc');
        } else {
            $this->db->from('tb_pel');
            $this->db->order_by('id_pel', 'asc');
        }
        $query = $this->db->get();
        return $query;
    }
}
