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

class Branches_model extends CI_Model {

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

    public function get_all_branches() {
        $query = $this->db->get('tbl_branches');
        return $query->result();
    }

    public function insert_branch($data) {
        return $this->db->insert('tbl_branches', $data);
    }

    public function get_branch_by_id($id) {
        $this->db->where('branch_id', $id);
        $query = $this->db->get('tbl_branches');
        return $query->row();
    }

    public function update_branch($id, $data) {
        $this->db->where('branch_id', $id);
        return $this->db->update('tbl_branches', $data);
    }
}
