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

class Skills_model extends CI_Model {

    public function skills_view()
    {
        return $this->db->select('*')
            ->from('skills')
            ->order_by('skill_id', 'desc')
            ->get()
            ->result();
    }

    public function skills_create($data = array())
    {
        return $this->db->insert('skills', $data);
    }

    public function update_skills($data = array())
    {
        return $this->db->where('skill_id',$data["skill_id"])
            ->update("skills", $data);


    }
    public function skills_updateForm($id){
        $this->db->where('skill_id',$id);
        $query = $this->db->get('skills');
        return $query->row();
    }

    public function skills_delete($id = null)
    {
        $this->db->where('skill_id',$id)
            ->delete('skills');

        if ($this->db->affected_rows()) {
            return true;
        } else {
            return false;
        }
    }

}
