<?php echo $this->a_this->fetchTemplate('um_list_js'); ?>

<h3><?php echo L_G_AFFILIATEAPPLICATIONS_TOPMENU; ?></h3>
<p><?php echo L_G_AFFILIATEAPPLICATIONS_DESC;?></p>

<form id="FilterForm" name="FilterForm" action="index.php" method="GET">
<input type="hidden" name="md" value='Affiliate_Merchants_Views_PendingAffiliates' />
<input type="hidden" id="action" name="action" value="" />
<input type="hidden" name="filtered" value="1" />
<input type="hidden" id="sortby" name="sortby" value="<?php echo $_REQUEST['sortby']?>">
<input type="hidden" id="sortorder" name="sortorder" value="<?php echo $_REQUEST['sortorder']?>" />
<input type="hidden" id="list_page" name="list_page" value='<?php echo $_REQUEST['list_page']?>' />

<table class="mt10" cellpadding="0" cellspacing="0" border="0" width="780">
<tr>
    <td>
    <table class="tblist" width="780" cellspacing="0" cellpadding="1">
    <tr class="header">
        <td width="20%"><?php echo L_G_USERNAME; ?></td>
        <td width="20%"><?php echo L_G_NAME; ?></td>
        <td width="20%"><?php echo L_G_PARENT; ?></td>
        <td width="20%"><?php echo L_G_JOINED; ?></td>
        <td width="20%"><?php echo L_G_ACTION; ?></td>
    </tr>
    <?php
    if($this->a_allcount == 0) {
        echo '<tr><td colspan="5">'.L_G_NORECORDSFOUND.'</td></tr>';
    }else {
        $s = '<tr onmouseout="this.className=\'listresult\';" onmouseover="this.className=\'listresultMouseOver\'"><td>%s</td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>';
        while($row = $this->a_list_data->getNextRecord()) {
            echo sprintf($s,
                $row['username'],
                getQuickDetails("index_popup2.php?md=Affiliate_Merchants_Views_AffiliateManager&action=affalldetails&aid=".$row['userid']),
                $row['name'],
                $row['parentuserid'],
                $row['joined'],
                '<a href="javascript:ChangeState(\''.$row['userid'].'\',\'approve\');">'.L_G_APPROVE.'</a> | <a href="javascript:ChangeState(\''.$row['userid'].'\',\'suppress\');">'.L_G_REVERSED.'</a> | <a href="javascript:Delete(\''.$row['userid'].'\');">'.L_G_DELETE.'</a>'
            );
        }
    ?>
    <tr><td colspan="5" align="center"><?php QUnit_Templates::printPaging($this->a_list_page, $this->a_list_pages, $this->a_allcount); ?></td></tr>
    <?php } ?>
    </table>
    </td>
</tr>
</table>

</form>

