irm-1.6-b3/include/connections.class.php
# return the (management) ip for a given computer id
return the (management) ip for a given computer id
return the ( management ) ip for a given computer id
function ID2IP($ID,$deviceType)
	{
		switch($deviceType){
			case "1":
				$query= "SELECT ip FROM computers WHERE ID = $ID";
				break;
			case "2":	
				$query= "SELECT ip FROM networking WHERE ID = $ID";
				break;
			default:
				$query= "SELECT ip FROM $deviceType WHERE ID = $ID";
				break;
		}
		$DB = Config::Database();
		if ($res=$DB->getOne($query))
		{
			return ($res);
		} else {
			return ("NOIP");
		}
	}
function ID2IP ( $ ID , $ deviceType ) { switch ( $ deviceType ) { case " 1 " : $ query = " SELECT ip FROM computers WHERE ID =  $ ID " ; break ; case " 2 " : $ query = " SELECT ip FROM networking WHERE ID =  $ ID " ; break ; default : $ query = " SELECT ip FROM  $ deviceType  WHERE ID =  $ ID " ; break ; } $ DB = Config :: Database ( ) ; if ( $ res = $ DB -> getOne ( $ query ) ) { return ( $ res ) ; } else { return ( " NOIP " ) ; } }
return the (management) ip for a given computer id
return the ( management ) ip for a given computer id
#		trigger_error(sprintf(_("ID2IP: Invalid Computer ID %s"),$ID));