<?php

function fnc_getUsernameById ( $id, $place )
	{
		global $db;
		$sql	= "SELECT * FROM User WHERE userId = '" . $id . "' LIMIT 1;";
		$result	= $db->query ( $sql );
		$nt		= $result->fetch_assoc ();
		switch ( $place )
			{
				case 'welcome':
					$user = $nt['userTitle'] . " " . $nt['userFirstname'] . " " . $nt['userLastname'];
					break;
				case 'logfiles':
					$user = $nt['userLastname'] . ", " . $nt['userFirstname'];
					break;
				case 'portal':
					$user = array ( $nt['userTitle'], $nt['userFirstname'], $nt['userLastname'] );
					break;
			}
		return $user;
	}

?>