Файл: LinkPayment/LinkPayment.php
Строк: 55
<?php
if(isset($_GET['Link'])){
echo '<a class="btn" href="?LinkWebMoney"><img width="24" height="24" src="images/icons/ruby.png" alt="наличку"/> Купить через WebMoney</a>';
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_payment`"),0);
if ($k_post==0)
{
echo "<a class="btn">Нечего покупать</a>";
}
$k_page=k_page($k_post,$user['set']);
$page=page($k_page);
$start=$user['set']*$page-$user['set'];
$q=mysql_query("SELECT * FROM `mystyle_payment` ORDER BY `id` DESC LIMIT $start, $user[set]");
echo '<ul>';
while($post=mysql_fetch_array($q))
{
echo '<a class="btn" href="?LinkPayment&Links='.$post['id'].'"><img width="24" height="24" src="images/icons/ruby.png" alt="наличку"/> Купить '.$post['cena'].' '.$post['name'].'</a>';
}
if ($k_page>1)str("?LinkPayment&Link&",$k_page,$page);
}elseif(isset($_GET['Links']) && num($_GET['Links'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_payment` WHERE `id` = '".num($_GET['Links'])."' LIMIT 1"),0)!=0){
$pay = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_payment` WHERE `id` = '".num($_GET['Links'])."'"));
include_once 'smsbillclass.php';
$smsbill = new SMSBill_getpassword();
$id_bill = $pay['id_payment'];
$smsbill->setServiceId($id_bill);
$smsbill->useEncoding('UTF-8');
$smsbill->useHeader('no');
$smsbill->useCSS('no');
$smsbill->useLang('ru');
$cena=$pay['cena'];
if (isset($_REQUEST['smsbill_password'])) {
if (!$smsbill->checkPassword($_REQUEST['smsbill_password'])) {
echo '<div class="err">Введенный пароль не верный вернитесь назад и попробуйте еще раз</div>';
}else{
///////// Лог Пользователя ///// By MyStyle
$time_log = $time+5; /// На 5 сек
$text = 'Вы купили: '.$cena.' '.$pay['name'].'';
update_log('user',$user['id'],'text',$text,'time',$time_log);
update_payment_user('col',$cena,'time',$time,'name',$pay['name'],'user',$user['id']);
mysql_query("UPDATE `mystyle_user` SET `".$pay['type']."` = '".($user[''.$pay['type'].'']+$cena)."' WHERE `id` = '".$user['id']."' LIMIT 1");
header("Location: ?LinkPayment&Link");
exit;
}
}else{
echo $smsbill->getForm();
}
}else{
header("Location: index.php");
exit;
}
?>