Guest User

Untitled

a guest
Jul 22nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. <?php
  2.  
  3. class Ecom_Pricenotify_Block_Adminhtml_Pricenotify_Grid extends Mage_Adminhtml_Block_Widget_Grid{
  4. public function __construct()
  5. {
  6. parent::__construct();
  7. $this->setId('pricenotifyGrid');
  8. // This is the primary key of the database
  9. $this->setDefaultSort('pricenotify_id');
  10. $this->setDefaultDir('ASC');
  11. $this->setSaveParametersInSession(true);
  12. }
  13.  
  14. protected function _prepareCollection()
  15. {
  16. $collection = Mage::getModel('pricenotify/pricenotify')->getCollection();
  17. $this->setCollection($collection);
  18. return parent::_prepareCollection();
  19. }
  20.  
  21. protected function _prepareColumns()
  22. {
  23. $this->addColumn('pricenotify_id', array(
  24. 'header' => Mage::helper('pricenotify')->__('Notification ID'),
  25. 'align' =>'left',
  26. 'width' => '50px',
  27. 'index' => 'pricenotify_id',
  28. ));
  29.  
  30. $this->addColumn('prod_id', array(
  31. 'header' => Mage::helper('pricenotify')->__('Product ID'),
  32. 'align' =>'left',
  33. 'width' => '50px',
  34. 'index' => 'prod_id',
  35. ));
  36.  
  37.  
  38. $this->addColumn('prod_price', array(
  39. 'header' => Mage::helper('pricenotify')->__('Product Price'),
  40. 'align' =>'left',
  41. 'width' => '50px',
  42. 'index' => 'prod_price',
  43. ));
  44.  
  45. $this->addColumn('user_price', array(
  46. 'header' => Mage::helper('pricenotify')->__('User Price'),
  47. 'align' =>'left',
  48. 'width' => '50px',
  49. 'index' => 'user_price',
  50. ));
  51.  
  52. $this->addColumn('email', array(
  53. 'header' => Mage::helper('pricenotify')->__('E-Mail Address'),
  54. 'align' =>'left',
  55. 'width' => '150px',
  56. 'index' => 'email',
  57. ));
  58.  
  59. $this->addColumn('created_time', array(
  60. 'header' => Mage::helper('pricenotify')->__('Creation Time'),
  61. 'align' => 'left',
  62. 'width' => '120px',
  63. 'type' => 'date',
  64. 'default' => '--',
  65. 'index' => 'created_time',
  66. ));
  67.  
  68.  
  69. $this->addColumn('status', array(
  70.  
  71. 'header' => Mage::helper('pricenotify')->__('Status'),
  72. 'align' => 'left',
  73. 'width' => '80px',
  74. 'index' => 'status',
  75. 'type' => 'options',
  76. 'options' => array(
  77. 'success' => 'Inactive',
  78. 'pending' => 'Active',
  79. ),
  80. ));
  81.  
  82. return parent::_prepareColumns();
  83. }
  84.  
  85. public function getRowUrl($row)
  86. {
  87. return $this->getUrl('*/*/edit', array('id' => $row->getId()));
  88. }}
  89.  
  90. public function indexAction() {
  91. $this->_initAction();
  92. $this->_addContent($this->getLayout()->createBlock('pricenotify/adminhtml_pricenotify'));
  93. $this->renderLayout();
  94. }
  95.  
  96. //$this->_addContent($this->getLayout()->createBlock('pricenotify/adminhtml_pricenotify'));
Add Comment
Please, Sign In to add comment