Exemplo n.º 1
0
 public function _prepareLayout()
 {
     parent::_prepareLayout();
     // $pager = $this->getLayout()->createBlock('page/html_pager', 'sales_pager')->setCollection($this->getCollection());
     // $this->setChild('sales_pager', $pager);
     $grid = $this->getLayout()->createBlock('affiliateplusstatistic/frontend_report_grid', 'sales_grid');
     $grid->setTemplate('affiliateplusstatistic/report/grid.phtml');
     // prepare column
     $totals = $this->getTotals();
     $grid->addColumn('created_time', array('header' => $this->__('Period'), 'index' => 'created_time', 'width' => 100, 'sortable' => false, 'render' => 'getMonth', 'total_label' => Mage::helper('adminhtml')->__('Total'), 'align' => 'left'));
     /*$this->addColumn('period', array(
           'header'        => Mage::helper('sales')->__('Period'),
           'index'         => 'period',
           'width'         => 100,
           'sortable'      => false,
           'period_type'   => $this->getPeriodType(),
           'renderer'      => 'adminhtml/report_sales_grid_column_renderer_date',
           'totals_label'  => Mage::helper('sales')->__('Total'),
           'html_decorators' => array('nobr'),
       ));*/
     $grid->addColumn('order_item_names', array('header' => $this->__('Products Name'), 'index' => 'order_item_names', 'align' => 'left', 'render' => 'getFrontendProductHtmls'));
     $grid->addColumn('total_amount', array('header' => $this->__('Total Amount'), 'align' => 'left', 'type' => 'baseprice', 'total' => $totals['total_amount'], 'index' => 'total_amount'));
     $grid->addColumn('commission', array('header' => $this->__('Commission'), 'align' => 'left', 'type' => 'baseprice', 'total' => $totals['commission'], 'index' => 'commission'));
     /*$grid->addColumn('commission_plus', array(
                 'header' => $this->__('Additional') . '<br />' . $this->__('Commission'),
                 'align' => 'left',
                 'type' => 'baseprice',
                 'index' => 'commission_plus',
                 'render' => 'getCommissionPlus'
             ));
     
             Mage::dispatchEvent('affiliateplus_prepare_sales_columns', array(
                 'grid' => $grid,
             ));
     
             $grid->addColumn('status', array(
                 'header' => $this->__('Status'),
                 'align' => 'left',
                 'index' => 'status',
                 'type' => 'options',
                 'options' => array(
                     1 => $this->__('Complete'),
                     2 => $this->__('Pending'),
                     3 => $this->__('Cancel')
                 )
             ));
             */
     $this->setChild('sales_grid', $grid);
     return $this;
 }
Exemplo n.º 2
0
 public function _prepareLayout()
 {
     parent::_prepareLayout();
     $pager = $this->getLayout()->createBlock('page/html_pager', 'sales_pager')->setCollection($this->getCollection());
     $this->setChild('sales_pager', $pager);
     $grid = $this->getLayout()->createBlock('affiliateplusstatistic/frontend_report_action', 'sales_grid');
     $grid->setActionType(1);
     $grid->setTemplate('affiliateplusstatistic/report/grid.phtml');
     // prepare column
     $totals = $this->getTotals();
     $grid->addColumn('created_date', array('header' => $this->__('Period'), 'index' => 'created_date', 'width' => 100, 'sortable' => false, 'render' => 'getPeriod', 'total_label' => Mage::helper('adminhtml')->__('Total'), 'align' => 'left'));
     $grid->addColumn('banner_title', array('header' => $this->__('Banner'), 'index' => 'banner_title', 'align' => 'left'));
     $grid->addColumn('landing_page', array('header' => $this->__('Landing Page'), 'align' => 'left', 'index' => 'landing_page'));
     $grid->addColumn('referer', array('header' => $this->__('Traffic Source'), 'align' => 'left', 'index' => 'referer'));
     $grid->addColumn('totals', array('header' => $this->__('Impressions (Unique/ Raw)'), 'align' => 'left', 'render' => 'getImpressions', 'index' => 'totals'));
     /*$grid->addColumn('commission_plus', array(
                 'header' => $this->__('Additional') . '<br />' . $this->__('Commission'),
                 'align' => 'left',
                 'type' => 'baseprice',
                 'index' => 'commission_plus',
                 'render' => 'getCommissionPlus'
             ));
     
             Mage::dispatchEvent('affiliateplus_prepare_sales_columns', array(
                 'grid' => $grid,
             ));
     
             $grid->addColumn('status', array(
                 'header' => $this->__('Status'),
                 'align' => 'left',
                 'index' => 'status',
                 'type' => 'options',
                 'options' => array(
                     1 => $this->__('Complete'),
                     2 => $this->__('Pending'),
                     3 => $this->__('Cancel')
                 )
             ));
             */
     $this->setChild('sales_grid', $grid);
     return $this;
 }
