<?php

	if($cron_pass != "secretcronpassword")
	exit;

$dbres	=	mysql_query("SELECT `login`,`bank` FROM `gebruiker` WHERE `bank`!='0' AND `level`!='-2' AND `level`!='-1' AND `level`!='0'");

	while($user = mysql_fetch_object($dbres)){
		if($user->bank <= 1000000){
		$rente	=	10;
		} else if($user->bank > 1000000 && $user->bank <= 1500000){
		$rente	=	9;
		} else if($user->bank > 1500000 && $user->bank <= 2000000){
		$rente	=	8;
		} else if($user->bank > 2000000 && $user->bank <= 2500000){
		$rente	=	7;
		} else if($user->bank > 2500000 && $user->bank <= 3000000){
		$rente	=	6;
		} else if($user->bank > 3000000 && $user->bank <= 3500000){
		$rente	=	5;
		} else if($user->bank > 3500000 && $user->bank <= 4000000){
		$rente	=	4;
		} else if($user->bank > 4000000 && $user->bank <= 4500000){
		$rente	=	3;
		} else if($user->bank > 4500000 && $user->bank <= 5000000){
		$rente	=	2;
		} else if($user->bank > 5000000 && $user->bank <= 5500000){
		$rente	=	1;
		} else {
		$rente	=	0;
		}
	$bank		=	round(($user->bank/100)*$rente);
	mysql_query("UPDATE `gebruiker` SET `bank`=`bank`+'$bank' WHERE `login`='{$user->login}'");
	}

mysql_query("UPDATE `gebruiker` SET `link1`='1'");
mysql_query("UPDATE `krassen` SET `a`='0',`b`='0',`c`='0',`d`='0',`e`='0',`f`='0'");
mysql_query("UPDATE `opbrensten` SET `geld`='0'");

$dbres1	=	mysql_query("SELECT * FROM `gebruiker` WHERE `level`='0' AND (UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`signup`) > 86400)");
	while($dbres = mysql_fetch_object($dbres1)){
	$subj		=	"Crimineel activatie";
	$emess		=	"Ultimatecrime\n\nJouw account op Ultimatecrime.nl is nog niet geactiveerd!\n\nAls je binnen 24 uur niet activeerd wordt die automatisch verwijdert\nGa naar http:/www.Ultimatecrime.nl en klik op Account activeren.\nJe kunt vervolgens je account activeren met de volgende activatie code: $dbres->activatiecode\n\nNogmaals bedankt voor je inzet & veel succes!\n\nDe Grote Raad";
	$headers	.=	"From: Ultimatecrime <info@ultimatecrime.nl>";
	mail("{$dbres->email}","$subj","$emess","$headers");
	}

$dbres2	=	mysql_query("SELECT * FROM `gebruiker` WHERE `level`='0' AND (UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`signup`) > 172800)");
	while($dbres = mysql_fetch_object($dbres2)){
	mysql_query("DELETE FROM `gebruiker` WHERE `login`='{$dbres->login}'");
	}

mysql_query("DELETE FROM `berichten` WHERE `delete1`='1' AND `delete2`='1'");
mysql_query("DELETE FROM `berichten` WHERE `read`='1' AND `delete1`='1'");
mysql_query("DELETE FROM `berichten` WHERE (UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`tijd`) > 172800)");


?>