@ 2020-10-25T10:40:44Z <?php
error_reporting(E_ALL);
// Отклоняем запросы с IP-адресов, которые не принадлежат Payeer
//if (!in_array($_SERVER['REMOTE_ADDR'], array('185.71.65.92', '185.71.65.189','149.202.17.210'))) return;
header("Content-type: text/html; charset=windows-1251");
require("".$_SERVER['DOCUMENT_ROOT']."/config.php");
require("".$_SERVER['DOCUMENT_ROOT']."/merchant/func_mysql.php");
require("".$_SERVER['DOCUMENT_ROOT']."/merchant/payeer/payeer_config.php");
require("".$_SERVER['DOCUMENT_ROOT']."/config.php");
define('PATH_TO_LOG', dirname(__FILE__).'/');
$m_operation_id = (isset($_REQUEST["m_operation_id"])) ? htmlspecialchars(trim($_REQUEST["m_operation_id"])) : false;
$m_operation_ps = (isset($_REQUEST["m_operation_ps"])) ? htmlspecialchars(trim($_REQUEST["m_operation_ps"])) : false;
$m_operation_date = (isset($_REQUEST["m_operation_date"])) ? htmlspecialchars(trim($_REQUEST["m_operation_date"])) : false;
$m_operation_pay_date = (isset($_REQUEST["m_operation_pay_date"])) ? htmlspecialchars(trim($_REQUEST["m_operation_pay_date"])) : false;
$m_shop = (isset($_REQUEST["m_shop"])) ? htmlspecialchars(trim($_REQUEST["m_shop"])) : false;
$m_orderid = (isset($_REQUEST["m_orderid"])) ? htmlspecialchars(trim($_REQUEST["m_orderid"])) : false;
$merch_amount = (isset($_REQUEST["m_amount"])) ? htmlspecialchars(trim($_REQUEST["m_amount"])) : false;
$m_curr = (isset($_REQUEST["m_curr"])) ? htmlspecialchars(trim($_REQUEST["m_curr"])) : false;
$m_desc = (isset($_REQUEST["m_desc"])) ? htmlspecialchars(trim($_REQUEST["m_desc"])) : false;
$m_status = (isset($_REQUEST["m_status"])) ? htmlspecialchars(trim($_REQUEST["m_status"])) : false;
$m_sign = (isset($_REQUEST["m_sign"])) ? strtoupper(htmlspecialchars(trim($_REQUEST["m_sign"]))) : false;
$arHash = [$m_operation_id,$m_operation_ps,$m_operation_date,$m_operation_pay_date,$m_shop,$m_orderid,$merch_amount,$m_curr,$m_desc,$m_status,$m_key];
$sign = strtoupper(hash('sha256', implode(":", $arHash)));
if($m_orderid!=false) {
$exp = explode(":", $m_orderid);
$shp_item = $exp[0];
$merch_tran_id = $exp[1];
}else{
$merch_tran_id = 0;
$shp_item = 0;
}
$shp_item = (isset($shp_item) && preg_match("|^[\d]{1,11}$|", htmlspecialchars(trim($shp_item))) ) ? intval(htmlspecialchars(trim($shp_item))) : false;
$merch_tran_id = (isset($merch_tran_id) && preg_match("|^[\d]{1,11}$|", htmlspecialchars(trim($merch_tran_id))) ) ? intval(htmlspecialchars(trim($merch_tran_id))) : false;
$TABLE_ARR = [
1 => "tb_add_pay",
2 => "tb_ads_dlink",
3 => "tb_ads_psevdo",
4 => "tb_ads_bs",
5 => "tb_ads_auto",
6 => "tb_ads_slink",
7 => "tb_ads_kontext",
8 => "tb_ads_banner",
9 => "tb_ads_txt",
10 => "tb_ads_frm",
11 => "tb_ads_mails",
12 => "tb_ads_rc",
13 => "tb_ads_downloads",
14 => "tb_ads_questions",
15 => "tb_ads_emails",
16 => "tb_ads_packet",
20 => "tb_ads_beg_stroka",
21 => "tb_ads_tests",
22 => "tb_ads_catalog",
23 => "tb_ads_youtube"
];
$STAT_PAY_ARR = [
1 => "money_in",
2 => "dlink",
3 => "psevdo",
4 => "bserf",
5 => "autoserf",
6 => "statlink",
7 => "kontext",
8 => "banners",
9 => "txtob",
10 => "frmlink",
11 => "mails",
12 => "rekcep",
13 => "files",
14 => "quest",
15 => "sent_mails",
16 => "packet",
20 => "bstroka",
21 => "tests",
22 => "catalog",
23 => "youtube"
];
if($sign==$m_sign && $m_status=="success") {
if($shp_item!= 0 && array_key_exists($shp_item, $TABLE_ARR)) {
$sql = mysql_query("SELECT `id`,`username`,`money` FROM `".$TABLE_ARR[$shp_item]."` WHERE `status`='0' AND `merch_tran_id`='$merch_tran_id' LIMIT 1");
$row = mysql_fetch_array($sql);
$username = $row["username"];
if($shp_item==3 | $shp_item==6 | $shp_item==8 | $shp_item==9 | $shp_item==10) {
$DATE_END = ", `date_end`=`plan`*'".(24*60*60)."'+'".time()."'";
}else{
$DATE_END = false;
}
if(floatval($row["money"])!=floatval($merch_amount)) {
exit("$m_orderid|error");
}elseif($shp_item==1) {
if($username!=false) {
echo "$m_orderid|success";
$bon = mysql_query("SELECT `price` FROM `tb_config` WHERE `item`='bon_popoln' AND `howmany`='1'") or die(mysql_error());
$b = number_format(mysql_result($bon,0), 0, ".", "");
$bonus=($merch_amount/100)*$b;
$merch_amount1=$merch_amount+$bonus;
mysql_query("UPDATE `tb_users` SET `money_rb`=`money_rb`+'$merch_amount1', `money_in`=`money_in`+'$merch_amount1' WHERE `username`='$username'") or die(mysql_error());
mysql_query("INSERT INTO `tb_history` (`user`, `date`, `amount`, `method`, `status`, `tipo`) VALUES('$username', '".DATE("d.m.Y H:i")."', '$merch_amount1', 'Пополнение рекламного баланса через Payeer','Зачислено', 'popoln')") or die(mysql_error());
mysql_query("UPDATE `tb_add_pay` SET `status`='1', `date`='".time()."' WHERE `merch_tran_id`='$merch_tran_id' AND`username`='$username'") or die(mysql_error());
stat_pay($STAT_PAY_ARR[$shp_item], $merch_amount);
}elseif($shp_item==16) {
mysql_query("UPDATE `".$TABLE_ARR[$shp_item]."` SET `status`='1', `date`='".time()."' WHERE `status`='0' AND `merch_tran_id`='$merch_tran_id' ORDER BY `id` DESC LIMIT 1") or die(mysql_error());
stat_pay($STAT_PAY_ARR[$shp_item], $merch_amount);
$merch_user_wmid = false;
konkurs_ads_new($merch_user_wmid, $username, $merch_amount);
require_once("".$_SERVER['DOCUMENT_ROOT']."/merchant/add_adv_packet.php");
require_once("".$_SERVER['DOCUMENT_ROOT']."/merchant/func_cache.php");
cache_stat_links();
cache_frm_links();
cache_txt_links();
cache_banners();
}elseif($shp_item==21) {
mysql_query("UPDATE `".$TABLE_ARR[$shp_item]."` SET `status`='1', `date`='".time()."',`money`='$merch_amount',`balance`='$merch_amount' WHERE `status`='0' AND `merch_tran_id`='$merch_tran_id' ORDER BY `id` DESC LIMIT 1") or die(mysql_error());
}elseif($shp_item==30) {
mysql_query("UPDATE `".$TABLE_ARR[$shp_item]."` SET `status`='2', `date`='".time()."' WHERE `status`='0' AND `merch_tran_id`='$merch_tran_id' ORDER BY `id` DESC LIMIT 1") or die(mysql_error());
}else{
mysql_query("UPDATE `".$TABLE_ARR[$shp_item]."` SET `status`='1', `date`='".time()."' $DATE_END WHERE `status`='0' AND `merch_tran_id`='$merch_tran_id' ORDER BY `id` DESC LIMIT 1") or die(mysql_error());
}
mysql_query("UPDATE `tb_users` SET `money_rek`=`money_rek`+'$merch_amount' WHERE `username`='$username'") or die(mysql_error());
echo "$m_orderid|success";
stat_pay($STAT_PAY_ARR[$shp_item], $merch_amount);
$merch_user_wmid = false;
if($shp_item!=21){ konkurs_rek_ed($merch_user_wmid, $username, $merch_amount);
konkurs_rek_ed($merch_user_wmid, $username, $merch_amount); }
if($shp_item==6 | $shp_item==7 | $shp_item==8 | $shp_item==9 | $shp_item==10 | $shp_item==12 | $shp_item==20) {
require_once($_SERVER['DOCUMENT_ROOT']."/merchant/func_cache.php");
cache_stat_links();
cache_kontext();
cache_frm_links();
cache_txt_links();
cache_rek_cep();
cache_banners();
cache_beg_stroka();
}
}
}else{
exit("$m_orderid|error");
}
}else{
exit("$m_orderid|error");
}
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Abusive script This script was stopped while abusing our resources
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 8.3.11 0.005 0.003 20.94 8.3.10 0.021 0.008 30.80 8.3.9 0.024 0.004 32.15 8.3.8 0.026 0.003 27.13 8.3.7 0.022 0.014 27.33 8.3.6 0.023 0.011 27.21 8.3.5 0.018 0.009 28.33 8.3.4 0.017 0.009 29.67 8.3.3 0.023 0.006 28.25 8.3.2 0.015 0.007 30.86 8.3.1 0.015 0.003 31.10 8.3.0 0.012 0.004 31.85 8.2.23 0.003 0.006 22.58 8.2.22 0.009 0.009 37.54 8.2.21 0.018 0.006 32.15 8.2.20 0.018 0.006 27.27 8.2.19 0.018 0.010 27.21 8.2.18 0.020 0.009 31.73 8.2.17 0.025 0.008 28.25 8.2.16 0.022 0.007 30.25 8.2.15 0.020 0.006 31.60 8.2.14 0.024 0.003 31.10 8.2.13 0.021 0.004 31.85 8.2.12 0.015 0.005 31.94 8.2.11 0.014 0.008 29.73 8.2.10 0.012 0.005 27.76 8.2.9 0.008 0.007 27.97 8.2.8 0.012 0.001 27.85 8.2.7 0.009 0.006 27.64 8.2.6 0.013 0.001 27.71 8.2.5 0.010 0.004 27.79 8.2.4 0.006 0.010 27.94 8.2.3 0.020 0.002 27.91 8.2.2 0.012 0.006 27.89 8.2.1 0.014 0.004 28.43 8.2.0 0.015 0.005 28.54 8.1.29 0.011 0.004 28.21 8.1.28 0.012 0.007 31.73 8.1.27 0.018 0.002 30.67 8.1.26 0.011 0.004 32.81 8.1.25 0.011 0.003 32.81 8.1.24 0.016 0.005 30.75 8.1.23 0.018 0.009 30.13 8.1.22 0.021 0.004 27.79 8.1.21 0.021 0.005 28.32 8.1.20 0.022 0.005 27.39 8.1.19 0.026 0.003 27.51 8.1.18 0.012 0.009 27.82 8.1.17 0.017 0.009 28.21 8.1.16 0.021 0.004 28.28 8.1.15 0.020 0.001 28.28 8.1.14 0.010 0.003 28.27 8.1.13 0.009 0.003 28.98 8.1.12 0.008 0.004 27.54 8.1.11 0.010 0.003 27.50 8.1.10 0.010 0.002 27.55 8.1.9 0.010 0.009 27.55 8.1.8 0.010 0.005 27.59 8.1.7 0.010 0.010 27.59 8.1.6 0.011 0.004 27.63 8.1.5 0.010 0.004 27.63 8.1.4 0.008 0.006 27.62 8.1.3 0.008 0.007 27.65 8.1.2 0.010 0.004 27.60 8.1.1 0.008 0.006 27.59 8.1.0 0.009 0.005 27.62 8.0.30 0.015 0.003 28.93 8.0.29 0.016 0.006 27.27 8.0.28 0.006 0.007 28.05 8.0.27 0.009 0.004 27.93 8.0.26 0.020 0.002 28.92 8.0.25 0.011 0.003 27.42 8.0.24 0.009 0.004 27.35 8.0.23 0.012 0.002 27.40 8.0.22 0.005 0.008 27.36 8.0.21 0.015 0.004 27.36 8.0.20 0.011 0.007 27.37 8.0.19 0.014 0.009 27.40 8.0.18 0.021 0.004 27.38 8.0.17 0.020 0.004 27.33 8.0.16 0.018 0.006 27.40 8.0.15 0.018 0.007 27.34 8.0.14 0.016 0.007 27.30 8.0.13 0.018 0.001 25.59 8.0.12 0.008 0.010 22.80 8.0.11 0.015 0.004 22.82 8.0.10 0.013 0.004 22.73 8.0.9 0.008 0.005 22.71 8.0.8 0.011 0.004 21.38 8.0.7 0.006 0.007 22.78 8.0.6 0.013 0.003 22.77 8.0.5 0.009 0.006 22.72 8.0.3 0.016 0.006 22.80 8.0.2 0.015 0.008 21.44 8.0.1 0.013 0.005 22.77 8.0.0 0.014 0.008 22.73 7.4.33 0.018 0.003 26.54 7.4.32 0.017 0.005 27.11 7.4.30 0.017 0.003 27.18 7.4.29 0.016 0.006 27.15 7.4.28 0.015 0.008 27.13 7.4.27 0.015 0.007 27.16 7.4.26 0.017 0.003 25.50 7.4.25 0.017 0.004 22.59 7.4.24 0.023 0.005 22.59 7.4.23 0.013 0.007 22.59 7.4.22 0.010 0.006 21.19 7.4.21 0.015 0.006 20.27 7.4.20 0.012 0.007 22.60 7.4.19 0.017 0.008 25.59 7.4.18 0.017 0.008 25.51 7.4.16 0.021 0.003 25.53 7.4.15 0.012 0.003 25.49 7.4.14 0.013 0.005 25.46 7.4.13 0.011 0.006 21.05 7.4.12 0.010 0.009 22.54 7.4.11 0.010 0.006 22.47 7.4.10 0.009 0.007 22.59 7.4.9 0.015 0.006 22.50 7.4.8 0.019 0.004 22.59 7.4.7 0.014 0.006 22.48 7.4.6 0.013 0.007 22.55 7.4.5 0.014 0.008 22.50 7.4.4 0.017 0.004 22.46 7.4.3 0.014 0.007 22.56 7.4.2 0.016 0.005 22.57 7.4.1 0.015 0.006 22.45 7.4.0 0.012 0.008 22.50 7.3.33 0.014 0.008 27.14 7.3.32 0.018 0.004 25.43 7.3.31 0.008 0.005 22.50 7.3.30 0.007 0.004 22.54 7.3.29 0.010 0.005 20.12 7.3.28 0.014 0.007 25.50 7.3.27 0.015 0.006 25.46 7.3.26 0.014 0.007 22.50 7.3.25 0.028 0.002 25.53 7.3.24 0.024 0.004 25.46 7.3.23 0.015 0.006 22.38 7.3.22 0.018 0.004 22.45 7.3.21 0.016 0.005 22.51 7.3.20 0.016 0.005 22.50 7.3.19 0.014 0.008 22.49 7.3.18 0.015 0.006 22.46 7.3.17 0.016 0.005 22.53 7.3.16 0.016 0.006 22.52 7.3.15 0.017 0.004 22.49 7.3.14 0.015 0.006 22.48 7.3.13 0.013 0.008 22.47 7.3.12 0.014 0.005 22.53 7.3.11 0.012 0.007 22.49 7.3.10 0.009 0.012 22.39 7.3.9 0.012 0.007 22.46 7.3.8 0.013 0.006 22.47 7.3.7 0.014 0.008 22.40 7.3.6 0.020 0.002 22.42 7.3.5 0.015 0.007 22.45 7.3.4 0.011 0.010 22.40 7.3.3 0.013 0.003 22.47 7.3.2 0.012 0.002 23.00 7.3.1 0.013 0.004 23.04 7.3.0 0.031 0.004 22.99 7.2.34 0.013 0.009 22.47 7.2.33 0.017 0.006 22.62 7.2.32 0.014 0.010 22.58 7.2.31 0.014 0.008 22.55 7.2.30 0.018 0.005 22.62 7.2.29 0.015 0.009 22.53 7.2.28 0.016 0.006 22.67 7.2.27 0.019 0.006 22.52 7.2.26 0.016 0.007 22.62 7.2.25 0.015 0.008 22.54 7.2.24 0.016 0.008 22.61 7.2.23 0.011 0.009 22.54 7.2.22 0.011 0.005 22.55 7.2.21 0.015 0.003 22.63 7.2.20 0.019 0.004 22.49 7.2.19 0.021 0.002 22.52 7.2.18 0.015 0.005 22.55 7.2.17 0.011 0.011 22.50 7.2.16 0.012 0.008 22.52 7.2.15 0.017 0.008 23.00 7.2.14 0.017 0.004 23.15 7.2.13 0.015 0.006 23.14 7.2.12 0.015 0.007 23.09 7.2.11 0.020 0.004 23.12 7.2.10 0.015 0.009 23.13 7.2.9 0.018 0.005 23.16 7.2.8 0.017 0.006 23.14 7.2.7 0.015 0.008 23.09 7.2.6 0.015 0.007 23.11 7.2.5 0.013 0.007 23.11 7.2.4 0.011 0.005 23.12 7.2.3 0.012 0.007 23.15 7.2.2 0.018 0.006 23.24 7.2.1 0.019 0.004 23.18 7.2.0 0.017 0.006 23.01
preferences:dark mode live preview
18.65 ms | 403 KiB | 5 Q