当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Adminhtml_Block_Report_Grid类代码示例

本文整理汇总了PHP中Mage_Adminhtml_Block_Report_Grid的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Adminhtml_Block_Report_Grid类的具体用法?PHP Mage_Adminhtml_Block_Report_Grid怎么用?PHP Mage_Adminhtml_Block_Report_Grid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Mage_Adminhtml_Block_Report_Grid类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: countTotals

 /**
  * Retrieve count totals
  *
  * @param Mage_Adminhtml_Block_Report_Grid $grid
  * @param string $from
  * @param string $to
  * @return Varien_Object
  */
 public function countTotals($grid, $from, $to)
 {
     $columns = array();
     foreach ($grid->getColumns() as $col) {
         $columns[$col->getIndex()] = array("total" => $col->getTotal(), "value" => 0);
     }
     $count = 0;
     $report = $grid->getCollection()->getReportFull($from, $to);
     foreach ($report as $item) {
         if ($grid->getSubReportSize() && $count >= $grid->getSubReportSize()) {
             continue;
         }
         $data = $item->getData();
         foreach ($columns as $field => $a) {
             if ($field !== '') {
                 $columns[$field]['value'] = $columns[$field]['value'] + (isset($data[$field]) ? $data[$field] : 0);
             }
         }
         $count++;
     }
     $data = array();
     foreach ($columns as $field => $a) {
         if ($a['total'] == 'avg') {
             if ($field !== '') {
                 if ($count != 0) {
                     $data[$field] = $a['value'] / $count;
                 } else {
                     $data[$field] = 0;
                 }
             }
         } else {
             if ($a['total'] == 'sum') {
                 if ($field !== '') {
                     $data[$field] = $a['value'];
                 }
             } else {
                 if (strpos($a['total'], '/') !== FALSE) {
                     if ($field !== '') {
                         $data[$field] = 0;
                     }
                 }
             }
         }
     }
     $totals = new Varien_Object();
     $totals->setData($data);
     return $totals;
 }
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:56,代码来源:Totals.php

示例2: _prepareColumns

 protected function _prepareColumns()
 {
     $this->addColumn('qty_ordered', array('header' => Mage::helper('reports')->__('Quantity Ordered'), 'align' => 'right', 'sortable' => false, 'type' => 'number', 'index' => 'ordered_qty'));
     $this->addExportType('*/*/export-csv', Mage::helper('supplierfrontendproductuploader')->__('CSV'));
     $this->addExportType('*/*/export-xml', Mage::helper('supplierfrontendproductuploader')->__('XML'));
     return parent::_prepareColumns();
 }
开发者ID:programmerrahul,项目名称:vastecom,代码行数:7,代码来源:Grid.php

示例3: _prepareColumns

 protected function _prepareColumns()
 {
     $this->addColumn('accounts', array('header' => Mage::helper('reports')->__('Number of New Accounts'), 'index' => 'accounts', 'total' => 'sum', 'type' => 'number'));
     $this->addExportType('*/*/exportAccountsCsv', Mage::helper('reports')->__('CSV'));
     $this->addExportType('*/*/exportAccountsExcel', Mage::helper('reports')->__('Excel XML'));
     return parent::_prepareColumns();
 }
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:7,代码来源:Grid.php

