本文整理汇总了PHP中Admin_DA::getAgency方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin_DA::getAgency方法的具体用法?PHP Admin_DA::getAgency怎么用?PHP Admin_DA::getAgency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin_DA
的用法示例。
在下文中一共展示了Admin_DA::getAgency方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetAgency
function testGetAgency()
{
TestEnv::startTransaction();
$id = Admin_DA::addAgency(array('name' => 'foo', 'contact' => 'bar', 'username' => 'user', 'email' => 'agent@example.com'));
$ret = Admin_DA::getAgency($id);
// should look like this
/*
Array
(
[agency_id] => 1
[name] => my agency
[contact] => foo bar
[email] => foo@example.com
[username] => Ronald
[password] => Reagan
[permissions] => 33
[language] => chinese
)
*/
$this->assertTrue(is_array($ret));
$this->assertTrue(count($ret));
$this->assertTrue(array_key_exists('agency_id', $ret));
$this->assertTrue(array_key_exists('name', $ret));
$this->assertTrue(array_key_exists('contact', $ret));
$this->assertTrue(array_key_exists('email', $ret));
TestEnv::rollbackTransaction();
}
示例2: MAX_displayChannels
function MAX_displayChannels($channels, $aParams)
{
$entityString = _getEntityString($aParams);
echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
echo "<tr height='25'><td height='25'><b> {$GLOBALS['strName']}</a></b></td>";
echo "<td height='25'><b>{$GLOBALS['strID']}</a></td>";
echo "<td height='25'> </td>";
echo "</tr>";
echo "<tr height='1'><td colspan='3' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
if (empty($channels)) {
echo "<tr height='25' bgcolor='#F6F6F6'><td height='25' colspan='3'>";
echo " {$GLOBALS['strNoChannels']}</td></tr>";
echo "<td colspan='3' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
} else {
$i = 0;
foreach ($channels as $channelId => $channel) {
if ($i > 0) {
echo "<td colspan='3' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td>";
}
echo "<tr height='25' " . ($i % 2 == 0 ? "bgcolor='#F6F6F6'" : "") . ">";
echo "<td height='25'> ";
echo "<img src='" . OX::assetPath() . "/images/icon-channel.gif' align='absmiddle'> ";
// set channel ownership info for display
if ($GLOBALS['pageName'] != 'affiliate-channels.php') {
if (!empty($channel['publisher_id'])) {
$ownerTypeStr = 'Publisher: ';
$publisher = Admin_DA::getPublisher($channel['publisher_id']);
$ownerNameStr = '[id' . $channel['publisher_id'] . '] ' . $publisher['name'];
} else {
if (!empty($channel['agency_id']) && empty($channel['publisher_id']) && !OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
$ownerTypeStr = 'Agency: ';
$agency = Admin_DA::getAgency($channel['agency_id']);
$ownerNameStr = '[id' . $channel['agency_id'] . '] ' . $agency['name'];
} else {
$ownerTypeStr = '';
$ownerNameStr = '';
}
}
}
$ownerStr = !empty($ownerTypeStr) ? '  <i>' . $ownerTypeStr . '</i>' . htmlspecialchars($ownerNameStr) : '';
echo "<a href='channel-edit.php?{$entityString}channelid={$channel['channel_id']}'>" . htmlspecialchars($channel['name'] . $ownerStr) . "</a>";
echo " ";
echo "</td>";
echo "<td height='25'>{$channel['channel_id']}</td>";
echo "<td> </td></tr>";
// Description
echo "<tr height='25' " . ($i % 2 == 0 ? "bgcolor='#F6F6F6'" : "") . ">";
echo "<td> </td>";
echo "<td height='25' colspan='3'>" . htmlspecialchars(stripslashes($channel['description'])) . "</td>";
echo "</tr>";
echo "<tr height='1'>";
echo "<td " . ($i % 2 == 0 ? "bgcolor='#F6F6F6'" : "") . "><img src='" . OX::assetPath() . "/images/spacer.gif' width='1' height='1'></td>";
echo "<td colspan='3' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break-l.gif' height='1' width='100%'></td>";
echo "</tr>";
echo "<tr height='25' " . ($i % 2 == 0 ? "bgcolor='#F6F6F6'" : "") . ">";
// Empty
echo "<td> </td>";
// Buttons
echo "<td height='25' colspan='3'>";
echo "<img src='" . OX::assetPath() . "/images/icon-acl.gif' border='0' align='absmiddle' alt='{$GLOBALS['strIncludedBanners']}'> <a href='channel-acl.php?{$entityString}channelid={$channel['channel_id']}'>{$GLOBALS['strEditChannelLimitations']}</a> ";
echo "<img src='" . OX::assetPath() . "/images/icon-recycle.gif' border='0' align='absmiddle' alt='{$GLOBALS['strDelete']}'> <a href='channel-delete.php?token=" . urlencode(phpAds_SessionGetToken()) . "&{$entityString}channelid={$channel['channel_id']}&returnurl=" . (empty($aParams['affiliateid']) ? 'channel-index.php' : 'affiliate-channels.php') . "'" . phpAds_DelConfirm($GLOBALS['strConfirmDeleteChannel']) . ">{$GLOBALS['strDelete']}</a> ";
echo "</td></tr>";
$i++;
}
if (!empty($channels)) {
echo "<tr height='1'><td colspan='4' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
}
}
echo "</table>";
}