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

class Lokcab_m extends CI_Model
{

    public function get($id = null)
    {
        $this->db->from('tb_cabang');
        if ($id != null) {
            $this->db->where('id_cabang', $id);
        }
        $query = $this->db->get();
        return $query;
    }

    public function addcab($post)
    {
        $params['cabang'] = $post['cabang'];
        $params['no_hp'] = $post['no_hp'];
        $params['alamat'] = $post['alamat'];
        $params['url'] = $post['url'];
        $params['foto'] = $post['foto'];
        $params['inopen'] = $post['inopen'];

        $this->db->insert('tb_cabang', $params);
    }
}
