<?php
    $data = $this->a_data;
    $cashsuffix = ' '.$GLOBALS['Auth']->getSetting('Aff_system_currency');
    $stcommtype = $this->cmp_comdetails['stsalecommtype']=='%'?'%':$cashsuffix;

    for($i=2;$i<11;$i++) {
        $k1 = 'st'.$i.'clickcommission';
        $k2 = 'st'.$i.'salecommission';
        $this->cmp_comdetails[$k1] = empty($this->cmp_comdetails[$k1])?0:$this->cmp_comdetails[$k1];
        $this->cmp_comdetails[$k2] = empty($this->cmp_comdetails[$k2])?0:$this->cmp_comdetails[$k2];
    }
?>
<script type="text/javascript">
    function approveTransactions() {
        document.location.href = "index.php?md=Affiliate_Merchants_Views_TransactionManager&tmdl_status=allpending"+"&<?php echo SID?>";
    }
    function approveURLs() {
        var wnd = window.open("index_popup.php?md=Affiliate_Merchants_Views_ApprovalManager&type=urls"+"&<?php echo SID?>","EditCustomization","scrollbars=1, top=100, left=100, width=550, height=260, status=0")
        wnd.focus();
    }
</script>

<table border="0">
<tr>
    <td align="left" valign="top">

    <?php if((GLOBAL_DB_ENABLED == '1' && ($this->a_news_count>0 || ($this->a_news_count == 0 && $this->a_old_news_exist)))) { ?>
    <table width="450" cellspacing="0" cellpadding=3 border=1>
    <?php QUnit_Templates::printFilter(2, L_G_NEWS_LIST); ?>
    <tr>
        <td class=actionheader align=right colspan="2">&nbsp;
        <a class=mainlink href="index.php?md=Affiliate_Merchants_Views_MerchantProfile&view_old=1"><?php echo L_G_VIEW_OLD?></a>
        </td>
    </tr>
    <?php while($news=$this->a_list_data->getNextRecord()) { ?>
    <tr>
      <td align="left" width="5%" nowrap>&nbsp;<?php echo $news['dateinserted']?>&nbsp;</td>
      <td align="left" nowrap>&nbsp;<a href='index.php?md=Affiliate_Merchants_Views_News&nid=<?php echo $news['messageid']?>&view_old=<?php echo $_REQUEST['view_old']?>'><b><?php echo $news['title']?></b></a>&nbsp;</td>
    </tr>
    <?php } ?>
    <?php if($this->a_news_count < 1) { ?>
    <tr>
      <td align="left" colspan="2" nowrap>&nbsp;<?php echo L_G_NO_AVAILABLE_NEWS?>&nbsp;</td>
    </tr>
    <?php } ?>
    </table>

    <br />
    <?php } ?>

    <?php showLoadedDataDiv("index_cache.php?md=Affiliate_Merchants_Views_MerchantProfile&action=showtransstats", false, true); ?>
    <?php showLoadedDataDiv("index_cache.php?md=Affiliate_Merchants_Views_MerchantProfile&action=showaffstats", false, true); ?>
  </td>
  <td>&nbsp;&nbsp;&nbsp;</td>
  <td align="left" valign="top">

