<?
header("Cache-control: no-cache");
$db_host = "localhost";
$db_user = "dbuser00001854";
$db_pass = "";
$db_base = "db00001854";
$db_prefix = "vms";
$domain = "http://www.Grafmails.de"; // ohne Slash am ende
$seitenname = "Eine Mail vom Grafen!";
$waehrung = "Taler";
$admin_id = "01";
$percode = ""; // Zusatz zu den Fordec-Puk
// SecVMS change begin
$ip = $_SERVER['REMOTE_ADDR'];
// SecVMS change end
$betreibermail = "gamma@marsmail.de";
// Variabeln definieren
if (!isset($login_check['hinweis'])) $login_check['hinweis'] = "";
function db_connect() {
global $db_host,$db_user,$db_pass,$db_base,$sql_open;
$sql_open = @mysql_connect($db_host,$db_user,$db_pass) or die("Keine Verbindung zur Datenbank!");
$sql_base = @mysql_select_db($db_base) or die("Keine oder falsche Datenbank gewählt!");
}
function db_query($sql_tag) {
$sql_return = mysql_query($sql_tag);
return $sql_return;
}
function db_close() {
global $sql_open;
@mysql_close($sql_open) or die("Konnte die Verbindung mit Datenbank nicht schliessen!");
}
function create_code($code_laenge) {
srand((double)microtime()*1000000);
$created_code = '';
$zeichen="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn opqrstuvwxyz1234567890";
for ($i=0;$i<$code_laenge;$i++) {
$n=rand() % strlen($zeichen);
$created_code .=substr($zeichen, $n, 1);
}
return $created_code;
}
function buchungsliste ($buchungs_id,$trans_menge,$verwendung,$fuer) {
global $db_prefix;
db_query("INSERT INTO ".$db_prefix."_buchungen (uid,buchungszeit,buchungs_id,buchungsmenge,verwen dungszweck) VALUES (".$fuer.",".time().",'".$buchungs_id."','".$trans _menge."','".$verwendung."')");
}
function kontobuchung ($art,$trans_menge,$fuer) {
global $db_prefix;
db_query("UPDATE ".$db_prefix."_kontodaten SET `kontostand` = `kontostand` ".$art." ".$trans_menge." WHERE uid=".$fuer."");
}
function userstatus () {
global $_SESSION,$db_prefix;
if ($_SESSION['login'] == 'true') {
$us = db_query("SELECT `uid`,`passwort`,`status`,`hinweis` FROM ".$db_prefix."_kontodaten WHERE uid=".$_SESSION['uid']." and passwort='".$_SESSION['passwort']."' LIMIT 1");
$login_check = mysql_fetch_array($us);
if (!mysql_num_rows($us) or $login_check['status'] == 0) {
setCookie('uid','',time()-86400*30);
setCookie('passwort','',time()-86400*30);
setCookie('autologin','',time()-86400*30);
$_SESSION['uid'] = "";
$_SESSION['passwort'] = "";
$_SESSION['login'] = "";
@include_once('content/error/kein_zutritt.php');
@include_once('lib/footer.php');
die();
}
if ($login_check['status'] == 2) {
setCookie('uid','',time()-86400*30);
setCookie('passwort','',time()-86400*30);
setCookie('autologin','',time()-86400*30);
$_SESSION['uid'] = "";
$_SESSION['passwort'] = "";
$_SESSION['login'] = "";
@include_once('content/error/user_gesperrt.php');
@include_once('lib/footer.php');
die();
}
} else {
@include_once('content/error/kein_zutritt.php');
@include_once('lib/footer.php');
die();
}
}
function refumsatz ($buchungssumme,$fuer) {
global $db_prefix;
db_query ("UPDATE ".$db_prefix."_werberdaten SET umsatz = umsatz + ".$buchungssumme.", aktivzeit='".time()."' WHERE uid='".$fuer."' and werber != 0");
}
function aktivralley ($buchungssumme,$fuer) {
global $db_prefix;
// Wenn Aktivralley läuft
$ralleydaten_aktiv = mysql_fetch_array(db_query("SELECT `start`,`ende` FROM ".$db_prefix."_ralleydaten WHERE ralley = 'aktivralley' LIMIT 1"));
if ($ralleydaten_aktiv['start'] <= time() && $ralleydaten_aktiv['ende'] >= time()) {
$aktiveintragen = db_query("SELECT * FROM ".$db_prefix."_aktivralley WHERE uid = '".$fuer."'");
if (!mysql_num_rows($aktiveintragen)) {
db_query ("INSERT INTO ".$db_prefix."_aktivralley (uid,punkte) VALUES ('".$fuer."','".$buchungssumme."')");
} else {
db_query ("UPDATE ".$db_prefix."_aktivralley SET punkte = punkte + ".$buchungssumme." WHERE uid='".$fuer."'");
}
}
}
function sonderralley ($zumpotdazu) {
global $db_prefix,$_SESSION;
// wenn Sonderralley läuft
$ralleydaten_klick = mysql_fetch_array(db_query("SELECT `start`,`ende`,`art`,`pro` FROM ".$db_prefix."_ralleydaten WHERE ralley = 'sonderralley' LIMIT 1"));
if ($ralleydaten_klick['start'] <= time() && $ralleydaten_klick['ende'] >= time()) {
$klickeintragen = db_query("SELECT * FROM ".$db_prefix."_sonderralley WHERE uid = '".$_SESSION['uid']."'");
if ($ralleydaten_klick['art'] == 'dynamisch') db_query ("UPDATE ".$db_prefix."_ralleydaten SET jackpot=jackpot+'".$zumpotdazu."' WHERE ralley = 'sonderralley'");
if (!mysql_num_rows($klickeintragen)) {
db_query ("INSERT INTO ".$db_prefix."_sonderralley (uid,klicks) VALUES ('".$_SESSION['uid']."','1')");
} else {
db_query ("UPDATE ".$db_prefix."_sonderralley SET klicks = klicks + 1 WHERE uid='".$_SESSION['uid']."'");
}
}
}
function klickralley () {
global $db_prefix,$_SESSION;
// wenn Klickralley läuft
$ralleydaten_klick = mysql_fetch_array(db_query("SELECT `start`,`ende`,`art`,`pro` FROM ".$db_prefix."_ralleydaten WHERE ralley = 'klickralley' LIMIT 1"));
if ($ralleydaten_klick['start'] <= time() && $ralleydaten_klick['ende'] >= time()) {
$klickeintragen = db_query("SELECT * FROM ".$db_prefix."_klickralley WHERE uid = '".$_SESSION['uid']."'");
if ($ralleydaten_klick['art'] == 'dynamisch') db_query ("UPDATE ".$db_prefix."_ralleydaten SET jackpot=jackpot+'".$ralleydaten_klick['pro']."' WHERE ralley = 'klickralley'");
if (!mysql_num_rows($klickeintragen)) {
db_query ("INSERT INTO ".$db_prefix."_klickralley (uid,klicks) VALUES ('".$_SESSION['uid']."','1')");
} else {
db_query ("UPDATE ".$db_prefix."_klickralley SET klicks = klicks + 1 WHERE uid='".$_SESSION['uid']."'");
}
}
}
db_query("UPDATE ".$db_prefix."_support SET status=2 WHERE status=1 AND time<".(time()-(5*86400)));
db_query("UPDATE ".$db_prefix."_support SET status=2 WHERE status=1 AND time<".(time()-(5*86400)));
?>