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

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

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

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


?>