PHP-Code:
<?
@include_once ('/lib/functions.lib.php');
db_connect();
$datum=date("d.m.Y");
$tag_platz1 = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_tagrally WHERE klicks >= 1 ORDER BY klicks DESC LIMIT 1"));
$ges_platz1 = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_userhighscore"));
if($tag_platz1['klicks'] > $ges_platz1['anzahl']){
$usernick = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_userdaten WHERE uid ='".$tag_platz1['uid']."'"));
db_query ("UPDATE ".$db_prefix."_userhighscore SET datum='$datum',nick='".$usernick['nickname']."',anzahl='".$tag_platz1['klicks']."', id='".$tag_platz1['uid']."'");
db_query ("INSERT INTO ".$db_prefix."_champions (datum,nick,anzahl,id) VALUES ('$datum','".$usernick['nickname']."','".$tag_platz1['klicks']."','".$tag_platz1['uid']."')");
$buchungssumme='1000000';//HIER DEN BETRAG EINGEBEN, DEN DER NEUE CHAMP ERHALTEN SOLL!!
$buchungs_id = create_code(14);
kontobuchung ('+',$buchungssumme,$tag_platz1['uid']);
buchungsliste ($buchungs_id,'+'.$buchungssumme,'Neuer Klick-Champion',$tag_platz1['uid']);
bilanzs(0,$buchungssumme);
}
else
{
$champ = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_userhighscore"));
$buchungssumme='100000';//HIER DEN BETRAG EINGEBEN, DEN DER aktuelle CHAMP täglich ERHALTEN SOLL!!
$buchungs_id = create_code(14);
kontobuchung ('+',$buchungssumme,$champ['id']);
buchungsliste ($buchungs_id,'+'.$buchungssumme,'Bonus aktueller Klick-Champion',$champ['id']);
bilanzs(0,$buchungssumme);
}
$rp = 0;
$ralleydaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_ralleydaten WHERE ralley='tagrally' LIMIT 1"));
$platz = db_query("SELECT * FROM ".$db_prefix."_tagrally WHERE klicks >= 1 ORDER BY klicks DESC LIMIT ".$ralleydaten['plaetze']."");
while ($pa = mysql_fetch_array($platz)) {
$rp++;
if ($ralleydaten['art'] == 'statisch') {
$buchungssumme = $ralleydaten['p'.$rp];
} else {
$stand = mysql_fetch_array(db_query("SELECT SUM(klicks) AS klicks FROM ".$db_prefix."_tagrally"));
$aktuell = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_smilie_bonus_30 where klicks <='".$stand['klicks']."' order by klicks desc Limit 1"));
$bonus=$aktuell['bonus'];
$buchungssumme = ($ralleydaten['jackpot']+$bonus) / 100 * $ralleydaten['p'.$rp];
}
db_query("UPDATE ".$db_prefix."_tagrally SET ausgezahlt = '".time()."' WHERE uid='".$pa['uid']."'");
$buchungs_id = create_code(14);
kontobuchung ('+',$buchungssumme,$pa['uid']);
buchungsliste ($buchungs_id,'+'.$buchungssumme, 'Tagesrally (Platz '.$rp.')',$pa['uid']);
bilanz (0,$buchungssumme);
}
db_query ("DELETE FROM ".$db_prefix."_tagrally");
db_query ("UPDATE ".$db_prefix."_ralleydaten SET jackpot='0' WHERE ralley='tagrally'");
//Alle beidseitig gelöschten PN´s löschen
db_query ("DELETE FROM ".$db_prefix."_pn_center WHERE del_e = '1' and del_s = '1'");
?>
So sieht das ding komplett aus...