Skip to content
Snippets Groups Projects
adcheck.php 1.16 KiB
Newer Older
<?php
if(!isset($_GET['data'])) exit;

require ('lib/datenbank.inc.php');
require ('lib/functions.lib.php');
require ('lib/session.lib.php');

list($art, $tan) = explode('-', $_GET['data']); // yeah sorry ;)
$art = base64_decode($art);
$tan = base64_decode($tan);
Christoph Zysik's avatar
Christoph Zysik committed
$kampdaten = $vms->campaigns->getByTanAndType( $tan, $art );

$result_color = 'red';

if( $tan == $_SESSION['current_ad']['tan'] &&
    $art == $_SESSION['current_ad']['art'] &&
    true == $_SESSION['current_ad']['paid'] &&
    false !== $kampdaten
  )
{
    $result_color = 'green';
}

?><!DOCTYPE html>
<html>
    <head>
        <!-- never is old spec but will be ignored by new browsers //-->
        <meta name="referrer" content="never">
        <meta name="referrer" content="no-referrer" />
        <title>Hinweis</title>
    </head>
    <body bgcolor="<?php echo $result_color; ?>">

        <?php if( 'green' == $result_color ) { ?>
        Diese Anzeige wurde dir mit <?php echo $kampdaten->verdienst .' '. $pageconfig['waehrung']; ?> verg&uuml;tet.
        <?php } else { ?>
        Nope, das war nix
        <?php } ?>

    </body>
</html><?php
Christoph Zysik's avatar
Christoph Zysik committed
$vms->ptc->invalidateAlreadyRunningAd( $_SESSION['uid'], $ip );