1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22:
<?php
class Inventory extends CI_Model
{
public function insert($inventory_data)
{
return $this->db->insert('inventory', $inventory_data);
}
public function get_inventory_data_for_item($item_id, $location_id = FALSE)
{
$this->db->from('inventory');
$this->db->where('trans_items', $item_id);
if($location_id != FALSE)
{
$this->db->where('trans_location', $location_id);
}
$this->db->order_by('trans_date', 'desc');
return $this->db->get();
}
}
?>