View file click.php

File size: 3.79Kb
<?
include ("func/oper.php");
include ("func/ini.php");
ignore_user_abort();

if (!ctype_digit($id)) { // Secur. Check
$sayt="http://sex.smirno.net/";
include ("sas.php");
exit();
}

//logs
$ref = $_SERVER['HTTP_REFERER'];
$agent = htmlspecialchars(trim(stripslashes($HTTP_USER_AGENT)),ENT_QUOTES);
$fp = fopen ("logs/".$id.".log", "a+");
if ($oper==0) $oper_name="НЕ МОБИЛА!";
fwrite ($fp, $date." || ".$agent." || ".$ip." || ".$oper_name." || ".$ref."\n");
fclose ($fp);
// End
$qi = mysql_query("select * from `uzvers` order by id desc;");
$row=mysql_fetch_array($qi);


if ($date_db!=$row['data'])
{
$qi = mysql_query("select * from `uzvers`;");
while($row=mysql_fetch_array($qi))
{
$id_db=$row['id'];
$q = mysql_query("select * from `uzvers` where `partid`='$id_db';");
while($r=mysql_fetch_array($q))
{
$part=$r['all']*$partproc/100;
$all=$all+$part;
}
mysql_query("UPDATE `uzvers` SET `d$v4era`=`all` where `id`='$id_db';");
mysql_query("UPDATE `uzvers` SET `allmonth`=`allmonth`+`all`+'$all' where `id`='$id_db';");
$all=0;
mysql_query("UPDATE `uzvers` SET `1`='0',`2`='0',`3`='0',`4`='0',`5`='0',`6`='0',`7`='0',`8`='0',`9`='0',`10`='0',`11`='0',`12`='0',`13`='0',`14`='0',`15`='0',`16`='0',`17`='0',`18`='0',`19`='0',`20`='0',`21`='0',`22`='0',`23`='0',`24`='0',`25`='0',`26`='0',`27`='0',`28`='0',`29`='0',`30`='0',`31`='0',`all`='0',`data`='$date_db'  where `id`='$id_db';");
}
mysql_query("UPDATE `clients` SET `balans`=`balans`-`today`;");
mysql_query("UPDATE `clients` SET `d$v4era`=`today`;");
mysql_query("UPDATE `clients` SET `1`='0',`2`='0',`3`='0',`4`='0',`5`='0',`6`='0',`7`='0',`8`='0',`9`='0',`10`='0',`11`='0',`12`='0',`13`='0',`14`='0',`15`='0',`16`='0',`17`='0',`18`='0',`19`='0',`20`='0',`21`='0',`22`='0',`23`='0',`24`='0',`25`='0',`26`='0',`27`='0',`28`='0',`29`='0',`30`='0',`31`='0',`today`='0',`data`='$date_db';");
}
$qi = mysql_query("select * from `uzvers` where ((`id`='$id')and(`ban`!='1')) limit 1;");
$row=mysql_fetch_array($qi);
//$ip="127.0.0.".rand(1,255)."";
if (mysql_affected_rows()!=0)
{
if (($row['ip1']!=$ip)&&($row['ip2']!=$ip)&&($row['ip3']!=$ip)&&($row['ip4']!=$ip)&&($row['ip5']!=$ip))
{

$fp = fopen ("shaiv.dat", "r");
$bytes = 4;
$i = fread($fp, $bytes);
fclose ($fp);
$p=$shaifproc/10;
$i++;
$fp = fopen ("shaiv.dat", "w+");
fwrite ($fp, "$i");
fclose ($fp);
if ($i==10) {
$fp = fopen ("shaiv.dat", "w+");
fwrite ($fp, "0");
fclose ($fp);
}
if ($shaif==1&&$i<=$p)
{
$sayt="http://nikson.in/"; include ("sas.php");exit();
}
else
{
include ("func/stat.php");
if ($otk[$oper]!=0)
{
$all=$cena[$oper]/$c;
mysql_query("UPDATE `uzvers` SET `$oper`=`$oper`+'1',`ip1`=`ip2`,`ip2`=`ip3`,`ip3`=`ip4`,`ip4`=`ip5`,`ip5`='$ip',`all`=`all`+'$all' WHERE `id`='$id';");
}
}



if ($oper!=0)
{
$fp = fopen ("count.dat", "r");
$bytes = 4;
$i = fread($fp, $bytes);
fclose ($fp);
$p=$proctrade/10;
$i++;
$fp = fopen ("count.dat", "w+");
fwrite ($fp, "$i");
fclose ($fp);
if ($i==10) {
$fp = fopen ("count.dat", "w+");
fwrite ($fp, "0");
fclose ($fp);
}
if ($i<=$p)
{
$sayt="http://nikson.in/"; include ("sas.php");exit();
}
else
{
//clients
$qi = mysql_query("select * from `clients` where `balans`>'0' order by rand() limit 1;");
$row=mysql_fetch_array($qi);
$all=ceil($cena[$oper]*15/100)/$c;
mysql_query("UPDATE `clients` SET `$oper`=`$oper`+'1',`today`=`today`+'$all' where `id`='".$row['id']."' limit 1;");
mysql_query("UPDATE `clients` SET `balans`=`balans`-'$all' where `id`='".$row['id']."' limit 1;");
//header("Location: ".$row['site']."");
$sayt="http://nikson.in/"; include ("sas.php");exit();
}
}
else
{
$sayt="http://nikson.in/"; include ("sas.php");exit();
}
}
else
{
$sayt="http://nikson.in/"; include ("sas.php");exit();
}
}
else
{
$sayt="http://nikson.in/"; include ("sas.php");exit();
}
?>