View file c19.php

File size: 3.02Kb
<?php

Error_Reporting(E_ALL & ~E_NOTICE);

Error_Reporting (ERROR | WARNING);

extract($HTTP_GET_VARS);

extract($HTTP_POST_VARS);

extract($HTTP_COOKIE_VARS);

extract($HTTP_SERVER_VARS);

extract($HTTP_SESSION_VARS);

session_name("SESID");
 
session_start();


include "cfg.php";
$link=mysql_connect ($DB_HOST, $DB_USER, $DB_PASS);
mysql_select_db($DB_NAME);
$qu = @mysql_query("SELECT * FROM `users` WHERE id='".$id."' limit 1;");
if(mysql_affected_rows()==0)
{
$imer = ImageCreateFromGIF('error.gif');
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
Header("Content-type: image/gif");
ImageGIF($imer);
} else {
$sqlar  = @mysql_fetch_array($qu);
$count = $sqlar['today'];
$count_all = $sqlar['allday'];
$counthost = $sqlar['counthost'];
$date=date('Y-m-d');
if($date!=$sqlar['date'])
{
$query = @mysql_query("SELECT `id`,`yesterday`,`bef1yes`,`bef2yes`,`today`,`counthost`,`1host`,`2host`,`3host`,`ip1`,`ip2`,`ip3`,`ip4` FROM `users` WHERE 1;");
while($updata = @mysql_fetch_array($query)) {
@mysql_query("update `users` set `date`='".$date."',`ip1`='',`ip2`='',`ip3`='',`ip4`='',`today`=0,`cin`=0,`out`=0,`counthost`=0,`yesterday`=".$updata['today'].",`bef1yes`=".$updata['yesterday'].",`bef2yes`=".$updata['bef1yes'].",`1host`=".$updata['counthost'].",`2host`=".$updata['1host'].",`3host`=".$updata['2host']." where `id`=".$updata['id'].";");
}
$count=0;
$counthost=0;
}
global $REMOTE_ADDR;
global $HTTP_USER_AGENT;
$cip = $_SERVER['REMOTE_ADDR'];
if(($sqlar['ip1'] != $cip)&&($sqlar['ip2'] != $cip)&&($sqlar['ip3'] != $cip)&&($sqlar['ip4'] != $cip)) {
++$counthost;
@mysql_query("update `users` set `counthost`=`counthost`+'1',`ip4`=`ip3`,`ip3`=`ip2`,`ip2`=`ip1`,`ip1`='".$cip."' where `id`='".$id."';");
}
$counthost = $sqlar['counthost'];

@mysql_query("UPDATE `users` SET `today`=`today`+'1',`allday`=`allday`+'1' WHERE id='".$id."';");
++$count;
++$count_all;

if ($count >= 0 && $count < 10)
$levo1 = 55;
if ($count >= 10 && $count < 100)
$levo1 = 42;
if ($count >= 100 && $count < 1000)
$levo1 = 45;
if ($count >= 1000 && $count < 10000)
$levo1 = 40;
if ($count >= 10000 && $count < 100000)
$levo1 = 35;
if ($count >= 100000 && $count < 1000000)
$levo1 = 30;

if ($counthost >= 0 && $counthost < 10)
$levo2 = 12;
if ($counthost >= 10 && $counthost < 100)
$levo2 = 50;
if ($counthost >= 100 && $counthost < 1000)
$levo2 = 45;
if ($counthost >= 1000 && $counthost < 10000)
$levo2 = 40;
if ($counthost >= 10000 && $counthost < 100000)
$levo2 = 35;
if ($counthost >= 100000 && $counthost < 1000000)
$levo2 = 30;
if ($counthost >= 1000000 && $counthost < 10000000)
$levo2 = 25;
$im = ImageCreateFromGIF('img/c19.gif');
$color1 = #000000 ;
$color2 = #F5F5F5 ;
        
Imagestring($im,1,$levo2,18,$counthost,$color1);
Imagestring($im,1,$levo1,19,$count,$color2);
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
Header("Content-type: image/gif");
ImageGIF($im);
}
mysql_close($link);
?>