<script type="text/javascript">
function customDynamicLink() {
    var wnd = window.open("index_popup.php?md=Affiliate_Affiliates_Views_AffBannerManager&action=custdynamiclink"+"&<?php echo SID?>","EditBanner","scrollbars=1, top=100, left=100, width=600, height=400, status=0");
    wnd.focus();
}
</script>


<div class="massactions">
    <input type="button" value="<?php echo L_G_ADD_DYNLINK;?>" onclick="javascript:customDynamicLink();" />
    <input type="button" value="<?php echo L_G_MERCHANTS_DYNLINK;?>" onclick="javascript:window.location.href='index.php?md=Affiliate_Affiliates_Views_DynamicLink&action=merchants';" />
</div>

<form id="listform" action="" method="POST">
<table class="tblist mt10" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr class="header"><td colspan="3"><b><?php echo L_G_MYDYNAMICLINKDESC; ?></b></td></tr>
<tr class="header"><th width="5%"><?php echo L_G_DELETE;?></th><th width="15%"><?php echo L_G_REMARK;?></th><th width="78%"><?php echo L_G_DYNAMICLINKHTMLCODE; ?></th></tr>
<?php
$tr = '<tr onmouseout="this.className=\'listresult\';" onmouseover="this.className=\'listresultMouseOver\'" class="detailrow%s"><td><input class="checkbox" type="checkbox" value="%s" name="checkeditems[]" /></td><td>%s</td><td><input class="htmlcode" type="text" value="%s" readonly="readonly" /></td></tr>';
$htmlcode = '<a href="%st.php?a_aid=%s&amp;a_bid=&amp;desturl=%s"><b>%s</b><br/>%s<img src="%ssb.php?a_aid=%s&amp;a_bid=" width="1" height="1" border="0" /></a>';
$scripts_url = urlencode($GLOBALS['Auth']->getSetting('Aff_scripts_url'));
foreach($this->listdata as $key=>$row) {
    $i = $key%2;
    $html = sprintf($htmlcode,
        $scripts_url,
        $GLOBALS['Auth']->userID,
        urlencode($row['target']),
        $row['subject'],
        $row['contentext'],
        $scripts_url,
        $GLOBALS['Auth']->userID
    );
    echo sprintf($tr,$i,$row['dlid'],$row['remark'],htmlspecialchars($html));
}
?>
<tr class="header"><td colspan="3">
<a id="selectall" href="javascript:;"><?php echo L_G_SELALL;?></a> /
<a id="unselectall" href="javascript:;"><?php echo L_G_SELNONE;?></a> /
<a id="antiselect" href="javascript:;"><?php echo L_G_ANISEL;?></a>
<a id="delete" href="javascript:;"><?php echo L_G_DELSEL;?></a>
<input type="hidden" value="yes" name="commited" />
<input type="hidden" value="delete" name="action" />
</td></tr>
</table></form>
