<?php

    
class CSSetti
    
{
    
        function 
GetPrice()
        {
            
            
$Pay = array(
                array(
716241.231),
                array(
726242.462),
                array(
736243.693),
                array(
746244.924),
                array(
756246.156),
                array(
766247.387),
                array(
7962411.0711),
                array(
9197423.3723),
                array(
9257430.7530)
            );
        
            foreach(
$Pay as $Key)
            {
                
                
$Return[] = array(
                    
'text' => 'DP CSSETTI',
                    
'number'    => $Key[0],
                    
'cost'     => $Key[1],
                    
'amount'   => $Key[2]
                );
                
            }
    
            return 
$Return;
        
        }
        
        function 
QueryAPI($SMS$Key)
        {
            
            
$Query file_get_contents(sprintf('http://cssetti.pl/Api/SmsApiV2CheckCode.php?UserId=%d&Code=%s'$Key$SMS));
            
            if(
$Query 0)
            {
                
                return 
true;
                
            }
            
            return 
false;
        
        }
        
        function 
CheckSMS($CodeSMS$NumberSMS)
        {
        
            global 
$MySQL;
            
            
$Query $MySQL->query("SELECT `value` FROM `settings` WHERE `name`='api_cssetti'");
            
            
$Fetch $Query->fetch();
        
            if(
$Query $this->QueryAPI($CodeSMS$Fetch['value']))
            {
                
                return 
true;
                
            }
            
            return 
false;
        
        }
    
    }

?>