<?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 Material
 *
 * @author Code sys PC 7
 */
class Material extends CI_Model {

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

    public function saveMaterial($array_insert_materials) {
        $this->db->insert("print_materials", $array_insert_materials);
    }

    public function getAllMaterials() {
        $this->db->select('*');
        $allmats = $this->db->get('print_materials');
        return $allmats;
    }

    public function deleteMaterial($matid) {
        $this->db->where('idprint_materials', $matid);
        $this->db->delete("print_materials");
    }

    public function updateMaterialDetails($matid, $array_details) {
        $this->db->where('idprint_materials', $matid);
        $this->db->update("print_materials", $array_details);
    }

    public function getInks() {
        $this->db->select('*');
        $allinks = $this->db->get('ink_materials');
        return $allinks;
    }

}
