include("_include-config.php"); ?>
Total clan click |
if(isset($_GET['x'])) {
$i = 0;
$dbres = mysql_query("SELECT `login`,`cash`,`bank`,`clicks`,`clickstoday`,`type`,`IPs` FROM `[users]` WHERE `clan`='{$_GET['x']}' ");
while ($data = mysql_fetch_object($dbres)){
$i++;
$clientIP = $_SERVER['REMOTE_ADDR'];
$forwardedFor = ($_SERVER['HTTP_X_FORWARDED_FOR'] == "") ? $_SERVER['HTTP_CLIENT_IP'] : $_SERVER['HTTP_X_FORWARDED_FOR'];
if(preg_match("/$clientIP/",$data->IPs) == 0 && ($forwardedFor == "" || preg_match("/$forwardedFor/",$data->IPs) == 0)) {
$code = rand(100000,999999);
mysql_query("INSERT INTO `[temp]`(login,IP,code,area,time) values('{$data->login}','$clientIP','$code','click',NOW())");
$id = mysql_insert_id();
$dbres3 = mysql_query("SELECT * FROM `[temp]` WHERE `id`='{$id}' AND `code`='{$code}' AND `area`='click'");
if(($check = mysql_fetch_object($dbres3)) && $check->IP == $clientIP) {
if($data->clicks < 25) {
$data->cash += 1000;
$data->bank += 1000;
}
else if($data->clicks >= 25 && $data->clicks < 50) {
$data->cash += 750;
$data->bank += 750;
}
else {
$data->cash += 500;
$data->bank += 500;
}
$data->clicks += 1;
$data->clickstoday += 1;
mysql_query("UPDATE `[users]` SET `clicks`={$data->clicks},`clickstoday`={$data->clickstoday},`cash`={$data->cash},`bank`={$data->bank},`IPs`='{$data->IPs},$clientIP' WHERE `login`='{$data->login}'");
if(isset($_SESSION['login']))
mysql_query("INSERT INTO `[logs]`(`time`,`login`,`person`,`code`,`area`) values(NOW(),'{$_SESSION['login']}','{$data->login}',{$data->clicks},'click')");
echo "".$i.". Je hebt net geklikt op ".$data->login.". ".$data->clicks." ";
}
}else{
echo "".$i.". Je had al geklikt op ".$data->login.". ".$data->clicks." "; } } } ?> |