MD_Product_Registration - Version 1.0.0

Version Notes

please contact us : support@mage-designer.com

Download this release

Release Info

Developer OSWorld
Extension MD_Product_Registration
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (43) hide show
  1. app/code/local/MD/Productregistration/Block/Adminhtml/Customer.php +12 -0
  2. app/code/local/MD/Productregistration/Block/Adminhtml/Customer/Edit.php +24 -0
  3. app/code/local/MD/Productregistration/Block/Adminhtml/Customer/Edit/Form.php +19 -0
  4. app/code/local/MD/Productregistration/Block/Adminhtml/Customer/Edit/Tab/Form.php +208 -0
  5. app/code/local/MD/Productregistration/Block/Adminhtml/Customer/Edit/Tabs.php +24 -0
  6. app/code/local/MD/Productregistration/Block/Adminhtml/Customer/Grid.php +141 -0
  7. app/code/local/MD/Productregistration/Block/Customer.php +70 -0
  8. app/code/local/MD/Productregistration/Helper/Data.php +6 -0
  9. app/code/local/MD/Productregistration/Model/Customer.php +10 -0
  10. app/code/local/MD/Productregistration/Model/Installer.php +10 -0
  11. app/code/local/MD/Productregistration/Model/Mysql4/Customer.php +10 -0
  12. app/code/local/MD/Productregistration/Model/Mysql4/Customer/Collection.php +10 -0
  13. app/code/local/MD/Productregistration/Model/Mysql4/Installer.php +10 -0
  14. app/code/local/MD/Productregistration/Model/Mysql4/Installer/Collection.php +10 -0
  15. app/code/local/MD/Productregistration/Model/Mysql4/Product.php +10 -0
  16. app/code/local/MD/Productregistration/Model/Mysql4/Product/Collection.php +10 -0
  17. app/code/local/MD/Productregistration/Model/Product.php +10 -0
  18. app/code/local/MD/Productregistration/Model/Status.php +17 -0
  19. app/code/local/MD/Productregistration/Model/System/Config/Source/Dropdown/Lang.php +39 -0
  20. app/code/local/MD/Productregistration/Model/System/Config/Source/Dropdown/Theme.php +28 -0
  21. app/code/local/MD/Productregistration/controllers/Adminhtml/CustomerController.php +268 -0
  22. app/code/local/MD/Productregistration/controllers/Adminhtml/ProductregistrationController.php +213 -0
  23. app/code/local/MD/Productregistration/controllers/IndexController.php +10 -0
  24. app/code/local/MD/Productregistration/controllers/SubmitController.php +142 -0
  25. app/code/local/MD/Productregistration/etc/config.xml +183 -0
  26. app/code/local/MD/Productregistration/etc/system.xml +91 -0
  27. app/code/local/MD/Productregistration/sql/productregistration_setup/mysql4-install-0.1.0.php +52 -0
  28. app/code/local/MD/Productregistration/sql/productregistration_setup/mysql4-upgrade-0.1.0-0.1.1.php +13 -0
  29. app/code/local/MD/Productregistration/sql/productregistration_setup/mysql4-upgrade-0.1.0-0.1.2.php +17 -0
  30. app/code/local/MD/Productregistration/sql/productregistration_setup/mysql4-upgrade-0.1.2-0.1.3.php +65 -0
  31. app/design/adminhtml/default/default/layout/md_productregistration.xml +8 -0
  32. app/design/frontend/default/default/layout/md_productregistration.xml +13 -0
  33. app/design/frontend/default/default/template/md/productregistration/form.phtml +284 -0
  34. app/etc/modules/MD_Productregistration.xml +9 -0
  35. app/locale/en_US/template/email/md/productregistration/productregistration.html +80 -0
  36. app/locale/en_US/template/email/md/productregistration/productregistration_admin.html +80 -0
  37. app/locale/en_US/template/email/md/productregistration/productregistration_admin_approve.html +83 -0
  38. app/locale/en_US/template/email/md/productregistration/productregistration_approve.html +83 -0
  39. package.xml +22 -0
  40. readme.txt +15 -0
  41. skin/frontend/default/default/md/productregistration/arial.ttf +0 -0
  42. skin/frontend/default/default/md/productregistration/captcha.php +1 -0
  43. skin/frontend/default/default/md/productregistration/cross.gif +0 -0
