<?php
//Функции для работы питомника-----
function birja_array()
{
	$arr[0]=0;		$bonus[0]=0;
	$arr[1]=250;	$bonus[1]=50;
	$arr[2]=500;	$bonus[2]=100;
	$arr[3]=1000;	$bonus[3]=250;
	$arr[4]=2000;	$bonus[4]=250;
	$arr[5]=3000;	$bonus[5]=250;
	$arr[6]=4000;	$bonus[6]=250;
	$arr[7]=5000;	$bonus[7]=250;
	$arr[8]=6000;	$bonus[8]=500;
	$arr[9]=8000;	$bonus[9]=500;
	$arr[10]=10000;	$bonus[10]=1000;

$array=Array('money'=>$arr,'bonus'=>$bonus);
return $array;
}

function birja_get_level($cost)
{
$level=0;

$mas=birja_array();
$arr=$mas['money'];

	foreach($arr AS $key=>$val)
	{
	if($cost>$val)continue;
	$level=$key-1;
	break;
	}

return $level;
}

function birja_get_bonus($level)
{
$mas=birja_array();
$arr=$mas['bonus'];
return $arr[$level];
}



?>