Файл: classes/_class.wmset.php
Строк: 15
<?PHP
class wmset{
var $sets = array( array() );
public function __construct(){
# Сет 1
$this->sets[1]["min_sum"] = 1000;
$this->sets[1]["desc"] = "от 1000 до 5000 RUB";
$this->sets[1]["t_a"] = 1;
$this->sets[1]["t_b"] = 0;
# Сет 2
$this->sets[2]["min_sum"] = 5000;
$this->sets[2]["desc"] = "от 5000 до 10000 RUB";
$this->sets[2]["t_a"] = 2;
$this->sets[2]["t_b"] = 0;
# Сет 3
$this->sets[3]["min_sum"] = 10000;
$this->sets[3]["desc"] = "от 10000";
$this->sets[3]["t_a"] = 3;
$this->sets[3]["t_b"] = 1;
}
function SetsList(){
unset($this->sets[0]);
return $this->sets;
}
function GetSet($sum){
$sum = $sum +1;
$my_array = array_reverse( $this->SetsList() );
foreach($my_array as $key => $value){
if($sum >= $value["min_sum"]) return $value;
}
}
}
?>