app/code/local/MD/Productregistration/Block/Adminhtml/Customer.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MD_Productregistration_Block_Adminhtml_Customer extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_customer';
7
+ $this->_blockGroup = 'productregistration';
8
+ $this->_headerText = Mage::helper('productregistration')->__('Product Registration');
9
+ parent::__construct();
10
+ $this->_removeButton('add');
11
+ }
12
+ }
app/code/local/MD/Productregistration/Block/Adminhtml/Customer/Edit.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Block_Adminhtml_Customer_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+
9
+ $this->_objectId = 'id';
10
+ $this->_blockGroup = 'productregistration';
11
+ $this->_controller = 'adminhtml_customer';
12
+ // $this->_removeButton('save');
13
+ $this->_updateButton('delete', 'label', Mage::helper('productregistration')->__('Delete Customer Information'));
14
+
15
+ }
16
+ public function getHeaderText()
17
+ {
18
+ if( Mage::registry('productregistration_data') && Mage::registry('productregistration_data')->getId() ) {
19
+ return Mage::helper('productregistration')->__("Product Registration # '%s'", $this->htmlEscape(Mage::registry('productregistration_data')->getInvoice()));
20
+ } else {
21
+ return Mage::helper('productregistration')->__('Product Registration #');
22
+ }
23
+ }
24
+ }
app/code/local/MD/Productregistration/Block/Adminhtml/Customer/Edit/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Block_Adminhtml_Customer_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form(array(
8
+ 'id' => 'edit_form',
9
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
10
+ 'method' => 'post',
11
+ 'enctype' => 'multipart/form-data'
12
+ )
13
+ );
14
+
15
+ $form->setUseContainer(true);
16
+ $this->setForm($form);
17
+ return parent::_prepareForm();
18
+ }
19
+ }
app/code/local/MD/Productregistration/Block/Adminhtml/Customer/Edit/Tab/Form.php ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Block_Adminhtml_Customer_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
8
+ $this->setForm($form);
9
+ $fieldset = $form->addFieldset('productregistration_form', array('legend'=>Mage::helper('productregistration')->__('Customer Information')));
10
+
11
+ $fieldset->addField('invoice', 'text', array(
12
+ 'label' => Mage::helper('productregistration')->__('Invoice'),
13
+ 'name' => 'invoice',
14
+ 'readonly' => true,
15
+ ));
16
+
17
+ $fieldset->addField('namecus', 'text', array(
18
+ 'label' => Mage::helper('productregistration')->__('Full Name'),
19
+ 'name' => 'namecus',
20
+ 'readonly' => true,
21
+ ));
22
+
23
+ $fieldset->addField('emailcus', 'text', array(
24
+ 'label' => Mage::helper('productregistration')->__('Email Address'),
25
+ 'name' => 'emailcus',
26
+ 'readonly' => true,
27
+ ));
28
+
29
+ $fieldset->addField('comment', 'textarea', array(
30
+ 'label' => Mage::helper('productregistration')->__('Comment'),
31
+ 'name' => 'comment',
32
+ ));
33
+ $fieldset->addField('status', 'select', array(
34
+ 'label' => Mage::helper('productregistration')->__('Status'),
35
+ 'name' => 'status',
36
+ 'value' => '1',
37
+ 'values' => array(
38
+ array('value'=>'1','label'=>'Pendding'),
39
+ array('value'=>'2','label'=>'Approve'),
40
+ array('value'=>'3','label'=>'Reject')
41
+ ),
42
+ 'onchange' => 'checkform_pa(this.value)',
43
+ ));
44
+ $fieldset->addField('datecus', 'text', array(
45
+ 'label' => Mage::helper('productregistration')->__('Date of install'),
46
+ 'name' => 'datecus',
47
+ 'readonly' => true,
48
+ ));
49
+ $inss = Mage::getModel('productregistration/installer');
50
+ $inss = $inss->getCollection();
51
+ $inss->addFieldToFilter('customer_id',Array('eq'=>$this->getRequest()->getParam('id')));
52
+ foreach ($inss as $ins)
53
+ {
54
+ $fieldset = $form->addFieldset('productregistration_form1', array('legend'=>Mage::helper('productregistration')->__('Installer Information')));
55
+
56
+ $fieldset->addField('nameins', 'text', array(
57
+ 'label' => Mage::helper('productregistration')->__('Full Name'),
58
+ 'name' => 'nameins',
59
+ 'readonly' => true,
60
+ 'after_element_html' => '<script type="text/javascript">document.getElementById("nameins").value="'.$ins->getNameins().'";</script>',
61
+ ));
62
+
63
+ $fieldset->addField('addressins', 'text', array(
64
+ 'label' => Mage::helper('productregistration')->__('Address'),
65
+ 'name' => 'addressins',
66
+ 'readonly' => true,
67
+ 'after_element_html' => '<script type="text/javascript">document.getElementById("addressins").value="'.$ins->getAddressins().'";</script>',
68
+ ));
69
+
70
+ $fieldset->addField('city', 'text', array(
71
+ 'label' => Mage::helper('productregistration')->__('City'),
72
+ 'name' => 'city',
73
+ 'readonly' => true,
74
+ 'after_element_html' => '<script type="text/javascript">document.getElementById("city").value="'.$ins->getCity().'";</script>',
75
+ ));
76
+
77
+ $fieldset->addField('state', 'text', array(
78
+ 'label' => Mage::helper('productregistration')->__('State'),
79
+ 'name' => 'state',
80
+ 'readonly' => true,
81
+ 'after_element_html' => '<script type="text/javascript">document.getElementById("state").value="'.$ins->getState().'";</script>',
82
+ ));
83
+
84
+ $fieldset->addField('zip', 'text', array(
85
+ 'label' => Mage::helper('productregistration')->__('Zip Code'),
86
+ 'name' => 'zip',
87
+ 'readonly' => true,
88
+ 'after_element_html' => '<script type="text/javascript">document.getElementById("zip").value="'.$ins->getZip().'";</script>',
89
+ ));
90
+
91
+ $fieldset->addField('emailadd', 'text', array(
92
+ 'label' => Mage::helper('productregistration')->__('Email Address'),
93
+ 'name' => 'emailadd',
94
+ 'readonly' => true,
95
+ 'after_element_html' => '<script type="text/javascript">document.getElementById("emailadd").value="'.$ins->getEmailadd().'";</script>',
96
+ ));
97
+
98
+ $fieldset->addField('phone', 'text', array(
99
+ 'label' => Mage::helper('productregistration')->__('Phone'),
100
+ 'name' => 'phone',
101
+ 'readonly' => true,
102
+ 'after_element_html' => '<script type="text/javascript">document.getElementById("phone").value="'.$ins->getPhone().'";</script>',
103
+ ));
104
+ if ($ins->getRecommend())
105
+ $rec = "yes";
106
+ else
107
+ $rec = "no";
108
+ $fieldset->addField('recommend', 'text', array(
109
+ 'label' => Mage::helper('productregistration')->__('Recommend'),
110
+ 'name' => 'recommend',
111
+ 'readonly' => true,
112
+ 'after_element_html' => '<script type="text/javascript">document.getElementById("recommend").value="'.$rec.'";</script>',
113
+ ));
114
+
115
+ }
116
+
117
+ $pros = Mage::getModel('productregistration/product');
118
+ $pros = $pros->getCollection();
119
+ $pros->addFieldToFilter('customer_id',Array('eq'=>$this->getRequest()->getParam('id')));
120
+ foreach ($pros as $pro)
121
+ {
122
+ $fieldset = $form->addFieldset('productregistration_form2', array('legend'=>Mage::helper('productregistration')->__('Product Information')));
123
+
124
+ $fieldset->addField('eqipment1', 'text', array(
125
+ 'label' => Mage::helper('productregistration')->__('Eqipment 1'),
126
+ 'name' => 'eqipment1',
127
+ 'readonly' => true,
128
+ 'after_element_html' => '<script type="text/javascript">document.getElementById("eqipment1").value="'.$pro->getEqipment1().'";</script>',
129
+ ));
130
+
131
+ $fieldset->addField('modelnumber1', 'text', array(
132
+ 'label' => Mage::helper('productregistration')->__('Model Number'),
133
+ 'name' => 'modelnumber1',
134
+ 'readonly' => true,
135
+ 'after_element_html' => '<script type="text/javascript">document.getElementById("modelnumber1").value="'.$pro->getModelnumber1().'";</script>',
136
+ ));
137
+
138
+ $fieldset->addField('serial1', 'text', array(
139
+ 'label' => Mage::helper('productregistration')->__('Serial Number'),
140
+ 'name' => 'serial1',
141
+ 'readonly' => true,
142
+ 'after_element_html' => '<script type="text/javascript">document.getElementById("serial1").value="'.$pro->getSerial1().'";</script>',
143
+ ));
144
+
145
+ $fieldset->addField('eqipment2', 'text', array(
146
+ 'label' => Mage::helper('productregistration')->__('Eqipment 2'),
147
+ 'name' => 'eqipment2',
148
+ 'readonly' => true,
149
+ 'after_element_html' => '<script type="text/javascript">document.getElementById("eqipment2").value="'.$pro->getEqipment2().'";</script>',
150
+ ));
151
+
152
+ $fieldset->addField('modelnumber2', 'text', array(
153
+ 'label' => Mage::helper('productregistration')->__('Model Number'),
154
+ 'name' => 'modelnumber2',
155
+ 'readonly' => true,
156
+ 'after_element_html' => '<script type="text/javascript">document.getElementById("modelnumber2").value="'.$pro->getModelnumber2().'";</script>',
157
+ ));
158
+
159
+ $fieldset->addField('serial2', 'text', array(
160
+ 'label' => Mage::helper('productregistration')->__('Serial Number'),
161
+ 'name' => 'serial2',
162
+ 'readonly' => true,
163
+ 'after_element_html' => '<script type="text/javascript">document.getElementById("serial2").value="'.$pro->getSerial2().'";</script>',
164
+ ));
165
+
166
+ $fieldset->addField('eqipment3', 'text', array(
167
+ 'label' => Mage::helper('productregistration')->__('Eqipment 3'),
168
+ 'name' => 'eqipment3',
169
+ 'readonly' => true,
170
+ 'after_element_html' => '<script type="text/javascript">document.getElementById("eqipment3").value="'.$pro->getEqipment3().'";</script>',
171
+ ));
172
+
173
+ $fieldset->addField('modelnumber3', 'text', array(
174
+ 'label' => Mage::helper('productregistration')->__('Model Number'),
175
+ 'name' => 'modelnumber3',
176
+ 'readonly' => true,
177
+ 'after_element_html' => '<script type="text/javascript">document.getElementById("modelnumber3").value="'.$pro->getModelnumber3().'";</script>',
178
+ ));
179
+
180
+ $fieldset->addField('serial3', 'text', array(
181
+ 'label' => Mage::helper('productregistration')->__('Serial Number'),
182
+ 'name' => 'serial3',
183
+ 'readonly' => true,
184
+ 'after_element_html' => '<script type="text/javascript">document.getElementById("serial3").value="'.$pro->getSerial3().'";</script>',
185
+ ));
186
+
187
+ }
188
+ if ( Mage::getSingleton('adminhtml/session')->getProductregistrationData() )
189
+ {
190
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getProductregistration());
191
+ Mage::getSingleton('adminhtml/session')->setProductregistration(null);
192
+ } elseif ( Mage::registry('productregistration_data') ) {
193
+ $form->setValues(Mage::registry('productregistration_data')->getData());
194
+ }
195
+ return parent::_prepareForm();
196
+ }
197
+ }
198
+ ?>
199
+ <script>
200
+ function checkform_pa(value)
201
+ {
202
+ if(value=="2" || value=="1"){
203
+ document.getElementById("comment").setAttribute("class", "required-entry");
204
+ }else{
205
+ document.getElementById("comment").setAttribute("class", "");
206
+ }
207
+ }
208
+ </script>
app/code/local/MD/Productregistration/Block/Adminhtml/Customer/Edit/Tabs.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Block_Adminhtml_Customer_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('productregistration_tabs');
10
+ $this->setDestElementId('edit_form');
11
+ $this->setTitle(Mage::helper('productregistration')->__('Product Registration'));
12
+ }
13
+
14
+ protected function _beforeToHtml()
15
+ {
16
+ $this->addTab('form_section', array(
17
+ 'label' => Mage::helper('productregistration')->__('Product Registration Information'),
18
+ 'title' => Mage::helper('productregistration')->__('Product Registration Information'),
19
+ 'content' => $this->getLayout()->createBlock('productregistration/adminhtml_customer_edit_tab_form')->toHtml(),
20
+ ));
21
+
22
+ return parent::_beforeToHtml();
23
+ }
24
+ }
app/code/local/MD/Productregistration/Block/Adminhtml/Customer/Grid.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Block_Adminhtml_Customer_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('productregistrationGrid');
9
+ $this->setDefaultSort('customer_id');
10
+ $this->setDefaultDir('desc');
11
+ $this->setSaveParametersInSession(false);
12
+ }
13
+
14
+ protected function _prepareCollection()
15
+ {
16
+ $collection = Mage::getModel('productregistration/customer')->getCollection()->setOrder('customer_id','DESC');
17
+ $this->setCollection($collection);
18
+ return parent::_prepareCollection();
19
+ }
20
+
21
+ protected function _prepareColumns()
22
+ {
23
+
24
+ $this->addColumn('invoice', array(
25
+ 'header' => Mage::helper('productregistration')->__('Invoice'),
26
+ 'align' =>'center',
27
+ 'width' => '200px',
28
+ 'index' => 'invoice',
29
+ ));
30
+
31
+ $this->addColumn('namecus', array(
32
+ 'header' => Mage::helper('productregistration')->__('Name'),
33
+ 'align' =>'center',
34
+ 'width' => '250px',
35
+ 'index' => 'namecus',
36
+ ));
37
+ $this->addColumn('store_id', array(
38
+ 'header' => Mage::helper('productregistration')->__('Name'),
39
+ 'align' =>'center',
40
+ 'width' => '250px',
41
+ 'index' => 'store_id',
42
+ ));
43
+
44
+ $this->addColumn('emailcus', array(
45
+ 'header' => Mage::helper('productregistration')->__('Email'),
46
+ 'align' =>'center',
47
+ 'index' => 'emailcus',
48
+ ));
49
+
50
+ $this->addColumn('datecus', array(
51
+ 'header' => Mage::helper('productregistration')->__('Date of install'),
52
+ 'align' =>'center',
53
+ 'width' => '40px',
54
+ 'index' => 'datecus',
55
+ ));
56
+ $this->addColumn('status', array(
57
+ 'header' => Mage::helper('productregistration')->__('Status'),
58
+ 'align' => 'left',
59
+ 'width' => '80px',
60
+ 'index' => 'status',
61
+ 'type' => 'options',
62
+ 'options' => array(
63
+ 1 => 'Pendding',
64
+ 2 => 'Approve',
65
+ 3 => 'Reject',
66
+ ),
67
+ ));
68
+
69
+ $this->addColumn('action',
70
+ array(
71
+ 'header' => Mage::helper('productregistration')->__('Action'),
72
+ 'width' => '100',
73
+ 'align' =>'center',
74
+ 'type' => 'action',
75
+ 'getter' => 'getId',
76
+ 'actions' => array(
77
+ array(
78
+ 'caption' => Mage::helper('customer')->__('view'),
79
+ 'url' => array('base'=> '*/*/edit'),
80
+ 'field' => 'id'
81
+ )
82
+ ),
83
+ 'filter' => false,
84
+ 'sortable' => false,
85
+ 'index' => 'stores',
86
+ 'is_system' => true,
87
+ ));
88
+
89
+ $this->addExportType('*/*/exportCsv', Mage::helper('productregistration')->__('CSV'));
90
+ $this->addExportType('*/*/exportXml', Mage::helper('productregistration')->__('XML'));
91
+
92
+ return parent::_prepareColumns();
93
+ }
94
+
95
+ protected function _prepareMassaction()
96
+ {
97
+ $this->setMassactionIdField('customer_id');
98
+ $this->getMassactionBlock()->setFormFieldName('productregistration');
99
+
100
+ $this->getMassactionBlock()->addItem('delete', array(
101
+ 'label' => Mage::helper('productregistration')->__('Delete'),
102
+ 'url' => $this->getUrl('*/*/massDelete'),
103
+ 'confirm' => Mage::helper('productregistration')->__('Are you sure?')
104
+ ));
105
+ return $this;
106
+ }
107
+ // protected function _prepareMassaction()
108
+ // {
109
+ // $this->setMassactionIdField('customer_id');
110
+ // $this->getMassactionBlock()->setFormFieldName('productregistration');
111
+
112
+ // $this->getMassactionBlock()->addItem('delete', array(
113
+ // 'label' => Mage::helper('productregistration')->__('Delete'),
114
+ // 'url' => $this->getUrl('*/*/massDelete'),
115
+ // 'confirm' => Mage::helper('productregistration')->__('Are you sure?')
116
+ // ));
117
+
118
+ // $statuses = Mage::getSingleton('productregistration/status')->getOptionArray();
119
+
120
+ // array_unshift($statuses, array('label'=>'', 'value'=>''));
121
+ // $this->getMassactionBlock()->addItem('status', array(
122
+ // 'label'=> Mage::helper('productregistration')->__('Change status'),
123
+ // 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
124
+ // 'additional' => array(
125
+ // 'visibility' => array(
126
+ // 'name' => 'status',
127
+ // 'type' => 'select',
128
+ // 'class' => 'required-entry',
129
+ // 'label' => Mage::helper('productregistration')->__('Status'),
130
+ // 'values' => $statuses
131
+ // )
132
+ // )
133
+ // ));
134
+ // return $this;
135
+ // }
136
+ public function getRowUrl($row)
137
+ {
138
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
139
+ }
140
+
141
+ }
app/code/local/MD/Productregistration/Block/Customer.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MD_Productregistration_Block_Customer extends Mage_Core_Block_Template
3
+ {
4
+ protected $_customer = false;
5
+
6
+ public function _prepareLayout()
7
+ {
8
+ return parent::_prepareLayout();
9
+ }
10
+
11
+ public function getCustomer()
12
+ {
13
+ if (!$this->_customer) {
14
+
15
+ //$banner_id = $this->getData('id');
16
+ $customer_id = $this->getCustomerId();
17
+
18
+ //echo $banner_id;
19
+
20
+ if ($customer_id) {
21
+ $customer = Mage::getModel('productregistration/customer')->load($customer_id);
22
+ //var_dump($banner); exit;
23
+ if ($customer->getId()==0) {
24
+ $customer = Mage::getModel('productregistration/customer')->load($customer_id, 'identifier');
25
+ }
26
+ $this->_customer = $customer;
27
+ }
28
+ }
29
+ return $this->_customer;
30
+ }
31
+
32
+ public function isVisible() {
33
+ return $this->getCustomer() && $this->getCustomer()->getStatus();
34
+ }
35
+
36
+ public function getInstaller() {
37
+ if ($this->isVisible()) {
38
+ $customer = $this->getCustomer();
39
+
40
+ $collection = Mage::getModel('productregistration/installer')->getCollection()
41
+ ->addFieldToFilter('status', true)
42
+ ->addFieldToFilter('installer_id', $customer->getId())
43
+ ->setOrder('customer_order','ASC');
44
+ return $collection;
45
+ }
46
+ return false;
47
+ }
48
+
49
+ public function getProduct() {
50
+ if ($this->isVisible()) {
51
+ $customer = $this->getCustomer();
52
+
53
+ $collection = Mage::getModel('productregistration/product')->getCollection()
54
+ ->addFieldToFilter('status', true)
55
+ ->addFieldToFilter('product_id', $customer->getId())
56
+ ->setOrder('customer_order','ASC');
57
+ return $collection;
58
+ }
59
+ return false;
60
+ }
61
+
62
+ public function getBrands() {
63
+ if (is_null($this->_brands)) {
64
+ $this->_brands = Mage::getModel('eav/config')->getAttribute('catalog_product', 'manufacturer')
65
+ ->getSource()->getAllOptions(false);
66
+ }
67
+
68
+ return $this->_brands;
69
+ }
70
+ }
app/code/local/MD/Productregistration/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/local/MD/Productregistration/Model/Customer.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Model_Customer extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('productregistration/customer');
9
+ }
10
+ }
app/code/local/MD/Productregistration/Model/Installer.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Model_Installer extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('productregistration/installer');
9
+ }
10
+ }
app/code/local/MD/Productregistration/Model/Mysql4/Customer.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Model_Mysql4_Customer extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the easybanner_id refers to the key field in your database table.
8
+ $this->_init('productregistration/customer', 'customer_id');
9
+ }
10
+ }
app/code/local/MD/Productregistration/Model/Mysql4/Customer/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Model_Mysql4_Customer_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('productregistration/customer');
9
+ }
10
+ }
app/code/local/MD/Productregistration/Model/Mysql4/Installer.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Model_Mysql4_Installer extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the easybanner_id refers to the key field in your database table.
8
+ $this->_init('productregistration/installer', 'installer_id');
9
+ }
10
+ }
app/code/local/MD/Productregistration/Model/Mysql4/Installer/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Model_Mysql4_Installer_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('productregistration/installer');
9
+ }
10
+ }
app/code/local/MD/Productregistration/Model/Mysql4/Product.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Model_Mysql4_Product extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the easybanner_id refers to the key field in your database table.
8
+ $this->_init('productregistration/product', 'product_id');
9
+ }
10
+ }
app/code/local/MD/Productregistration/Model/Mysql4/Product/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Model_Mysql4_Product_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('productregistration/product');
9
+ }
10
+ }
app/code/local/MD/Productregistration/Model/Product.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Model_Product extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('productregistration/product');
9
+ }
10
+ }
app/code/local/MD/Productregistration/Model/Status.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Model_Status extends Varien_Object
4
+ {
5
+ const STATUS_PENDDING = 1;
6
+ const STATUS_APPROVE = 2;
7
+ const STATUS_REJECT = 3;
8
+
9
+ static public function getOptionArray()
10
+ {
11
+ return array(
12
+ self::STATUS_PENDDING => Mage::helper('productregistration')->__('Pendding'),
13
+ self::STATUS_APPROVE => Mage::helper('productregistration')->__('Approve'),
14
+ self::STATUS_REJECT => Mage::helper('productregistration')->__('Reject')
15
+ );
16
+ }
17
+ }
app/code/local/MD/Productregistration/Model/System/Config/Source/Dropdown/Lang.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MD_Productregistration_Model_System_Config_Source_Dropdown_Lang {
3
+ public function toOptionArray() {
4
+ return array(
5
+ array(
6
+ 'value' => 'en',
7
+ 'label' => 'English (default)',
8
+ ),
9
+ array(
10
+ 'value' => 'nl',
11
+ 'label' => 'Dutch',
12
+ ),
13
+ array(
14
+ 'value' => 'fr',
15
+ 'label' => 'French',
16
+ ),
17
+ array(
18
+ 'value' => 'de',
19
+ 'label' => 'German',
20
+ ),
21
+ array(
22
+ 'value' => 'pt',
23
+ 'label' => 'Portuguese',
24
+ ),
25
+ array(
26
+ 'value' => 'ru',
27
+ 'label' => 'Russian',
28
+ ),
29
+ array(
30
+ 'value' => 'es',
31
+ 'label' => 'Spanish',
32
+ ),
33
+ array(
34
+ 'value' => 'tr',
35
+ 'label' => 'Turkish',
36
+ ),
37
+ );
38
+ }
39
+ }
app/code/local/MD/Productregistration/Model/System/Config/Source/Dropdown/Theme.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Custom options for "reCaptcha Theme" dropdown of "Contacts Form Captcha" customization
4
+ */
5
+ class MD_Productregistration_Model_System_Config_Source_Dropdown_Theme
6
+ {
7
+ public function toOptionArray()
8
+ {
9
+ return array(
10
+ array(
11
+ 'value' => 'red',
12
+ 'label' => 'Red (default)',
13
+ ),
14
+ array(
15
+ 'value' => 'white',
16
+ 'label' => 'White',
17
+ ),
18
+ array(
19
+ 'value' => 'blackglass',
20
+ 'label' => 'Blackglass',
21
+ ),
22
+ array(
23
+ 'value' => 'clean',
24
+ 'label' => 'Clean',
25
+ ),
26
+ );
27
+ }
28
+ }
app/code/local/MD/Productregistration/controllers/Adminhtml/CustomerController.php ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_action
4
+ {
5
+ protected function _initAction() {
6
+ $this->loadLayout()
7
+ ->_setActiveMenu('productregistration/customer')
8
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Product Registration'), Mage::helper('adminhtml')->__('Product Registration'));
9
+ return $this;
10
+ }
11
+
12
+ public function indexAction() {
13
+ $this->_initAction()
14
+ ->renderLayout();
15
+ }
16
+
17
+ public function editAction() {
18
+ $id = $this->getRequest()->getParam('id');
19
+ $model = Mage::getModel('productregistration/customer')->load($id);
20
+
21
+ if ($model->getId() || $id == 0) {
22
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
23
+ if (!empty($data)) {
24
+ $model->setData($data);
25
+ }
26
+
27
+ Mage::register('productregistration_data', $model);
28
+
29
+ $this->loadLayout();
30
+ $this->_setActiveMenu('productregistration/customer');
31
+
32
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Product Registration'), Mage::helper('adminhtml')->__('Product Registration'));
33
+
34
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
35
+
36
+ $this->_addContent($this->getLayout()->createBlock('productregistration/adminhtml_customer_edit'))
37
+ ->_addLeft($this->getLayout()->createBlock('productregistration/adminhtml_customer_edit_tabs'));
38
+
39
+ $this->renderLayout();
40
+ } else {
41
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('productregistration')->__('Item does not exist'));
42
+ $this->_redirect('*/*/');
43
+ }
44
+ }
45
+ public function saveAction() {
46
+ if ($data = $this->getRequest()->getPost()) {
47
+
48
+ $model = Mage::getModel('productregistration/customer');
49
+ $model->setData($data)
50
+ ->setId($this->getRequest()->getParam('id'));
51
+
52
+ try {
53
+ $model->save();
54
+ switch ($model->getStatus()) {
55
+ case 2:
56
+ if(Mage::getStoreConfig('productregistration/general/enable_sent_mail')==1){
57
+ $this->setMailAddMember($model);
58
+ }
59
+ break;
60
+ case 3:
61
+ if(Mage::getStoreConfig('productregistration/general/enable_sent_mail')==1){
62
+ $this->setMailAddMemberReject($model);
63
+ }
64
+ break;
65
+ }
66
+
67
+ // print_r($model->getStatus());
68
+ // die('sent Mail ok');
69
+
70
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('productregistration')->__('Item was successfully saved'));
71
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
72
+
73
+ if ($this->getRequest()->getParam('back')) {
74
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
75
+ return;
76
+ }
77
+ $this->_redirect('*/*/');
78
+ return;
79
+ } catch (Exception $e) {
80
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
81
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
82
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
83
+ return;
84
+ }
85
+ }
86
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('productregistration')->__('Unable to find product registration to save'));
87
+ $this->_redirect('*/*/');
88
+ }
89
+ public function deleteAction() {
90
+ if( $this->getRequest()->getParam('id') > 0 ) {
91
+ try {
92
+ $model = Mage::getModel('productregistration/customer');
93
+
94
+ $model->setId($this->getRequest()->getParam('id'))
95
+ ->delete();
96
+
97
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
98
+ $this->_redirect('*/*/');
99
+ } catch (Exception $e) {
100
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
101
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
102
+ }
103
+ }
104
+ $this->_redirect('*/*/');
105
+ }
106
+
107
+ public function massDeleteAction() {
108
+ $productregistrationIds = $this->getRequest()->getParam('productregistration');
109
+ if(!is_array($productregistrationIds)) {
110
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select product registration(s)'));
111
+ } else {
112
+ try {
113
+ foreach ($productregistrationIds as $productregistrationId) {
114
+ $productregistration = Mage::getModel('productregistration/customer')->load($productregistrationId);
115
+ $productregistration->delete();
116
+ }
117
+ Mage::getSingleton('adminhtml/session')->addSuccess(
118
+ Mage::helper('adminhtml')->__(
119
+ 'Total of %d record(s) were successfully deleted', count($productregistrationIds)
120
+ )
121
+ );
122
+ } catch (Exception $e) {
123
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
124
+ }
125
+ }
126
+ $this->_redirect('*/*/index');
127
+ }
128
+
129
+ public function massStatusAction()
130
+ {
131
+ $productregistrationIds = $this->getRequest()->getParam('productregistration');
132
+ if(!is_array($productregistrationIds)) {
133
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select productregistration(s)'));
134
+ } else {
135
+ try {
136
+ foreach ($productregistrationIds as $productregistrationId) {
137
+ $productregistration = Mage::getSingleton('productregistration/customer')
138
+ ->load($productregistrationId)
139
+ ->setStatus($this->getRequest()->getParam('status'))
140
+ ->setIsMassupdate(true)
141
+ ->save();
142
+ }
143
+ $this->_getSession()->addSuccess(
144
+ $this->__('Total of %d record(s) were successfully updated', count($productregistrationIds))
145
+ );
146
+ } catch (Exception $e) {
147
+ $this->_getSession()->addError($e->getMessage());
148
+ }
149
+ }
150
+ $this->_redirect('*/*/index');
151
+ }
152
+
153
+ public function exportCsvAction()
154
+ {
155
+ $fileName = 'productregistration.csv';
156
+ $content = $this->getLayout()->createBlock('productregistration/adminhtml_customer_grid')
157
+ ->getCsv();
158
+
159
+ $this->_sendUploadResponse($fileName, $content);
160
+ }
161
+
162
+ public function exportXmlAction()
163
+ {
164
+ $fileName = 'productregistration.xml';
165
+ $content = $this->getLayout()->createBlock('productregistration/adminhtml_customer_grid')
166
+ ->getXml();
167
+
168
+ $this->_sendUploadResponse($fileName, $content);
169
+ }
170
+
171
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
172
+ {
173
+ $response = $this->getResponse();
174
+ $response->setHeader('HTTP/1.1 200 OK','');
175
+ $response->setHeader('Pragma', 'public', true);
176
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
177
+ $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
178
+ $response->setHeader('Last-Modified', date('r'));
179
+ $response->setHeader('Accept-Ranges', 'bytes');
180
+ $response->setHeader('Content-Length', strlen($content));
181
+ $response->setHeader('Content-type', $contentType);
182
+ $response->setBody($content);
183
+ $response->sendResponse();
184
+ die;
185
+ }
186
+
187
+ public function setMailAddMemberReject($procustomer)
188
+ {
189
+
190
+ $emailData = array();
191
+ $_storeName = Mage::app()->getStore()->getName();
192
+ $emailData['to_email'] = $procustomer->getEmailcus();
193
+ $emailData['to_name'] = $procustomer->getNamecus();
194
+ $emailTemplate = Mage::getModel('core/email_template')
195
+ ->loadDefault('product_notification_productregistration_reject');
196
+ $emailTemplateVariables = array();
197
+ $htlm="";
198
+ if($procustomer->getModelnumber1()!=""){
199
+ $htlm=$htlm.'<td class="fields"><tr><td style="padding-left: 20px;" >Equipment 1 :'.$procustomer->getEqipment1().'</td></tr><tr><td style="padding-left: 20px;" >Model Number: '.$procustomer->getModelnumber1().'</td></tr><tr><td style="padding-left: 20px;" >Serial Number: '.$procustomer->getSerial1().'</td></tr></td>';
200
+ }
201
+
202
+ if($procustomer->getModelnumber2()!=""){
203
+ $htlm=$htlm.'<td class="fields"><tr><td style="padding-left: 20px;" >Equipment 2 :'.$procustomer->getEqipment2().'</td></tr><tr><td style="padding-left: 20px;" >Model Number: '.$procustomer->getModelnumber2().'</td></tr><tr><td style="padding-left: 20px;" >Serial Number: '.$procustomer->getSerial2().'</td></tr></td>';
204
+ }
205
+
206
+ if($procustomer->getModelnumber3()!=""){
207
+ $htlm=$htlm.'<td class="fields"><tr><td style="padding-left: 20px;" >Equipment 3 :'.$procustomer->getEqipment3().'</td></tr><tr><td style="padding-left: 20px;" >Model Number: '.$procustomer->getModelnumber3().'</td></tr><tr><td style="padding-left: 20px;" >Serial Number: '.$procustomer->getSerial3().'</td></tr></td>';
208
+ }
209
+
210
+
211
+ // $emailTemplateVariables['logo_url'] = Mage::getDesign()->getSkinUrl(Mage::getStoreConfig('design/header/logo_src'));
212
+ $emailTemplateVariables['lable'] = 'Your product rejected register';
213
+ $emailTemplateVariables['data'] = $procustomer;
214
+ $emailTemplateVariables['html'] = $htlm;
215
+ $emailTemplateVariables['store'] = $_storeName;
216
+ $emailTemplateVariables['websitename'] = Mage::app()->getWebsite()->getName();
217
+ $emailTemplateVariables['namecheckmail'] = $procustomer->getNamecus();
218
+ $emailTemplateVariables['baseurl'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
219
+ $emailTemplateVariables['emailadmin'] = Mage::getStoreConfig('productregistration/general/admin_email');
220
+ $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
221
+ $emailTemplate->setSenderName(Mage::getStoreConfig('productregistration/general/admin_name'));
222
+ $emailTemplate->setSenderEmail(Mage::getStoreConfig('productregistration/general/admin_email'));
223
+
224
+ $emailTemplate->setTemplateSubject(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).' : Your product rejected register');
225
+ $emailTemplate->send( $procustomer->getEmailcus(), $procustomer->getNamecus(), $emailTemplateVariables);
226
+ }
227
+
228
+ public function setMailAddMember($procustomer)
229
+ {
230
+
231
+ $emailData = array();
232
+ $_storeName = Mage::app()->getStore()->getName();
233
+ $emailData['to_email'] = $procustomer->getEmailcus();
234
+ $emailData['to_name'] = $procustomer->getNamecus();
235
+ $emailTemplate = Mage::getModel('core/email_template')
236
+ ->loadDefault('product_notification_productregistration_approve');
237
+ $emailTemplateVariables = array();
238
+ $htlm="";
239
+ if($procustomer->getModelnumber1()!=""){
240
+ $htlm=$htlm.'<td class="fields"><tr><td style="padding-left: 20px;" >Equipment 1 :'.$procustomer->getEqipment1().'</td></tr><tr><td style="padding-left: 20px;" >Model Number: '.$procustomer->getModelnumber1().'</td></tr><tr><td style="padding-left: 20px;" >Serial Number: '.$procustomer->getSerial1().'</td></tr></td>';
241
+ }
242
+
243
+ if($procustomer->getModelnumber2()!=""){
244
+ $htlm=$htlm.'<td class="fields"><tr><td style="padding-left: 20px;" >Equipment 2 :'.$procustomer->getEqipment2().'</td></tr><tr><td style="padding-left: 20px;" >Model Number: '.$procustomer->getModelnumber2().'</td></tr><tr><td style="padding-left: 20px;" >Serial Number: '.$procustomer->getSerial2().'</td></tr></td>';
245
+ }
246
+
247
+ if($procustomer->getModelnumber3()!=""){
248
+ $htlm=$htlm.'<td class="fields"><tr><td style="padding-left: 20px;" >Equipment 3 :'.$procustomer->getEqipment3().'</td></tr><tr><td style="padding-left: 20px;" >Model Number: '.$procustomer->getModelnumber3().'</td></tr><tr><td style="padding-left: 20px;" >Serial Number: '.$procustomer->getSerial3().'</td></tr></td>';
249
+ }
250
+
251
+
252
+ // $emailTemplateVariables['logo_url'] = Mage::getDesign()->getSkinUrl(Mage::getStoreConfig('design/header/logo_src'));
253
+ $emailTemplateVariables['lable'] = 'Your product successfully registered';
254
+ $emailTemplateVariables['data'] = $procustomer;
255
+ $emailTemplateVariables['html'] = $htlm;
256
+ $emailTemplateVariables['websitename'] = Mage::app()->getWebsite()->getName();
257
+ $emailTemplateVariables['store'] = $_storeName;
258
+ $emailTemplateVariables['namecheckmail'] = $procustomer->getNamecus();
259
+ $emailTemplateVariables['baseurl'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
260
+ $emailTemplateVariables['emailadmin'] = Mage::getStoreConfig('productregistration/general/admin_email');
261
+ $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
262
+ $emailTemplate->setSenderName(Mage::getStoreConfig('productregistration/general/admin_name'));
263
+ $emailTemplate->setSenderEmail(Mage::getStoreConfig('productregistration/general/admin_email'));
264
+
265
+ $emailTemplate->setTemplateSubject(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).' : Your product successfully registered');
266
+ $emailTemplate->send( $procustomer->getEmailcus(), $procustomer->getNamecus(), $emailTemplateVariables);
267
+ }
268
+ }
app/code/local/MD/Productregistration/controllers/Adminhtml/ProductregistrationController.php ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MD_Productregistration_Adminhtml_ProductregistrationController extends Mage_Adminhtml_Controller_action
4
+ {
5
+
6
+ protected function _initAction() {
7
+ $this->loadLayout()
8
+ ->_setActiveMenu('productregistration/customer')
9
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Product Registration'), Mage::helper('adminhtml')->__('Product Registration'));
10
+
11
+ return $this;
12
+ }
13
+
14
+ public function indexAction() {
15
+ $this->_initAction()
16
+ ->renderLayout();
17
+ }
18
+
19
+ public function editAction() {
20
+ $id = $this->getRequest()->getParam('id');
21
+ $model = Mage::getModel('productregistration/customer')->load($id);
22
+
23
+ if ($model->getId() || $id == 0) {
24
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
25
+ if (!empty($data)) {
26
+ $model->setData($data);
27
+ }
28
+
29
+ Mage::register('productregistration_data', $model);
30
+
31
+ $this->loadLayout();
32
+ $this->_setActiveMenu('productregistration/customer');
33
+
34
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Product Registration'), Mage::helper('adminhtml')->__('Product Registration'));
35
+
36
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
37
+
38
+ $this->_addContent($this->getLayout()->createBlock('productregistration/adminhtml_customer_edit'))
39
+ ->_addLeft($this->getLayout()->createBlock('productregistration/adminhtml_customer_edit_tabs'));
40
+
41
+ $this->renderLayout();
42
+ } else {
43
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('productregistration')->__('Item does not exist'));
44
+ $this->_redirect('*/*/');
45
+ }
46
+ }
47
+
48
+ public function newAction() {
49
+ $this->_forward('edit');
50
+ }
51
+
52
+ public function saveAction() {
53
+ if ($data = $this->getRequest()->getPost()) {
54
+
55
+ if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
56
+ try {
57
+ /* Starting upload */
58
+ $uploader = new Varien_File_Uploader('filename');
59
+
60
+ // Any extention would work
61
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
62
+ $uploader->setAllowRenameFiles(false);
63
+
64
+ // Set the file upload mode
65
+ // false -> get the file directly in the specified folder
66
+ // true -> get the file in the product like folders
67
+ // (file.jpg will go in something like /media/f/i/file.jpg)
68
+ $uploader->setFilesDispersion(false);
69
+
70
+ // We set media as the upload dir
71
+ $path = Mage::getBaseDir('media') . DS ;
72
+ $uploader->save($path, $_FILES['filename']['name'] );
73
+
74
+ } catch (Exception $e) {
75
+
76
+ }
77
+
78
+ //this way the name is saved in DB
79
+ $data['filename'] = $_FILES['filename']['name'];
80
+ }
81
+
82
+
83
+ $model = Mage::getModel('productregistration/customer');
84
+ $model->setData($data)
85
+ ->setId($this->getRequest()->getParam('id'));
86
+
87
+ try {
88
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
89
+ $model->setCreatedTime(now())
90
+ ->setUpdateTime(now());
91
+ } else {
92
+ $model->setUpdateTime(now());
93
+ }
94
+
95
+ $model->save();
96
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('productregistration')->__('Item was successfully saved'));
97
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
98
+
99
+ if ($this->getRequest()->getParam('back')) {
100
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
101
+ return;
102
+ }
103
+ $this->_redirect('*/*/');
104
+ return;
105
+ } catch (Exception $e) {
106
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
107
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
108
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
109
+ return;
110
+ }
111
+ }
112
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('productregistration')->__('Unable to find product registration to save'));
113
+ $this->_redirect('*/*/');
114
+ }
115
+
116
+ public function deleteAction() {
117
+ if( $this->getRequest()->getParam('id') > 0 ) {
118
+ try {
119
+ $model = Mage::getModel('productregistration/customer');
120
+
121
+ $model->setId($this->getRequest()->getParam('id'))
122
+ ->delete();
123
+
124
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
125
+ $this->_redirect('*/*/');
126
+ } catch (Exception $e) {
127
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
128
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
129
+ }
130
+ }
131
+ $this->_redirect('*/*/');
132
+ }
133
+
134
+ public function massDeleteAction() {
135
+ $productregistrationIds = $this->getRequest()->getParam('productregistration');
136
+ if(!is_array($productregistrationIds)) {
137
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select product registration(s)'));
138
+ } else {
139
+ try {
140
+ foreach ($productregistrationIds as $productregistrationId) {
141
+ $productregistration = Mage::getModel('productregistration/customer')->load($productregistrationId);
142
+ $productregistration->delete();
143
+ }
144
+ Mage::getSingleton('adminhtml/session')->addSuccess(
145
+ Mage::helper('adminhtml')->__(
146
+ 'Total of %d record(s) were successfully deleted', count($productregistrationIds)
147
+ )
148
+ );
149
+ } catch (Exception $e) {
150
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
151
+ }
152
+ }
153
+ $this->_redirect('*/*/index');
154
+ }
155
+
156
+ public function massStatusAction()
157
+ {
158
+ $productregistrationIds = $this->getRequest()->getParam('productregistration');
159
+ if(!is_array($productregistrationIds)) {
160
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select productregistration(s)'));
161
+ } else {
162
+ try {
163
+ foreach ($productregistrationIds as $productregistrationId) {
164
+ $productregistration = Mage::getSingleton('productregistration/customer')
165
+ ->load($productregistrationId)
166
+ ->setStatus($this->getRequest()->getParam('status'))
167
+ ->setIsMassupdate(true)
168
+ ->save();
169
+ }
170
+ $this->_getSession()->addSuccess(
171
+ $this->__('Total of %d record(s) were successfully updated', count($productregistrationIds))
172
+ );
173
+ } catch (Exception $e) {
174
+ $this->_getSession()->addError($e->getMessage());
175
+ }
176
+ }
177
+ $this->_redirect('*/*/index');
178
+ }
179
+
180
+ public function exportCsvAction()
181
+ {
182
+ $fileName = 'productregistration.csv';
183
+ $content = $this->getLayout()->createBlock('productregistration/adminhtml_customer_grid')
184
+ ->getCsv();
185
+
186
+ $this->_sendUploadResponse($fileName, $content);
187
+ }
188
+
189
+ public function exportXmlAction()
190
+ {
191
+ $fileName = 'productregistration.xml';
192
+ $content = $this->getLayout()->createBlock('productregistration/adminhtml_customer_grid')
193
+ ->getXml();
194
+
195
+ $this->_sendUploadResponse($fileName, $content);
196
+ }
197
+
198
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
199
+ {
200
+ $response = $this->getResponse();
201
+ $response->setHeader('HTTP/1.1 200 OK','');
202
+ $response->setHeader('Pragma', 'public', true);
203
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
204
+ $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
205
+ $response->setHeader('Last-Modified', date('r'));
206
+ $response->setHeader('Accept-Ranges', 'bytes');
207
+ $response->setHeader('Content-Length', strlen($content));
208
+ $response->setHeader('Content-type', $contentType);
209
+ $response->setBody($content);
210
+ $response->sendResponse();
211
+ die;
212
+ }
213
+ }
app/code/local/MD/Productregistration/controllers/IndexController.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ session_start();
3
+ class MD_Productregistration_IndexController extends Mage_Core_Controller_Front_Action
4
+ {
5
+ public function indexAction()
6
+ {
7
+ $this->loadLayout();
8
+ $this->renderLayout();
9
+ }
10
+ }
app/code/local/MD/Productregistration/controllers/SubmitController.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ session_start();
3
+ class MD_Productregistration_SubmitController extends Mage_Core_Controller_Front_Action
4
+ {
5
+ public function indexAction()
6
+ {
7
+
8
+ $session = Mage::getSingleton('core/session', array('name'=>'frontend'));
9
+ $data = $this->getRequest()->getPost();
10
+ $capt = $this->getRequest()->getPost('captcharnumber');
11
+ $_capt = $session->getCodeCaptcha();
12
+
13
+ // die($_capt);
14
+ if ($capt === $_capt)
15
+ {
16
+ if (!empty($data)) {
17
+
18
+ $procustomer = Mage::getModel('productregistration/customer')->setData($data);
19
+ /* @var $review Mage_Review_Model_Review */
20
+ if ($procustomer->getCreatedTime == NULL || $procustomer->getUpdateTime() == NULL) {
21
+ $procustomer->setCreatedTime(now())->setUpdateTime(now());
22
+
23
+ } else {
24
+ $procustomer->setUpdateTime(now());
25
+ }
26
+
27
+ try {
28
+
29
+ if(Mage::getStoreConfig('productregistration/general/enable_sent_mail')==1){
30
+ $this->setMailAddMember($procustomer);
31
+ $this->setMailAdmin($procustomer);
32
+ }
33
+ $procustomer->save();
34
+ $session->setCheckData(1);
35
+ $customer11 = Mage::getModel('productregistration/customer')->getCollection();
36
+ $data['customer_id'] = $customer11->getLastItem()->getId();
37
+ $proinstaller = Mage::getModel('productregistration/installer')->setData($data);
38
+ $proproduct = Mage::getModel('productregistration/product')->setData($data);
39
+ $proinstaller->setCreatedTime(now())->setUpdateTime(now());
40
+ $proproduct->setCreatedTime(now())->setUpdateTime(now());
41
+ $proinstaller->save();
42
+ $proproduct->save();
43
+ $session->addSuccess($this->__('Your information has been inserted.'));
44
+ }
45
+ catch (Exception $e) {
46
+ $session->setCheckData(2);
47
+ $session->setFormData($data);
48
+ $session->addError($this->__('Unable to post your information. Please, try again later.'));
49
+ }
50
+
51
+ }
52
+ $this->_redirect('productregistration');
53
+ } else {
54
+ $session->setFormData($data);
55
+ $session->setCheckData(2);
56
+ $session->addError($this->__('Please make sure captcha code match.'));
57
+ $this->_redirect('productregistration');
58
+ }
59
+ }
60
+ public function setMailAddMember($procustomer)
61
+ {
62
+
63
+ $emailData = array();
64
+ $_storeName = Mage::app()->getStore()->getName();
65
+ $emailData['to_email'] = $procustomer->getEmailcus();
66
+ $emailData['to_name'] = $procustomer->getNamecus();
67
+ $emailTemplate = Mage::getModel('core/email_template')
68
+ ->loadDefault('product_notification_productregistration');
69
+ $emailTemplateVariables = array();
70
+ $htlm="";
71
+ if($procustomer->getModelnumber1()!=""){
72
+ $htlm=$htlm.'<td class="fields"><tr><td style="padding-left: 20px;" >Equipment 1 :'.$procustomer->getEqipment1().'</td></tr><tr><td style="padding-left: 20px;" >Model Number: '.$procustomer->getModelnumber1().'</td></tr><tr><td style="padding-left: 20px;" >Serial Number: '.$procustomer->getSerial1().'</td></tr></td>';
73
+ }
74
+
75
+ if($procustomer->getModelnumber2()!=""){
76
+ $htlm=$htlm.'<td class="fields"><tr><td style="padding-left: 20px;" >Equipment 2 :'.$procustomer->getEqipment2().'</td></tr><tr><td style="padding-left: 20px;" >Model Number: '.$procustomer->getModelnumber2().'</td></tr><tr><td style="padding-left: 20px;" >Serial Number: '.$procustomer->getSerial2().'</td></tr></td>';
77
+ }
78
+
79
+ if($procustomer->getModelnumber3()!=""){
80
+ $htlm=$htlm.'<td class="fields"><tr><td style="padding-left: 20px;" >Equipment 3 :'.$procustomer->getEqipment3().'</td></tr><tr><td style="padding-left: 20px;" >Model Number: '.$procustomer->getModelnumber3().'</td></tr><tr><td style="padding-left: 20px;" >Serial Number: '.$procustomer->getSerial3().'</td></tr></td>';
81
+ }
82
+
83
+
84
+ // $emailTemplateVariables['logo_url'] = Mage::getDesign()->getSkinUrl(Mage::getStoreConfig('design/header/logo_src'));
85
+ $emailTemplateVariables['lable'] = 'You have already registered products';
86
+ $emailTemplateVariables['data'] = $procustomer;
87
+ $emailTemplateVariables['html'] = $htlm;
88
+ $emailTemplateVariables['websitename'] = Mage::app()->getWebsite()->getName();
89
+ $emailTemplateVariables['store'] = $_storeName;
90
+ $emailTemplateVariables['namecheckmail'] = $procustomer->getNamecus();
91
+ $emailTemplateVariables['baseurl'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
92
+ $emailTemplateVariables['emailadmin'] = Mage::getStoreConfig('productregistration/general/admin_email');
93
+ $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
94
+ $emailTemplate->setSenderName(Mage::getStoreConfig('productregistration/general/admin_name'));
95
+ $emailTemplate->setSenderEmail(Mage::getStoreConfig('productregistration/general/admin_email'));
96
+
97
+ $emailTemplate->setTemplateSubject(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).': You for submitting your product registration information');
98
+ $emailTemplate->send( $procustomer->getEmailcus(), $procustomer->getNamecus(), $emailTemplateVariables);
99
+ }
100
+ public function setMailAdmin($procustomer)
101
+ {
102
+
103
+ $emailData = array();
104
+ $_storeName = Mage::app()->getStore()->getName();
105
+ $emailData['to_email'] = $procustomer->getEmailcus();
106
+ $emailData['to_name'] = $procustomer->getNamecus();
107
+ $emailTemplate = Mage::getModel('core/email_template')
108
+ ->loadDefault('product_notification_productregistration_admin');
109
+ $emailTemplateVariables = array();
110
+ $htlm="";
111
+ if($procustomer->getModelnumber1()!=""){
112
+ $htlm=$htlm.'<td class="fields"><tr><td style="padding-left: 20px;" >Equipment 1 :'.$procustomer->getEqipment1().'</td></tr><tr><td style="padding-left: 20px;" >Model Number: '.$procustomer->getModelnumber1().'</td></tr><tr><td style="padding-left: 20px;" >Serial Number: '.$procustomer->getSerial1().'</td></tr></td>';
113
+ }
114
+
115
+ if($procustomer->getModelnumber2()!=""){
116
+ $htlm=$htlm.'<td class="fields"><tr><td style="padding-left: 20px;" >Equipment 2 :'.$procustomer->getEqipment2().'</td></tr><tr><td style="padding-left: 20px;" >Model Number: '.$procustomer->getModelnumber2().'</td></tr><tr><td style="padding-left: 20px;" >Serial Number: '.$procustomer->getSerial2().'</td></tr></td>';
117
+ }
118
+
119
+ if($procustomer->getModelnumber3()!=""){
120
+ $htlm=$htlm.'<td class="fields"><tr><td style="padding-left: 20px;" >Equipment 3 :'.$procustomer->getEqipment3().'</td></tr><tr><td style="padding-left: 20px;" >Model Number: '.$procustomer->getModelnumber3().'</td></tr><tr><td style="padding-left: 20px;" >Serial Number: '.$procustomer->getSerial3().'</td></tr></td>';
121
+ }
122
+
123
+
124
+ // $emailTemplateVariables['logo_url'] = Mage::getDesign()->getSkinUrl(Mage::getStoreConfig('design/header/logo_src'));
125
+ $emailTemplateVariables['lable'] = 'You have already registered products';
126
+ $emailTemplateVariables['data'] = $procustomer;
127
+ $emailTemplateVariables['name'] = Mage::getStoreConfig('productregistration/general/admin_name');
128
+ $emailTemplateVariables['html'] = $htlm;
129
+ $emailTemplateVariables['store'] = $_storeName;
130
+ $emailTemplateVariables['websitename'] = Mage::app()->getWebsite()->getName();
131
+ $emailTemplateVariables['namecheckmail'] = Mage::getStoreConfig('productregistration/general/admin_name');
132
+ $emailTemplateVariables['baseurl'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
133
+ $emailTemplateVariables['emailadmin'] = Mage::getStoreConfig('productregistration/general/admin_email');
134
+ $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
135
+
136
+ $emailTemplate->setSenderName($procustomer->getNamecus());
137
+ $emailTemplate->setSenderEmail($procustomer->getEmailcus());
138
+
139
+ $emailTemplate->setTemplateSubject(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).': Product information register customers');
140
+ $emailTemplate->send( Mage::getStoreConfig('productregistration/general/admin_email'), Mage::getStoreConfig('productregistration/general/admin_name'), $emailTemplateVariables);
141
+ }
142
+ }
app/code/local/MD/Productregistration/etc/config.xml ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <MD_Productregistration>
5
+ <version>0.1.0</version>
6
+ </MD_Productregistration>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <productregistration>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>MD_Productregistration</module>
14
+ <frontName>productregistration</frontName>
15
+ </args>
16
+ </productregistration>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <productregistration>
21
+ <file>md_productregistration.xml</file>
22
+ </productregistration>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <productregistration>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>MD_Productregistration</module>
32
+ <frontName>productregistration</frontName>
33
+ </args>
34
+ </productregistration>
35
+ </routers>
36
+ </admin>
37
+ <adminhtml>
38
+ <menu>
39
+ <productregistration module="productregistration">
40
+ <title>Product Registration</title>
41
+ <sort_order>71</sort_order>
42
+ <children>
43
+ <customer module="productregistration">
44
+ <title>Customer Information</title>
45
+ <sort_order>1</sort_order>
46
+ <action>productregistration/adminhtml_customer</action>
47
+ </customer>
48
+ </children>
49
+ </productregistration>
50
+ </menu>
51
+
52
+ <acl>
53
+ <resources>
54
+ <all>
55
+ <title>Allow Everything</title>
56
+ </all>
57
+ <admin>
58
+ <children>
59
+ <productregistration module="productregistration">
60
+ <title>Product Registration</title>
61
+ <sort_order>71</sort_order>
62
+ </productregistration>
63
+ <system>
64
+ <children>
65
+ <config>
66
+ <children>
67
+ <productregistration translate="title" module="productregistration">
68
+ <title>Product Registration</title>
69
+ </productregistration>
70
+ </children>
71
+ </config>
72
+ </children>
73
+ </system>
74
+ </children>
75
+ </admin>
76
+ </resources>
77
+ </acl>
78
+ <layout>
79
+ <updates>
80
+ <productregistration>
81
+ <file>md_productregistration.xml</file>
82
+ </productregistration>
83
+ </updates>
84
+ </layout>
85
+ </adminhtml>
86
+ <global>
87
+ <models>
88
+ <productregistration>
89
+ <class>MD_Productregistration_Model</class>
90
+ <resourceModel>productregistration_mysql4</resourceModel>
91
+ </productregistration>
92
+ <productregistration_mysql4>
93
+ <class>MD_Productregistration_Model_Mysql4</class>
94
+ <entities>
95
+ <customer>
96
+ <table>md_customer</table>
97
+ </customer>
98
+ </entities>
99
+ <entities>
100
+ <installer>
101
+ <table>md_installer</table>
102
+ </installer>
103
+ </entities>
104
+ <entities>
105
+ <product>
106
+ <table>md_product</table>
107
+ </product>
108
+ </entities>
109
+ </productregistration_mysql4>
110
+ </models>
111
+ <resources>
112
+ <productregistration_setup>
113
+ <setup>
114
+ <module>MD_Productregistration</module>
115
+ </setup>
116
+ <connection>
117
+ <use>core_setup</use>
118
+ </connection>
119
+ </productregistration_setup>
120
+ <productregistration_write>
121
+ <connection>
122
+ <use>core_write</use>
123
+ </connection>
124
+ </productregistration_write>
125
+ <productregistration_read>
126
+ <connection>
127
+ <use>core_read</use>
128
+ </connection>
129
+ </productregistration_read>
130
+ </resources>
131
+ <blocks>
132
+ <productregistration>
133
+ <class>MD_Productregistration_Block</class>
134
+ </productregistration>
135
+ </blocks>
136
+ <helpers>
137
+ <productregistration>
138
+ <class>MD_Productregistration_Helper</class>
139
+ </productregistration>
140
+ </helpers>
141
+ <template>
142
+ <email>
143
+ <product_notification_productregistration translate="label" module="productregistration">
144
+ <label>Product Registration</label>
145
+ <file>md/productregistration/productregistration.html</file>
146
+ <type>html</type>
147
+ </product_notification_productregistration>
148
+ <product_notification_productregistration_admin translate="label" module="productregistration">
149
+ <label>Admin Product Registration</label>
150
+ <file>md/productregistration/productregistration_admin.html</file>
151
+ <type>html</type>
152
+ </product_notification_productregistration_admin>
153
+ <!-- <product_notification_productregistration_admin_approve translate="label" module="productregistration">
154
+ <label>Admin Product Registration Approve</label>
155
+ <file>md/productregistration/productregistration_admin_approve.html</file>
156
+ <type>html</type>
157
+ </product_notification_productregistration_admin_approve> -->
158
+ <product_notification_productregistration_approve translate="label" module="productregistration">
159
+ <label>Product Registration Approve</label>
160
+ <file>md/productregistration/productregistration_approve.html</file>
161
+ <type>html</type>
162
+ </product_notification_productregistration_approve>
163
+ <!-- <product_notification_productregistration_admin_reject translate="label" module="productregistration">
164
+ <label>Admin Product Registration Reject</label>
165
+ <file>md/productregistration/productregistration_admin_approve.html</file>
166
+ <type>html</type>
167
+ </product_notification_productregistration_admin_reject> -->
168
+ <product_notification_productregistration_reject translate="label" module="productregistration">
169
+ <label>Product Registration Reject</label>
170
+ <file>md/productregistration/productregistration_approve.html</file>
171
+ <type>html</type>
172
+ </product_notification_productregistration_reject>
173
+ </email>
174
+ </template>
175
+ </global>
176
+ <default>
177
+ <productregistration>
178
+ <info>
179
+ <enabled>1</enabled>
180
+ </info>
181
+ </productregistration>
182
+ </default>
183
+ </config>
app/code/local/MD/Productregistration/etc/system.xml ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <md module="productregistration">
5
+ <label>Mage-Designer</label>
6
+ <sort_order>110</sort_order>
7
+ </md>
8
+ </tabs>
9
+ <sections>
10
+ <productregistration translate="label" module="productregistration">
11
+ <label>Product Registration</label>
12
+ <tab>md</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>300</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <general translate="label" module="productregistration">
20
+ <label>General Settings</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>50</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <enable translate="label">
28
+ <label>Enable</label>
29
+ <frontend_type>select</frontend_type>
30
+ <source_model>adminhtml/system_config_source_yesno</source_model>
31
+ <sort_order>1</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ </enable>
36
+ <enable_sent_mail translate="label">
37
+ <label>Enable Sent Mail</label>
38
+ <frontend_type>select</frontend_type>
39
+ <source_model>adminhtml/system_config_source_yesno</source_model>
40
+ <sort_order>2</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>1</show_in_store>
44
+ </enable_sent_mail>
45
+ <enable_sent_mail_admin translate="label">
46
+ <label>Enable Notifies admin</label>
47
+ <frontend_type>select</frontend_type>
48
+ <source_model>adminhtml/system_config_source_yesno</source_model>
49
+ <sort_order>2</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>1</show_in_website>
52
+ <show_in_store>1</show_in_store>
53
+ </enable_sent_mail_admin>
54
+ <admin_email translate="label comment">
55
+ <label>Admin Email</label>
56
+ <frontend_type>text</frontend_type>
57
+ <sort_order>3</sort_order>
58
+ <show_in_default>1</show_in_default>
59
+ <show_in_website>1</show_in_website>
60
+ <show_in_store>1</show_in_store>
61
+ </admin_email>
62
+ <admin_name translate="label comment">
63
+ <label>Admin Name</label>
64
+ <frontend_type>text</frontend_type>
65
+ <sort_order>4</sort_order>
66
+ <show_in_default>1</show_in_default>
67
+ <show_in_website>1</show_in_website>
68
+ <show_in_store>1</show_in_store>
69
+ </admin_name>
70
+ <!-- <sender_admin_email translate="label comment">
71
+ <label>Sender Admin Email</label>
72
+ <frontend_type>text</frontend_type>
73
+ <sort_order>5</sort_order>
74
+ <show_in_default>1</show_in_default>
75
+ <show_in_website>1</show_in_website>
76
+ <show_in_store>1</show_in_store>
77
+ </sender_admin_email>
78
+ <sender_admin_name translate="label comment">
79
+ <label>Sender Admin Name</label>
80
+ <frontend_type>text</frontend_type>
81
+ <sort_order>6</sort_order>
82
+ <show_in_default>1</show_in_default>
83
+ <show_in_website>1</show_in_website>
84
+ <show_in_store>1</show_in_store>
85
+ </sender_admin_name> -->
86
+ </fields>
87
+ </general>
88
+ </groups>
89
+ </productregistration>
90
+ </sections>
91
+ </config>
app/code/local/MD/Productregistration/sql/productregistration_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run("
5
+ -- DROP TABLE IF EXISTS {$this->getTable('md_customer')};
6
+ CREATE TABLE {$this->getTable('md_customer')} (
7
+ `customer_id` int(11) unsigned NOT NULL auto_increment,
8
+ `invoice` varchar(255) NOT NULL default '',
9
+ `namecus` varchar(255) NOT NULL default '',
10
+ `emailcus` varchar(255) NOT NULL default '',
11
+ `datecus` varchar(255) NOT NULL default '',
12
+ `created_time` datetime NULL,
13
+ `update_time` datetime NULL,
14
+ `store_id` varchar(255) NOT NULL default '1',
15
+ `status` int(11) NOT NULL default '1',
16
+ `comment` varchar(500) NOT NULL default '',
17
+ PRIMARY KEY (`customer_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
18
+
19
+ -- DROP TABLE IF EXISTS {$this->getTable('md_installer')};
20
+ CREATE TABLE {$this->getTable('md_installer')} (
21
+ `installer_id` int(11) unsigned NOT NULL auto_increment,
22
+ `customer_id` int(11) unsigned NOT NULL,
23
+ `nameins` varchar(255) NOT NULL default '',
24
+ `addressins` varchar(255) NOT NULL default '',
25
+ `city` varchar(255) NOT NULL default '',
26
+ `state` varchar(255) NOT NULL default '',
27
+ `zip` varchar(255) NOT NULL default '',
28
+ `emailadd` varchar(255) NOT NULL default '',
29
+ `phone` varchar(255) NOT NULL default '',
30
+ `recommend` smallint(6) NOT NULL default '0',
31
+ `created_time` datetime NULL,
32
+ `update_time` datetime NULL,
33
+ PRIMARY KEY (`installer_id`), CONSTRAINT `FK_MD_INSTALLER` FOREIGN KEY (`customer_id`) REFERENCES `{$this->getTable('md_customer')}` (`customer_id`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=utf8;
34
+
35
+ -- DROP TABLE IF EXISTS {$this->getTable('md_product')};
36
+
37
+ CREATE TABLE {$this->getTable('md_product')} (
38
+ `product_id` int(11) unsigned NOT NULL auto_increment,
39
+ `customer_id` int(11) unsigned NOT NULL,
40
+ `eqipment1` varchar(255) NOT NULL default '',
41
+ `eqipment2` varchar(255) NOT NULL default '',
42
+ `eqipment3` varchar(255) NOT NULL default '',
43
+ `modelnumber1` varchar(255) NOT NULL default '',
44
+ `modelnumber2` varchar(255) NOT NULL default '',
45
+ `modelnumber3` varchar(255) NOT NULL default '',
46
+ `serial1` varchar(255) NOT NULL default '',
47
+ `serial2` varchar(255) NOT NULL default '',
48
+ `serial3` varchar(255) NOT NULL default '',
49
+ `created_time` datetime NULL,
50
+ `update_time` datetime NULL,
51
+ PRIMARY KEY (`product_id`), CONSTRAINT `FK_MD_PRODUCT` FOREIGN KEY (`customer_id`) REFERENCES `{$this->getTable('md_customer')}` (`customer_id`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=utf8; ");
52
+ $installer->endSetup(); ?>
app/code/local/MD/Productregistration/sql/productregistration_setup/mysql4-upgrade-0.1.0-0.1.1.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+ alter table md_customer add store_id varchar(255) NOT NULL default '1';
9
+ ");
10
+
11
+ $installer->endSetup();
12
+
13
+ ?>
app/code/local/MD/Productregistration/sql/productregistration_setup/mysql4-upgrade-0.1.0-0.1.2.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+
9
+ DROP TABLE IF EXISTS {$this->getTable('md_customer')};
10
+ DROP TABLE IF EXISTS {$this->getTable('md_installer')};
11
+ DROP TABLE IF EXISTS {$this->getTable('md_product')};
12
+
13
+ ");
14
+
15
+ $installer->endSetup();
16
+
17
+ ?>
app/code/local/MD/Productregistration/sql/productregistration_setup/mysql4-upgrade-0.1.2-0.1.3.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+
9
+ -- DROP TABLE IF EXISTS {$this->getTable('md_customer')};
10
+ CREATE TABLE {$this->getTable('md_customer')} (
11
+ `customer_id` int(11) unsigned NOT NULL auto_increment,
12
+ `invoice` varchar(255) NOT NULL default '',
13
+ `namecus` varchar(255) NOT NULL default '',
14
+ `emailcus` varchar(255) NOT NULL default '',
15
+ `datecus` varchar(255) NOT NULL default '',
16
+ `created_time` datetime NULL,
17
+ `update_time` datetime NULL,
18
+ `status` int(11) NOT NULL default '1',
19
+ `comment` varchar(500) NOT NULL default '',
20
+ PRIMARY KEY (`customer_id`)
21
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
22
+
23
+ -- DROP TABLE IF EXISTS {$this->getTable('md_installer')};
24
+ CREATE TABLE {$this->getTable('md_installer')} (
25
+ `installer_id` int(11) unsigned NOT NULL auto_increment,
26
+ `customer_id` int(11) unsigned NOT NULL,
27
+ `nameins` varchar(255) NOT NULL default '',
28
+ `addressins` varchar(255) NOT NULL default '',
29
+ `city` varchar(255) NOT NULL default '',
30
+ `state` varchar(255) NOT NULL default '',
31
+ `zip` varchar(255) NOT NULL default '',
32
+ `emailadd` varchar(255) NOT NULL default '',
33
+ `phone` varchar(255) NOT NULL default '',
34
+ `recommend` smallint(6) NOT NULL default '0',
35
+ `created_time` datetime NULL,
36
+ `update_time` datetime NULL,
37
+ PRIMARY KEY (`installer_id`),
38
+ CONSTRAINT `FK_MD_INSTALLER` FOREIGN KEY (`customer_id`) REFERENCES `{$this->getTable('md_customer')}` (`customer_id`) ON DELETE CASCADE ON UPDATE CASCADE
39
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
40
+
41
+
42
+ -- DROP TABLE IF EXISTS {$this->getTable('md_product')};
43
+ CREATE TABLE {$this->getTable('md_product')} (
44
+ `product_id` int(11) unsigned NOT NULL auto_increment,
45
+ `customer_id` int(11) unsigned NOT NULL,
46
+ `eqipment1` varchar(255) NOT NULL default '',
47
+ `eqipment2` varchar(255) NOT NULL default '',
48
+ `eqipment3` varchar(255) NOT NULL default '',
49
+ `modelnumber1` varchar(255) NOT NULL default '',
50
+ `modelnumber2` varchar(255) NOT NULL default '',
51
+ `modelnumber3` varchar(255) NOT NULL default '',
52
+ `serial1` varchar(255) NOT NULL default '',
53
+ `serial2` varchar(255) NOT NULL default '',
54
+ `serial3` varchar(255) NOT NULL default '',
55
+ `created_time` datetime NULL,
56
+ `update_time` datetime NULL,
57
+ PRIMARY KEY (`product_id`),
58
+ CONSTRAINT `FK_MD_PRODUCT` FOREIGN KEY (`customer_id`) REFERENCES `{$this->getTable('md_customer')}` (`customer_id`) ON DELETE CASCADE ON UPDATE CASCADE
59
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
60
+
61
+ ");
62
+
63
+ $installer->endSetup();
64
+
65
+ ?>
app/design/adminhtml/default/default/layout/md_productregistration.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <productregistration_adminhtml_customer_index>
4
+ <reference name="content">
5
+ <block type="productregistration/adminhtml_customer" name="customer" />
6
+ </reference>
7
+ </productregistration_adminhtml_customer_index>
8
+ </layout>
app/design/frontend/default/default/layout/md_productregistration.xml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ </default>
5
+ <productregistration_index_index>
6
+ <reference name="root" ifconfig="productregistration/general/enable">
7
+ <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
8
+ </reference>
9
+ <reference name="content" ifconfig="productregistration/general/enable">
10
+ <block type="productregistration/customer" name="customer" template="md/productregistration/form.phtml" />
11
+ </reference>
12
+ </productregistration_index_index>
13
+ </layout>
app/design/frontend/default/default/template/md/productregistration/form.phtml ADDED
@@ -0,0 +1,284 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(Mage::getStoreConfig('productregistration/general/enable')==1){
3
+ $session = Mage::getSingleton('core/session', array('name'=>'frontend'));
4
+ $data = $session->getFormData();
5
+ $check = $session->getCheckData();
6
+ if($check==1){
7
+ $data = Array ( 'invoice' => '', 'namecus' => '', 'emailcus' => '', 'nameins' => '', 'addressins' => '', 'city' => '', 'state' => '', 'zip' => '', 'emailadd' => '', 'phone' => '', 'recommend' => '', 'eqipment1' => '', 'modelnumber1' => '', 'serial1' => '', 'eqipment2' => '', 'modelnumber2' => '', 'serial2' => '', 'eqipment3' => '', 'modelnumber3' => '', 'serial3' => '', 'captcharnumber' => '' );
8
+ }
9
+ ?>
10
+
11
+ <div class="account-create">
12
+ <div class="page-title">
13
+ <h1><?php echo $this->__('Product Registration Form') ?></h1>
14
+ </div>
15
+ <form action="<?php echo $this->getUrl('productregistration/submit') ?>" id="dataForm" name="dataForm" method="post" enctype="multipart/form-data" >
16
+ <div class="fieldset">
17
+ <h2 class="legend"><?php echo $this->__('Customer Information:') ?></h2>
18
+ <ul class="form-list">
19
+ <li class="fields">
20
+ <div class="field invoice">
21
+ <label class="required" for="invoice"><em>*</em><?php echo $this->__('Invoice #') ?></label>
22
+ <div class="input-box">
23
+ <input type="text" class="input-text required-entry" value="<?php echo $data['invoice'] ?>" name="invoice">
24
+ </div>
25
+ </div>
26
+ <div class="field name-fullname">
27
+ <label class="required" for="fullname"><?php echo $this->__('Full Name') ?></label>
28
+ <div class="input-box">
29
+ <input type="text" class="input-text" value="<?php echo $data['namecus'] ?>" name="namecus">
30
+ </div>
31
+ </div>
32
+ </li>
33
+ <li>
34
+ <div class="field emailcus">
35
+ <label class="required" for="invoice"><em>*</em><?php echo $this->__('Email Address') ?></label>
36
+ <div class="input-box">
37
+ <input type="text" value="<?php echo $data['emailcus'] ?>" class="input-text required-entry validate-email" name="emailcus">
38
+ </div>
39
+ </div>
40
+ <div class="field datecus">
41
+ <label class="required" for="fullname"><?php echo $this->__('Date of install') ?></label>
42
+ <div class="input-box">
43
+ <input type="text" name="datecus" class="input-text" value="<?php echo date('d/m/Y') ?>">
44
+
45
+ </div>
46
+ </div>
47
+ </li>
48
+ </ul>
49
+ </div>
50
+
51
+ <div class="fieldset">
52
+ <h2 class="legend"><?php echo $this->__('Installer Information:') ?></h2>
53
+ <ul class="form-list">
54
+ <li class="fields">
55
+ <div class="field fullname">
56
+ <label class="required" for="Full Name"><em>*</em><?php echo $this->__('Full Name') ?></label>
57
+ <div class="input-box">
58
+ <input type="text" value="<?php echo $data['nameins'] ?>" class="input-text required-entry" name="nameins">
59
+ </div>
60
+ </div>
61
+ <div class="field address">
62
+ <label class="required" for="address"><?php echo $this->__('Address') ?></label>
63
+ <div class="input-box">
64
+ <input type="text" value="<?php echo $data['addressins'] ?>" class="input-text" name="addressins">
65
+ </div>
66
+ </div>
67
+ </li>
68
+ <li>
69
+ <div class="field city">
70
+ <label class="required" for="invoice"><?php echo $this->__('City') ?></label>
71
+ <div class="input-box">
72
+ <input type="text" class="input-text" value="<?php echo $data['city'] ?>" name="city">
73
+ </div>
74
+ </div>
75
+ <div class="field state">
76
+ <label class="required" for="fullname"><?php echo $this->__('State') ?></label>
77
+ <div class="input-box">
78
+ <input type="text" class="input-text" value="<?php echo $data['state'] ?>" name="state">
79
+ </div>
80
+ </div>
81
+ </li>
82
+ <li>
83
+ <div class="field zip">
84
+ <label class="required" for="invoice"><?php echo $this->__('Zip Code') ?></label>
85
+ <div class="input-box">
86
+ <input type="text" value="<?php echo $data['zip'] ?>" class="input-text" name="zip">
87
+ </div>
88
+ </div>
89
+ <div class="field emailadd">
90
+ <label class="required" for="fullname"><em>*</em><?php echo $this->__('Email Address:') ?></label>
91
+ <div class="input-box">
92
+ <input type="text" class="input-text required-entry" value="<?php echo $data['emailadd'] ?>" name="emailadd">
93
+ </div>
94
+ </div>
95
+ </li>
96
+ <li>
97
+ <div class="field phone">
98
+ <label class="required" for="invoice"><em>*</em><?php echo $this->__('Phone #') ?></label>
99
+ <div class="input-box">
100
+ <input type="text" class="input-text required-entry" value="<?php echo $data['phone'] ?>" name="phone">
101
+ </div>
102
+ </div>
103
+ </li>
104
+ <li>
105
+ <?php
106
+ $yData="";
107
+ $nData="";
108
+ if($data['recommend']){
109
+ $yData="checked";
110
+ }else{
111
+ $nData="checked";
112
+ }
113
+ ?>
114
+ <div class="field recommend" style="width: 168px;">
115
+ <label class="required" for="invoice"><em>*</em><?php echo $this->__('Recommend the installer?') ?></label>
116
+ </div>
117
+ <div class="field recommend" style="width: 50px;">
118
+ <div class="input-box">
119
+ <input type="radio" checked="<?php echo $yData ?>" name="recommend" value="true" id="workedWithProYes">
120
+ <label style="float: none;"> <?php echo $this->__('Yes') ?></label>
121
+ </div>
122
+ </div>
123
+ <div class="field recommend">
124
+ <div class="input-box">
125
+ <input type="radio" checked="<?php echo $nData ?>" name="recommend" value="false" id="workedWithProNo">
126
+ <label style="float: none;"> <?php echo $this->__('NO') ?></label>
127
+ </div>
128
+ </div>
129
+ </li>
130
+ </ul>
131
+ </div>
132
+
133
+ <div class="fieldset">
134
+ <h2 class="legend"><?php echo $this->__('Product Information:') ?></h2>
135
+ <ul class="form-list">
136
+ <p class="webforms-fields-comment"><?php echo $this->__('Please select the brand below then input the model and serial (one piece at a time)') ?></p>
137
+ <li class="fields">
138
+ <div class="field fullname">
139
+ <label class="required" for="Full Name"><?php echo $this->__('Equipment 1') ?></label>
140
+ <div class="input-box">
141
+ <select name="eqipment1">
142
+ <?php if ($this->getBrands()): ?>
143
+ <?php foreach ($this->getBrands() as $_brand): ?>
144
+ <?php
145
+ if($data['eqipment1']==$_brand["label"]){
146
+ echo '<option selected>'.$_brand["label"].'</option>';
147
+ }else{
148
+ ?>
149
+ <option><?php echo $_brand["label"]; ?></option>
150
+ <?php }?>
151
+ <?php endforeach; ?>
152
+ <?php else: ?>
153
+ <option><?php echo $this->__("Brands Aren't Available") ?></option>
154
+ <?php endif; ?>
155
+ </select>
156
+ </div>
157
+ </div>
158
+ <div class="field modelnumber1">
159
+ <label class="required" for="modelnumber1"><?php echo $this->__('Model Number:') ?></label>
160
+ <div class="input-box">
161
+ <input type="text" value="<?php echo $data['modelnumber1'] ?>" class="input-text" name="modelnumber1">
162
+ </div>
163
+ </div>
164
+ </li>
165
+ <li>
166
+ <div class="field" style="height: 40px;">
167
+ </div>
168
+ <div class="field serial1">
169
+ <label class="required" for="serial1"><?php echo $this->__('Serial Number:') ?></label>
170
+ <div class="input-box">
171
+ <input type="text" value="<?php echo $data['serial1'] ?>" class="input-text" name="serial1">
172
+ </div>
173
+ </div>
174
+ </li>
175
+
176
+ <li class="fields">
177
+ <div class="field fullname">
178
+ <label class="required" for="Full Name"><?php echo $this->__('Equipment 2') ?></label>
179
+ <div class="input-box">
180
+ <select name="eqipment2">
181
+ <?php if ($this->getBrands()): ?>
182
+ <?php foreach ($this->getBrands() as $_brand): ?>
183
+ <?php
184
+ if($data['eqipment2']==$_brand["label"]){
185
+ echo '<option selected>'.$_brand["label"].'</option>';
186
+ }else{
187
+ ?>
188
+ <option><?php echo $_brand["label"]; ?></option>
189
+ <?php }?>
190
+ <?php endforeach; ?>
191
+ <?php else: ?>
192
+ <option><?php echo $this->__("Brands Aren't Available") ?></option>
193
+ <?php endif; ?>
194
+ </select>
195
+ </div>
196
+ </div>
197
+ <div class="field modelnumber2">
198
+ <label class="required" for="modelnumber2"><?php echo $this->__('Model Number:') ?></label>
199
+ <div class="input-box">
200
+ <input type="text" value="<?php echo $data['modelnumber2'] ?>" class="input-text" name="modelnumber2">
201
+ </div>
202
+ </div>
203
+ </li>
204
+ <li>
205
+ <div class="field" style="height: 40px;">
206
+ </div>
207
+ <div class="field serial2">
208
+ <label class="required" for="serial2"><?php echo $this->__('Serial Number:') ?></label>
209
+ <div class="input-box">
210
+ <input type="text" value="<?php echo $data['serial2'] ?>" class="input-text" name="serial2">
211
+ </div>
212
+ </div>
213
+ </li>
214
+
215
+ <li class="fields">
216
+ <div class="field equipment">
217
+ <label class="required" for="Equipment"><?php echo $this->__('Equipment 3') ?></label>
218
+ <div class="input-box">
219
+ <select name="eqipment3">
220
+ <?php if ($this->getBrands()): ?>
221
+ <?php foreach ($this->getBrands() as $_brand): ?>
222
+ <?php
223
+ if($data['eqipment3']==$_brand["label"]){
224
+ echo '<option selected>'.$_brand["label"].'</option>';
225
+ }else{
226
+ ?>
227
+ <option><?php echo $_brand["label"]; ?></option>
228
+ <?php }?>
229
+ <?php endforeach; ?>
230
+ <?php else: ?>
231
+ <option><?php echo $this->__("Brands Aren't Available") ?></option>
232
+ <?php endif; ?>
233
+ </select>
234
+ </div>
235
+ </div>
236
+ <div class="field modelnumber3">
237
+ <label class="required" for="modelnumber3"><?php echo $this->__('Model Number:') ?></label>
238
+ <div class="input-box">
239
+ <input type="text" value="<?php echo $data['modelnumber3'] ?>" class="input-text" name="modelnumber3">
240
+ </div>
241
+ </div>
242
+ </li>
243
+ <li>
244
+ <div class="field" style="height: 40px;">
245
+ </div>
246
+ <div class="field serial3">
247
+ <label class="required" for="serial3"><?php echo $this->__('Serial Number:') ?></label>
248
+ <div class="input-box">
249
+ <input type="text" value="<?php echo $data['serial3'] ?>" class="input-text" name="serial3">
250
+ </div>
251
+ </div>
252
+ </li>
253
+ </ul>
254
+ </div>
255
+ <div class="fieldset">
256
+ <h2 class="legend"><?php echo $this->__('Captcha') ?></h2>
257
+ <ul class="form-list">
258
+ <li class="fields">
259
+ <div class="field">
260
+ <label class="required" for="serial3"><em>*</em><?php echo $this->__('Please enter the following code into the box provided:') ?></label>
261
+ <img src="<?php echo $this->getSkinUrl('md/productregistration/captcha.php') ?>" alt="captcha" width="150px" height="60px" />
262
+
263
+ <br/><br/>
264
+ <input type="text" class="input-text required-entry" name="captcharnumber">
265
+ </div>
266
+ </li>
267
+ </ul>
268
+ </div>
269
+
270
+ <div class="buttons-set">
271
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
272
+ <input type="submit" class="button_dataForm" name="submit" value="<?php echo $this->__('Send Information') ?>" style="background: none repeat scroll 0px 0px rgb(241, 130, 0); width: 125px; height: 30px; color: rgb(255, 255, 255); font-weight: bold; font-size: 11px;">
273
+ </div>
274
+
275
+ </form>
276
+ <script type="text/javascript">
277
+ //<![CDATA[
278
+ var contactForm = new VarienForm('dataForm', true);
279
+ //]]>
280
+ </script>
281
+ </div>
282
+ <?php
283
+ }
284
+ ?>
app/etc/modules/MD_Productregistration.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <MD_Productregistration>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </MD_Productregistration>
8
+ </modules>
9
+ </config>
app/locale/en_US/template/email/md/productregistration/productregistration.html ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject {{var store.getFrontendName()}}: Product Register # {{htmlescape var=$data.invoice}} @-->
2
+ <!--@vars
3
+
4
+ <!--@styles
5
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
6
+ .fieldset {background: none repeat scroll 0 0 #FBFAF6;border: 1px solid #BBAFA0;margin: 28px 0;padding: 22px 25px 12px 33px;}
7
+ .legend{color:#555;}
8
+ @-->
9
+
10
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
11
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
12
+ <div style="background:#EAEAEA;font-size:13px;padding:10px;">
13
+ Hi {{htmlescape var=$data.namecus}}!
14
+ </div>
15
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
16
+ <tr>
17
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
18
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
19
+ <!-- [ header starts here] -->
20
+ <tr>
21
+ <td valign="top"><a href="{{store url=""}}"><img height = "47" src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
22
+ </tr>
23
+ <tr style="color: #555555; text-align: center;">
24
+ <h2 class="legend">Product Information Register</h2>
25
+ </tr>
26
+ <tr>
27
+ <td style="padding-left: 50px;">
28
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
29
+ <tr>
30
+ <h2 style="color: #555555;">Customer Information:</h2>
31
+ </tr>
32
+ <tr style="background:#DDDACC">
33
+ <td class="fields">
34
+ <tr><td style="padding-left: 20px;" >Invoice # : {{htmlescape var=$data.invoice}} </td></tr>
35
+ <tr><td style="padding-left: 20px;" >Full Name : {{htmlescape var=$data.namecus}}</td></tr>
36
+ </td>
37
+ <td>
38
+ <tr><td style="padding-left: 20px;" >Email Address : {{htmlescape var=$data.emailcus}} </td></tr>
39
+ <tr><td style="padding-left: 20px;" >Date of install : {{htmlescape var=$data.datecus}}</td></tr>
40
+ </td>
41
+ </tr>
42
+ <tr>
43
+ <h2 style="color: #555555;">Installer Information:</h2>
44
+ </tr>
45
+ <tr style="background:#DDDACC">
46
+ <td class="fields">
47
+ <tr><td style="padding-left: 20px;" >Full Name : {{htmlescape var=$data.nameins}} </td></tr>
48
+ <tr><td style="padding-left: 20px;" >Address : {{htmlescape var=$data.addressins}}</td></tr>
49
+ </td>
50
+ <td>
51
+ <tr class="fields"><td style="padding-left: 20px;" >City : {{htmlescape var=$data.city}} </td></tr>
52
+ <tr><td style="padding-left: 20px;" >{{htmlescape var=$data.state}}</td></tr>
53
+ </td>
54
+ <td>
55
+ <tr><td style="padding-left: 20px;" >Zip Code : {{htmlescape var=$data.zip}}</td></tr>
56
+ <tr><td style="padding-left: 20px;" >Email Address : {{htmlescape var=$data.emailadd}}</td></tr>
57
+ </td>
58
+ <td>
59
+ <tr><td style="padding-left: 20px;" >Phone # : {{htmlescape var=$data.phone}}</td> </tr>
60
+ <tr><td style="padding-left: 20px;" >Recommend the installer? : {{htmlescape var=$data.recommend}}</td> </tr>
61
+ </td>
62
+ </tr>
63
+
64
+ <tr>
65
+ <h2 style="color: #555555;">Product Information:</h2>
66
+ </tr>
67
+ <tr style="background:#DDDACC">{{var html}}</tr>
68
+ </table>
69
+ </td>
70
+ </tr>
71
+ <!-- [ middle starts here] -->
72
+ <tr>
73
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you, <strong>{{var namecheckmail}}</strong></p></center></td>
74
+ </tr>
75
+ </table>
76
+ </td>
77
+ </tr>
78
+ </table>
79
+ </div>
80
+ </body>
app/locale/en_US/template/email/md/productregistration/productregistration_admin.html ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject {{var store.getFrontendName()}}: Product Register # {{htmlescape var=$data.invoice}} @-->
2
+ <!--@vars
3
+
4
+ <!--@styles
5
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
6
+ .fieldset {background: none repeat scroll 0 0 #FBFAF6;border: 1px solid #BBAFA0;margin: 28px 0;padding: 22px 25px 12px 33px;}
7
+ .legend{color:#555;}
8
+ @-->
9
+
10
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
11
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
12
+ <div style="background:#EAEAEA;font-size:13px;padding:10px;">
13
+ Hi {{var name}}!
14
+ </div>
15
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
16
+ <tr>
17
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
18
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
19
+ <!-- [ header starts here] -->
20
+ <tr>
21
+ <td valign="top"><a href="{{store url=""}}"><img height = "47" src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
22
+ </tr>
23
+ <tr style="color: #555555; text-align: center;">
24
+ <h2 class="legend">Product Information Register</h2>
25
+ </tr>
26
+ <tr>
27
+ <td style="padding-left: 50px;">
28
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
29
+ <tr>
30
+ <h2 style="color: #555555;">Customer Information:</h2>
31
+ </tr>
32
+ <tr style="background:#DDDACC">
33
+ <td class="fields">
34
+ <tr><td style="padding-left: 20px;" >Invoice # : {{htmlescape var=$data.invoice}} </td></tr>
35
+ <tr><td style="padding-left: 20px;" >Full Name : {{htmlescape var=$data.namecus}}</td></tr>
36
+ </td>
37
+ <td>
38
+ <tr><td style="padding-left: 20px;" >Email Address : {{htmlescape var=$data.emailcus}} </td></tr>
39
+ <tr><td style="padding-left: 20px;" >Date of install : {{htmlescape var=$data.datecus}}</td></tr>
40
+ </td>
41
+ </tr>
42
+ <tr>
43
+ <h2 style="color: #555555;">Installer Information:</h2>
44
+ </tr>
45
+ <tr style="background:#DDDACC">
46
+ <td class="fields">
47
+ <tr><td style="padding-left: 20px;" >Full Name : {{htmlescape var=$data.nameins}} </td></tr>
48
+ <tr><td style="padding-left: 20px;" >Address : {{htmlescape var=$data.addressins}}</td></tr>
49
+ </td>
50
+ <td>
51
+ <tr class="fields"><td style="padding-left: 20px;" >City : {{htmlescape var=$data.city}} </td></tr>
52
+ <tr><td style="padding-left: 20px;" >{{htmlescape var=$data.state}}</td></tr>
53
+ </td>
54
+ <td>
55
+ <tr><td style="padding-left: 20px;" >Zip Code : {{htmlescape var=$data.zip}}</td></tr>
56
+ <tr><td style="padding-left: 20px;" >Email Address : {{htmlescape var=$data.emailadd}}</td></tr>
57
+ </td>
58
+ <td>
59
+ <tr><td style="padding-left: 20px;" >Phone # : {{htmlescape var=$data.phone}}</td> </tr>
60
+ <tr><td style="padding-left: 20px;" >Recommend the installer? : {{htmlescape var=$data.recommend}}</td> </tr>
61
+ </td>
62
+ </tr>
63
+
64
+ <tr>
65
+ <h2 style="color: #555555;">Product Information:</h2>
66
+ </tr>
67
+ <tr style="background:#DDDACC">{{var html}}</tr>
68
+ </table>
69
+ </td>
70
+ </tr>
71
+ <!-- [ middle starts here] -->
72
+ <tr>
73
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you, <strong>{{var namecheckmail}}</strong></p></center></td>
74
+ </tr>
75
+ </table>
76
+ </td>
77
+ </tr>
78
+ </table>
79
+ </div>
80
+ </body>
app/locale/en_US/template/email/md/productregistration/productregistration_admin_approve.html ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject {{var store.getFrontendName()}}: Product Register # {{htmlescape var=$data.invoice}} @-->
2
+ <!--@vars
3
+
4
+ <!--@styles
5
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
6
+ .fieldset {background: none repeat scroll 0 0 #FBFAF6;border: 1px solid #BBAFA0;margin: 28px 0;padding: 22px 25px 12px 33px;}
7
+ .legend{color:#555;}
8
+ @-->
9
+
10
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
11
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
12
+ <div style="background:#EAEAEA;font-size:13px;padding:10px;">
13
+ Hi {{var name}}!
14
+ </div>
15
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
16
+ <tr>
17
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
18
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
19
+ <!-- [ header starts here] -->
20
+ <tr>
21
+ <td valign="top"><a href="{{store url=""}}"><img height = "47" src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
22
+ </tr>
23
+ <tr style="font-size: 14px; font-weight: bold; float: left;">
24
+ <td>{{var lable}} : {{htmlescape var=$data.comment}}</td>
25
+ </tr>
26
+ <tr style="color: #555555; text-align: center;">
27
+ <h2 class="legend">Product Information Register</h2>
28
+ </tr>
29
+ <tr>
30
+ <td style="padding-left: 50px;">
31
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
32
+ <tr>
33
+ <h2 style="color: #555555;">Customer Information:</h2>
34
+ </tr>
35
+ <tr style="background:#DDDACC">
36
+ <td class="fields">
37
+ <tr><td style="padding-left: 20px;" >Invoice # : {{htmlescape var=$data.invoice}} </td></tr>
38
+ <tr><td style="padding-left: 20px;" >Full Name : {{htmlescape var=$data.namecus}}</td></tr>
39
+ </td>
40
+ <td>
41
+ <tr><td style="padding-left: 20px;" >Email Address : {{htmlescape var=$data.emailcus}} </td></tr>
42
+ <tr><td style="padding-left: 20px;" >Date of install : {{htmlescape var=$data.datecus}}</td></tr>
43
+ </td>
44
+ </tr>
45
+ <tr>
46
+ <h2 style="color: #555555;">Installer Information:</h2>
47
+ </tr>
48
+ <tr style="background:#DDDACC">
49
+ <td class="fields">
50
+ <tr><td style="padding-left: 20px;" >Full Name : {{htmlescape var=$data.nameins}} </td></tr>
51
+ <tr><td style="padding-left: 20px;" >Address : {{htmlescape var=$data.addressins}}</td></tr>
52
+ </td>
53
+ <td>
54
+ <tr class="fields"><td style="padding-left: 20px;" >City : {{htmlescape var=$data.city}} </td></tr>
55
+ <tr><td style="padding-left: 20px;" >{{htmlescape var=$data.state}}</td></tr>
56
+ </td>
57
+ <td>
58
+ <tr><td style="padding-left: 20px;" >Zip Code : {{htmlescape var=$data.zip}}</td></tr>
59
+ <tr><td style="padding-left: 20px;" >Email Address : {{htmlescape var=$data.emailadd}}</td></tr>
60
+ </td>
61
+ <td>
62
+ <tr><td style="padding-left: 20px;" >Phone # : {{htmlescape var=$data.phone}}</td> </tr>
63
+ <tr><td style="padding-left: 20px;" >Recommend the installer? : {{htmlescape var=$data.recommend}}</td> </tr>
64
+ </td>
65
+ </tr>
66
+
67
+ <tr>
68
+ <h2 style="color: #555555;">Product Information:</h2>
69
+ </tr>
70
+ <tr style="background:#DDDACC">{{var html}}</tr>
71
+ </table>
72
+ </td>
73
+ </tr>
74
+ <!-- [ middle starts here] -->
75
+ <tr>
76
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you, <strong>{{var namecheckmail}}</strong></p></center></td>
77
+ </tr>
78
+ </table>
79
+ </td>
80
+ </tr>
81
+ </table>
82
+ </div>
83
+ </body>
app/locale/en_US/template/email/md/productregistration/productregistration_approve.html ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject {{var store.getFrontendName()}}: Product Register # {{htmlescape var=$data.invoice}} @-->
2
+ <!--@vars
3
+
4
+ <!--@styles
5
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
6
+ .fieldset {background: none repeat scroll 0 0 #FBFAF6;border: 1px solid #BBAFA0;margin: 28px 0;padding: 22px 25px 12px 33px;}
7
+ .legend{color:#555;}
8
+ @-->
9
+
10
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
11
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
12
+ <div style="background:#EAEAEA;font-size:13px;padding:10px;">
13
+ Hi {{htmlescape var=$data.namecus}}!
14
+ </div>
15
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
16
+ <tr>
17
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
18
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
19
+ <!-- [ header starts here] -->
20
+ <tr>
21
+ <td valign="top"><a href="{{store url=""}}"><img height = "47" src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
22
+ </tr>
23
+ <tr style="font-size: 14px; font-weight: bold; float: left;">
24
+ <td>{{var lable}} : {{htmlescape var=$data.comment}}</td>
25
+ </tr>
26
+ <tr style="color: #555555; text-align: center;font-size: 13px;font-weight: bold;">
27
+ <h2 class="legend">Product Information Register</h2>
28
+ </tr>
29
+ <tr>
30
+ <td style="padding-left: 50px;">
31
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
32
+ <tr>
33
+ <h2 style="color: #555555;">Customer Information:</h2>
34
+ </tr>
35
+ <tr style="background:#DDDACC">
36
+ <td class="fields">
37
+ <tr><td style="padding-left: 20px;" >Invoice # : {{htmlescape var=$data.invoice}} </td></tr>
38
+ <tr><td style="padding-left: 20px;" >Full Name : {{htmlescape var=$data.namecus}}</td></tr>
39
+ </td>
40
+ <td>
41
+ <tr><td style="padding-left: 20px;" >Email Address : {{htmlescape var=$data.emailcus}} </td></tr>
42
+ <tr><td style="padding-left: 20px;" >Date of install : {{htmlescape var=$data.datecus}}</td></tr>
43
+ </td>
44
+ </tr>
45
+ <tr>
46
+ <h2 style="color: #555555;">Installer Information:</h2>
47
+ </tr>
48
+ <tr style="background:#DDDACC">
49
+ <td class="fields">
50
+ <tr><td style="padding-left: 20px;" >Full Name : {{htmlescape var=$data.nameins}} </td></tr>
51
+ <tr><td style="padding-left: 20px;" >Address : {{htmlescape var=$data.addressins}}</td></tr>
52
+ </td>
53
+ <td>
54
+ <tr class="fields"><td style="padding-left: 20px;" >City : {{htmlescape var=$data.city}} </td></tr>
55
+ <tr><td style="padding-left: 20px;" >{{htmlescape var=$data.state}}</td></tr>
56
+ </td>
57
+ <td>
58
+ <tr><td style="padding-left: 20px;" >Zip Code : {{htmlescape var=$data.zip}}</td></tr>
59
+ <tr><td style="padding-left: 20px;" >Email Address : {{htmlescape var=$data.emailadd}}</td></tr>
60
+ </td>
61
+ <td>
62
+ <tr><td style="padding-left: 20px;" >Phone # : {{htmlescape var=$data.phone}}</td> </tr>
63
+ <tr><td style="padding-left: 20px;" >Recommend the installer? : {{htmlescape var=$data.recommend}}</td> </tr>
64
+ </td>
65
+ </tr>
66
+
67
+ <tr>
68
+ <h2 style="color: #555555;">Product Information:</h2>
69
+ </tr>
70
+ <tr style="background:#DDDACC">{{var html}}</tr>
71
+ </table>
72
+ </td>
73
+ </tr>
74
+ <!-- [ middle starts here] -->
75
+ <tr>
76
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you, <strong>{{var namecheckmail}}</strong></p></center></td>
77
+ </tr>
78
+ </table>
79
+ </td>
80
+ </tr>
81
+ </table>
82
+ </div>
83
+ </body>
package.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>MD_Product_Registration</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Product Registration Customer Extensions will help your website get closer to your customers is an important thing to achieve success in business. Take the first step on the path to customer success with our product registration. It is completely free for you.</summary>
10
+ <description>Product Registration Customer Extensions will help your website get closer to your customers is an important thing to achieve success in business. Take the first step on the path to customer success with our product registration. It is completely free for you.&#xD;
11
+ &#xD;
12
+ Product Registration Customeris easy to install, manage and use, will be very simple for you and your customers.&#xD;
13
+ &#xD;
14
+ Product Registration Customer will provide your customers with registered warranty information solutions for products purchased at the store. Your customers will certainly be very happy with the gadgets that we offer.</description>
15
+ <notes>please contact us : support@mage-designer.com</notes>
16
+ <authors><author><name>OSWorld</name><user>OSWorld</user><email>thinhct@mage-designer.com</email></author></authors>
17
+ <date>2013-01-22</date>
18
+ <time>08:01:01</time>
19
+ <contents><target name="magelocal"><dir name="MD"><dir name="Productregistration"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Edit"><file name="Form.php" hash="e21422d2cdecc7b6358c3a9c665e36c3"/><dir name="Tab"><file name="Form.php" hash="b889b8b7284c785756545a49cce24bc4"/></dir><file name="Tabs.php" hash="458f3f157524f50c424bc963596a8495"/></dir><file name="Edit.php" hash="6a98f7687ac1d3871a7808ce93244eff"/><file name="Grid.php" hash="6c81eab21ffe24cd32c766d0bbd555f5"/></dir><file name="Customer.php" hash="7609a1fdd692d260b3e938bb7196c637"/></dir><file name="Customer.php" hash="f6ea126f262781fadcd12febd77e5466"/></dir><dir name="Helper"><file name="Data.php" hash="cff9ed0996eaa59d4a89d0a9cdb26074"/></dir><dir name="Model"><file name="Customer.php" hash="ed98dde147ff24b86320e48de802a534"/><file name="Installer.php" hash="e9198f6fe0c56f6b31127861eb10edda"/><dir name="Mysql4"><dir name="Customer"><file name="Collection.php" hash="7429b8d5a6a173c4c4e44fd85e4af8fa"/></dir><file name="Customer.php" hash="1710c5585c1ae32ac3998075ae3ab304"/><dir name="Installer"><file name="Collection.php" hash="8d4b23dc85be59256d5fe14e6483ad6b"/></dir><file name="Installer.php" hash="eb5bba559416e03b84c777b337c2caec"/><dir name="Product"><file name="Collection.php" hash="fba90256e62899b7ef0c6cad1b92c05b"/></dir><file name="Product.php" hash="5a76391e2c24e788a9479f1bd2d2958c"/></dir><file name="Product.php" hash="9f0693826901a2ceb62bbc6fa2c86228"/><file name="Status.php" hash="b4efac03b8d8a9e77ee22fd12f4d76b4"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Dropdown"><file name="Lang.php" hash="2ea42eec2662adad2a332bcf1cc46303"/><file name="Theme.php" hash="34e608e9ceac5fc2a09e8c91a52e0162"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CustomerController.php" hash="b9891351ecc1f75431cffd33195ae540"/><file name="ProductregistrationController.php" hash="089e8b03f3e7da2565e1d23fb8aab58e"/></dir><file name="IndexController.php" hash="88d1c7e8a544f03b4daa0ee67e9df247"/><file name="SubmitController.php" hash="6fcb1620ae1115e1647f0af5243b4862"/></dir><dir name="etc"><file name="config.xml" hash="47f242c19852f5b300a3e0b99966d86c"/><file name="system.xml" hash="7224ee793aa2ac61a8c499af5ec6ec70"/></dir><dir name="sql"><dir name="productregistration_setup"><file name="mysql4-install-0.1.0.php" hash="3e1cb976b6022bbcbb41c5e3a8b07f16"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="1254a40315cabe82d35bd54f7ecd0daf"/><file name="mysql4-upgrade-0.1.0-0.1.2.php" hash="3e9d2f38a35a86f75c863f41ca10b716"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="f3e099fd30cfc52f64c7d848bae5505a"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="md_productregistration.xml" hash="1170aa71c0f4cb70b4f91d05635bfd25"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="md_productregistration.xml" hash="90c10cd2666500678b1b959e3fa7f19f"/></dir><dir name="template"><dir name="md"><dir name="productregistration"><file name="form.phtml" hash="4ca7fbfb2d6a353fb401861a64c2e8d1"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="md"><dir name="productregistration"><file name="arial.ttf" hash="5995c725ca5a13be62d3dc75c2fc59fc"/><file name="captcha.php" hash="f674c1da3db7386502d82b17e76dea75"/><file name="cross.gif" hash="d4f75db8bb2c10fd00ad80670c220340"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="."><file name="readme.txt" hash="c226fb05de60d19a675f03d38abb2f4b"/></dir></target><target name="mageetc"><dir name="modules"><file name="MD_Productregistration.xml" hash="24ff8e2e216139698808394639a07532"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="md"><dir name="productregistration"><file name="productregistration.html" hash="4dc1260562c80a401e1d26e59a2fcec1"/><file name="productregistration_admin.html" hash="c0f90d852fa49432034c049b321463b8"/><file name="productregistration_admin_approve.html" hash="8ef3bc5d1c9576505f7d8ad4d5ebd3a2"/><file name="productregistration_approve.html" hash="7df355d6688173ddbce0d89025d4dc20"/></dir></dir></dir></dir></dir></target></contents>
20
+ <compatible/>
21
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
22
+ </package>
readme.txt ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Mage-designer.com==== Productregistration - v1.0 ===Mage-designer.com
2
+
3
+ 1, Copy folder app, arial.ttf, captcha.php, cross.gif into magento root.
4
+ 2, Go to Admin, and making sure that the cache have been cleared
5
+ then you will see the tab menu Product Registration in admin panel.
6
+ 3, Goto Tab System -> configuration-> MAGE-DESIGNER -> Product Registration
7
+ and select General and choose yes to enable module.
8
+ 4, Final, go to front end access url */productregistration to see module
9
+
10
+ If after install extension, you get message "Access denied", please try to logout and login again.
11
+
12
+ If you have any problem please email to: noreply@mage-designer.com
13
+ Thanks,
14
+ Mage-designer.com
15
+
skin/frontend/default/default/md/productregistration/arial.ttf ADDED
Binary file
skin/frontend/default/default/md/productregistration/captcha.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
skin/frontend/default/default/md/productregistration/cross.gif ADDED
Binary file