<?php

require_once("class.response.php");
require_once("class.billing.php");
require_once("class.project.php");
require_once("class.protocol.php");
require_once("class.standart.php");

$db_host = "localhost";
$db_user = "gamer";
$db_table = "game";
$db_pass = "FO3mImuD";
$connect = @ mysql_pconnect($db_host, $db_user, $db_pass);
@ mysql_select_db($db_table);
@ mysql_query("SET NAMES 'utf8'", $connect);




class XsollaConfig
{


    public static $mysqlHost = "localhost";
    public static $mysqlUser = "gamer";
    public static $mysqlPass = "FO3mImuD";
    public static $mysqlDb = "game";

    public static $allowedIPs = array("94.103.26.178","94.103.26.181");

    public static $secretKey = "=[c6SyL-h+Vhx&;kbv9h?.-Gs++nvX+L";
}


class XsollaStandartSampleProject extends XsollaStandartProject
{
    public function check()
    {
$nick = iconv('windows-1251','utf-8',$_GET[v1]); 
$req = mysql_query("SELECT `usr` FROM `users` WHERE `usr`='$nick'");
$avto=mysql_num_rows($req);
if($avto>=1){
return array("code" => XsollaStandartProtocolResponse::$codeSuccess, "description" => "Success"); }
else{
return array("code" => XsollaStandartProtocolResponse::$codeIncorrectUser, "description" => "User is not found"); }

      
    }

    public function sell()
    {

$nick = iconv('windows-1251','utf-8',$_GET[v1]); 
$aprel = round($_GET[sum]/4);
mysql_query("update `users` set `almaz`=`almaz`+'$_GET[sum]' where `usr` = '$nick'");

        return array("code" => XsollaStandartProtocolResponse::$codeSuccess, "description" => "Success");
    }

    public function cancel()
    {
        // put your code here
        return array("code" => XsollaStandartProtocolResponse::$codeCancelSuccess, "description" => "Success");
    }
}

class XsollaStandartSampleBilling extends XsollaBilling
{

}