<!-- commistions show -->
<table class="tblist" width="240" border="0" cellspacing="0" cellpadding="2">
  <tr><td class="tableheader2" colspan="3"><a class="right" href="index.php?md=Affiliate_Merchants_Views_CampaignBasicsettings"><?php echo L_G_CHANGE_COMMISSIONPOLICY; ?></a><b><?php echo L_G_COMMISSIONPOLICY; ?></b></td></tr>
  <?php
      if(!$this->cmp_comdetails) {
        echo '<tr><td>'.L_G_NODATA.'</td></tr>';
    } else {
 ?>
    <tr onmouseout="this.className='listresult';" onmouseover="this.className='listresultMouseOver'">
        <td width="20%"><?php echo L_G_TIER; ?></td>
        <td width="40%"><?php echo L_G_TRANSCLICKAPPROVAL; ?></td>
        <td width="40%"><?php echo L_G_TRANSSALEAPPROVAL; ?></td>
    </tr>
    <tr onmouseout="this.className='listresult';" onmouseover="this.className='listresultMouseOver'">
        <td>1</td>
        <td><?php echo $this->cmp_comdetails['clickcommission'].$cashsuffix; ?></td>
        <td><?php echo $this->cmp_comdetails['salecommission'];
            if($this->cmp_comdetails['salecommtype']=='%') {
                echo ' %';
            }else {
                echo $cashsuffix;
            }
        ?></td>
    </tr>
    <tr onmouseout="this.className='listresult';" onmouseover="this.className='listresultMouseOver'">
        <td>2</td>
        <td><?php echo $this->cmp_comdetails['st2clickcommission'].$cashsuffix; ?></td>
        <td><?php echo $this->cmp_comdetails['st2salecommission'].$stcommtype; ?></td>
    </tr>
    <tr onmouseout="this.className='listresult';" onmouseover="this.className='listresultMouseOver'">
        <td>3</td>
        <td><?php echo $this->cmp_comdetails['st3clickcommission'].$cashsuffix; ?></td>
        <td><?php echo $this->cmp_comdetails['st3salecommission'].$stcommtype; ?></td>
    </tr>
    <tr onmouseout="this.className='listresult';" onmouseover="this.className='listresultMouseOver'">
        <td>4</td>
        <td><?php echo $this->cmp_comdetails['st4clickcommission'].$cashsuffix; ?></td>
        <td><?php echo $this->cmp_comdetails['st4salecommission'].$stcommtype; ?></td>
    </tr>
    <tr onmouseout="this.className='listresult';" onmouseover="this.className='listresultMouseOver'">
        <td>5</td>
        <td><?php echo $this->cmp_comdetails['st5clickcommission'].$cashsuffix; ?></td>
        <td><?php echo $this->cmp_comdetails['st5salecommission'].$stcommtype; ?></td>
    </tr>
    <tr onmouseout="this.className='listresult';" onmouseover="this.className='listresultMouseOver'">
        <td>6</td>
        <td><?php echo $this->cmp_comdetails['st6clickcommission'].$cashsuffix; ?></td>
        <td><?php echo $this->cmp_comdetails['st6salecommission'].$stcommtype; ?></td>
    </tr>
    <tr onmouseout="this.className='listresult';" onmouseover="this.className='listresultMouseOver'">
        <td>7</td>
        <td><?php echo $this->cmp_comdetails['st7clickcommission'].$cashsuffix; ?></td>
        <td><?php echo $this->cmp_comdetails['st7salecommission'].$stcommtype; ?></td>
    </tr>
    <tr onmouseout="this.className='listresult';" onmouseover="this.className='listresultMouseOver'">
        <td>8</td>
        <td><?php echo $this->cmp_comdetails['st8clickcommission'].$cashsuffix; ?></td>
        <td><?php echo $this->cmp_comdetails['st8salecommission'].$stcommtype; ?></td>
    </tr>
    <tr onmouseout="this.className='listresult';" onmouseover="this.className='listresultMouseOver'">
        <td>9</td>
        <td><?php echo $this->cmp_comdetails['st9clickcommission'].$cashsuffix; ?></td>
        <td><?php echo $this->cmp_comdetails['st9salecommission'].$stcommtype; ?></td>
    </tr>
    <tr onmouseout="this.className='listresult';" onmouseover="this.className='listresultMouseOver'">
        <td>10</td>
        <td><?php echo $this->cmp_comdetails['st10clickcommission'].$cashsuffix; ?></td>
        <td><?php echo $this->cmp_comdetails['st10salecommission'].$stcommtype; ?></td>
    </tr>
 <?php
    }
  ?>
  </table>


<!-- pzone article -->
<table class="tblist mt10" width="240" border="0" cellspacing="0" cellpadding="2">
  <tr><td class="tableheader2"><b><?php echo L_G_PZONE_PZARTICLES; ?></b></td></tr>
  <?php
    $s = '<tr onmouseout="this.className=\'listresult\';" onmouseover="this.className=\'listresultMouseOver\'"><td><a href="index.php?md=Affiliate_Merchants_Views_PZoneArticles&action=edit&id=%s">[%s] %s</a></td></tr>';
    foreach($this->pza_listdata as $row) {
        echo sprintf($s,$row['ID'],$row['catename'],cut_str($row['title'],6));
    }
  ?>
</table>

