isLoaded())
{
$account->setCustomField('premium_points', ($account->getCustomField('premium_points')+$number_of_points));
return true;
}
else
return false;
}
if ($_REQUEST['system'] == 'paypal' && $config['paypal_active']) {
$content = file_get_contents("paypal/paypal.htm");
$main_content .= $content;
}
elseif ($_REQUEST['system'] == 'zaypay' && $config['zaypay_active']) {
if(!$logged)
$main_content .= '
Please login first to donate via ZayPay.';
if($logged)
$main_content .= '
';
}
elseif ($_REQUEST['system'] == 'daopay' && $config['daopay_active'])
{
#################################################################################
$offer_id = (int) $_POST['offer_id'];
$posted_pincode = trim($_POST['pincode']);
$to_user = trim($_POST['to_user']);
$verify_code = trim($_POST['verify_code']);
#################################################################################
if(!empty($to_user))
{
if(is_numeric($to_user))
{
$account = new OTS_Account();
$account->find($to_user);
}
else
{
$player = new OTS_Player();
$player->find($to_user);
if($player->isLoaded())
$account = $player->getAccount();
else
$account = new OTS_Account();
}
if(empty($posted_pincode))
$errors[] = 'Please enter your PIN code.';
if(!$account->isLoaded())
$errors[] = 'Account/account of player with this name doesn\'t exist.';
if(count($errors) == 0)
{
if($config['site']['verify_code_shop'])
{
//check verification code
$string = strtoupper($_SESSION['string']);
$userstring = strtoupper($verify_code);
$_SESSION['string'] = mt_rand(1,99999);
if(empty($string))
$errors[] = "Code from verification image in session is empty, try again.";
else
{
if(empty($userstring))
$errors[] = "Please enter code from verification image.";
else
{
if($string != $userstring)
$errors[] = "Code from verification image is wrong.";
}
}
}
if(count($errors) == 0)
{
$code_info = check_code_daopay($config['daopay'][$offer_id]['appcode'], $config['daopay'][$offer_id]['prodcode'], $posted_pincode);
if($code_info == 3)
$errors[] = 'Server has problem with connection to daopay.com, can\'t verify PIN code.';
elseif($code_info == 2)
$errors[] = 'Wrong PIN code, try to enter code again.';
elseif($code_info == 1)
{
if(add_points($account, $config['daopay'][$offer_id]['addpoints']))
{
save_trans('config/daopay.log', $account->getId(), $posted_pincode);
$main_content .= 'Good PIN code. Added '.$config['daopay'][$offer_id]['addpoints'].' Premium Points to account of: '.$to_user.' !
';
}
else
$errors[] = 'Error occured, try again.';
}
}
}
}
if(count($errors) > 0)
{
$main_content .= 'Errors occured:';
foreach($errors as $error)
$main_content .= '
* '.$error;
$main_content .= '
';
}
$main_content .= 'Buy Premium Points. For this points you can buy pacc/items in Shop. To buy points:
1. Visit one of our pages and donate us (send SMS/call special number).
2. After donate daopay.com will show you PIN code.
3. Save somewhere this PIN code and open this page again.
4. Enter your character name or account and your PIN code in form below.
5. Select donation cost from list and press "Check Code".
6. If account and PIN code is valid you get premium points.
7. Open "Shop Offer" and buy items/pacc :)
Our pages:
';
foreach($config['daopay'] as $offer) {
$order++;
$main_content .= '';
}
$main_content .= '
';
}
elseif ($_REQUEST['system'] == 'dotpay' && $config['dotpay_active'])
{
#################################################################################
$sms_type = (int) $_POST['sms_type'];
$posted_code = trim($_POST['code']);
$to_user = trim($_POST['to_user']);
$verify_code = trim($_POST['verify_code']);
#################################################################################
if(!empty($to_user))
{
if(is_numeric($to_user))
{
$account = new OTS_Account();
$account->find($to_user);
}
else
{
$player = new OTS_Player();
$player->find($to_user);
if($player->isLoaded())
$account = $player->getAccount();
else
$account = new OTS_Account();
}
if(empty($posted_code))
$errors[] = 'Prosze wpisac kod z SMSa/przelewu.';
if(!$account->isLoaded())
$errors[] = 'Konto/konto postaci o podanym nicku nie istnieje.';
if(count($errors) == 0)
{
if($config['site']['verify_code_shop'])
{
//check verification code
$string = strtoupper($_SESSION['string']);
$userstring = strtoupper($verify_code);
$_SESSION['string'] = mt_rand(1,99999);
if(empty($string))
$errors[] = "Kod z obrazka weryfikacyjnego w sesji jest pusty, sproboj ponownie.";
else
{
if(empty($userstring))
$errors[] = "Prosze wpisac kod z obrazka weryfikacyjnego.";
else
{
if($string != $userstring)
$errors[] = "Kod z obrazka weryfikacyjnego jest niepoprawny.";
}
}
}
if(count($errors) == 0)
{
$code_info = check_code_dotpay($config['dotpay'][$sms_type]['code'], $posted_code, $config['dotpay'][$sms_type]['id'], $config['dotpay'][$sms_type]['type']);
if($code_info[0] == 0)
$errors[] = 'Podany kod z SMSa/przelewu jest niepoprawny lub wybrano zla opcje SMSa/przelewu.';
else
{
if(add_points($account, $config['dotpay'][$sms_type]['addpoints']))
{
save_trans('config/dotpay.log', $account->getId(), $posted_code);
$code_info = delete_code_dotpay($config['dotpay'][$sms_type]['code'], $posted_code, $config['dotpay'][$sms_type]['id'], $config['dotpay'][$sms_type]['type']);
$main_content .= 'Dodano '.$config['dotpay'][$sms_type]['addpoints'].' punktow premium do konta: '.$to_user.' !
';
}
else
$errors[] = 'Wystapil blad podczas dodawania punktow do konta, sproboj ponownie.';
}
}
}
}
if(count($errors) > 0)
{
$main_content .= 'Wystapily bledy:';
foreach($errors as $error)
$main_content .= '
* '.$error;
$main_content .= '
';
}
if($config['dotpay_active_sms'])
{
$main_content .= 'SMS
Kup punkty premium, mozesz je wymienic w sklepie OTSa na PACC/przedmioty w grze, aby zakupic punkty premium wyslij SMSa:';
foreach($config['dotpay'] as $sms)
if($sms['type'] == 'sms')
$main_content .= '
* Na numer '.$sms['sms_number'].' o tresci '.$sms['sms_text'].' za '.$sms['sms_cost'].', a za kod dostaniesz '.$sms['addpoints'].' punktow premium.';
$main_content .= '
W SMSie zwrotnym otrzymasz specjalny kod. Wpisz ten kod w formularzu wraz z nickiem postaci lub numerem konta osoby ktora ma otrzymac punkty.
Serwis SMS obslugiwany przez Dotpay.pl
Regulamin: http://www.dotpay.pl/regulaminsms
Usluga dostepna w sieciach: Orange, Plus GSM, Era.
'.$config['server']['serverName'].' nie odpowieda za zle wpisane tresci SMS.
';
}
if($config['dotpay_active_transfer'])
{
$main_content .= 'Przelew/karta kredytowa
Kup punkty premium, mozesz je wymienic w sklepie OTSa na PACC/przedmioty w grze, aby zakupic punkty premium wejdz na jeden z adresow i wypelnij formularz:';
foreach($config['dotpay'] as $przelew)
if($przelew['type'] == 'C1')
$main_content .= '
* Adres - https://ssl.allpay.pl/?id='.$przelew['id'].'&code='.$przelew['code'].' - koszt '.$przelew['sms_cost'].', a za kod dostaniesz '.$przelew['addpoints'].' punktow premium.';
$main_content .= 'Kiedy Twoj przelew dojdzie (z kart kredytowych i bankow internetowych z listy jest to kwestia paru sekund) na e-mail ktory podales w formularzu otrzymasz kod. Kod ten mozesz wymienic na tej stronie na punkty premium w formularzu ponizej.
';
}
$main_content .= '';
}
else
{
if($config['dotpay_active'])
$main_content .= '
For users from Poland - LINK
Zaplac SMS, karta kredytowa lub przelewem bankowym.
';
if($config['daopay_active'])
$main_content .= '
Donate via Daopay
Send SMS (not for all countries) or call special number to donate and get points.
';
if($config['zaypay_active'])
$main_content .= '
Donate via Zaypay
Send SMS (not for all countries) or call special number to donate and get points.
';
if($config['paypal_active'])
$main_content .= '
Donate via Paypal
Donate via Paypal to get 12 shop points.
';
}
?>