<?php
function getSFBadgeByID($id)
{
	$id_lines  = file(getcwd()."/queries/sfbadge-id.list");
	$name_lines  = file(getcwd()."/queries/sfbadges.list");
	foreach ($id_lines as $key => $value)
	{
		if ($id == intval($value))
			return $name_lines [$key];
	}
}

function getSFBadgeNameByID($id)
{
	$id_lines  = file(getcwd()."/queries/sfbadge-id.list");
	$name_lines  = file(getcwd()."/queries/sfbadges_3.list");
	foreach ($id_lines as $key => $value)
	{
		if ($id == intval($value))
			return $name_lines [$key];
	}
}

function getSFBadgeCount()
{
	$lines  = file(getcwd()."/queries/sfbadges.list");
	return count($lines);	
}

function getSFBadge($id)
{
	$lines  = file(getcwd()."/queries/sfbadge-id.list");
	return $lines[$id];
}

function getSFCountBadge($id)
{
	$id_lines  = file(getcwd()."/queries/sfbadge-id.list");
    $i = 0;
    foreach ($id_lines as $key => $value)
	{
		if (intval($id) == intval($value))
			return $i;
    $i++;
    }
}


?>