<?php
QUnit_Global::includeClass('Affiliate_Merchants_Views_AffiliateManager');

class Affiliate_Merchants_Views_PendingAffiliates extends Affiliate_Merchants_Views_AffiliateManager {

    function Affiliate_Merchants_Views_PendingAffiliates() {
        $_REQUEST['fromprofile'] = 1;
        $_REQUEST['umprof_status'] = 1; //过滤待批状态
        parent::Affiliate_Merchants_Views_AffiliateManager();
        $this->navigationRemoveURL(L_G_TOPMENU_AFFILIATES);
        $this->navigationAddURL(L_G_AFFILIATEAPPLICATIONS_TOPMENU,'index.php?md=Affiliate_Merchants_Views_PendingAffiliates');
    }

    //--------------------------------------------------------------------------

	function showUsers($exportToCsv=false) {
		$temp_perm['add'] = $this->checkPermissions('add');
		$temp_perm['view'] = $this->checkPermissions('view');

		$this->assign('a_action_permission', $temp_perm);

		$this->initViews();

		$this->createWhereOrderBy($orderby, $where);

		$objSaleStatistics =& QUnit_Global::newObj('Affiliate_Scripts_Bl_SaleStatistics');
		$view =& $this->getView();

		if ($view->isColumnUsed('paid') || $view->isColumnUsed('pending') ||
		    $view->isColumnUsed('approved') || $view->isColumnUsed('reversed')) {
		      $transdata = $objSaleStatistics->getTransactionsSummariesForAffiliateManager();
		}

		if ($view->isColumnUsed('payoptid')) {
		    $userInfo = $this->blSettings->getAccountUsersSettings($GLOBALS['Auth']->getAccountID(USERTYPE_USER));
		}

		$UserData = $this->getRecords($orderby, $where, $transdata, $userInfo);



		$list_data = QUnit_Global::newobj('QCore_RecordSet');
		$list_data->setTemplateRS($UserData);
		$this->assign('a_list_data', $list_data);

		$this->pageLimitsAssign();


		$this->assign('a_filterColumns', $this->getAvailableFilterColumns());

		$this->addContent('um_list_pending');
	}

    //--------------------------------------------------------------------------

}

?>