<!-- how to start -->
<table style="display:none;" width="240" border="0" cellspacing="0" cellpadding="2">
  <tr><td colspan="2"><h3><?php echo L_G_HOW2START; ?></h3></td></tr>
  <tr>
    <td class="biggerText" align="left" valign="top">
    <table border="0" cellspacing="0" cellpadding="2">
    <tr>
      <td align="right" width="20"><a href="index.php?md=Affiliate_Merchants_Views_SetupWizard"><img src="<?php echo QUnit_UI_TemplatePage::getImage('icon_quote_m_s.gif')?>" border="0"></a></td>
      <td align="left" colspan="2"><a class="textlink" href="index.php?md=Affiliate_Merchants_Views_SetupWizard"><?php echo L_G_QUICKSETTINGS_TITLE; ?></a></td>
    </tr>
    <tr>
      <td></td>
      <td align="left" valign="top"><?php echo L_G_QUICKSETTINGS_DESC; ?></td>
    </tr>
    <tr>
      <td align="right"><a href="index.php?md=home&action=firststeps"><img src="<?php echo QUnit_UI_TemplatePage::getImage('icon_quote_m_s.gif')?>" border="0"></a></td>
      <td align="left" colspan="2"><a class="textlink" href="index.php?md=home&action=firststeps"><?php echo L_G_FIRSTSTEPS; ?></a></td>
    </tr>
    <tr>
      <td></td>
      <td align="left"><?php echo L_G_HOW2START_DESC; ?></td>
    </tr>

    <tr>
      <td colspan="2"></td>
    </tr>
    </table>
    <div align="center">
    </span>
    </td>
  </tr>
</table>
<br/>

<!-- quick links -->
<table style="display:none;" width="240" border="0" cellspacing="0" cellpadding="2">
  <tr><td><h3><?php echo L_G_QUICKLINKS; ?></h3></td></tr>
  <tr><td align="left">
  <table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr>
    <td width="20"></td>
    <td class="biggerText" align="left" valign="top">
    <?php echo L_G_VIEW; ?><a class="textlink" href="index.php?md=home"><?php echo L_G_STATISTICS; ?></a>
    </td>
  </tr>
  <tr>
    <td width="20"></td>
    <td class="biggerText" align="left" valign="top">
    <?php echo L_G_SET; ?><a class="textlink" href="index.php?md=Affiliate_Merchants_Views_CampaignManager"><?php echo L_G_SETCAMP_DESC; ?></a>
    </td>
  </tr>
  <tr>
    <td width="20"></td>
    <td class="biggerText" align="left" valign="top">
    <?php echo L_G_VIEWANDMANAGE; ?><a class="textlink" href="index.php?md=Affiliate_Merchants_Views_AffiliateManager"><?php echo L_G_AFFILIATES; ?></a><?php echo L_G_TEAM; ?>
    </td>
  </tr>
  <tr>
    <td width="20"></td>
    <td class="biggerText" align="left" valign="top">
    <?php echo L_G_VIEWUNAVID; ?><a class="textlink" href="index.php?md=Affiliate_Merchants_Views_TransactionManager&tmdl_status=allpending"><?php echo L_G_TRANSACTIONS; ?></a><?php echo L_G_TRANSACTIONS_FLKDESC; ?>
    </td>
  </tr>
  <tr>
    <td width="20"></td>
    <td class="biggerText" align="left" valign="top">
    <?php echo L_G_EDIT; ?><a class="textlink" href="index.php?md=Affiliate_Merchants_Views_Settings"><?php echo L_G_TRANSACTIONS; ?></a><?php echo L_G_TRANSACTIONS_FLKDESC; ?>
    </td>
  </tr>
  <tr>
    <td width="20"></td>
    <td class="biggerText" align="left" valign="top">
    <?php echo L_G_CREATEOREDIT; ?><a class="textlink" href="index.php?md=Affiliate_Merchants_Views_BannerManager"><?php echo L_G_BANNERS; ?></a>
    </td>
  </tr>
  <tr>
    <td width="20"></td>
    <td class="biggerText" align="left" valign="top">
    <a class="textlink" href="index.php?md=Affiliate_Merchants_Views_AffiliatePayments"><?php echo L_G_ONLINEPAY; ?></a><?php echo L_G_P2AFF; ?></td>
  </tr>
  <tr>
    <td width="20"></td>
    <td class="biggerText" align="left" valign="top">
    <?php echo L_G_VIEW; ?><a class="textlink" target="_blank" href="../index.php"><?php echo L_G_PZONE; ?></a>
    </td>
  </tr>
  <tr>
    <td width="20"></td>
    <td class="biggerText" align="left" valign="top">
    <a class="textlink" href="index.php?md=Affiliate_Merchants_Views_BroadcastMessage"><?php echo L_G_SENDMESSAGE; ?></a><?php echo L_G_TOAFFILIATE; ?>
    </td>
  </tr>
  </table>
  </td>
</tr>
</table>



  </td>
</tr>
</table>
<!-- end tpl:m_profile -->
