<?php

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

class Company_model extends CI_Model {

    public function get_name($company_id) {
        if (!is_numeric($company_id))
            return null;
        $this->db->select('u.company');
        $this->db->from('users u');
        $this->db->where('u.id', $company_id);
        $result = $this->db->get()->row_array();
        return $result['company'];
    }

    public function check_isset($company_id) {
        if (!is_numeric($company_id))
            return null;
        $this->db->select('1');
        $this->db->from('users u');
        $this->db->where('u.id', $company_id);
        $result = $this->db->get()->row_array();
        if ($result)
            return true;
        else
            return false;
    }

}
