Commit 18cbe0a6 authored by Christoph Zysik's avatar Christoph Zysik

removed some direct calls to gebuchte_werbung

parent 56d62df8
<?php head("Admin ForcedBanner");
if (!isset($_GET['tan'])) $_GET['tan'] = '';
if (!isset($_GET['loeschen'])) $_GET['loeschen'] = '';
if ($_GET['loeschen'] == 'true' && $_GET['tan']) {
db_query("DELETE FROM " . $db_prefix . "_gebuchte_werbung WHERE tan='" . $_GET['tan'] . "' and sponsor='administrator' LIMIT 1");
if ($_GET['loeschen'] == 'true' && isset($_GET['id']) )
{
echo $campaigns->delete( array( 'id' => $_GET['id'] ) ) .' Banner gel&ouml;scht';
}
$forcedbanner = db_query("SELECT * FROM " . $db_prefix . "_gebuchte_werbung WHERE sponsor='administrator' and werbeart = 'forcedbanner' and status = '1' ORDER BY kid ASC");
while ($anzeigen = mysqli_fetch_array($forcedbanner)) {
$forcedbanner = $campaigns->getAll( 'forcedbanner', 1, 'administrator');
foreach($forcedbanner['data'] as $anzeigen)
{
echo '
<table width="100%" cellpadding="0" cellspacing="1" border="0" bgcolor="#c0c0c0">
<tr bgcolor="#f0f0f0">
<td align="center" width="50%"><b>TAN:</b>&nbsp;' . $anzeigen['tan'] . '</td>
<td align="center" width="50%"><b>Vergütung:</b>&nbsp;' . number_format($anzeigen['verdienst'], 2, ",", ".") . '</td>
<td align="center" width="50%"><b>TAN:</b>&nbsp;' . $anzeigen->tan . '</td>
<td align="center" width="50%"><b>Verg&uuml;tung:</b>&nbsp;' . number_format($anzeigen->verdienst, 2, ",", ".") . '</td>
</tr>
<tr bgcolor="#f0f0f0">
<td align="left" colspan="2"><br><b>Ziel:</b> <a href="' . $anzeigen['ziel'] . '">' . $anzeigen['ziel'] . '</a> <br><b>Banner:</b> <a href="' . $anzeigen['banner'] . '">' . $anzeigen['banner'] . '</a><br><br></td>
<td align="left" colspan="2"><br><b>Ziel:</b> <a href="' . $anzeigen->ziel . '">' . $anzeigen->ziel . '</a> <br><b>Banner:</b> <a href="' . $anzeigen->banner . '">' . $anzeigen->banner . '</a><br><br></td>
</tr>
<tr bgcolor="#f0f0f0">
<td align="center" width="50%"><b>Reload:</b>&nbsp;' . $anzeigen['reload'] / 3600 . 'h <b>Rest:</b>&nbsp;' . number_format($anzeigen['menge'], 0, ",", ".") . ' Klicks</td>
<td align="center" width="50%"><a href="?content=/interfacebanner/admin&amp;loeschen=true&amp;tan=' . $anzeigen['tan'] . '" target="_self">Löschen</a></td>
<td align="center" width="50%"><b>Reload:</b>&nbsp;' . $anzeigen->reload / 3600 . 'h <b>Rest:</b>&nbsp;' . number_format($anzeigen->menge, 0, ",", ".") . ' Klicks</td>
<td align="center" width="50%"><a href="?content=/interfacebanner/admin&amp;loeschen=true&amp;id=' . $anzeigen->id . '" target="_self">Löschen</a></td>
</tr>
</table>
<br>
......@@ -30,5 +32,3 @@ while ($anzeigen = mysqli_fetch_array($forcedbanner)) {
foot();
?>
<?php head("ForcedBanner Blacklist");
if (!isset($_GET['kid'])) $_GET['kid'] = '';
if (!isset($_GET['id'])) $_GET['id'] = false;
if (!isset($_GET['loeschen'])) $_GET['loeschen'] = '';
if (!isset($_GET['blacklist'])) $_GET['blacklist'] = '';
if ($_GET['loeschen'] == 'true' && $_GET['kid']) {
db_query("DELETE FROM " . $db_prefix . "_gebuchte_werbung WHERE kid='" . $_GET['kid'] . "' and status = '2' and sponsor='" . $_GET['sponsor'] . "' LIMIT 1");
if ($_GET['loeschen'] == 'true' && $_GET['id'])
{
$campaigns->delete( array( 'id' => $_GET['id'] ) );
}
if ($_GET['blacklist'] == 'true' && $_GET['kid']) {
db_query("UPDATE " . $db_prefix . "_gebuchte_werbung SET status = '1' WHERE kid='" . $_GET['kid'] . "' and sponsor='" . $_GET['sponsor'] . "' LIMIT 1");
if ($_GET['blacklist'] == 'true' && $_GET['id'])
{
$campaigns->update( array( 'status' => 1 ), array( 'id' => $_GET['id'] ) );
}
$forcedbanner = db_query("SELECT * FROM " . $db_prefix . "_gebuchte_werbung WHERE werbeart = 'forcedbanner' and status = '2' ORDER BY kid ASC");
while ($anzeigen = mysqli_fetch_array($forcedbanner)) {
$forcedbanner = $campaigns->getAll( 'forcedbanner', 2);
foreach( $forcedbanner['data'] as $anzeigen)
{
echo '
<table width="100%" cellpadding="0" cellspacing="1" border="0" bgcolor="#c0c0c0">
<tr bgcolor="#f0f0f0">
<td align="center" width="50%">TAN:&nbsp;' . $anzeigen['tan'] . '<br>KID:&nbsp;' . $anzeigen['kid'] . ' (' . $anzeigen['sponsor'] . ')</td>
<td align="center" width="50%">Bet:&nbsp;' . number_format($anzeigen['preis'], 2, ",", ".") . ' / User:&nbsp;' . number_format($anzeigen['verdienst'], 2, ",", ".") . '</td>
<td align="center" width="50%">TAN:&nbsp;' . $anzeigen->tan . '<br>KID:&nbsp;' . $anzeigen->kid . ' (' . $anzeigen->sponsor . ')</td>
<td align="center" width="50%">Bet:&nbsp;' . number_format($anzeigen->preis, 2, ",", ".") . ' / User:&nbsp;' . number_format($anzeigen->verdienst, 2, ",", ".") . '</td>
</tr>
<tr bgcolor="#f0f0f0">
<td align="center" colspan="2"><a href="' . $anzeigen['ziel'] . '" target="_blank"><img alt="Sponsorenbanner" src="' . $anzeigen['banner'] . '" border="0" width="468" height="60"></a></td>
<td align="center" colspan="2"><a href="' . $anzeigen->ziel . '" target="_blank"><img alt="Sponsorenbanner" src="' . $anzeigen->banner . '" border="0" width="468" height="60"></a></td>
</tr>
<tr bgcolor="#f0f0f0">
<td align="center" width="50%">Reload:&nbsp;' . $anzeigen['reload'] / 3600 . ' Std. / Rest:&nbsp;' . number_format($anzeigen['menge'], 0, ",", ".") . '</td>
<td align="center" width="50%"><a href="?content=/interfacebanner/blacklist&amp;sponsor=' . $anzeigen['sponsor'] . '&amp;loeschen=true&amp;kid=' . $anzeigen['kid'] . '" target="_self">Löschen</a> <a href="?content=/interfacebanner/blacklist&amp;sponsor=' . $anzeigen['sponsor'] . '&amp;blacklist=true&amp;kid=' . $anzeigen['kid'] . '" target="_self">Löschen-Blacklist</a></td>
<td align="center" width="50%">Reload:&nbsp;' . $anzeigen->reload / 3600 . ' Std. / Rest:&nbsp;' . number_format($anzeigen->menge, 0, ",", ".") . '</td>
<td align="center" width="50%"><a href="?content=/interfacebanner/blacklist&amp;sponsor=' . $anzeigen->sponsor . '&amp;loeschen=true&amp;id=' . $anzeigen->id . '" target="_self">L&ouml;schen</a> <a href="?content=/interfacebanner/blacklist&amp;sponsor=' . $anzeigen->sponsor . '&amp;blacklist=true&amp;id=' . $anzeigen->id . '" target="_self">Freischalten</a></td>
</tr>
</table>
<br>
......@@ -33,4 +36,3 @@ while ($anzeigen = mysqli_fetch_array($forcedbanner)) {
foot();
?>
......@@ -15,13 +15,25 @@ if ($_POST['buchen'] == 'Jetzt Buchen') {
if (!is_numeric($_POST['menge'])) $buchungsfehler .= 'Bei Menge nur Zahlen!<br>';
if (!$_POST['banner_url'] or !$_POST['menge'] or !$_POST['ziel'] or !$_POST['reload']) $buchungsfehler .= 'Bitte alle Felder ausfüllen!<br>';
if ($_POST['reload'] < 1 or $_POST['reload'] > 24 or !is_numeric($_POST['reload'])) $buchungsfehler .= 'Bei Reloadzeit nur Zahlen und zwischen 1 und 24 Stunden!<br>';
if ($_POST['aufendhalt'] < 0 or $_POST['aufendhalt'] > 30 or !is_numeric($_POST['aufendhalt'])) $buchungsfehler .= 'Bei dem Aufendhalt nur Zahlen und zwischen 0 und 30 Sekunden!<br>';
if ($_POST['aufendhalt'] > 30 or $_POST['aufendhalt'] < 0 or !is_numeric($_POST['aufendhalt'])) $buchungsfehler .= 'Aufendhalt nur Zahlen und zwischen 1 und 30 Sek.!<br>';
if ($_POST['aufendhalt'] < 0 or !is_numeric($_POST['aufendhalt'])) $buchungsfehler .= 'Aufenthalt nur Zahlen und mindestens 1 Sek.!<br>';
// Buchung durchführen
if (!$buchungsfehler) {
$buchungs_id = create_code(32);
$reload = $_POST['reload'] * 60 * 60;
db_query("INSERT INTO " . $db_prefix . "_gebuchte_werbung (tan,ziel,banner,aufendhalt,menge,preis,verdienst,werbeart,status,reload,sponsor) VALUES ('" . $buchungs_id . "','" . $_POST['ziel'] . "','" . $_POST['banner_url'] . "','" . $_POST['aufendhalt'] . "','" . $_POST['menge'] . "','0','" . $_POST['verdienst'] . "','forcedbanner','1','" . $reload . "','administrator')");
$data = array(
'tan' => $buchungs_id,
'ziel' => $_POST['ziel'],
'banner' => $_POST['banner_url'],
'aufendhalt' => $_POST['aufendhalt'],
'menge' => $_POST['menge'],
'preis' => 0,
'verdienst' => $_POST['verdienst'],
'werbeart' => 'forcedbanner',
'status' => 1,
'reload' => $reload,
'sponsor' => 'administrator',
);
$campaigns->insert( $data );
$buchung = 'true';
}
}
......@@ -63,11 +75,11 @@ head("Formular Forcedbanner 468*60");
</tr>
<tr>
<td>Aufendhalt (Sekunden)</td>
<td><input type="Text" name="aufendhalt" value="' . $_POST['aufendhalt'] . '" style="width:40px" maxlength="2"> max. 30</td>
<td><input type="Text" name="aufendhalt" value="' . $_POST['aufendhalt'] . '" style="width:40px" maxlength="2"></td>
</tr>
<tr>
<td align="center" valign="middle" colspan="2"><input type="Submit" name="buchen" value="Jetzt Buchen"></td>
</tr>
</table>
</form>';
foot();
\ No newline at end of file
foot();
<?php
if (!isset($_GET['frame'])) $_GET['frame'] = false;
if (!isset($_GET['testen'])) $_GET['testen'] = true;
if (!isset($_GET['tan'])) $_GET['tan'] = "";
if ($_GET['testen'] == 'true') {
if ($_GET['frame'] == 'true') {
echo 'Dies ist der Testframe';
} else {
require_once ( '../lib/datenbank.inc.php' );
require_once ( '../lib/functions.lib.php' );
if (!isset($_GET['art'])) $_GET['art'] = "";
if (!isset($forced['tan'])) $forced['tan'] = "";
if (!isset($forced['ziel'])) $forced['ziel'] = "";
// SecVMS change begin
$_GET['tan'] = addslashes ($_GET['tan']);
// SecVMS change end
$forced = mysql_fetch_assoc(db_query("SELECT ziel FROM " . $db_prefix . "_gebuchte_werbung WHERE tan='" . $_GET['tan'] . "' LIMIT 1"));
if ($forced) {
$ziel = $forced['ziel'];
} else {
$ziel = urldecode($_GET['url']);
}
echo '
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Framekiller-Test by ' . $seitenname . '</title>
</head>
<frameset rows="75,*" border="0">
<frame src="frametest.php?testen=true&frame=true" name="abuse" frameborder="0" scrolling="no" marginheight="10">
<frame name="werbung" src="' . $ziel . '" scrolling="auto" frameborder="0" marginheight="10">
<noscript>Bei dir ist kein Javascript aktiviert!</noscript>
</frameset><noframes></noframes><noframes>Bei dir sind keine Frames aktiviert!</noframes>
</body>
</html>';
}
} else {
echo 'Javascript Test! Bitte warte einen Moment!
<script type="text/javascript">
<!--
document.location = "frametest.php?url=' . $_GET['url'] . '&testen=true&tan=' . $_GET['tan'] . '";
//-->
</script>';
}
......@@ -9,16 +9,17 @@
if ($_GET['content'] {0} != '/') $_GET['content'] = '/' . $_GET['content'];
}
if (!ini_get('display_errors')) {
ini_set('display_errors', '0');
ini_set('display_errors', '1');
}
if (!isset($_GET['content']) || empty ($_GET['content'])) $_GET['content'] = '/startseite';
if (!file_exists('content' . $_GET['content'] . '.php')) $_GET['content'] = '/error/keine_seite';
require ('../lib/datenbank.inc.php');
require ('../lib/datenbank.inc.php');
require ('../lib/functions.lib.php');
session_start();
$pageconfig = mysqli_fetch_array(db_query("SELECT * FROM " . $db_prefix . "_seitenkonfig LIMIT 1"));
require ('lib/layout.lib.php');
require ( '../lib/extras.lib.php' );
require ('../lib/extra/mail.php');
......@@ -45,9 +46,7 @@ if (!ini_get('display_errors')) {
}
}
?>
<!DOCTYPE html>
?><!DOCTYPE html>
<html lang='de'>
<head>
<title>..:: Adminforce ::..</title>
......@@ -104,7 +103,7 @@ if (!ini_get('display_errors')) {
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar">
<?php if($_SESSION['admin'] == 1) require_once('lib/menue_links.php');?>
<?php if(isset($_SESSION['admin']) && $_SESSION['admin'] == 1) require_once('lib/menue_links.php');?>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<div class="jumbotron">
......@@ -144,15 +143,16 @@ if (!ini_get('display_errors')) {
</div>
<?php
}
if($_SESSION['admin'] == 1) {
if(file_exists('../install')){
echo '<div class="alert alert-danger text-center">Du musst den Ordner install noch l&ouml;schen</div>';
}
require_once('content'.$_GET['content'].'.php');
if( isset($_SESSION['admin']) && $_SESSION['admin'] == 1 )
{
if(file_exists('../install')){
echo '<div class="alert alert-danger text-center">Du musst den Ordner install noch l&ouml;schen</div>';
}
require_once('content'.$_GET['content'].'.php');
}else{
echo '
<form method="post">
<input type="Text" name="loginname" value="'.$_POST['loginname'].'" placeholder="Username">
<input type="Text" name="loginname" value="" placeholder="Username">
<input type="Password" name="passwort" value="" placeholder="Passwort">
<button type="submit" name="check" value="Login">Login</button>
</form>
......
......@@ -5,7 +5,9 @@ class Campaigns
private $database;
const FIELDS_gebuchte_werbung = '`t1`.`id`, `t1`.`uid`, `t1`.`tan`, `t1`.`kid`, `t1`.`ziel`, `t1`.`banner`, `t1`.`verdienst`, `t1`.`preis`, `t1`.`aufendhalt`, `t1`.`menge`, `t1`.`reload`, `t1`.`sponsor`, `t1`.`werbeart`, `t1`.`status`';
const FIELDS_gebuchte_werbung = ' `t1`.`id`, `t1`.`uid`, `t1`.`tan`, `t1`.`kid`, `t1`.`ziel`, `t1`.`banner`,
`t1`.`verdienst`, `t1`.`preis`, `t1`.`aufendhalt`, `t1`.`menge`, `t1`.`reload`,
`t1`.`sponsor`, `t1`.`werbeart`, `t1`.`status` ';
public function __construct( $database )
{
......@@ -24,9 +26,25 @@ class Campaigns
public function getIsClickableByTanAndType( $tan, $type, $ip, $uid, $zeit )
{
$sql = self::FIELDS_gebuchte_werbung .' FROM `'. DB_PREFIX .'_gebuchte_werbung` AS `t1`
LEFT JOIN `'. DB_PREFIX .'_reloads` AS `t2` ON ( `t1`.`tan` = `t2`.`tan` AND (`t2`.`uid` = :t2uid OR `t2`.`ip` = :t2ip ) AND `t2`.`bis` > :t2bis )
WHERE `t1`.`tan` = :t1tan AND `t2`.`tan` IS NULL AND `t1`.`werbeart` = :t1type AND `t1`.`menge` >= 1 AND `t1`.`status` = 1 AND `t1`.`sponsor` != :t1uid LIMIT 1';
$sql = self::FIELDS_gebuchte_werbung .'
FROM `'. DB_PREFIX .'_gebuchte_werbung` AS `t1`
LEFT JOIN `'. DB_PREFIX .'_reloads` AS `t2` ON
(
`t1`.`tan` = `t2`.`tan` AND
(
`t2`.`uid` = :t2uid OR
`t2`.`ip` = :t2ip
) AND
`t2`.`bis` > :t2bis
)
WHERE
`t1`.`tan` = :t1tan AND
`t2`.`tan` IS NULL AND
`t1`.`werbeart` = :t1type AND
`t1`.`menge` >= 1 AND
`t1`.`status` = 1 AND
`t1`.`sponsor` != :t1uid
LIMIT 1';
$sql_params = array(
':t2uid' => $uid,
......@@ -59,4 +77,112 @@ class Campaigns
return ( isset($result[0]) ) ? $result[0] : false;
}
public function getNewAdData( $art, $uid, $ip, $limit = 3 )
{
$zeit = time();
$result = array('count' => 0, 'data' => array() );
$num_limit = (int)$limit;
$sql = self::FIELDS_gebuchte_werbung .'
FROM `' . DB_PREFIX . '_gebuchte_werbung` AS `t1`
LEFT JOIN `' . DB_PREFIX . '_reloads` AS `t2` ON (`t1`.`tan` = `t2`.`tan` AND ( `t2`.`uid` = :ruid OR `t2`.`ip` = :ip ) AND t2.bis >= :zeit)
LEFT JOIN `' . DB_PREFIX . '_fb_blacklist` AS `t3` ON `t3`.`kid` = `t1`.`kid` AND `t3`.`werbeart`=`t1`.`werbeart`
LEFT JOIN `' . DB_PREFIX . '_userblacklist` AS `t4` ON `t4`.`uid` = :ubuid
WHERE
(`t3`.`kid` IS NULL OR LOCATE(`t3`.`sponsor`, `t1`.`ziel`) = 0) AND
`t2`.`tan` IS NULL AND
`t1`.`werbeart` = :wart AND
`t1`.`menge` > 0 AND
`t1`.`status` = 1 AND
`t1`.`verdienst` > 0 AND
`t1`.`sponsor` != :spuid
ORDER BY `t1`.`verdienst` DESC LIMIT '.$num_limit;
$sql_params = array(
':ruid' => $uid,
':ip' => $ip,
':zeit' => $zeit,
':ubuid'=> $uid,
':wart' => $art,
':spuid'=> $uid,
);
$result['data'] = $this->database->select($sql, $sql_params);
$result['count'] = count($result['data']);
return $result;
}
public function getAll( $art, $status = false, $sponsor = false, $limit = false, $start = false)
{
$result = array('count' => 0, 'data' => array() );
$sql_params = array();
$sql = self::FIELDS_gebuchte_werbung .' FROM `' . DB_PREFIX . '_gebuchte_werbung` AS `t1`
WHERE';
if( false !== $sponsor )
{
$sql .= '`t1`.`sponsor` = :sponsor AND ';
$sql_params[':sponsor'] = $sponsor;
}
if( false !== $status )
{
$sql .= '`t1`.`status` = :status AND ';
$sql_params[':status'] = $status;
}
$sql .= '`t1`.`werbeart` = :wart
ORDER BY kid ASC ';
$sql_params[':wart'] = $art;
$result['data'] = $this->database->select($sql, $sql_params);
$result['count'] = count($result['data']);
return $result;
}
public function delete( $where )
{
return $this->database->delete( '`' . DB_PREFIX . '_gebuchte_werbung`' , $where );
}
public function update( $data, $where )
{
return $this->database->update( '`' . DB_PREFIX . '_gebuchte_werbung`' , $data, $where );
}
public function insert( $data )
{
return $this->database->insert( '`' . DB_PREFIX . '_gebuchte_werbung`' , $data );
}
public function getTimeToFirstOffReloadAd( $art, $uid )
{
$zeit = time();
$retval = NULL;
$sql = ' `r`.`bis` FROM `'.DB_PREFIX.'_reloads` AS `r`
LEFT JOIN `'.DB_PREFIX.'_gebuchte_werbung` AS `ad` ON (`ad`.`tan` = `r`.`tan` AND `ad`.`status` = 1 AND `ad`.`werbeart` = :wart AND `ad`.`sponsor` != :spuid)
WHERE
`r`.`uid` = :ruid AND `ad`.`tan` IS NOT NULL AND `r`.`bis` > :zeit
ORDER BY `r`.`bis` ASC LIMIT 1';
$sql_params = array(
':wart' => $art,
':spuid' => $uid,
':ruid' => $uid,
':zeit' => $zeit,
);
$result = $this->database->select($sql, $sql_params);
if( isset($result[0]) )
{
$res = $result[0];
$retval = (($res->bis - $zeit ) >= 0) ? ($res->bis - $zeit) : NULL;
}
return $retval;
}
}
<?php
class Stats
{
private $database;
public function __construct( $database )
{
$this->database = $database;
}
public function adsTotalsCount( $art, $personal = false )
{
$sql = ' COUNT(`t1`.`tan`) AS `ganzahl`, SUM(`t1`.`verdienst`) AS `gverdienst`, SUM(`t1`.`aufendhalt`) AS `gaufenthalt`,
SUM(`t1`.`menge` * `t1`.`verdienst`) AS `totalvalue`,
SUM(`t1`.`menge`) AS `totalclicks`
FROM `'.DB_PREFIX.'_gebuchte_werbung` AS `t1` ';
if( false !== $personal )
$sql .= ' LEFT JOIN `'.DB_PREFIX.'_userblacklist` `t4` ON `t4`.`uid` = :juid ';
// TODO fix join on blacklist, kid only works with sponsor, going to use id anyway...
$sql .= ' LEFT JOIN `'.DB_PREFIX.'_fb_blacklist` AS `t3` ON `t3`.`kid` = `t1`.`kid` AND `t3`.`werbeart`=`t1`.`werbeart`
WHERE
(`t3`.`kid` IS NULL OR LOCATE(`t3`.`sponsor`, `t1`.`ziel`) = 0) AND
`t1`.`werbeart` = :wart AND
`t1`.`reload` >= 100 AND
`t1`.`menge` > 0 AND
`t1`.`status` = 1 AND
`t1`.`verdienst` >= 0 ';
if( false !== $personal )
$sql .= ' AND `t1`.`sponsor` != :spuid ';
$sql_params = array(':wart' => $art);
if( false !== $personal )
{
$sql_params[':juid'] = $personal;
$sql_params[':spuid'] = $personal;
}
$result = $this->database->select( $sql, $sql_params );
return ( isset($result[0]) ) ? $result[0] : false;
}
public function adsClickableCount( $art, $uid, $ip )
{
$zeit = time();
$sql = ' COUNT(`t1`.`tan`) AS `uanzahl`, SUM(`t1`.`verdienst`) AS `uverdienst` FROM `'.DB_PREFIX.'_gebuchte_werbung` AS `t1`
LEFT JOIN `'.DB_PREFIX.'_reloads` AS `t2` ON (`t1`.`tan` = `t2`.`tan` AND ( `t2`.`uid` = :ruid OR `t2`.`ip` = :ip ) AND t2.bis >= :zeit )
LEFT JOIN `'.DB_PREFIX.'_fb_blacklist` AS `t3` ON `t3`.`kid` = `t1`.`kid` AND `t3`.`werbeart`=`t1`.`werbeart`
LEFT JOIN `'.DB_PREFIX.'_userblacklist` AS `t4` ON `t4`.`uid` = :buid
WHERE
( `t3`.`kid` IS NULL OR LOCATE(`t3`.`sponsor`, `t1`.`ziel`) = 0) AND
`t2`.`tan` IS NULL AND
`t1`.`werbeart` = :wart AND
`t1`.`reload` >= 100 AND
`t1`.`menge` > 0 AND
`t1`.`status` = 1 AND
`t1`.`verdienst` >= 0 AND
`t1`.`sponsor` != :spuid ';
$sql_params = array(
':ruid' => $uid,
':ip' => $ip,
':zeit' => $zeit,
':buid' => $uid,
':spuid'=> $uid,
':wart' => $art,
);
$result = $this->database->select( $sql, $sql_params );
return ( isset($result[0]) ) ? $result[0] : false;
}
}
<?php
userstatus();
if ($_POST['uebertragen'] == 'Melden') {
head('Meldung');
if ($_POST['tan'] != '') {
if (is_numeric($_POST['grund']) && $_POST['grund'] > 0 && $_POST['grund'] < 8) {
if (eregi('tan=',$_POST['tan'])) {
$tan = split('tan=',$_POST['tan'], 2);
$tan = split('&', $tan[1]);
$_POST['tan'] = $tan[0];
}
$abfrage = mysqli_fetch_assoc(db_query('SELECT tan, kid, ziel, reload, aufendhalt, werbeart FROM '.$db_prefix.'_gebuchte_werbung WHERE tan="'.mysqli_real_escape_string($_POST['tan']).'" LIMIT 1'));
if ($abfrage) {
db_query('REPLACE INTO '.$db_prefix.'_adscan_userblacklist (uid, tan) VALUES ('.$_SESSION['uid'].', "'.$abfrage['tan'].'")');
$einstellungen = mysqli_fetch_assoc(db_query('SELECT updatesite, pw, werbearten, version FROM '.$db_prefix.'_adscan LIMIT 1'));
$einstellungen['werbearten'] = explode(', ', $einstellungen['werbearten']);
if ((!in_array($abfrage['werbeart'], $einstellungen['werbearten']) && $_POST['grund'] == 1) || $_POST['grund'] != 1) {
if ($_POST['grund'] < 7) db_query('INSERT INTO '.$db_prefix.'_adminblacklist (tan, time) VALUES ("'.$abfrage['tan'].'", '.time().')');
if (($abfrage['kid'] != 0) && ($abfrage['sponsor'] != 'administrator') && $_POST['grund'] < 6) {
if ($fp = file_get_contents($einstellungen['updatesite'].'upload.php?pw='.$einstellungen['pw'].'&url='.urlencode($abfrage['ziel']).'&kid='.$abfrage['kid'].'&reload='.$abfrage['reload'].'&aufenthalt='.$abfrage['aufendhalt'].'&werbeart='.$abfrage['werbeart'].'&grund='.$_POST['grund'])) {
echo 'Der Adscan Server erzeugt folgende Rückgabe:<br><br>'.$fp;
} elseif ($_POST['grund'] < 6) {
echo 'Kampagne wurde dem Admin gemeldet!';
} else {
echo 'Die Verbindung zum Adscan Server konnte nicht hergestellt werden.';
}
} else echo 'Meldung wurde dem Admin gesendet!';
} else {
echo 'Diese Kampagne hat einen Zwangsframebrecher!';
}
} else {
echo 'Ung&uuml;ltige TAN!';
}
} else {
echo 'Du hast eine ung&uuml;ltige Auswahl beim Pulldown-Feld gemacht!';
}
} else {
echo 'Du hast keine TAN eingegeben';
}
foot();
}
head('Neue Kampagne melden');
echo '<form action="" method="post">
<table width="70%">
<tr>
<td>Tan oder URL:</td><td><input type="text" name="tan" value="'.$_GET['tan'].'"></td>
</tr>
<tr>
<td>Meldegrund:</td><td><select name="grund"><option value="1">Framebrecher</option><option value="2">Virus</option><option value="4">Zu viele Popups</option><option value="5">Zu viele Frames</option><option value="6">Kampagne abgelaufen</option><option value="7">Persönliche Gründe</option></select></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="uebertragen" value="Melden"></td>
</tr>
</table>
</form>';
foot();
?>
\ No newline at end of file
<?php
if (!isset($fc_gebucht)) $fc_gebucht = '';
if (!isset($fc_menge)) $fc_menge = 0;
if (!isset($fc_wert)) $fc_wert = 0;
if (!isset($in_fc_gebucht)) $in_fc_gebucht = '';
if (!isset($in_fc_menge)) $in_fc_menge = '';
if (!isset($in_fc_wert)) $in_fc_wert = '';
......@@ -9,13 +6,6 @@ if (!isset($in_fc_wert)) $in_fc_wert = '';
$kontostats = mysqli_fetch_array(db_query("SELECT SUM(s_aufrufe) AS kd_s_aufrufe , SUM(s_verdienst) AS kd_s_verdienst ,COUNT(uid) AS kd_uid , SUM(kontostand) AS kd_kontostand , SUM(klicks) AS kd_klicks , SUM(angebettelt) AS kd_angebettelt , SUM(kv) AS kd_kv , SUM(bv) AS kd_bv FROM ".$db_prefix."_kontodaten"));
$werberdaten = mysqli_fetch_array(db_query("SELECT SUM(gesamt) AS wd_gesamt FROM ".$db_prefix."_werberdaten"));
$ex_fc = db_query("SELECT * FROM ".$db_prefix."_gebuchte_werbung WHERE menge >= 1 and werbeart = 'forcedbanner' and status = '1'");
while ($count = mysqli_fetch_array($ex_fc)) {
$fc_gebucht++;
$fc_menge = $fc_menge + $count['menge'];
$fc_wert = $fc_wert + ($count['verdienst']*$count['menge']);
}
$heute = strtotime("".date("m")."/".date("d")."/".date("Y").""); // Format mm.tt.yyyy
$seitenstart = strtotime("04/02/2005"); // Format mm.tt.yyyy
$tage = ($heute - $seitenstart) / 86400;
......@@ -91,17 +81,20 @@ head("Mediadaten - Diverses");?>
foot();
head("Mediadaten - Werbung");?>
<table width="100%" border="0" cellpadding="1" cellspacing="1">
<?php
$forcedbanner_stats = $stats->adsTotalsCount( 'forcedbanner' );
?>
<tr class="tabellenbody_0">
<td width="50%">Forcedklick Kampagnen</td>
<td width="50%"><?php echo @number_format($fc_gebucht,0,",",".");?> Kampagnen</td>
<td width="50%"><?php echo @number_format($forcedbanner_stats->ganzahl,0,",",".");?> Kampagnen</td>
</tr>
<tr class="tabellenbody_1">
<td width="50%">Forcedklick Restklicks</td>
<td width="50%"><?php echo @number_format($fc_menge,0,",",".");?> Klicks</td>
<td width="50%"><?php echo @number_format($forcedbanner_stats->totalclicks,0,",",".");?> Klicks</td>
</tr>
<tr class="tabellenbody_0">
<td width="50%">Forcedklicks Gesamtwert</td>
<td width="50%"><?php echo @number_format($fc_wert,2,",",".");?> <?php echo $pageconfig['waehrung'];?></td>
<td width="50%"><?php echo @number_format($forcedbanner_stats->totalvalue,2,",",".");?> <?php echo $pageconfig['waehrung'];?></td>
</tr>
</table>
<?php foot();?>
......@@ -3,36 +3,32 @@ $sperre = mysqli_fetch_array(db_query("SELECT forced_sperre FROM ".$db_prefix."_
userstatus ();
include ('fakecheck/fc_redirect.php');
head ('Klickbanner');
$fstats_gesamt_query = db_query('SELECT COUNT(t1.tan) AS ganzahl, SUM(t1.verdienst) AS gverdienst, SUM(t1.aufendhalt) AS gaufenthalt FROM '.$db_prefix.'_gebuchte_werbung t1
LEFT JOIN vms_userblacklist t4 ON t4.uid = '.$_SESSION['uid'].'
LEFT JOIN vms_fb_blacklist AS t3 ON t3.kid = t1.kid AND t3.werbeart=t1.werbeart
WHERE (t3.kid IS NULL OR LOCATE(t3.sponsor, t1.ziel) = 0) AND t1.werbeart = "forcedbanner" and t1.reload >= 100 AND t1.menge > 0 AND t1.status = 1 AND t1.verdienst >= 0 AND t1.sponsor != '.$_SESSION['uid'].'');
$fstats_gesamt = mysqli_fetch_assoc($fstats_gesamt_query);
$fstats_uebrig_query = db_query('SELECT COUNT(t1.tan) AS uanzahl, SUM(t1.verdienst) AS uverdienst FROM '.$db_prefix.'_gebuchte_werbung t1
LEFT JOIN vms_userblacklist t4 ON t4.uid = '.$_SESSION['uid'].'
LEFT JOIN vms_fb_blacklist AS t3 ON t3.kid = t1.kid AND t3.werbeart=t1.werbeart
LEFT JOIN vms_reloads t2 ON (t1.tan = t2.tan AND (t2.uid = '.$_SESSION['uid'].' OR t2.ip = "'.$ip.'") AND t2.bis >= '.time().')
WHERE (t3.kid IS NULL OR LOCATE(t3.sponsor, t1.ziel) = 0) AND t2.tan IS NULL AND t1.werbeart = "forcedbanner" and t1.reload >= 100 AND t1.menge > 0 AND t1.status = 1 AND t1.verdienst >= 0 AND t1.sponsor != '.$_SESSION['uid'].'');
$fstats_uebrig = mysqli_fetch_assoc($fstats_uebrig_query);
$uebriga=100/$fstats_gesamt['ganzahl']*$fstats_uebrig['uanzahl'];
$uebrig=number_format($uebriga,2,',','.');
$abgebaut= 100-$uebriga;
$fstats_gesamt = $stats->adsTotalsCount( 'forcedbanner', $_SESSION['uid'] );
$fstats_uebrig = $stats->adsClickableCount( 'forcedbanner', $_SESSION['uid'], $ip );
$uebriga = ( 0 != $fstats_gesamt->ganzahl && 0 != $fstats_uebrig->uanzahl ) ? 100/$fstats_gesamt->ganzahl * $fstats_uebrig->uanzahl : 0;
$uebrig = number_format($uebriga,2,',','.');
$abgebaut = 100-$uebriga; // breite fuer progressbar, nicht % oder anzahl abgebauter kampagnen
$aufenthalt = (0 != $fstats_gesamt->gaufenthalt && 0 != $fstats_gesamt->ganzahl) ? number_format($fstats_gesamt->gaufenthalt/$fstats_gesamt->ganzahl,0,",",".") : 0;
$verguetung = (0 != $fstats_gesamt->gverdienst && 0 != $fstats_gesamt->ganzahl) ? number_format( $fstats_gesamt->gverdienst/$fstats_gesamt->ganzahl ,2,",",".") : 0;
echo "<table class=\"table\">
<tr>
<td align='center''>Paidbanner gesamt: ".$fstats_gesamt['ganzahl']."</td>
<td align='center''>Paidbanner gesamt: ". $fstats_gesamt->ganzahl ."</td>
<td>&nbsp;&nbsp;</td>
<td align='center'>Paidbanner uebrig: ".$fstats_uebrig['uanzahl']."</td>
<td align='center'>Paidbanner uebrig: ". $fstats_uebrig->uanzahl ."</td>
</tr>
<tr>
<td align='center'>&Oslash; Aufenthalt: ".number_format($fstats_gesamt['gaufenthalt']/$fstats_gesamt['ganzahl'],2,",",".")." Sekunden</td>
<td align='center'>&Oslash; Aufenthalt: ".$aufenthalt." Sekunden</td>
<td>&nbsp;&nbsp;</td>
<td align='center''>&Oslash; Verg&uuml;tung: ".number_format($fstats_gesamt['gverdienst']/$fstats_gesamt['ganzahl'],2,",",".")." ".$pageconfig['waehrung']."</td>
<td align='center''>&Oslash; Verg&uuml;tung: ".$verguetung." ". $pageconfig['waehrung'] ."</td>
</tr>
<tr>
<td align='center''>Gesamtwert: ".$fstats_gesamt['gverdienst']." ".$pageconfig['waehrung']."</td>
<td align='center''>Gesamtwert: ". $fstats_gesamt->gverdienst ." ". $pageconfig['waehrung'] ."</td>
<td>&nbsp;&nbsp;</td>
<td align='center'>Offen: ".$fstats_uebrig['uverdienst']." ".$pageconfig['waehrung']."</td>
<td align='center'>Offen: ". $fstats_uebrig->uverdienst ." ".$pageconfig['waehrung']."</td>
</tr>
</table>
<div id='fortschritt' style='width: 380px; font-weight: bold; margin: 0 auto' align='center''></div>
......@@ -41,33 +37,39 @@ include ('fakecheck/fc_redirect.php');
jQuery('#fortschritt').progressbar({value: width});
jQuery('#fortschritt').append(jQuery('<div>').html('Noch ".$uebrig."&#37; &uuml;brig ').css('position', 'relative').css('top', '-21px').css('width', '100%').css('font-size', '14px').attr('align', 'center').attr('id', 'fortschritttext'));
</script> ";
$res = mysqli_fetch_assoc (db_query ('SELECT r.bis FROM vms_reloads AS r
LEFT JOIN vms_gebuchte_werbung AS ad ON (ad.tan = r.tan AND ad.status = 1 AND ad.werbeart = "forcedbanner" AND ad.sponsor != '.$_SESSION['uid'].')
WHERE r.uid = '.$_SESSION['uid'].' AND ad.tan IS NOT NULL AND r.bis > '.(time()).'
ORDER BY r.bis ASC LIMIT 1'));
$zeit = ((($res['bis']-time()) >= 0) ? ($res['bis']-time()) : NULL );
if ($zeit != NULL){
$reloffzeit = $campaigns->getTimeToFirstOffReloadAd( 'forcedbanner', $_SESSION['uid'] );
if ($reloffzeit != NULL)
{
echo '<center>Der n&auml;chste Banner kommt in '.ceil($zeit/60).' Minuten aus dem Reload!</center><hr><br>';
}else echo '<center>Kein Banner im Reload.</center><hr><br>';
}
else
{
echo '<center>Kein Banner im Reload.</center><hr><br>';
}
if($sperre['forced_sperre'] == 0){
$usr = mysqli_fetch_assoc (db_query ('SELECT max_forced FROM ' . $db_prefix . '_userdaten WHERE uid = ' . $_SESSION['uid'] . ' LIMIT 1'));
$fbanner = db_query ('SELECT t1.*
FROM ' . $db_prefix . '_gebuchte_werbung t1
LEFT JOIN ' . $db_prefix . '_userblacklist t4 ON t4.uid = ' . $_SESSION['uid'] . '
LEFT JOIN ' . $db_prefix . '_fb_blacklist AS t3 ON t3.kid = t1.kid AND t3.werbeart=t1.werbeart
LEFT JOIN ' . $db_prefix . '_reloads t2
ON (t1.tan = t2.tan AND (t2.uid = ' . $_SESSION['uid'] . ' OR t2.ip = "' . $ip . '") AND t2.bis >= ' . time() . ')
WHERE (t3.kid IS NULL OR LOCATE(t3.sponsor, t1.ziel) = 0) AND t2.tan IS NULL AND t1.werbeart = "forcedbanner" AND t1.menge > 0 AND t1.status = 1 AND t1.verdienst > 0 AND t1.sponsor != ' . $_SESSION['uid'] . ' ORDER BY t1.verdienst DESC LIMIT ' . $usr['max_forced']);
$ads = $campaigns->getNewAdData( 'forcedbanner', $_SESSION['uid'], $ip, $usr['max_forced'] );
if( 0 >= $ads['count'] )
{
echo '<div class="alert alert-warning text-center">Alle Banner im Reload !</div>';
} else {
foreach($ads['data'] as $f_banner)
{
echo '<div align="center" id="banner_'. $f_banner->tan .'">';
echo '<a href="top_forcedbanner.php?tan=' . $f_banner->tan . '" target="_blank">';
echo '<img src="'. $f_banner->banner .'" border="0" height="60" width="468" alt="'. $f_banner->tan .'" onclick="document.getElementById(\'banner_'. $f_banner->tan .'\').style.display=\'none\';">';
echo '</a>';
while ($f_banner = mysqli_fetch_assoc ($fbanner)) {
echo '<div align="center" id="banner_' . $f_banner['tan'] . '"><a href="top_forcedbanner.php?tan=' . $f_banner['tan'] . '" target="_blank"><img src="' . $f_banner['banner'] . '" border="0" height="60" width="468" alt="' . $f_banner['tan'] . '" onClick="document.getElementById(\'banner_' . $f_banner['tan'] . '\').style.display=\'none\';"></a>'
. '<br>Reload:' . $f_banner['reload'] /