function browseUsersAction() { $withWrap = (bool) $this->_request->get('_u_wrap'); unset($_GET['_u_wrap']); $ds = $this->searchUi->getActive()->getQuery(); $grid = new Am_Grid_ReadOnly('_u', ___('Selected for E-Mailing'), $ds, $this->_request, $this->view); if ($withWrap) { $grid->isAjax(false); } $grid->setCountPerPage(10); $grid->addField('login', ___('Username'))->setRenderFunction(array($this, 'renderUserUrl')); $grid->addField('name_f', ___('First Name')); $grid->addField('name_l', ___('Last Name')); $grid->addField('email', ___('E-Mail Address')); $grid->run($this->getResponse()); }
function payoutDetailAction() { $ds = new Am_Query($this->getDi()->affCommissionTable); $ds->leftJoin('?_invoice', 'i', 'i.invoice_id=t.invoice_id'); $ds->leftJoin('?_user', 'u', 'u.user_id=i.user_id'); $ds->leftJoin('?_product', 'p', 't.product_id=p.product_id'); $ds->addField('u.user_id', 'user_id')->addField('CONCAT(u.login, \' (\',u.name_f, \' \',u.name_l,\') [#\', u.user_id, \'] \')', 'user_name')->addField('u.email', 'user_email')->addField('p.title', 'product_title'); $ds->addWhere('t.aff_id=?', $this->user_id); $ds->addWhere('payout_detail_id=?', $this->getParam('payout_detail_id')); $ds->setOrder('commission_id', 'desc'); $grid = new Am_Grid_ReadOnly('_affcomm', ___('Affiliate Commission'), $ds, $this->_request, $this->view); $grid->setPermissionId(Bootstrap_Aff::ADMIN_PERM_ID); $grid->setCountPerPage(10); $userUrl = new Am_View_Helper_UserUrl(); $grid->addField(new Am_Grid_Field_Date('date', ___('Date')))->setFormatDate(); $grid->addField('user_name', ___('User'))->addDecorator(new Am_Grid_Field_Decorator_Link($userUrl->userUrl('{user_id}'), '_top')); $grid->addField('product_title', ___('Product')); $grid->addField('record_type', ___('Type'))->setRenderFunction(array($this, 'renderType')); $fieldAmount = $grid->addField('amount', ___('Commission'))->setRenderFunction(array($this, 'renderCommAmount')); $grid->addField('tier', ___('Tier'))->setRenderFunction(array($this, 'renderTier')); $grid->addCallback(Am_Grid_ReadOnly::CB_TR_ATTRIBS, array($this, 'commCbGetTrAttribs')); $grid->runWithLayout('admin/user-layout.phtml'); }
protected function createDetailGrid($date) { // public $textNoRecordsFound = "No rebills today - most possible cron job was not running."; $q = new Am_Query($this->getDi()->ccRebillTable); $q->addWhere('t.rebill_date=?', $date); $q->leftJoin('?_invoice', 'i', 'i.invoice_id=t.invoice_id'); $q->addField('i.public_id', 'public_id'); $q->addField('i.user_id', 'user_id'); $grid = new Am_Grid_ReadOnly('_r_d', ___('Detailed Rebill Report for %s', amDate($date)), $q, $this->_request, $this->view); $grid->setPermissionId('cc'); $grid->addField(new Am_Grid_Field_Date('tm_added', 'Started', true)); $grid->addField(new Am_Grid_Field('invoice_id', 'Invoice#', true, '', array($this, 'renderInvoiceLink'))); $grid->addField(new Am_Grid_Field_Date('rebill_date', 'Date', true))->setFormatDate(); $grid->addField('status', 'Status', true)->setFormatFunction(array('CcRebill', 'getStatusText')); $grid->addField('status_msg', 'Message'); $grid->setCountPerPage(10); return $grid; }