<?php
	
	function get_ban_timeleft($user_id)
	{
		
		$query	=	@mysql_query(sprintf(
			'SELECT
					*
				FROM
					`ban`
				WHERE
					`user_id`	=	%d',
			$user_id
		));
		
		if (@mysql_num_rows($query) != 0)
		{
			
			$ban	=	@mysql_fetch_assoc($query);
			
			return ( $ban['time'] - time() );
			
		}
		
	}
	
?>