Файл: coin_sms.php
Строк: 50
<?php
include_once("files/zag.php");
include_once("smsbill.class.php");
include_once("settings_sms.php");
include_once("files/ini.php");
$polz=mysql_query("SELECT * FROM `users` WHERE `udata0`='$log' AND `udata1`='$pas' LIMIT 1");
if(mysql_num_rows($polz)==0){
header ("Location: index.php?error");
}else{
switch($go) {
default:
echo "У вас <font color=#FF8C00>$udata38</font> Coin of Luck<br/><br/>";
foreach ($money as $serv_id => $money_val){
echo '<img src="img/adena.png"> <font color=#FF8C00><b>'.$money_val.'</b></font> Coin of Luck - <a href="coin_sms.php?go=pay&servid='.$serv_id.'">Купить</a><br />';
}
break;
//************************************************************************************************
case 'pay':
$serv = htmlspecialchars($_GET['servid']);
$coin = $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"files/down.php";
exit;
}else{
//пароль верный
mysql_query("UPDATE `users` SET `udata38` =`udata38`+ '$coin' WHERE `udata0` = '$log'");
file_put_contents("data/pay.dat", date('Y-m-d') .' / '. $log .' / '. $coin ."rn", FILE_APPEND);
echo "Персонажу ". $log ." зачислено ". $coin ." Coin of Luck. Платеж осуществлен сервисом www.smsbill.com.ua";
}
}else{
//показать форму т.к. пароль не введен
echo $smsbill->getForm();
include_once"files/down.php";
}
break;
//************************************************************************************************
}
}
include_once"files/down.php";
?>