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

class Model_academic_qualification_attachment extends CI_Model {

	public function fetchAttachment($staff_id = null, $mask_id = null)
	{
		
		$this->db->select('a.*');
		if($staff_id)$this->db->where('user_id',$staff_id);
		if($mask_id)$this->db->where('mask_id',$mask_id);
		$query = $this->db->get('user__academic_qualification_attachment a');

		return ($query->num_rows() > 0)?$query->result() : null;
	}

	public function createAttachment($input)
	{
		$this->db->insert('user__academic_qualification_attachment',$input);

		return $this->db->insert_id();
	}

	public function editAttachment($input, $id = null, $qualification_id = null)
	{
		if($qualification_id) $this->db->where('academic_qualification_id',$qualification_id);
		if($id) $this->db->where('id',$id);
		$this->db->set($input);
		return $this->db->update('user__academic_qualification_attachment');
	}

	
}
?>