<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Item_modal
 *
 * @author user
 */
class Item_modal extends CI_Model {

    public function __construct() {
        $this->load->database();
    }

    public function get_item_list() {
        $this->db->select();
        $this->db->from('item');
        $query = $this->db->get();
        return $query->result();
    }

    public function get_item_list_by_id($itemid) {
        $this->db->select('code,name,cprice,sprice,unit');
        $this->db->from('item');
        $this->db->where('code', $itemid);
        $query = $this->db->get();
        $item = $query->first_row('array');
        return $item;
    }

}
