Detect Device

https://github.com/serbanghita/Mobile-Detect

$this->load->library('Mobile_Detect');

function get_device(){
	if($this->mobile_detect->isMobile() == true){
		if($this->mobile_detect->isTablet() == true){
				return 'tablet';
		}else{
			return 'phone';
		}
	}else{
		return 'computer';
	}
}