<?php

class AuthModel extends CI_Model {

	function get_client($id, $key) {

		$this->db->select('*');
		$this->db->from('user_client');
		$this->db->where(array('ID' => $id, 'client_key' => $key));

		$query = $this->db->get();

		if($query->num_rows() > 0) {
			return $query->result_array();
		} else {
			return null;
		}
	}

	function get_key_client($id) {

                $this->db->select('key');
                $this->db->from('user_client');
                $this->db->where(array('ID' => $id));

                $query = $this->db->get();

                if($query->num_rows() > 0) {
                        return $query->result_row();
                } else {
                        return null;
                }
        }
}
