<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Asset_type_model extends CI_Model {
    public function __construct() {
        parent::__construct(); 
    }
    
    // Function to fetch all asset types
    public function get_asset_types() {
        $query = $this->db->get('db_asset_type');
        return $query->result();
    }

    // Function to add new asset type
    public function add_asset_type($data) {
        $this->db->insert('db_asset_type', $data);
        return $this->db->insert_id();
    }

    // Function to update asset type
    public function update_asset_type($id, $data) {
        $this->db->where('id', $id);
        $this->db->update('db_asset_type', $data);
    }

    // Function to delete asset type
    public function delete_asset_type($id) {
        $this->db->where('id', $id);
        $this->db->delete('db_asset_type');
    }
}
?>