示例4: _prepareColumns

 protected function _prepareColumns()
 {
     $this->addColumn('promo_code', array('header' => Mage::helper('reports')->__('Promo Code'), 'type' => 'text', 'index' => 'promo_code', 'sortable' => true));
     /*if (!Mage::app()->isSingleStoreMode()) {
     		$this->addColumn('store_id', array(
     		    'header'    => Mage::helper('sales')->__('Purchased From (Store)'),
     		    'index'     => 'store_id',
     		    'type'      => 'store',
     		    'store_view'=> true,
     		    'display_deleted' => true,
     		));
     	    }*/
     $this->addColumn('ckc_key_code_name', array('header' => Mage::helper('reports')->__('Description'), 'type' => 'text', 'index' => 'ckc_key_code_name', 'sortable' => false));
     $this->addColumn('total_orders', array('header' => Mage::helper('reports')->__('Resp'), 'type' => 'text', 'index' => 'total_orders', 'sortable' => false));
     $this->addColumn('gross_total', array('header' => Mage::helper('reports')->__('Grs Ord$'), 'type' => 'text', 'index' => 'gross_total', 'sortable' => false));
     $this->addColumn('shipping_amount', array('header' => Mage::helper('reports')->__('S&H$'), 'type' => 'text', 'index' => 'shipping_amount', 'sortable' => false));
     $this->addColumn('tax_amount', array('header' => Mage::helper('reports')->__('Sls Tax$'), 'type' => 'text', 'index' => 'tax_amount', 'sortable' => false));
     $this->addColumn('grs_sls', array('header' => Mage::helper('reports')->__('Grs Sls$'), 'type' => 'text', 'index' => 'grs_sls', 'sortable' => false));
     $this->addColumn('total_refunded', array('header' => Mage::helper('reports')->__('Retn$'), 'type' => 'text', 'index' => 'total_refunded', 'sortable' => false));
     $this->addColumn('return_percent', array('header' => Mage::helper('reports')->__('Ret%'), 'type' => 'text', 'index' => 'return_percent', 'sortable' => false));
     $this->addColumn('adjustment_positive', array('header' => Mage::helper('reports')->__('Adj$'), 'type' => 'text', 'index' => 'adjustment_positive', 'sortable' => false));
     $this->addColumn('adjustment_percent', array('header' => Mage::helper('reports')->__('Adj%'), 'type' => 'text', 'index' => 'adjustment_percent', 'sortable' => false));
     /*$this->addColumn('write_off', array(
     		'header'    =>Mage::helper('reports')->__('W/O$'),
     		'type'  => 'text',
     		'index' => 'write_off',
     		'sortable'  => false
     		)
         );*/
     $this->addColumn('base_total_paid', array('header' => Mage::helper('reports')->__('Pay$'), 'type' => 'text', 'index' => 'base_total_paid', 'sortable' => false));
     $this->addColumn('base_total_percent', array('header' => Mage::helper('reports')->__('Pay%'), 'type' => 'text', 'index' => 'base_total_percent', 'sortable' => false));
     $this->addColumn('created_at', array('header' => Mage::helper('sales')->__('Created Date'), 'index' => 'created_at', 'type' => 'datetime', 'width' => '100px'));
     $this->addExportType('*/*/exportPanelreportCsv', Mage::helper('reports')->__('CSV'));
     return parent::_prepareColumns();
 }
开发者ID:par-orillonsoft,项目名称:magento_work,代码行数:35,代码来源:Grid.php

示例5: _prepareColumns

 /**
  * Prepare Grid columns
  *
  * @return Mage_Adminhtml_Block_Report_Product_Sold_Grid
  */
 protected function _prepareColumns()
 {
     $this->addColumn('name', array('header' => Mage::helper('reports')->__('Product Name'), 'index' => 'name'));
     $this->addColumn('ordered_qty', array('header' => Mage::helper('reports')->__('Quantity Ordered'), 'width' => '120px', 'align' => 'right', 'index' => 'ordered_qty', 'total' => 'sum', 'type' => 'number'));
     $this->addExportType('*/*/exportSoldCsv', Mage::helper('reports')->__('CSV'));
     $this->addExportType('*/*/exportSoldExcel', Mage::helper('reports')->__('Excel'));
     return parent::_prepareColumns();
 }
开发者ID:codercv,项目名称:urbansurprisedev,代码行数:13,代码来源:Grid.php

