本文整理汇总了PHP中phpAds_sqlDie函数的典型用法代码示例。如果您正苦于以下问题:PHP phpAds_sqlDie函数的具体用法?PHP phpAds_sqlDie怎么用?PHP phpAds_sqlDie使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了phpAds_sqlDie函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Plugin_AffiliatehistoryExecute
function Plugin_AffiliatehistoryExecute($affiliateid, $delimiter = ",")
{
global $phpAds_config, $date_format;
global $strAffiliate, $strTotal, $strDay, $strViews, $strClicks, $strCTRShort;
header("Content-type: application/csv\nContent-Disposition: \"inline; filename=affiliatehistory.csv\"");
$idresult = phpAds_dbQuery("\n\t\tSELECT\n\t\t\tzoneid\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_zones'] . "\n\t\tWHERE\n\t\t\taffiliateid = '" . $affiliateid . "'\n\t");
while ($row = phpAds_dbFetchArray($idresult)) {
$zoneids[] = "zoneid = " . $row['zoneid'];
}
$res_query = "\n\t\tSELECT\n\t\t\tDATE_FORMAT(day, '" . $date_format . "') as day,\n\t\t\tSUM(views) AS adviews,\n\t\t\tSUM(clicks) AS adclicks\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_adstats'] . "\n\t\tWHERE\n\t\t\t(" . implode(' OR ', $zoneids) . ")\n\t\tGROUP BY\n\t\t\tday\n\t";
$res_banners = phpAds_dbQuery($res_query) or phpAds_sqlDie();
while ($row_banners = phpAds_dbFetchArray($res_banners)) {
$stats[$row_banners['day']]['views'] = $row_banners['adviews'];
$stats[$row_banners['day']]['clicks'] = $row_banners['adclicks'];
}
echo $strAffiliate . ": " . strip_tags(phpAds_getAffiliateName($affiliateid)) . "\n\n";
echo $strDay . $delimiter . $strViews . $delimiter . $strClicks . $delimiter . $strCTRShort . "\n";
$totalclicks = 0;
$totalviews = 0;
if (isset($stats) && is_array($stats)) {
for (reset($stats); $key = key($stats); next($stats)) {
$row = array();
// $key = implode('/',array_reverse(split('[-]',$key)));
$row[] = $key;
$row[] = $stats[$key]['views'];
$row[] = $stats[$key]['clicks'];
$row[] = phpAds_buildCTR($stats[$key]['views'], $stats[$key]['clicks']);
echo implode($delimiter, $row) . "\n";
$totalclicks += $stats[$key]['clicks'];
$totalviews += $stats[$key]['views'];
}
}
echo "\n";
echo $strTotal . $delimiter . $totalviews . $delimiter . $totalclicks . $delimiter . phpAds_buildCTR($totalviews, $totalclicks) . "\n";
}
示例2: Plugin_GlobalhistoryExecute
function Plugin_GlobalhistoryExecute($delimiter = ",")
{
global $phpAds_config, $date_format;
global $strGlobalHistory, $strTotal, $strDay, $strViews, $strClicks, $strCTRShort;
header("Content-type: application/csv\nContent-Disposition: \"inline; filename=globalhistory.csv\"");
if (phpAds_isUser(phpAds_Admin)) {
$res_query = "\n\t\tSELECT\n\t\t\tDATE_FORMAT(day, '" . $date_format . "') as day,\n\t\t\tSUM(views) AS adviews,\n\t\t\tSUM(clicks) AS adclicks\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_adstats'] . "\n\t\tGROUP BY\n\t\t\tday\n\t";
} else {
$res_query = "SELECT\n\t\t\t\t\t\tDATE_FORMAT(s.day, '" . $date_format . "') as day,\n\t\t\t\t\t\tSUM(s.views) AS adviews,\n\t\t\t\t\t\tSUM(s.clicks) AS adclicks\n\t\t\t\t\tFROM\n\t\t\t\t\t\t" . $phpAds_config['tbl_adstats'] . " \tas s,\n\t\t\t\t\t\t" . $phpAds_config['tbl_banners'] . " \tas b,\n\t\t\t\t\t\t" . $phpAds_config['tbl_campaigns'] . " as m,\n\t\t\t\t\t\t" . $phpAds_config['tbl_clients'] . " \tas c\n\t\t\t\t\tWHERE\n\t\t\t\t\t\ts.bannerid \t\t= b.bannerid AND\n\t\t\t\t\t\tb.campaignid \t= m.campaignid AND\n\t\t\t\t\t\tm.clientid \t\t= c.clientid AND\n\t\t\t\t\t\tc.agencyid \t\t= " . phpAds_getUserID() . "\n\t\t\t\t\tGROUP BY\n\t\t\t\t\t\tday";
}
$res_banners = phpAds_dbQuery($res_query) or phpAds_sqlDie();
while ($row_banners = phpAds_dbFetchArray($res_banners)) {
$stats[$row_banners['day']]['views'] = $row_banners['adviews'];
$stats[$row_banners['day']]['clicks'] = $row_banners['adclicks'];
}
echo $strGlobalHistory . "\n\n";
echo $strDay . $delimiter . $strViews . $delimiter . $strClicks . $delimiter . $strCTRShort . "\n";
$totalclicks = 0;
$totalviews = 0;
if (isset($stats) && is_array($stats)) {
for (reset($stats); $key = key($stats); next($stats)) {
$row = array();
//$key = implode('/',array_reverse(split('[-]',$key)));
$row[] = $key;
$row[] = $stats[$key]['views'];
$row[] = $stats[$key]['clicks'];
$row[] = phpAds_buildCTR($stats[$key]['views'], $stats[$key]['clicks']);
echo implode($delimiter, $row) . "\n";
$totalclicks += $stats[$key]['clicks'];
$totalviews += $stats[$key]['views'];
}
}
echo "\n";
echo $strTotal . $delimiter . $totalviews . $delimiter . $totalclicks . $delimiter . phpAds_buildCTR($totalviews, $totalclicks) . "\n";
}
示例3: phpAds_getCampaign
function phpAds_getCampaign($query)
{
$campaigns = array();
$res = phpAds_dbQuery($query) or phpAds_sqlDie();
while ($row = phpAds_dbFetchArray($res)) {
$campaigns[$row['campaignid']] = $row;
}
return $campaigns;
}
示例4: Plugin_GlobalhistoryExecute
function Plugin_GlobalhistoryExecute($delimiter = 't', $quotes = '')
{
global $phpAds_config, $date_format;
global $strGlobalHistory, $strTotal, $strDay, $strViews, $strClicks, $strCTRShort;
// Expand delimiter and quotes
if ($delimiter == 't') {
$delimiter = "\t";
}
if ($quotes == '1') {
$quotes = "'";
}
if ($quotes == '2') {
$quotes = '"';
}
header("Content-type: application/csv");
header("Content-Disposition: inline; filename=\"publisherhistory.csv\"");
if ($phpAds_config['compact_stats']) {
$res_query = "\n\t\t\tSELECT\n\t\t\t\tDATE_FORMAT(day, '%Y%m%d') as date,\n\t\t\t\tDATE_FORMAT(day, '{$date_format}') as date_formatted,\n\t\t\t\tSUM(views) AS adviews,\n\t\t\t\tSUM(clicks) AS adclicks\n\t\t\tFROM\n\t\t\t\t" . $phpAds_config['tbl_adstats'] . "\n\t\t\tGROUP BY\n\t\t\t\tday\n\t\t\tORDER BY\n\t\t\t\tdate\n\t\t";
$res_banners = phpAds_dbQuery($res_query) or phpAds_sqlDie();
while ($row_banners = phpAds_dbFetchArray($res_banners)) {
$stats[$row_banners['date_formatted']]['views'] = $row_banners['adviews'];
$stats[$row_banners['date_formatted']]['clicks'] = $row_banners['adclicks'];
}
} else {
$res_query = "\n\t\t\tSELECT\n\t\t\t\tDATE_FORMAT(t_stamp, '%Y%m%d') as date,\n\t\t\t\tDATE_FORMAT(t_stamp, '" . $date_format . "') as date_formatted,\n\t\t\t\tcount(bannerid) as adviews\n\t\t\tFROM\n\t\t\t\t" . $phpAds_config['tbl_adviews'] . "\n\t\t\tGROUP BY\n\t\t\t\tdate, date_formatted\n\t\t\tORDER BY\n\t\t\t\tdate\n\t\t";
$res_banners = phpAds_dbQuery($res_query) or phpAds_sqlDie();
while ($row_banners = phpAds_dbFetchArray($res_banners)) {
$stats[$row_banners['date_formatted']]['views'] = $row_banners['adviews'];
$stats[$row_banners['date_formatted']]['clicks'] = 0;
}
$res_query = "\n\t\t\tSELECT\n\t\t\t\tDATE_FORMAT(t_stamp, '%Y%m%d') as date,\n\t\t\t\tDATE_FORMAT(t_stamp, '" . $date_format . "') as date_formatted,\n\t\t\t\tcount(bannerid) as adclicks\n\t\t\tFROM\n\t\t\t\t" . $phpAds_config['tbl_adclicks'] . "\n\t\t\tGROUP BY\n\t\t\t\tdate, date_formatted\n\t\t\tORDER BY\n\t\t\t\tdate\n\t\t";
$res_banners = phpAds_dbQuery($res_query) or phpAds_sqlDie();
while ($row_banners = phpAds_dbFetchArray($res_banners)) {
$stats[$row_banners['date_formatted']]['clicks'] = $row_banners['adclicks'];
}
}
echo $quotes . $strGlobalHistory . $quotes . "\n\n";
echo $quotes . $strDay . $quotes . $delimiter . $quotes . $strViews . $quotes . $delimiter;
echo $quotes . $strClicks . $quotes . $delimiter . $quotes . $strCTRShort . $quotes . "\n";
$totalclicks = 0;
$totalviews = 0;
if (isset($stats) && is_array($stats)) {
foreach (array_keys($stats) as $key) {
$row = array();
$row[] = $quotes . $key . $quotes;
$row[] = $quotes . $stats[$key]['views'] . $quotes;
$row[] = $quotes . $stats[$key]['clicks'] . $quotes;
$row[] = $quotes . phpAds_buildCTR($stats[$key]['views'], $stats[$key]['clicks']) . $quotes;
echo implode($delimiter, $row) . "\n";
$totalclicks += $stats[$key]['clicks'];
$totalviews += $stats[$key]['views'];
}
}
echo "\n";
echo $quotes . $strTotal . $quotes . $delimiter . $quotes . $totalviews . $quotes . $delimiter;
echo $quotes . $totalclicks . $quotes . $delimiter . $quotes . phpAds_buildCTR($totalviews, $totalclicks) . $quotes . "\n";
}
示例5: phpAds_DeleteTracker
function phpAds_DeleteTracker($trackerid)
{
global $phpAds_config;
// Delete Campaign
$res = phpAds_dbQuery("DELETE FROM " . $phpAds_config['tbl_trackers'] . " WHERE trackerid=" . $trackerid) or phpAds_sqlDie();
// Delete Campaign/Tracker links
$res = phpAds_dbQuery("DELETE FROM " . $phpAds_config['tbl_campaigns_trackers'] . " WHERE trackerid=" . $trackerid) or phpAds_sqlDie();
// Delete Conversions Logged to this Tracker
$res = phpAds_dbQuery("DELETE FROM " . $phpAds_config['tbl_conversionlog'] . " WHERE trackerid=" . $trackerid) or phpAds_sqlDie();
// Delete stats for each banner
phpAds_deleteStatsByTrackerID($trackerid);
}
示例6: phpAds_updateSources
function phpAds_updateSources($old_source, $new_source)
{
global $phpAds_config;
$old_source_len = strlen($old_source);
echo "Converting: " . $old_source . " to " . $new_source . " ...";
$query = "UPDATE " . $phpAds_config['tbl_adclicks'] . " SET source=CONCAT('" . $new_source . "',SUBSTRING(source," . ($old_source_len + 1) . ")) WHERE source LIKE '" . $old_source . "%'";
$res = phpAds_dbQuery($query) or phpAds_sqlDie();
$query = "UPDATE " . $phpAds_config['tbl_conversionlog'] . " SET action_source=CONCAT('" . $new_source . "',SUBSTRING(action_source," . ($old_source_len + 1) . ")) WHERE action_source LIKE '" . $old_source . "%'";
$res = phpAds_dbQuery($query) or phpAds_sqlDie();
$query = "UPDATE " . $phpAds_config['tbl_adviews'] . " SET source=CONCAT('" . $new_source . "',SUBSTRING(source," . ($old_source_len + 1) . "))" . " WHERE source='" . $old_source . "%'" . " OR source LIKE '" . $old_source . "/%'";
$res = phpAds_dbQuery($query) or phpAds_sqlDie();
echo "Done.<br>";
}
示例7: phpAds_getSourceStats
function phpAds_getSourceStats($query, $listorder, $orderdirection)
{
$res_stats = phpAds_dbQuery($query) or phpAds_sqlDie();
while ($row_stats = phpAds_dbFetchArray($res_stats)) {
$source = $row_stats['source'];
if (strlen($source) > 0) {
$sources = phpAds_buildSourceArray($sources, $source, '', $row_stats);
}
}
// Sort the array
$ascending = !($orderdirection == 'down' || $orderdirection == '');
phpAds_qsort($sources, $listorder, $ascending);
}
示例8: RaiseErrorHandler
function RaiseErrorHandler($group, $id, $info = NULL)
{
if (function_exists('phpAds_sqlDie')) {
global $phpAds_last_query;
$phpAds_last_query = $info['sql'];
phpAds_sqlDie();
} else {
$oError =& new ErrorInfo();
$oError->group = $group;
$oError->id = $id;
$oError->info = $info;
$errorstr = sprintf('[%s: message="%s" group=%d id=%s]', strtolower(get_class($oError)), implode(', ', $oError->info), $oError->group, $oError->id);
trigger_error($errorstr, E_USER_ERROR);
}
}
示例9: phpAds_DeleteBanner
function phpAds_DeleteBanner($bannerid)
{
global $phpAds_config;
// Cleanup webserver stored image
$res = phpAds_dbQuery("\n\t\tSELECT\n\t\t\tstoragetype, filename\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_banners'] . "\n\t\tWHERE\n\t\t\tbannerid = '{$bannerid}'\n\t") or phpAds_sqlDie();
if ($row = phpAds_dbFetchArray($res)) {
if (($row['storagetype'] == 'web' || $row['storagetype'] == 'sql') && $row['filename'] != '') {
phpAds_ImageDelete($row['storagetype'], $row['filename']);
}
}
// Delete banner
$res = phpAds_dbQuery("\n\t\tDELETE FROM\n\t\t\t" . $phpAds_config['tbl_banners'] . "\n\t\tWHERE\n\t\t\tbannerid = '{$bannerid}'\n\t\t") or phpAds_sqlDie();
// Delete banner ACLs
$res = phpAds_dbQuery("\n\t\tDELETE FROM\n\t\t\t" . $phpAds_config['tbl_acls'] . "\n\t\tWHERE\n\t\t\tbannerid = '{$bannerid}'\n\t\t") or phpAds_sqlDie();
// Delete statistics for this banner
phpAds_deleteStatsByBannerID($bannerid);
}
示例10: phpAds_DeleteCampaign
function phpAds_DeleteCampaign($campaignid)
{
global $phpAds_config;
// Delete Campaign
$res = phpAds_dbQuery("\n\t\tDELETE FROM\n\t\t\t" . $phpAds_config['tbl_clients'] . "\n\t\tWHERE\n\t\t\tclientid = '{$campaignid}'\n\t") or phpAds_sqlDie();
// Loop through each banner
$res_banners = phpAds_dbQuery("\n\t\tSELECT\n\t\t\tbannerid,\n\t\t\tstoragetype,\n\t\t\tfilename\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_banners'] . "\n\t\tWHERE\n\t\t\tclientid = '{$campaignid}'\n\t") or phpAds_sqlDie();
while ($row = phpAds_dbFetchArray($res_banners)) {
// Cleanup stored images for each banner
if (($row['storagetype'] == 'web' || $row['storagetype'] == 'sql') && $row['filename'] != '') {
phpAds_ImageDelete($row['storagetype'], $row['filename']);
}
// Delete Banner ACLs
phpAds_dbQuery("\n\t\t\tDELETE FROM\n\t\t\t\t" . $phpAds_config['tbl_acls'] . "\n\t\t\tWHERE\n\t\t\t\tbannerid = " . $row['bannerid'] . "\n\t\t") or phpAds_sqlDie();
// Delete stats for each banner
phpAds_deleteStats($row['bannerid']);
}
// Delete Banners
phpAds_dbQuery("\n\t\tDELETE FROM\n\t\t\t" . $phpAds_config['tbl_banners'] . "\n\t\tWHERE\n\t\t\tclientid = '{$campaignid}'\n\t") or phpAds_sqlDie();
}
示例11: phpAds_getSources
function phpAds_getSources($name = '', $parent = '')
{
global $phpAds_config;
if (strlen($parent) > 0) {
$n = substr_count($parent, '/') + 2;
$query = "SELECT" . " SUBSTRING_INDEX(SUBSTRING_INDEX(source,'/'," . $n . "),'/',-1) AS source_part" . ",COUNT(*) AS sum_views" . " FROM " . $phpAds_config['tbl_adviews'] . " WHERE source LIKE '" . $parent . "/%'" . " AND t_stamp > DATE_SUB(NOW(), INTERVAL 7 DAY)" . " GROUP BY source_part" . " ORDER BY sum_views DESC";
} else {
$query = "SELECT" . " SUBSTRING_INDEX(source, '/', 1) AS source_part" . ",COUNT(*) AS sum_views" . " FROM " . $phpAds_config['tbl_adviews'] . " WHERE t_stamp > DATE_SUB(NOW(), INTERVAL 7 DAY)" . " GROUP BY source_part" . " ORDER BY sum_views DESC";
}
$source_arr = array();
$res_sources = phpAds_dbQuery($query) or phpAds_sqlDie();
while ($row_sources = phpAds_dbFetchArray($res_sources)) {
$source_arr[] = $row_sources;
//echo "filing source: ".$row_sources['source']."...<br>\n";
//phpAds_buildSourceArrayChildren($source_arr, $row_sources['source']);
}
// Sort the array
//$ascending = !( ($orderdirection == 'down') || ($orderdirection == '') );
//phpAds_sortSources($source_arr, $listorder, $ascending);
return $source_arr;
}
示例12: OX_Translation
if (!empty($duplicate)) {
// Duplicate the campaign
$doCampaigns = OA_Dal::factoryDO('campaigns');
$doCampaigns->get($campaignid);
$oldName = $doCampaigns->campaignname;
$newCampaignId = $doCampaigns->duplicate();
if ($newCampaignId) {
// Queue confirmation message
$newName = $doCampaigns->campaignname;
$translation = new OX_Translation();
$translated_message = $translation->translate($GLOBALS['strCampaignHasBeenDuplicated'], array(MAX::constructURL(MAX_URL_ADMIN, "campaign-edit.php?clientid={$clientid}&campaignid={$campaignid}"), htmlspecialchars($oldName), MAX::constructURL(MAX_URL_ADMIN, "campaign-edit.php?clientid={$clientid}&campaignid={$newCampaignId}"), htmlspecialchars($newName)));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
Header("Location: {$returnurl}?clientid={$clientid}&campaignid={$newCampaignId}");
exit;
} else {
phpAds_sqlDie();
}
} else {
if (!empty($newclientid)) {
/*-------------------------------------------------------*/
/* Restore cache of $node_array, if it exists */
/*-------------------------------------------------------*/
if (isset($session['prefs']['advertiser-index.php']['nodes'])) {
$node_array = $session['prefs']['advertiser-index.php']['nodes'];
}
/*-------------------------------------------------------*/
// Delete any campaign-tracker links
$doCampaign_trackers = OA_Dal::factoryDO('campaigns_trackers');
$doCampaign_trackers->campaignid = $campaignid;
$doCampaign_trackers->delete();
// Move the campaign
示例13: phpAds_deleteStats
// Delete stats for this banner
phpAds_deleteStats($bannerid);
// Return to campaign statistics
Header("Location: stats-campaign-banners.php?clientid=" . $clientid . "&campaignid=" . $campaignid);
} elseif (isset($campaignid) && $campaignid != '') {
// Get all banners for this client
$idresult = phpAds_dbQuery(" SELECT\n\t\t\t\t\t\t\t\tbannerid\n\t\t\t\t\t\t\t FROM\n\t\t\t\t\t\t\t \t" . $phpAds_config['tbl_banners'] . "\n\t\t\t\t\t\t\t WHERE\n\t\t\t\t\t\t\t\tclientid = '{$campaignid}'\n\t\t \t\t\t\t ");
// Loop to all banners for this client
while ($row = phpAds_dbFetchArray($idresult)) {
// Delete stats for the banner
phpAds_deleteStats($row['bannerid']);
}
// Return to campaign statistics
Header("Location: stats-client-campaigns.php?clientid=" . $clientid);
} elseif (isset($clientid) && $clientid != '') {
// Get all banners for this client
$idresult = phpAds_dbQuery("\n\t\tSELECT\n\t\t\tb.bannerid\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_banners'] . " AS b,\n\t\t\t" . $phpAds_config['tbl_clients'] . " AS c\n\t\tWHERE\n\t\t\tc.parent = {$clientid} AND\n\t\t\tc.clientid = b.clientid\n\t");
// Loop to all banners for this client
while ($row = phpAds_dbFetchArray($idresult)) {
// Delete stats for the banner
phpAds_deleteStats($row['bannerid']);
}
// Return to campaign statistics
Header("Location: stats-global-client.php");
} elseif (isset($all) && $all == 'tr' . 'ue') {
phpAds_dbQuery("DELETE FROM " . $phpAds_config['tbl_adviews']) or phpAds_sqlDie();
phpAds_dbQuery("DELETE FROM " . $phpAds_config['tbl_adclicks']) or phpAds_sqlDie();
phpAds_dbQuery("DELETE FROM " . $phpAds_config['tbl_adstats']) or phpAds_sqlDie();
// Return to campaign statistics
Header("Location: stats-global-client.php");
}
示例14: phpAds_registerGlobal
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
// Include required files
require "config.php";
require "lib-statistics.inc.php";
require "../libraries/lib-reports.inc.php";
// Register input variables
phpAds_registerGlobal('startday', 'startmonth', 'startyear', 'endday', 'endmonth', 'endyear');
// Security check
phpAds_checkAccess(phpAds_Admin + phpAds_Agency);
if (phpAds_isUser(phpAds_Agency)) {
$query = "SELECT clientid FROM " . $phpAds_config['tbl_clients'] . " WHERE clientid=" . $clientid . " AND agencyid=" . phpAds_getUserID();
$res = phpAds_dbQuery($query) or phpAds_sqlDie();
if (phpAds_dbNumRows($res) == 0) {
phpAds_PageHeader("2");
phpAds_Die($strAccessDenied, $strNotAdmin);
}
}
/*********************************************************/
/* Main code */
/*********************************************************/
if (isset($clientid) && $clientid != '') {
if (isset($startyear) && isset($startmonth) && isset($startday) && $startyear != '' && $startmonth != '' && $startday != '') {
$first_unixtimestamp = mktime(0, 0, 0, $startmonth, $startday, $startyear);
} else {
$first_unixtimestamp = 0;
}
if (isset($endyear) && isset($endmonth) && isset($endday)) {
示例15: phpAds_getUserID
$query = "SELECT campaignid" . " FROM " . $phpAds_config['tbl_campaigns'] . "," . $phpAds_config['tbl_clients'] . " WHERE clientid=" . $clientid . " AND campaignid=" . $campaignid . " AND agencyid=" . phpAds_getUserID();
$res = phpAds_dbQuery($query) or phpAds_sqlDie();
if (phpAds_dbNumRows($res) == 0) {
phpAds_PageHeader("1");
phpAds_Die($strAccessDenied, $strNotAdmin);
}
}
/*********************************************************/
/* HTML framework */
/*********************************************************/
$bannerids = array();
$idresult = phpAds_dbQuery("\n\tSELECT\n\t\tbannerid\n\tFROM\n\t\t" . $phpAds_config['tbl_banners'] . "\n\tWHERE\n\t\tcampaignid = '{$campaignid}'\n");
while ($row = phpAds_dbFetchArray($idresult)) {
$bannerids[] = "bannerid = " . $row['bannerid'];
}
$res = phpAds_dbQuery("\n\tSELECT\n\t\tDATE_FORMAT(day, '%Y%m%d') as date,\n\t\tDATE_FORMAT(day, '{$date_format}') as date_formatted\n\tFROM\n\t\t" . $phpAds_config['tbl_adstats'] . "\n\tWHERE\n\t\t(" . implode(' OR ', $bannerids) . ")\n\tGROUP BY\n\t\tday\n\tORDER BY\n\t\tday DESC\n\tLIMIT 7\n") or phpAds_sqlDie();
while ($row = phpAds_dbFetchArray($res)) {
phpAds_PageContext($row['date_formatted'], "stats-campaign-daily-hosts.php?day=" . $row['date'] . "&clientid=" . $clientid . "&campaignid=" . $campaignid, $day == $row['date']);
}
if (phpAds_isUser(phpAds_Admin) || phpAds_isUser(phpAds_Agency)) {
phpAds_PageShortcut($strClientProperties, 'advertiser-edit.php?clientid=' . $clientid, 'images/icon-advertiser.gif');
phpAds_PageShortcut($strCampaignProperties, 'campaign-edit.php?clientid=' . $clientid . '&campaignid=' . $campaignid, 'images/icon-campaign.gif');
phpAds_PageHeader("2.1.2.1.2");
echo "<img src='images/icon-advertiser.gif' align='absmiddle'> " . phpAds_getClientName($clientid);
echo " <img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'> ";
echo "<img src='images/icon-campaign.gif' align='absmiddle'> " . phpAds_getCampaignName($campaignid);
echo " <img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'> ";
echo "<img src='images/icon-date.gif' align='absmiddle'> <b>" . date(str_replace('%', '', $date_format), mktime(0, 0, 0, substr($day, 4, 2), substr($day, 6, 2), substr($day, 0, 4))) . "</b><br><br><br>";
phpAds_ShowSections(array("2.1.2.1.1", "2.1.2.1.2"));
}
if (phpAds_isUser(phpAds_Client)) {