<?
/*andrey69rus*/
include_once("inc/smsbill/smsbill.class.php");
include_once("inc/smsbill/money_settings_sms.php");

echo "<div class='event'><h1>Покупка Монет</h1></div>";
echo "<div class='block'>";
echo "У вас <img width='16' height='16' src='images/icons/money.png' alt='o'><b>$ku[money]</b> монет<br/><br/>
<span class='title'><b>Оплата по смс</b></span><br /><br />";

if(isset($_GET['pay']))
{
$serv = htmlspecialchars($_GET['servid']);
	
if(!isset($money[$serv]))
 {err_game('ОШШШиБКААА!!!');
 include_once 'inc/foot.php';
}else{

	$money = $money[$serv];
	
	$smsbill = new SMSBill();
	$smsbill->setServiceId($serv);
	$smsbill->useEncoding($charset);
	$smsbill->useHeader('no');
	$smsbill->useLang($lang); 
	$smsbill->useCss('http://'.$_SERVER['HTTP_HOST']);
	
	if (isset($_REQUEST['smsbill_password'])) {
		if (!$smsbill->checkPassword($_REQUEST['smsbill_password'])) { 
			
			echo"Код указан не верно.";
			include_once"inc/foot.php";
			exit;
		}else{ 
			
			mysql_query("UPDATE `kolhoz_user` SET `money` =`money`+ '$money' WHERE `id` = '$ku[id]'");	
			echo  "Вам зачислено ". $money ." монет.";
           include_once"inc/foot.php";			
		}
	}else{
		
		echo $smsbill->getForm();
		include_once"inc/foot.php";
	}
}
}
foreach ($money as $serv_id => $money_val){
	echo "<img width='16' height='16' src='images/icons/money.png' alt='o'><b>$money_val</b> монет <a href='?payment&money&pay&servid=".$serv_id."'>Купить</a><br />";
}
echo"
&copy andrey69rus.</small>

";
echo "</div>";

include_once 'inc/foot.php';
exit;
/*andrey69rus*/
?>