示例6: _prepareColumns

 protected function _prepareColumns()
 {
     $this->addColumn('tax_rate', array('header' => Mage::helper('reports')->__('Tax Rate'), 'index' => 'tax_rate'));
     $this->addColumn('orders', array('header' => Mage::helper('reports')->__('Number of Orders'), 'index' => 'orders', 'total' => 'sum'));
     $this->addColumn('tax', array('header' => Mage::helper('reports')->__('Tax Amount'), 'type' => 'currency', 'currency_code' => (string) Mage::app()->getStore((int) $this->getParam('store'))->getBaseCurrencyCode(), 'index' => 'tax', 'total' => 'sum', 'renderer' => 'adminhtml/report_grid_column_renderer_currency'));
     $this->addExportType('*/*/exportTaxCsv', Mage::helper('reports')->__('CSV'));
     $this->addExportType('*/*/exportTaxExcel', Mage::helper('reports')->__('Excel'));
     return parent::_prepareColumns();
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:9,代码来源:Grid.php

示例7: _prepareColumns

 protected function _prepareColumns()
 {
     $this->addColumn('name', array('header' => AO::helper('reports')->__('Product Name'), 'index' => 'name'));
     $this->addColumn('price', array('header' => AO::helper('reports')->__('Price'), 'width' => '120px', 'type' => 'currency', 'currency_code' => $this->getCurrentCurrencyCode(), 'index' => 'price'));
     $this->addColumn('ordered_qty', array('header' => AO::helper('reports')->__('Quantity Ordered'), 'width' => '120px', 'align' => 'right', 'index' => 'ordered_qty', 'total' => 'sum', 'type' => 'number'));
     $this->addExportType('*/*/exportOrderedCsv', AO::helper('reports')->__('CSV'));
     $this->addExportType('*/*/exportOrderedExcel', AO::helper('reports')->__('Excel'));
     return parent::_prepareColumns();
 }
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:9,代码来源:Report_Product_Ordered_Grid.php

示例8: _prepareColumns

 protected function _prepareColumns()
 {
     $this->addColumn('name', array('header' => Mage::helper('reports')->__('Product Name'), 'index' => 'name'));
     $this->addColumn('price', array('header' => Mage::helper('reports')->__('Price'), 'width' => '120px', 'type' => 'currency', 'currency_code' => (string) Mage::app()->getStore((int) $this->getParam('store'))->getBaseCurrencyCode(), 'index' => 'price', 'renderer' => 'adminhtml/report_grid_column_renderer_currency'));
     $this->addColumn('ordered_qty', array('header' => Mage::helper('reports')->__('Quantity Ordered'), 'width' => '120px', 'align' => 'right', 'index' => 'ordered_qty', 'total' => 'sum'));
     $this->addExportType('*/*/exportOrderedCsv', Mage::helper('reports')->__('CSV'));
     $this->addExportType('*/*/exportOrderedExcel', Mage::helper('reports')->__('Excel'));
     return parent::_prepareColumns();
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:9,代码来源:Grid.php

示例9: _prepareColumns

 protected function _prepareColumns()
 {
     $this->addColumn('shipping_description', array('header' => Mage::helper('reports')->__('Carrier/Method'), 'index' => 'shipping_description'));
     $this->addColumn('orders', array('header' => Mage::helper('reports')->__('Number of Orders'), 'index' => 'orders', 'total' => 'sum', 'type' => 'number'));
     $this->addColumn('total', array('header' => Mage::helper('reports')->__('Total Shipping'), 'type' => 'currency', 'currency_code' => $this->getCurrentCurrencyCode(), 'index' => 'total', 'total' => 'sum', 'renderer' => 'adminhtml/report_grid_column_renderer_currency'));
     $this->addExportType('*/*/exportShippingCsv', Mage::helper('reports')->__('CSV'));
     $this->addExportType('*/*/exportShippingExcel', Mage::helper('reports')->__('Excel'));
     return parent::_prepareColumns();
 }
开发者ID:HelioFreitas,项目名称:magento-pt_br,代码行数:9,代码来源:Grid.php

示例10: _prepareColumns

 protected function _prepareColumns()
 {
     $this->addColumn('name', array('header' => Mage::helper('reports')->__('Product Name'), 'index' => 'name', 'total' => Mage::helper('reports')->__('Subtotal')));
     $this->addColumn('price', array('header' => Mage::helper('reports')->__('Price'), 'width' => '120px', 'type' => 'currency', 'currency_code' => $this->getCurrentCurrencyCode(), 'index' => 'price'));
     $this->addColumn('views', array('header' => Mage::helper('reports')->__('Number of Views'), 'width' => '120px', 'align' => 'right', 'index' => 'views', 'total' => 'sum'));
     $this->addExportType('*/*/exportViewedCsv', Mage::helper('reports')->__('CSV'));
     $this->addExportType('*/*/exportViewedExcel', Mage::helper('reports')->__('Excel XML'));
     return parent::_prepareColumns();
 }
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:9,代码来源:Grid.php

示例11: _prepareColumns

 /**
  * Prepare report grid columns
  *
  * @return Enterprise_Invitation_Block_Adminhtml_Report_Invitation_Order_Grid
  */
 protected function _prepareColumns()
 {
     $this->addColumn('sent', array('header' => Mage::helper('enterprise_invitation')->__('Invitations Sent'), 'type' => 'number', 'index' => 'sent', 'width' => '200'));
     $this->addColumn('accepted', array('header' => Mage::helper('enterprise_invitation')->__('Invitations Accepted'), 'type' => 'number', 'index' => 'accepted', 'width' => '200'));
     $this->addColumn('purchased', array('header' => Mage::helper('enterprise_invitation')->__('Accepted and Purchased'), 'type' => 'number', 'index' => 'purchased', 'width' => '220'));
     $this->addColumn('purchased_rate', array('header' => Mage::helper('enterprise_invitation')->__('Conversion Rate'), 'index' => 'purchased_rate', 'renderer' => 'enterprise_invitation/adminhtml_grid_column_renderer_percent', 'type' => 'string', 'width' => '100'));
     $this->addExportType('*/*/exportOrderCsv', Mage::helper('enterprise_invitation')->__('CSV'));
     $this->addExportType('*/*/exportOrderExcel', Mage::helper('enterprise_invitation')->__('Excel XML'));
     return parent::_prepareColumns();
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:15,代码来源:Grid.php

示例12: _prepareColumns

 protected function _prepareColumns()
 {
     $this->addColumn('code', array('header' => AO::helper('reports')->__('Tax'), 'index' => 'code', 'type' => 'string'));
     $this->addColumn('percent', array('header' => AO::helper('reports')->__('Rate'), 'index' => 'percent', 'type' => 'number', 'renderer' => 'adminhtml/report_grid_column_renderer_blanknumber', 'width' => '100'));
     $this->addColumn('orders', array('header' => AO::helper('reports')->__('Number of Orders'), 'index' => 'orders', 'total' => 'sum', 'type' => 'number', 'width' => '100'));
     $this->addColumn('tax', array('header' => AO::helper('reports')->__('Tax Amount'), 'type' => 'currency', 'currency_code' => $this->getCurrentCurrencyCode(), 'index' => 'tax', 'total' => 'sum', 'renderer' => 'adminhtml/report_grid_column_renderer_currency'));
     $this->addExportType('*/*/exportTaxCsv', AO::helper('reports')->__('CSV'));
     $this->addExportType('*/*/exportTaxExcel', AO::helper('reports')->__('Excel'));
     return parent::_prepareColumns();
 }
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:10,代码来源:Report_Sales_Tax_Grid.php

示例13: _prepareColumns

 /**
  * Prepare Grid columns
  *
  * @return Mage_Adminhtml_Block_Report_Product_Sold_Grid
  */
 protected function _prepareColumns()
 {
     $this->addColumn('total_rewarded_sum', array('header' => Mage::helper('rewardpoints')->__('Total Rewarded'), 'align' => 'left', 'index' => 'total_rewarded_sum', 'width' => '250px', 'type' => 'text'));
     $this->addColumn('total_redeemed_sum', array('header' => Mage::helper('rewardpoints')->__('Total Redeemed'), 'align' => 'left', 'index' => 'total_redeemed_sum', 'width' => '250px', 'type' => 'text'));
     $this->addColumn('order_id_count', array('header' => Mage::helper('rewardpoints')->__('Number of Orders'), 'width' => '150px', 'align' => 'left', 'index' => 'order_id_count'));
     $this->addColumn('sign_up_count', array('header' => Mage::helper('rewardpoints')->__('Number of Sign Ups'), 'width' => '150px', 'align' => 'left', 'index' => 'sign_up_count'));
     $this->addColumn('customer_id_count', array('header' => Mage::helper('rewardpoints')->__('Number of Customers'), 'width' => '150px', 'align' => 'left', 'index' => 'customer_id_count'));
     $this->addExportType('*/*/exportOverviewCsv', Mage::helper('reports')->__('CSV'));
     $this->addExportType('*/*/exportOverviewExcel', Mage::helper('reports')->__('Excel XML'));
     return parent::_prepareColumns();
 }
开发者ID:shebin512,项目名称:Magento_Zoff,代码行数:16,代码来源:Grid.php

示例14: _prepareColumns

 /**
  * Prepare report grid columns
  *
  * @return Enterprise_Invitation_Block_Adminhtml_Report_Invitation_General_Grid
  */
 protected function _prepareColumns()
 {
     $this->addColumn('sent', array('header' => Mage::helper('enterprise_invitation')->__('Sent'), 'type' => 'number', 'index' => 'sent'));
     $this->addColumn('accepted', array('header' => Mage::helper('enterprise_invitation')->__('Accepted'), 'type' => 'number', 'index' => 'accepted', 'width' => ''));
     $this->addColumn('canceled', array('header' => Mage::helper('enterprise_invitation')->__('Discarded'), 'type' => 'number', 'index' => 'canceled', 'width' => ''));
     $this->addColumn('accepted_rate', array('header' => Mage::helper('enterprise_invitation')->__('Acceptance Rate'), 'index' => 'accepted_rate', 'renderer' => 'enterprise_invitation/adminhtml_grid_column_renderer_percent', 'type' => 'string', 'width' => '170'));
     $this->addColumn('canceled_rate', array('header' => Mage::helper('enterprise_invitation')->__('Discard Rate'), 'index' => 'canceled_rate', 'type' => 'number', 'renderer' => 'enterprise_invitation/adminhtml_grid_column_renderer_percent', 'width' => '170'));
     $this->addExportType('*/*/exportCsv', Mage::helper('enterprise_invitation')->__('CSV'));
     $this->addExportType('*/*/exportExcel', Mage::helper('enterprise_invitation')->__('Excel XML'));
     return parent::_prepareColumns();
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:16,代码来源:Grid.php

示例15: _prepareColumns

 protected function _prepareColumns()
 {
     $this->addColumn('name', array('header' => $this->__('Customer Name'), 'sortable' => false, 'index' => 'name'));
     $this->addColumn('orders_count', array('header' => $this->__('Number of Orders'), 'width' => '100px', 'sortable' => false, 'index' => 'orders_count', 'total' => 'sum', 'type' => 'number'));
     $baseCurrencyCode = $this->getCurrentCurrencyCode();
     $this->addColumn('orders_avg_amount', array('header' => $this->__('Average Order Amount'), 'width' => '200px', 'align' => 'right', 'sortable' => false, 'type' => 'currency', 'currency_code' => $baseCurrencyCode, 'index' => 'orders_avg_amount', 'total' => 'orders_sum_amount/orders_count', 'renderer' => 'adminhtml/report_grid_column_renderer_currency'));
     $this->addColumn('orders_sum_amount', array('header' => $this->__('Total Order Amount'), 'width' => '200px', 'align' => 'right', 'sortable' => false, 'type' => 'currency', 'currency_code' => $baseCurrencyCode, 'index' => 'orders_sum_amount', 'total' => 'sum', 'renderer' => 'adminhtml/report_grid_column_renderer_currency'));
     $this->addExportType('*/*/exportOrdersCsv', Mage::helper('reports')->__('CSV'));
     $this->addExportType('*/*/exportOrdersExcel', Mage::helper('reports')->__('Excel XML'));
     return parent::_prepareColumns();
 }
开发者ID:usamatahir,项目名称:BulletProof,代码行数:11,代码来源:Grid.php


注:本文中的Mage_Adminhtml_Block_Report_Grid类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。