<?php

if (! defined ( 'BLOCK_FILE' )) {
	if (function_exists ( "location" ))
		location ( "../index.php" );
	else
		die ();
	exit ();
}
global $tracker_lang, $CURGROUP;
$content = ReadCache ( 'donateds', true );
if (! $content) {
	$al = sql_query ( "SELECT id, `group`, username, donated FROM users WHERE donated > 0" ) or sqlerr ( __FILE__, __LINE__ );
	while ( $row = mysql_fetch_array ( $al ) ) {
		$all .= $row ["donated"];
		if ($all >= 1) {
			$content .= "<font size=\"2\"><center><b>" . $tracker_lang ['donaters'] . ":</b></center></font>";
			$full = array ();
			$id = $row ["id"];
			$username = $row ["username"];
			$group = $row ["group"];
			$donated = $row ["donated"];
			$full [] = WriteCurgroup ( "<a href=\"userdetails.php?id=$id\">", "\$CURGROUP['can_viewprof']" ) . get_user_group_color ( $group, $username ) . WriteCurgroup ( "</a>", "\$CURGROUP['can_viewprof']" ) . " $donated " . $tracker_lang ['donateds'] . "";
		}
	}
	if ($all == 1) {
		$content = "<table class=\"main\" align=\"center\" border=\"1\" cellspacing=\"0\" cellpadding=\"10\">
<font size=\"1\"><center>" . $tracker_lang ['on_our_site_1'] . " " . $tracker_lang ['donated'] . "</center></font>";
	} else if ($all >= 2 and $all <= 4) {
		$content = "<table class=\"main\" align=\"center\" border=\"1\" cellspacing=\"0\" cellpadding=\"10\">
<font size=\"1\"><center>" . $tracker_lang ['on_our_site_many'] . " $all " . $tracker_lang ['donateds'] . "</center></font>";
	} else if ($all == 0) {
		$content = "<table class=\"main\" align=\"center\" border=\"1\" cellspacing=\"0\" cellpadding=\"10\">
<font size=\"1\"><center>" . $tracker_lang ['on_our_site_no'] . " " . $tracker_lang ['donated'] . "</center></font>";
	} else {
		$content = "<table class=\"main\" align=\"center\" border=\"1\" cellspacing=\"0\" cellpadding=\"10\">
<font size=\"1\"><center>" . $tracker_lang ['on_our_site_many'] . " $all " . $tracker_lang ['donateds_q'] . "</center></font>";
	}
	$content .= "<font size=\"1\"> " . @implode ( ", ", $full ) . " </font>";
	$content .= WriteCurgroup ( "<form method=\"post\" action=\"donusdel.php\"><font size=\"1\"><center><b>" . $tracker_lang ['donusdel'] . ": </b></center></font>
<font size=\"1\"><center><b>" . $tracker_lang ['userd'] . ": </b></font><br /><input type=\"text\" name=\"dud\" /></center>
<font size=\"1\"><center><b>" . $tracker_lang ['amount'] . " " . $tracker_lang ['donateds_q'] . ": </b></font><br /><input type=\"text\" name=\"raz\" /></center>
<center><input type=\"submit\" value=\"" . $tracker_lang ['execute'] . "\" /></form></center>", "\$CURGROUP['can_deldon']" );
	$content .= "</table>";
	$content = WriteCache ( $content );
}
$blocktitle = $tracker_lang ['donateds_title'];
?>