$get['by'] = $_SESSION['stats202_by']; } if (!$_SESSION['stats202_by']) { $_SESSION['stats202_by'] = 'DESC'; } if ($_POST['page']) { $get['offset'] = $get['limit'] * ($_POST['page'] - 1); } $query = http_build_query($get); //build the offers202 api string $url = TRACKING202_API_URL . "/stats202/getOfferStats?{$query}"; #echo "<p>$url</p>"; //grab the url $xml = getUrl($url); $getOfferStats = convertXmlIntoArray($xml); checkForApiErrors($getOfferStats); $getOfferStats = $getOfferStats['getOfferStats']; $summary = $getOfferStats['summary'][0]; $total_rows = $summary['total_rows']; $offset = $summary['offset']; $limit = $summary['limit']; $totalOfferStatImpressions = $summary['totalOfferStatImpressions']; $totalOfferStatClicks = $summary['totalOfferStatClicks']; $totalOfferStatActions = $summary['totalOfferStatActions']; $totalOfferStatTotal = $summary['totalOfferStatTotal']; $totalOfferStatEpc = $summary['totalOfferStatEpc']; #print_r_html($summary); //paging $page = $_POST['page']; if (!$page) { $page = 1;
$_SESSION['offers202_limit'] = 100; } if ($_POST['page']) { $get['offset'] = $get['limit'] * ($_POST['page'] - 1); } $query = http_build_query($get); if ($_SESSION['offers202_query']) { $html['query'] = htmlentities($_SESSION['offers202_query']); echo "\t<div style='text-align: center; padding: 5px 0px 15px;' id='addAlert'>\n\t\t\t\tWould you like to be notified every time a new <strong><em>{$html['query']}</em></strong> offer is found? \n\t\t\t\t Simply <a href='/alerts202/?addAlert=1&alertType=offer&alertValue={$html['query']}'>click here to create this alert</a>.\n\t\t\t</div>"; } //build the offers202 api string $url = TRACKING202_API_URL . "/offers202/getOffers?{$query}"; $xml = getUrl($url); $getOffers = convertXmlIntoArray($xml); //check for api errors checkForApiErrors($getOffers); //if there were no errors continue $getOffers = $getOffers['getOffers']; $summary = $getOffers['summary'][0]; $total_rows = $summary['total_rows']; $offset = $summary['offset']; $limit = $summary['limit']; #print_r_html($summary); //paging $page = $_POST['page']; if (!$page) { $page = 1; } $pages = ceil($total_rows / $limit); if (!$pages) { $pages = 1;
$get = array(); $get['apiKey'] = $_SESSION['user_api_key']; $get['stats202AppKey'] = $_SESSION['user_stats202_app_key']; $query = http_build_query($get); //build the offers202 api string $url = TRACKING202_API_URL . "/stats202/getPostBacks?{$query}"; #echo "<p>$url</p>"; //grab the url $data = getUrl($url); //parse out the array $xmlToArray = new XmlToArray($data); $getPostBacks = $xmlToArray->createArray(); template_top('Postback URLs'); include_once '../top.php'; //check for api errors checkForApiErrors($getPostBacks); ?> <?php if ($_GET['delete']) { echo "<div class='success'><div><h3>Your submission was successful</h3>You have deleted a postback url.</div></div>"; } if ($success) { echo "<div class='success'><div><h3>Your submission was successful</h3>You have modified or created a new postback url</div></div>"; } if ($errors) { echo "<div class='warning'><div><h3>There were errors with your submission</h3>Please look at the errors below</div></div>"; for ($x = 0; $x < count($errors); $x++) { $html = array_merge($html, array_map('htmlentities', $errors[$x])); echo "<div class='error'>ErrorCode: {$html['errorCode']}<br/>";
} if (!$_SESSION['stats202_by']) { $_SESSION['stats202_by'] = 'DESC'; } $get['limit'] = $_SESSION['stats202_limit']; if ($_POST['page']) { $get['offset'] = $get['limit'] * ($_POST['page'] - 1); } $query = http_build_query($get); //build the offers202 api string $url = TRACKING202_API_URL . "/stats202/getStats?{$query}"; #echo "$url<br/><br/>"; //grab the url $xml = getUrl($url); $getStats = convertXmlIntoArray($xml); checkForApiErrors($getStats); $getStats = $getStats['getStats']; $summary = $getStats['summary'][0]; $total_rows = $summary['total_rows']; $offset = $summary['offset']; $limit = $summary['limit']; $totalStatImpressions = $summary['totalStatImpressions']; $totalStatClicks = $summary['totalStatClicks']; $totalStatActions = $summary['totalStatActions']; $totalStatTotal = $summary['totalStatTotal']; $totalStatEpc = $summary['totalStatEpc']; $totalSubids = $summary['total_rows']; //paging $page = $_POST['page']; if (!$page) { $page = 1;
} //only allow a 500 limit on this view if ($_SESSION['stats202_limit']) { $get['limit'] = $_SESSION['stats202_limit']; } if ($_POST['page']) { $get['offset'] = $get['limit'] * ($_POST['page'] - 1); } $query = http_build_query($get); //build the offers202 api string $url = TRACKING202_API_URL . "/stats202/getSubids?{$query}"; #echo "<p>$url</p>"; //grab the url $xml = getUrl($url); $getSubids = convertXmlIntoArray($xml); checkForApiErrors($getSubids); $getSubids = $getSubids['getSubids']; $summary = $getSubids['summary'][0]; $total_rows = $summary['total_rows']; $offset = $summary['offset']; $limit = $summary['limit']; $totalSubidActions = $summary['totalSubidActions']; $totalSubidAmount = $summary['totalSubidAmount']; $totalSubids = $summary['total_rows']; #print_r_html($summary); //paging $page = $_POST['page']; if (!$page) { $page = 1; } $pages = ceil($total_rows / $limit);
//_mysql_error($delete_result)) { $delete_success = true; } if ($error) { //if someone happend take the post stuff and add it $selected['stat_network_id'] = $_POST['stat_network_id']; $html = array_map('htmlentities', $_POST); } template_top('Affiliate Accounts'); include_once '../../top.php'; ?> <?php //show api errors if they exist checkForApiErrors($getNetworks); checkForApiErrors($getStatAccount); ?> <form method="post" action="<?php if ($delete_success == true) { echo $_SERVER['REDIRECT_URL']; } ?> " style> <table style="margin: 0px auto;"> <tr> <td style="padding: 0px 0px 20px;"> <?php if ($errors) {
$xml = getUrl($url); $isDownloadComplete = convertXmlIntoArray($xml); checkForApiErrors($isDownloadComplete); $isDownloadComplete = $isDownloadComplete['isDownloadComplete']; $downloadComplete = $isDownloadComplete['downloadComplete']; if ($downloadComplete == 'false') { echo "<img src='/202-img/refresh-animated.gif' style='margin: 0px 5px -3px 0px;'/>Stats202 is now updating your subid conversions & earnings amount... this will only take a moment."; //mark this field that the download is not complete echo "<input type='hidden' id='downloadComplete' value='0'/>"; } else { //show the last time stats202 updated $url = TRACKING202_API_URL . "/stats202/getLastDownloadTime?{$query}"; //grab the url $xml = getUrl($url); $getLastDownloadTime = convertXmlIntoArray($xml); checkForApiErrors($getLastDownloadTime); $getLastDownloadTime = $getLastDownloadTime['getLastDownloadTime']; $lastDownloadTime = $getLastDownloadTime['lastDownloadTime']; //make a pretty date if ($lastDownloadTime != 'false') { $today_time = mktime(0, 0, 0, date('n', time()), date('j', time()), date('Y', time())); if ($lastDownloadTime >= $today_time) { $last_update_date = 'today at ' . date('g:i a', $lastDownloadTime); } else { //if yesterday $yesterday_time = $today_time - 86400; if ($lastDownloadTime >= $yesterday_time) { $last_update_date = 'yesterday at ' . date('g:i a', $lastDownloadTime); } else { //another day $last_update_date = date('\\o\\n M d, Y', $lastDownloadTime);