Exemplo n.º 3
0
 public function _prepareLayout()
 {
     parent::_prepareLayout();
     $pager = $this->getLayout()->createBlock('page/html_pager', 'sales_pager')->setCollection($this->getCollection());
     $this->setChild('sales_pager', $pager);
     $grid = $this->getLayout()->createBlock('affiliateplusstatistic/frontend_report_action', 'sales_grid');
     $grid->setCollection($this->getClickCollection());
     $grid->setActionType(2);
     $data = $this->getFilterData();
     $grid->setTemplate('affiliateplusstatistic/report/view.phtml');
     // prepare column
     $totals = $this->getTotals();
     $group_by = $this->getRequest()->getParam('group_by');
     if ($group_by == 1) {
         $grid->addColumn('created_date', array('header' => $this->__('Period'), 'index' => 'created_date', 'width' => 100, 'sortable' => false, 'render' => 'getPeriod', 'total_label' => Mage::helper('adminhtml')->__('Total'), 'align' => 'left'));
         $grid->addColumn('banner_title', array('header' => $this->__('Banner'), 'index' => 'banner_title', 'align' => 'left'));
     } else {
         if ($group_by == 2) {
             $grid->addColumn('banner_title', array('header' => $this->__('Banner'), 'index' => 'banner_title', 'align' => 'left', 'total_label' => Mage::helper('adminhtml')->__('Total')));
             $grid->addColumn('created_date', array('header' => $this->__('Period'), 'index' => 'created_date', 'width' => 100, 'sortable' => false, 'render' => 'getPeriod', 'align' => 'left'));
         } else {
             if ($group_by == 3) {
                 $grid->addColumn('referer', array('header' => $this->__('Traffic Source'), 'align' => 'left', 'index' => 'referer', 'total_label' => Mage::helper('adminhtml')->__('Total')));
                 $grid->addColumn('created_date', array('header' => $this->__('Period'), 'index' => 'created_date', 'width' => 100, 'sortable' => false, 'render' => 'getPeriod', 'align' => 'left'));
                 $grid->addColumn('banner_title', array('header' => $this->__('Banner'), 'index' => 'banner_title', 'align' => 'left'));
             }
         }
     }
     $grid->addColumn('landing_page', array('header' => $this->__('Landing Page'), 'align' => 'left', 'index' => 'landing_page'));
     if ($group_by == 1 || $group_by == 2) {
         $grid->addColumn('referer', array('header' => $this->__('Traffic Source'), 'align' => 'left', 'index' => 'referer'));
     }
     $grid->addColumn('uniques', array('header' => $this->__('Unique'), 'align' => 'left', 'total' => $totals['uniques'], 'index' => 'uniques'));
     $grid->addColumn('raws', array('header' => $this->__('Raw'), 'align' => 'left', 'total' => $totals['raws'], 'index' => 'raws'));
     Mage::dispatchEvent('affiliateplusstatistic_add_column_click_report', array('grid' => $grid));
     $this->setChild('sales_grid', $grid);
     return $this;
 }