
<!--search form start-->

<!--search form end-->

<table class="tblist mt10" border="0" cellspacing="0" cellpadding="2" width="780">
<tr class="header">
    <td class="listresult2" width="15%" nowrap><b><?php echo L_G_TRANSID?></b></td>
    <td class="listresult2" width="15%" nowrap><b><?php echo L_G_CAMOUNT?></b></td>
    <td class="listresult2" width="15%" nowrap><b><?php echo L_G_TOTALCOST?></b></td>
    <td class="listresult2" width="15%" nowrap><b><?php echo L_G_ORDERID?></b></td>
    <td class="listresult2" width="10%" nowrap><b><?php echo L_G_CREATED?></b></td>
    <td class="listresult2" width="10%" nowrap><b><?php echo L_G_TYPE?></b></td>
    <td class="listresult2" width="10%" nowrap><b><?php echo L_G_IP?></b></td>
    <td class="listresult2" width="10%" nowrap><b><?php echo L_G_STATUS?></b></td>
</tr>


    <?php
    $i = 0;
    while($data=$this->a_list_data->getNextRecord()) {
    ?>
        <tr class="listrow<?php echo ($i++)%2?>">
        <td class="listresult2" align="left" nowrap>
            <?php showQuickDetails("index_popup2.php?md=Affiliate_Merchants_Views_TransactionManager&action=transdetails&tid=".$data['transid'], 300);?>
            <?php echo $data['transid']?></td>
        <td class="listresult2<?php echo ($data['commission'] < 0) ? ' minusCost' : ''?>" align=right nowrap><?php echo Affiliate_Merchants_Bl_Settings::showCurrency(_rnd($data['commission']))?></td>
        <td class="listresult2" align=right nowrap><?php echo Affiliate_Merchants_Bl_Settings::showCurrency(_rnd($data['totalcost']))?></td>
        <td class="listresult2" align="right" nowrap><?php echo !empty($data['orderid'])?$data['orderid']:L_G_NONE; ?></td>
        <td class="listresult2" align="left" nowrap><?php echo $data['datecreated']?></td>
        <td class="listresult2" align="center" nowrap>
        <?php
        if($data['transkind'] > TRANSKIND_SECONDTIER)
            echo L_G_SECONDTIER.' ';

        echo $GLOBALS['Auth']->getComposedCommissionTypeString($data['transtype']);
        if ($data['count'] > 1) echo ' * '.$data['count'];
        ?>
        </td>
        <td class="listresult2" align="left">
        <?php if($this->a_geo_allowed && ($data['ip'] != '') && ($this->a_country_info[$data['countrycode']]['countryname'] != '')) {
               echo substr($data['ip'], 0, 5)."&nbsp;&nbsp;<a name=\"row_".$data['transid']."_caption\" id=\"c4\" title=\"more\"
                     href=\"javascript: showInfoRow('c4', 'row_".$data['transid']."', '&nbsp;<b>".L_G_IP."</b> ".$data['ip']." &nbsp;&nbsp;&nbsp;<b>".L_G_COUNTRY.":</b> ".$this->a_country_info[$data['countrycode']]['countryname']."',
                            '<img src=".$this->a_this->getImage('icon_more.gif').">', '<img src=".$this->a_this->getImage('icon_less.gif').">');\"><img src=".$this->a_this->getImage('icon_more.gif')."></a>";
           } else {
               echo !empty($data['ip'])?$data['ip']:L_G_NONE;
        } ?></td>
        <td class="listresult2" nowrap>
        <?php
        if($data['payoutstatus'] == AFFSTATUS_APPROVED)
        {
            echo '<img src="'.$this->a_this->getImage('sphore_active.png').'" title="'.L_G_PAID.'" alt="'.L_G_PAID.'"> '.L_G_PAID;
            $totalPaid += $data['commission'];
        }
        else
        {
            if($data['rstatus'] == AFFSTATUS_NOTAPPROVED) echo '<img src="'.$this->a_this->getImage('sphore_pending.png').'" title="'.L_G_WAITINGAPPROVAL.'" alt="'.L_G_WAITINGAPPROVAL.'"> '.L_G_WAITINGAPPROVAL;
            else if($data['rstatus'] == AFFSTATUS_APPROVED) echo '<img src="'.$this->a_this->getImage('sphore_active.png').'" title="'.L_G_APPROVED.'" alt="'.L_G_APPROVED.'"> '.L_G_APPROVED;
            else if($data['rstatus'] == AFFSTATUS_SUPPRESSED) echo '<img src="'.$this->a_this->getImage('sphore_declined.png').'" title="'.L_G_SUPPRESSED.'" alt="'.L_G_SUPPRESSED.'"> '.L_G_SUPPRESSED;

            if($data['rstatus'] == AFFSTATUS_SUPPRESSED || $data['payoutstatus'] == AFFSTATUS_SUPPRESSED)
            $totalDeclined += $data['commission'];
            else
            $totalWaiting += $data['commission'];
        }
        ?>
        </td>
        </tr>
        <tr id="row_<?php echo $data['transid']?>" style="display: none;" class="listrow<?php echo ($i+1)%2?>">
            <td id="row_<?php echo $data['transid']?>_td" class="listresult2" colspan="11" align="right"></td>
        </tr>
        <?php
    }
    ?>
    <?php if($i == 0) { ?>
        <tr><td class=listresult2 colspan="8">&nbsp;<b><?php echo L_G_NODATA?></b></td></tr>
    <?php } ?>
    <tr>
    <td class=listresult2 nowrap><b><?php echo L_G_SUMMARY?></b></td>
    <td class=listresult2 align=right nowrap><?php echo Affiliate_Merchants_Bl_Settings::showCurrency(_rnd($this->a_summaries['paid']+$this->a_summaries['approved']+$this->a_summaries['pending']+$this->a_summaries['reversed']))?></td>
    <td class=listresult2 align=right nowrap><?php echo Affiliate_Merchants_Bl_Settings::showCurrency(_rnd($this->a_summaries['totalcost']))?></td>
    <td class=listresultBorderRight colspan=8></td>
    </tr>
    <tr>
    <td class=listresult2>&nbsp;<b><?php echo L_G_WAITING?></b></td>
    <td class=listresult2 align=right nowrap><?php echo Affiliate_Merchants_Bl_Settings::showCurrency(_rnd($this->a_summaries['pending']))?></td>
    <td class=listresult2></td>
    <td class=listresultBorderRight colspan=8></td>
    </tr>
    <tr>
    <td class=listresult2>&nbsp;<b><?php echo L_G_APPROVED?></b></td>
    <td class=listresult2 align=right nowrap><?php echo Affiliate_Merchants_Bl_Settings::showCurrency(_rnd($this->a_summaries['approved']))?></td>
    <td class=listresult2></td>
    <td class=listresultBorderRight colspan=8></td>
    </tr>
    <tr>
    <td class=listresult2>&nbsp;<b><?php echo L_G_PAID?></b></td>
    <td class=listresult2 align=right nowrap><?php echo Affiliate_Merchants_Bl_Settings::showCurrency(_rnd($this->a_summaries['paid']))?></td>
    <td class=listresult2></td>
    <td class=listresultBorderRight colspan=8></td>
    </tr>
    <tr>
    <td class=listresult2>&nbsp;<b><?php echo L_G_SUPPRESSED?></b></td>
    <td class=listresult2 align=right nowrap><?php echo Affiliate_Merchants_Bl_Settings::showCurrency(_rnd($this->a_summaries['reversed']))?></td>
    <td class=listresult2></td>
    <td class=listresultBorderRight colspan=8></td>
    </tr>
    <tr><td align="center" colspan="8"><?php QUnit_Templates::printPaging($this->a_list_page, $this->a_list_pages, $this->a_allcount) ?></td></tr>
    </table>
</form>
