$navorder = $Session['prefs']['client-campaigns.php'][$clientid]['listorder'];
 } else {
     $navorder = '';
 }
 if (isset($Session['prefs']['client-campaigns.php'][$clientid]['orderdirection'])) {
     $navdirection = $Session['prefs']['client-campaigns.php'][$clientid]['orderdirection'];
 } else {
     $navdirection = '';
 }
 // Get other campaigns
 $res = phpAds_dbQuery("\n\t\tSELECT\n\t\t\t*\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_clients'] . "\n\t\tWHERE\n\t\t\tparent = " . $clientid . "\n\t\t" . phpAds_getListOrder($navorder, $navdirection) . "\n\t");
 while ($row = phpAds_dbFetchArray($res)) {
     phpAds_PageContext(phpAds_buildClientName($row['clientid'], $row['clientname']), "campaign-edit.php?clientid=" . $clientid . "&campaignid=" . $row['clientid'], $campaignid == $row['clientid']);
 }
 phpAds_PageShortcut($strClientProperties, 'client-edit.php?clientid=' . $clientid, 'images/icon-client.gif');
 phpAds_PageShortcut($strCampaignHistory, 'stats-campaign-history.php?clientid=' . $clientid . '&campaignid=' . $campaignid, 'images/icon-statistics.gif');
 $extra = "<form action='campaign-modify.php'>";
 $extra .= "<input type='hidden' name='campaignid' value='{$campaignid}'>";
 $extra .= "<input type='hidden' name='clientid' value='{$clientid}'>";
 $extra .= "<input type='hidden' name='returnurl' value='campaign-edit.php'>";
 $extra .= "<br><br>";
 $extra .= "<b>{$strModifyCampaign}</b><br>";
 $extra .= "<img src='images/break.gif' height='1' width='160' vspace='4'><br>";
 $extra .= "<img src='images/icon-move-campaign.gif' align='absmiddle'>&nbsp;{$strMoveTo}<br>";
 $extra .= "<img src='images/spacer.gif' height='1' width='160' vspace='2'><br>";
 $extra .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
 $extra .= "<select name='moveto' style='width: 110px'>";
 $res = phpAds_dbQuery("SELECT * FROM " . $phpAds_config['tbl_clients'] . " WHERE parent = 0 AND clientid != " . phpAds_getParentID($campaignid)) or phpAds_sqlDie();
 while ($row = phpAds_dbFetchArray($res)) {
     $extra .= "<option value='" . $row['clientid'] . "'>" . phpAds_buildClientName($row['clientid'], $row['clientname']) . "</option>";
 }
}
/*********************************************************/
/* HTML framework                                        */
/*********************************************************/
if (phpAds_isUser(phpAds_Admin)) {
    if ($phpAds_config['compact_stats']) {
        $res = phpAds_dbQuery("\n\t\t\tSELECT\n\t\t\t\tDISTINCT bannerid\n\t\t\tFROM\n\t\t\t\t" . $phpAds_config['tbl_adstats'] . "\n\t\t\tWHERE\n\t\t\t\tzoneid = '" . $zoneid . "'\n\t\t") or phpAds_sqlDie();
    } else {
        $res = phpAds_dbQuery("\n\t\t\tSELECT\n\t\t\t\tDISTINCT bannerid\n\t\t\tFROM\n\t\t\t\t" . $phpAds_config['tbl_adviews'] . "\n\t\t\tWHERE\n\t\t\t\tzoneid = '" . $zoneid . "'\n\t\t") or phpAds_sqlDie();
    }
    while ($row = phpAds_dbFetchArray($res)) {
        phpAds_PageContext(phpAds_getBannerName($row['bannerid']), "stats-linkedbanner-history.php?affiliateid=" . $affiliateid . "&zoneid=" . $zoneid . "&bannerid=" . $row['bannerid'], $bannerid == $row['bannerid']);
    }
    phpAds_PageShortcut($strAffiliateProperties, 'affiliate-edit.php?affiliateid=' . $affiliateid, 'images/icon-affiliate.gif');
    phpAds_PageShortcut($strZoneProperties, 'zone-edit.php?affiliateid=' . $affiliateid . '&zoneid=' . $zoneid, 'images/icon-zone.gif');
    phpAds_PageShortcut($strIncludedBanners, 'zone-include.php?affiliateid=' . $affiliateid . '&zoneid=' . $zoneid, 'images/icon-zone-linked.gif');
    phpAds_PageHeader("2.4.2.2.1");
    echo "<img src='images/icon-affiliate.gif' align='absmiddle'>&nbsp;" . phpAds_getAffiliateName($affiliateid);
    echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
    echo "<img src='images/icon-zone.gif' align='absmiddle'>&nbsp;" . phpAds_getZoneName($zoneid);
    echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
    echo "<img src='images/icon-zone-linked.gif' align='absmiddle'>&nbsp;<b>" . phpAds_getBannerName($bannerid) . "</b><br><br><br>";
    phpAds_ShowSections(array("2.4.2.2.1"));
} else {
    phpAds_PageHeader("1.1.2.1");
    echo "<img src='images/icon-zone.gif' align='absmiddle'>&nbsp;" . phpAds_getZoneName($zoneid);
    echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
    echo "<img src='images/icon-zone-linked.gif' align='absmiddle'>&nbsp;<b>" . phpAds_getBannerName($bannerid) . "</b><br><br><br>";
    phpAds_ShowSections(array("1.1.2.1"));
}
/*********************************************************/
}
/*********************************************************/
/* 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'>&nbsp;" . phpAds_getClientName($clientid);
    echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
    echo "<img src='images/icon-campaign.gif' align='absmiddle'>&nbsp;" . phpAds_getCampaignName($campaignid);
    echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
    echo "<img src='images/icon-date.gif' align='absmiddle'>&nbsp;<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)) {
    phpAds_PageHeader("1.1.2");
    echo "<img src='images/icon-campaign.gif' align='absmiddle'>&nbsp;" . phpAds_getCampaignName($campaignid);
    echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
    echo "<img src='images/icon-date.gif' align='absmiddle'>&nbsp;<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>";
    phpAds_ShowSections(array("1.2.1.1", "1.2.1.2"));
}
} else {
    $navorder = '';
}
if (isset($Session['prefs']['stats-campaign-banners.php']['orderdirection'])) {
    $navdirection = $Session['prefs']['stats-campaign-banners.php']['orderdirection'];
} else {
    $navdirection = '';
}
$res = phpAds_dbQuery("\n\tSELECT\n\t\t*\n\tFROM\n\t\t" . $phpAds_config['tbl_banners'] . "\n\tWHERE\n\t\tclientid = '{$campaignid}'\n\t" . phpAds_getBannerListOrder($navorder, $navdirection) . "\n") or phpAds_sqlDie();
while ($row = phpAds_dbFetchArray($res)) {
    phpAds_PageContext(phpAds_buildBannerName($row['bannerid'], $row['description'], $row['alt']), "stats-banner-affiliates.php?clientid=" . $clientid . "&campaignid=" . $campaignid . "&bannerid=" . $row['bannerid'], $bannerid == $row['bannerid']);
}
phpAds_PageShortcut($strClientProperties, 'client-edit.php?clientid=' . $clientid, 'images/icon-client.gif');
phpAds_PageShortcut($strCampaignProperties, 'campaign-edit.php?clientid=' . $clientid . '&campaignid=' . $campaignid, 'images/icon-campaign.gif');
phpAds_PageShortcut($strBannerProperties, 'banner-edit.php?clientid=' . $clientid . '&campaignid=' . $campaignid . '&bannerid=' . $bannerid, 'images/icon-banner-stored.gif');
phpAds_PageShortcut($strModifyBannerAcl, 'banner-acl.php?clientid=' . $clientid . '&campaignid=' . $campaignid . '&bannerid=' . $bannerid, 'images/icon-acl.gif');
phpAds_PageHeader("2.1.2.2.2");
echo "<img src='images/icon-client.gif' align='absmiddle'>&nbsp;" . phpAds_getParentName($campaignid);
echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
echo "<img src='images/icon-campaign.gif' align='absmiddle'>&nbsp;" . phpAds_getClientName($campaignid);
echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
echo "<img src='images/icon-banner-stored.gif' align='absmiddle'>&nbsp;<b>" . phpAds_getBannerName($bannerid) . "</b><br><br>";
echo phpAds_buildBannerCode($bannerid) . "<br><br><br><br>";
phpAds_ShowSections(array("2.1.2.2.1", "2.1.2.2.2"));
/*********************************************************/
/* Main code                                             */
/*********************************************************/
$manual['clicks'] = 0;
$manual['views'] = 0;
// Get affiliates and build the tree
$res_affiliates = phpAds_dbQuery("\n\tSELECT \n\t\taffiliateid, name\n\tFROM \n\t\t" . $phpAds_config['tbl_affiliates'] . "\n\t" . phpAds_getAffiliateListOrder($listorder, $orderdirection) . "\n\t") or phpAds_sqlDie();
    }
}
if (!isset($orderdirection)) {
    if (isset($Session['prefs']['tracker-campaigns.php']['orderdirection'])) {
        $orderdirection = $Session['prefs']['tracker-campaigns.php']['orderdirection'];
    } else {
        $orderdirection = '';
    }
}
// Get other trackers
$res = phpAds_dbQuery("SELECT *" . " FROM " . $phpAds_config['tbl_trackers'] . " WHERE clientid=" . $clientid . phpAds_getTrackerListOrder($navorder, $navdirection));
while ($row = phpAds_dbFetchArray($res)) {
    phpAds_PageContext(phpAds_buildName($row['trackerid'], $row['trackername']), "tracker-campaigns.php?clientid=" . $clientid . "&trackerid=" . $row['trackerid'], $trackerid == $row['trackerid']);
}
if (phpAds_isUser(phpAds_Admin) || phpAds_isUser(phpAds_Agency)) {
    phpAds_PageShortcut($strClientProperties, 'advertiser-edit.php?clientid=' . $clientid, 'images/icon-advertiser.gif');
    //phpAds_PageShortcut($strTrackerHistory, 'stats-tracker-history.php?clientid='.$clientid.'&trackerid='.$trackerid, 'images/icon-statistics.gif');
    $extra = "\t\t\t\t<form action='tracker-modify.php'>" . "\n";
    $extra .= "\t\t\t\t<input type='hidden' name='trackerid' value='{$trackerid}'>" . "\n";
    $extra .= "\t\t\t\t<input type='hidden' name='clientid' value='{$clientid}'>" . "\n";
    $extra .= "\t\t\t\t<input type='hidden' name='returnurl' value='tracker-campaigns.php'>" . "\n";
    $extra .= "\t\t\t\t<br><br>" . "\n";
    $extra .= "\t\t\t\t<b>{$strModifyTracker}</b><br>" . "\n";
    $extra .= "\t\t\t\t<img src='images/break.gif' height='1' width='160' vspace='4'><br>" . "\n";
    $extra .= "\t\t\t\t<img src='images/icon-duplicate-tracker.gif' align='absmiddle'>&nbsp;<a href='tracker-modify.php?clientid=" . $clientid . "&trackerid=" . $trackerid . "&duplicate=true&returnurl=tracker-campaigns.php'>{$strDuplicate}</a><br>" . "\n";
    $extra .= "\t\t\t\t<img src='images/break.gif' height='1' width='160' vspace='4'><br>" . "\n";
    $extra .= "\t\t\t\t<img src='images/icon-move-tracker.gif' align='absmiddle'>&nbsp;{$strMoveTo}<br>" . "\n";
    $extra .= "\t\t\t\t<img src='images/spacer.gif' height='1' width='160' vspace='2'><br>" . "\n";
    $extra .= "\t\t\t\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . "\n";
    $extra .= "\t\t\t\t<select name='moveto' style='width: 110;'>" . "\n";
    if (phpAds_isUser(phpAds_Admin)) {
Example #6
0
} else {
    $navorder = '';
}
if (isset($Session['prefs']['campaign-banners.php'][$campaignid]['orderdirection'])) {
    $navdirection = $Session['prefs']['campaign-banners.php'][$campaignid]['orderdirection'];
} else {
    $navdirection = '';
}
// Get other banners
$res = phpAds_dbQuery("\n\tSELECT\n\t\t*\n\tFROM\n\t\t" . $phpAds_config['tbl_banners'] . "\n\tWHERE\n\t\tcampaignid = '{$campaignid}'\n\t" . phpAds_getBannerListOrder($navorder, $navdirection) . "\n");
while ($row = phpAds_dbFetchArray($res)) {
    phpAds_PageContext(phpAds_buildBannerName($row['bannerid'], $row['description'], $row['alt']), "banner-acl.php?clientid=" . $clientid . "&campaignid=" . $campaignid . "&bannerid=" . $row['bannerid'], $bannerid == $row['bannerid']);
}
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_PageShortcut($strBannerHistory, 'stats-banner-history.php?clientid=' . $clientid . '&campaignid=' . $campaignid . '&bannerid=' . $bannerid, 'images/icon-statistics.gif');
$extra = "<form action='banner-modify.php'>";
$extra .= "<input type='hidden' name='clientid' value='{$clientid}'>";
$extra .= "<input type='hidden' name='campaignid' value='{$campaignid}'>";
$extra .= "<input type='hidden' name='bannerid' value='{$bannerid}'>";
$extra .= "<input type='hidden' name='returnurl' value='banner-acl.php'>";
$extra .= "<br><br>";
$extra .= "<b>{$strModifyBanner}</b><br>";
$extra .= "<img src='images/break.gif' height='1' width='160' vspace='4'><br>";
$extra .= "<img src='images/icon-duplicate-banner.gif' align='absmiddle'>&nbsp;<a href='banner-modify.php?clientid=" . $clientid . "&campaignid=" . $campaignid . "&bannerid=" . $bannerid . "&duplicate=true&returnurl=banner-acl.php'>{$strDuplicate}</a><br>";
$extra .= "<img src='images/break.gif' height='1' width='160' vspace='4'><br>";
$extra .= "<img src='images/icon-move-banner.gif' align='absmiddle'>&nbsp;{$strMoveTo}<br>";
$extra .= "<img src='images/spacer.gif' height='1' width='160' vspace='2'><br>";
$extra .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
$extra .= "<select name='moveto' style='width: 110;'>";
if (phpAds_isUser(phpAds_Admin)) {
if (phpAds_isUser(phpAds_Admin)) {
    if (isset($Session['prefs']['stats-global-client.php']['listorder'])) {
        $navorder = $Session['prefs']['stats-global-client.php']['listorder'];
    } else {
        $navorder = '';
    }
    if (isset($Session['prefs']['stats-global-client.php']['orderdirection'])) {
        $navdirection = $Session['prefs']['stats-global-client.php']['orderdirection'];
    } else {
        $navdirection = '';
    }
    $res = phpAds_dbQuery("\n\t\tSELECT\n\t\t\t*\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_clients'] . "\n\t\tWHERE\n\t\t\tparent = 0\n\t\t" . phpAds_getListOrder($navorder, $navdirection) . "\n\t") or phpAds_sqlDie();
    while ($row = phpAds_dbFetchArray($res)) {
        phpAds_PageContext(phpAds_buildClientName($row['clientid'], $row['clientname']), "stats-client-history.php?clientid=" . $row['clientid'], $clientid == $row['clientid']);
    }
    phpAds_PageShortcut($strClientProperties, 'client-edit.php?clientid=' . $clientid, 'images/icon-client.gif');
    $extra = "<br><br><br>";
    $extra .= "<b>{$strMaintenance}</b><br>";
    $extra .= "<img src='images/break.gif' height='1' width='160' vspace='4'><br>";
    $extra .= "<a href='stats-reset.php?clientid={$clientid}'" . phpAds_DelConfirm($strConfirmResetClientStats) . ">";
    $extra .= "<img src='images/" . $phpAds_TextDirection . "/icon-undo.gif' align='absmiddle' border='0'>&nbsp;{$strResetStats}</a>";
    $extra .= "<br><br>";
    phpAds_PageHeader("2.1.1", $extra);
    echo "<img src='images/icon-client.gif' align='absmiddle'>&nbsp;<b>" . phpAds_getClientName($clientid) . "</b><br><br><br>";
    phpAds_ShowSections(array("2.1.1", "2.1.2"));
}
if (phpAds_isUser(phpAds_Client)) {
    phpAds_PageHeader("1.1");
    if ($phpAds_config['client_welcome']) {
        echo "<br><br>";
        // Show welcome message
    if (isset($Session['prefs']['affiliate-index.php']['listorder'])) {
        $navorder = $Session['prefs']['affiliate-index.php']['listorder'];
    } else {
        $navorder = '';
    }
    if (isset($Session['prefs']['affiliate-index.php']['orderdirection'])) {
        $navdirection = $Session['prefs']['affiliate-index.php']['orderdirection'];
    } else {
        $navdirection = '';
    }
    // Get other affiliates
    $res = phpAds_dbQuery("\n\t\tSELECT\n\t\t\t*\n\t\tFROM\n\t\t\t" . $phpAds_config['tbl_affiliates'] . "\n\t\t" . phpAds_getAffiliateListOrder($navorder, $navdirection) . "\n\t") or phpAds_sqlDie();
    while ($row = phpAds_dbFetchArray($res)) {
        phpAds_PageContext(phpAds_buildAffiliateName($row['affiliateid'], $row['name']), "affiliate-zones.php?affiliateid=" . $row['affiliateid'], $affiliateid == $row['affiliateid']);
    }
    phpAds_PageShortcut($strAffiliateHistory, 'stats-affiliate-history.php?affiliateid=' . $affiliateid, 'images/icon-statistics.gif');
    phpAds_PageHeader("4.2.3");
    echo "<img src='images/icon-affiliate.gif' align='absmiddle'>&nbsp;<b>" . phpAds_getAffiliateName($affiliateid) . "</b><br><br><br>";
    phpAds_ShowSections(array("4.2.2", "4.2.3"));
} else {
    $sections[] = "2.1";
    if (phpAds_isAllowed(phpAds_ModifyInfo)) {
        $sections[] = "2.2";
    }
    phpAds_PageHeader("2.1");
    echo "<img src='images/icon-affiliate.gif' align='absmiddle'>&nbsp;<b>" . phpAds_getAffiliateName($affiliateid) . "</b><br><br><br>";
    phpAds_ShowSections($sections);
}
/*********************************************************/
/* Main code                                             */
/*********************************************************/
    }
}
/*********************************************************/
/* HTML framework                                        */
/*********************************************************/
$zoneids = array();
$idresult = phpAds_dbQuery("\n\tSELECT\n\t\tzoneid\n\tFROM\n\t\t" . $phpAds_config['tbl_zones'] . "\n\tWHERE\n\t\taffiliateid = '{$affiliateid}'\n");
while ($row = phpAds_dbFetchArray($idresult)) {
    $zoneids[] = "zoneid = " . $row['zoneid'];
}
$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 ', $zoneids) . ")\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-affiliate-daily-hosts.php?day=" . $row['date'] . "&affiliateid=" . $affiliateid, $day == $row['date']);
}
if (phpAds_isUser(phpAds_Admin)) {
    phpAds_PageShortcut($strAffiliateProperties, 'affiliate-edit.php?affiliateid=' . $affiliateid, 'images/icon-affiliate.gif');
    phpAds_PageHeader("2.4.1.2");
    echo "<img src='images/icon-affiliate.gif' align='absmiddle'>&nbsp;" . phpAds_getAffiliateName($affiliateid);
    echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
    echo "<img src='images/icon-date.gif' align='absmiddle'>&nbsp;<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.4.1.1", "2.4.1.2"));
}
if (phpAds_isUser(phpAds_Affiliate)) {
    phpAds_PageHeader("1.2.2");
    echo "<img src='images/icon-date.gif' align='absmiddle'>&nbsp;<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>";
    phpAds_ShowSections(array("1.2.1", "1.2.2"));
}
/*********************************************************/
/* Main code                                             */
/*********************************************************/
$lib_hourly_where = "(" . implode(' OR ', $zoneids) . ")";
} else {
    $navorder = '';
}
if (isset($Session['prefs']['affiliate-zones.php']['orderdirection'])) {
    $navdirection = $Session['prefs']['affiliate-zones.php']['orderdirection'];
} else {
    $navdirection = '';
}
// Get other zones
$res = phpAds_dbQuery("\n\tSELECT\n\t\t*\n\tFROM\n\t\t" . $phpAds_config['tbl_zones'] . "\n\tWHERE\n\t\taffiliateid=" . $affiliateid . "\n\t\t" . phpAds_getZoneListOrder($navorder, $navdirection) . "\n");
while ($row = phpAds_dbFetchArray($res)) {
    phpAds_PageContext(phpAds_buildZoneName($row['zoneid'], $row['zonename']), "zone-advanced.php?affiliateid=" . $affiliateid . "&zoneid=" . $row['zoneid'], $zoneid == $row['zoneid']);
}
if (phpAds_isUser(phpAds_Admin) || phpAds_isUser(phpAds_Agency)) {
    phpAds_PageShortcut($strAffiliateProperties, 'affiliate-edit.php?affiliateid=' . $affiliateid, 'images/icon-affiliate.gif');
    phpAds_PageShortcut($strZoneHistory, 'stats-zone-history.php?affiliateid=' . $affiliateid . '&zoneid=' . $zoneid, 'images/icon-statistics.gif');
    $extra = "<form action='zone-modify.php'>";
    $extra .= "<input type='hidden' name='zoneid' value='{$zoneid}'>";
    $extra .= "<input type='hidden' name='returnurl' value='zone-advanced.php'>";
    $extra .= "<br><br>";
    $extra .= "<b>{$strModifyZone}</b><br>";
    $extra .= "<img src='images/break.gif' height='1' width='160' vspace='4'><br>";
    $extra .= "<img src='images/icon-duplicate-zone.gif' align='absmiddle'>&nbsp;<a href='zone-modify.php?affiliateid=" . $affiliateid . "&zoneid=" . $zoneid . "&duplicate=true&returnurl=zone-advanced.php'>{$strDuplicate}</a><br>";
    $extra .= "<img src='images/break.gif' height='1' width='160' vspace='4'><br>";
    $extra .= "<img src='images/icon-move-zone.gif' align='absmiddle'>&nbsp;{$strMoveTo}<br>";
    $extra .= "<img src='images/spacer.gif' height='1' width='160' vspace='2'><br>";
    $extra .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    $extra .= "<select name='moveto' style='width: 110;'>";
    if (phpAds_isUser(phpAds_Admin)) {
        $query = "SELECT affiliateid,name" . " FROM " . $phpAds_config['tbl_affiliates'] . " WHERE affiliateid != " . $affiliateid;
    } elseif (phpAds_isUser(phpAds_Agency)) {
    if (isset($Session['prefs']['advertiser-index.php']['orderdirection'])) {
        $navdirection = $Session['prefs']['advertiser-index.php']['orderdirection'];
    } else {
        $navdirection = '';
    }
    // Get other advertisers
    if (phpAds_isUser(phpAds_Admin)) {
        $query = "SELECT * FROM " . $phpAds_config['tbl_clients'] . phpAds_getClientListOrder($navorder, $navdirection);
    } elseif (phpAds_isUser(phpAds_Agency)) {
        $query = "SELECT * FROM " . $phpAds_config['tbl_clients'] . " WHERE agencyid=" . $Session['userid'] . phpAds_getClientListOrder($navorder, $navdirection);
    }
    $res = phpAds_dbQuery($query) or phpAds_sqlDie();
    while ($row = phpAds_dbFetchArray($res)) {
        phpAds_PageContext(phpAds_buildName($row['clientid'], $row['clientname']), "advertiser-trackers.php?clientid=" . $row['clientid'], $clientid == $row['clientid']);
    }
    phpAds_PageShortcut($strClientHistory, 'stats-advertiser-history.php?clientid=' . $clientid, 'images/icon-statistics.gif');
    phpAds_PageHeader("4.1.4");
    echo "\t\t\t\t<img src='images/icon-advertiser.gif' align='absmiddle'>&nbsp;\n";
    echo "\t\t\t\t<b>" . phpAds_getClientName($clientid) . "</b>\n";
    echo "\t\t\t\t<br><br><br>\n";
    phpAds_ShowSections(array("4.1.2", "4.1.3", "4.1.4"));
}
/*********************************************************/
/* Main code                                             */
/*********************************************************/
// Get clients & campaign and build the tree
$res_trackers = phpAds_dbQuery("SELECT *" . " FROM " . $phpAds_config['tbl_trackers'] . " WHERE clientid=" . $clientid . phpAds_getTrackerListOrder($listorder, $orderdirection)) or phpAds_sqlDie();
if (phpAds_isUser(phpAds_Admin) || phpAds_isUser(phpAds_Agency) || phpAds_isAllowed(phpAds_AddTracker)) {
    echo "\t\t\t\t<img src='images/icon-tracker-new.gif' border='0' align='absmiddle'>\n";
    echo "\t\t\t\t<a href='tracker-edit.php?clientid=" . $clientid . "' accesskey='" . $keyAddNew . "'>" . $strAddTracker_Key . "</a>&nbsp;&nbsp;\n";
    phpAds_ShowBreak();
Example #12
0
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
if ($bannerid != '') {
    // Get other banners
    $doBanners = OA_Dal::factoryDO('banners');
    $doBanners->campaignid = $campaignid;
    $doBanners->addSessionListOrderBy('campaign-banners.php');
    $doBanners->find();
    while ($doBanners->fetch() && ($row = $doBanners->toArray())) {
        phpAds_PageContext(phpAds_buildBannerName($row['bannerid'], $row['description'], $row['alt']), "banner-edit.php?clientid=" . $clientid . "&campaignid=" . $campaignid . "&bannerid=" . $row['bannerid'], $bannerid == $row['bannerid']);
    }
    if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
        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_PageShortcut($strBannerHistory, 'stats.php?entity=banner&breakdown=history&clientid=' . $clientid . '&campaignid=' . $campaignid . '&bannerid=' . $bannerid, 'images/icon-statistics.gif');
        phpAds_PageHeader("4.1.3.4.5");
        echo "<img src='" . OX::assetPath() . "/images/icon-advertiser.gif' align='absmiddle'>&nbsp;" . phpAds_getParentClientName($campaignid);
        echo "&nbsp;<img src='" . OX::assetPath() . "/images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
        echo "<img src='" . OX::assetPath() . "/images/icon-campaign.gif' align='absmiddle'>&nbsp;" . phpAds_getCampaignName($campaignid);
        echo "&nbsp;<img src='" . OX::assetPath() . "/images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
        echo "<img src='" . OX::assetPath() . "/images/icon-banner-stored.gif' align='absmiddle'>&nbsp;<b>" . phpAds_getBannerName($bannerid) . "</b><br /><br />";
        phpAds_ShowSections(array("4.1.3.4.5"));
    } else {
        phpAds_PageHeader("1.2.2.3");
        echo "<img src='" . OX::assetPath() . "/images/icon-campaign.gif' align='absmiddle'>&nbsp;" . phpAds_getCampaignName($campaignid);
        echo "&nbsp;<img src='" . OX::assetPath() . "/images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
        echo "<img src='" . OX::assetPath() . "/images/icon-banner-stored.gif' align='absmiddle'>&nbsp;<b>" . phpAds_getBannerName($bannerid) . "</b><br /><br />";
        phpAds_ShowSections(array("1.2.2.3"));
    }
    $doBanners = OA_Dal::factoryDO('banners');