Customer_Additional_Info - Version 1.0.0

Version Notes

First stable release.

Download this release

Release Info

Developer Bikash Kaushik
Extension Customer_Additional_Info
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/Bk/Customerdetails/Block/Adminhtml/Customer/Tab.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Bk_Customerdetails_Block_Adminhtml_Customer_Tab
3
+ extends Mage_Adminhtml_Block_Template
4
+ implements Mage_Adminhtml_Block_Widget_Tab_Interface {
5
+
6
+ public function _construct()
7
+ {
8
+ parent::_construct();
9
+ $this->setTemplate('customerdetails/customer/tab.phtml');
10
+ }
11
+
12
+ public function getTabLabel()
13
+ {
14
+ return $this->__('Extended Information');
15
+ }
16
+
17
+ public function getTabTitle()
18
+ {
19
+ return $this->__('Extended Information');
20
+ }
21
+
22
+ public function canShowTab()
23
+ {
24
+ return true;
25
+ }
26
+
27
+ public function isHidden()
28
+ {
29
+ return false;
30
+ }
31
+ }
app/code/community/Bk/Customerdetails/Block/Extended/Info.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bk_Customerdetails_Block_Extended_Info extends Mage_Core_Block_Template //Mage_Customer_Block_Form_Edit
4
+ {
5
+
6
+ // protected function _construct()
7
+ // {
8
+ // parent::_construct();
9
+ // $this->setTemplate('');
10
+ // }
11
+
12
+ public function getCustomerId() {
13
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
14
+ return $customer->getEntityId();
15
+ }
16
+
17
+ public function getCustomerInfo() {
18
+ $_collection = Mage::getModel('customerdetails/extendedinfo')->load($this->getCustomerId(), 'entity_id');
19
+ return $_collection;
20
+ }
21
+ }
app/code/community/Bk/Customerdetails/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bk_Customerdetails_Helper_Data extends Mage_Payment_Helper_Data
4
+ {
5
+ // const XML_PATH_EMAIL = '';
6
+ }
app/code/community/Bk/Customerdetails/Model/Extendedinfo.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bk_Customerdetails_Model_Extendedinfo extends Mage_Core_Model_Abstract {
4
+
5
+ public function _construct() {
6
+ parent::_construct();
7
+ $this->_init('customerdetails/extendedinfo');
8
+ }
9
+ }
app/code/community/Bk/Customerdetails/Model/Mysql4/Extendedinfo.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bk_Customerdetails_Model_Mysql4_Extendedinfo extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct() {
6
+ $this->_init('customerdetails/extendedinfo', 'info_id');
7
+ }
8
+ }
app/code/community/Bk/Customerdetails/Model/Mysql4/Extendedinfo/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bk_Customerdetails_Model_Mysql4_Extendedinfo_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct() {
6
+ parent::_construct();
7
+ $this->_init('customerdetails/extendedinfo');
8
+ }
9
+ }
10
+
app/code/community/Bk/Customerdetails/controllers/Adminhtml/CustomerController.php ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once(Mage::getModuleDir('controllers','Mage_Adminhtml').DS.'CustomerController.php');
4
+
5
+ class Bk_Customerdetails_Adminhtml_CustomerController extends Mage_Adminhtml_CustomerController
6
+ {
7
+ /**
8
+ * Save customer action
9
+ */
10
+ public function saveAction()
11
+ {
12
+ $data = $this->getRequest()->getPost();
13
+ if ($data) {
14
+ $redirectBack = $this->getRequest()->getParam('back', false);
15
+ $this->_initCustomer('customer_id');
16
+
17
+ /** @var $customer Mage_Customer_Model_Customer */
18
+ $customer = Mage::registry('current_customer');
19
+
20
+ /** @var $customerForm Mage_Customer_Model_Form */
21
+ $customerForm = Mage::getModel('customer/form');
22
+ $customerForm->setEntity($customer)
23
+ ->setFormCode('adminhtml_customer')
24
+ ->ignoreInvisible(false)
25
+ ;
26
+
27
+ $formData = $customerForm->extractData($this->getRequest(), 'account');
28
+
29
+ // Handle 'disable auto_group_change' attribute
30
+ if (isset($formData['disable_auto_group_change'])) {
31
+ $formData['disable_auto_group_change'] = empty($formData['disable_auto_group_change']) ? '0' : '1';
32
+ }
33
+
34
+ $errors = null;
35
+ if ($customer->getId()&& !empty($data['account']['new_password'])
36
+ && Mage::helper('customer')->getIsRequireAdminUserToChangeUserPassword()
37
+ ) {
38
+ //Validate current admin password
39
+ if (isset($data['account']['current_password'])) {
40
+ $currentPassword = $data['account']['current_password'];
41
+ } else {
42
+ $currentPassword = null;
43
+ }
44
+ unset($data['account']['current_password']);
45
+ $errors = $this->_validateCurrentPassword($currentPassword);
46
+ }
47
+
48
+ if (!is_array($errors)) {
49
+ $errors = $customerForm->validateData($formData);
50
+ }
51
+
52
+ if ($errors !== true) {
53
+ foreach ($errors as $error) {
54
+ $this->_getSession()->addError($error);
55
+ }
56
+ $this->_getSession()->setCustomerData($data);
57
+ $this->getResponse()->setRedirect($this->getUrl('*/customer/edit', array('id' => $customer->getId())));
58
+ return;
59
+ }
60
+
61
+ $customerForm->compactData($formData);
62
+
63
+ // Unset template data
64
+ if (isset($data['address']['_template_'])) {
65
+ unset($data['address']['_template_']);
66
+ }
67
+
68
+ $modifiedAddresses = array();
69
+ if (!empty($data['address'])) {
70
+ /** @var $addressForm Mage_Customer_Model_Form */
71
+ $addressForm = Mage::getModel('customer/form');
72
+ $addressForm->setFormCode('adminhtml_customer_address')->ignoreInvisible(false);
73
+
74
+ foreach (array_keys($data['address']) as $index) {
75
+ $address = $customer->getAddressItemById($index);
76
+ if (!$address) {
77
+ $address = Mage::getModel('customer/address');
78
+ }
79
+
80
+ $requestScope = sprintf('address/%s', $index);
81
+ $formData = $addressForm->setEntity($address)
82
+ ->extractData($this->getRequest(), $requestScope);
83
+
84
+ // Set default billing and shipping flags to address
85
+ $isDefaultBilling = isset($data['account']['default_billing'])
86
+ && $data['account']['default_billing'] == $index;
87
+ $address->setIsDefaultBilling($isDefaultBilling);
88
+ $isDefaultShipping = isset($data['account']['default_shipping'])
89
+ && $data['account']['default_shipping'] == $index;
90
+ $address->setIsDefaultShipping($isDefaultShipping);
91
+
92
+ $errors = $addressForm->validateData($formData);
93
+ if ($errors !== true) {
94
+ foreach ($errors as $error) {
95
+ $this->_getSession()->addError($error);
96
+ }
97
+ $this->_getSession()->setCustomerData($data);
98
+ $this->getResponse()->setRedirect($this->getUrl('*/customer/edit', array(
99
+ 'id' => $customer->getId())
100
+ ));
101
+ return;
102
+ }
103
+
104
+ $addressForm->compactData($formData);
105
+
106
+ // Set post_index for detect default billing and shipping addresses
107
+ $address->setPostIndex($index);
108
+
109
+ if ($address->getId()) {
110
+ $modifiedAddresses[] = $address->getId();
111
+ } else {
112
+ $customer->addAddress($address);
113
+ }
114
+ }
115
+ }
116
+
117
+ // Default billing and shipping
118
+ if (isset($data['account']['default_billing'])) {
119
+ $customer->setData('default_billing', $data['account']['default_billing']);
120
+ }
121
+ if (isset($data['account']['default_shipping'])) {
122
+ $customer->setData('default_shipping', $data['account']['default_shipping']);
123
+ }
124
+ if (isset($data['account']['confirmation'])) {
125
+ $customer->setData('confirmation', $data['account']['confirmation']);
126
+ }
127
+
128
+ // Mark not modified customer addresses for delete
129
+ foreach ($customer->getAddressesCollection() as $customerAddress) {
130
+ if ($customerAddress->getId() && !in_array($customerAddress->getId(), $modifiedAddresses)) {
131
+ $customerAddress->setData('_deleted', true);
132
+ }
133
+ }
134
+
135
+ if (Mage::getSingleton('admin/session')->isAllowed('customer/newsletter')
136
+ && !$customer->getConfirmation()
137
+ ) {
138
+ $customer->setIsSubscribed(isset($data['subscription']));
139
+ }
140
+
141
+ if (isset($data['account']['sendemail_store_id'])) {
142
+ $customer->setSendemailStoreId($data['account']['sendemail_store_id']);
143
+ }
144
+
145
+ $isNewCustomer = $customer->isObjectNew();
146
+ try {
147
+ $sendPassToEmail = false;
148
+ // Force new customer confirmation
149
+ if ($isNewCustomer) {
150
+ $customer->setPassword($data['account']['password']);
151
+ $customer->setForceConfirmed(true);
152
+ if ($customer->getPassword() == 'auto') {
153
+ $sendPassToEmail = true;
154
+ $customer->setPassword($customer->generatePassword());
155
+ }
156
+ }
157
+
158
+ Mage::dispatchEvent('adminhtml_customer_prepare_save', array(
159
+ 'customer' => $customer,
160
+ 'request' => $this->getRequest()
161
+ ));
162
+
163
+ $customer->save();
164
+
165
+ // Send welcome email
166
+ if ($customer->getWebsiteId() && (isset($data['account']['sendemail']) || $sendPassToEmail)) {
167
+ $storeId = $customer->getSendemailStoreId();
168
+ if ($isNewCustomer) {
169
+ $customer->sendNewAccountEmail('registered', '', $storeId);
170
+ } elseif ((!$customer->getConfirmation())) {
171
+ // Confirm not confirmed customer
172
+ $customer->sendNewAccountEmail('confirmed', '', $storeId);
173
+ }
174
+ }
175
+
176
+ if (!empty($data['account']['new_password'])) {
177
+ $newPassword = $data['account']['new_password'];
178
+ if ($newPassword == 'auto') {
179
+ $newPassword = $customer->generatePassword();
180
+ }
181
+ $customer->changePassword($newPassword);
182
+ $customer->sendPasswordReminderEmail();
183
+ }
184
+
185
+ Mage::getSingleton('adminhtml/session')->addSuccess(
186
+ Mage::helper('adminhtml')->__('The customer has been saved.')
187
+ );
188
+ Mage::dispatchEvent('adminhtml_customer_save_after', array(
189
+ 'customer' => $customer,
190
+ 'request' => $this->getRequest()
191
+ ));
192
+
193
+ //Here start extended info saving
194
+ $_collection = Mage::getModel('customerdetails/extendedinfo')->load($data['entity_id'], 'entity_id');
195
+ try {
196
+ if($_collection->getEntityId() == NULL) {
197
+ $_collection->setData('entity_id', $data['entity_id']);
198
+ }
199
+ $_collection->setData('matriculation_year', $data['bk']['matriculation_year']);
200
+ $_collection->setData('matriculation_school', $data['bk']['matriculation_school']);
201
+ $_collection->setData('matriculation_city', $data['bk']['matriculation_city']);
202
+ $_collection->setData('matriculation_stream', $data['bk']['matriculation_stream']);
203
+ $_collection->setData('matriculation_marks', $data['bk']['matriculation_marks']);
204
+ $_collection->setData('intermediate_year', $data['bk']['intermediate_year']);
205
+ $_collection->setData('intermediate_school', $data['bk']['intermediate_school']);
206
+ $_collection->setData('intermediate_city', $data['bk']['intermediate_city']);
207
+ $_collection->setData('intermediate_stream', $data['bk']['intermediate_stream']);
208
+ $_collection->setData('intermediate_marks', $data['bk']['intermediate_marks']);
209
+ $_collection->setData('graduation_year', $data['bk']['graduation_year']);
210
+ $_collection->setData('graduation_college', $data['bk']['graduation_college']);
211
+ $_collection->setData('graduation_university', $data['bk']['graduation_university']);
212
+ $_collection->setData('graduation_city', $data['bk']['graduation_city']);
213
+ $_collection->setData('graduation_stream', $data['bk']['graduation_stream']);
214
+ $_collection->setData('graduation_marks', $data['bk']['graduation_marks']);
215
+ $_collection->setData('pgraduation_year', $data['bk']['pgraduation_year']);
216
+ $_collection->setData('pgraduation_college', $data['bk']['pgraduation_college']);
217
+ $_collection->setData('pgraduation_university', $data['bk']['pgraduation_university']);
218
+ $_collection->setData('pgraduation_city', $data['bk']['pgraduation_city']);
219
+ $_collection->setData('pgraduation_stream', $data['bk']['pgraduation_stream']);
220
+ $_collection->setData('pgraduation_marks', $data['bk']['pgraduation_marks']);
221
+ $_collection->save();
222
+ } catch (Mage_Core_Exception $e) {
223
+ $this->_getSession()->addError($e->getMessage());
224
+ $this->_getSession()->setCustomerData($data);
225
+ $this->getResponse()->setRedirect($this->getUrl('*/customer/edit', array('id' => $customer->getId())));
226
+ }
227
+ //Here ends extended info saving
228
+
229
+ if ($redirectBack) {
230
+ $this->_redirect('*/*/edit', array(
231
+ 'id' => $customer->getId(),
232
+ '_current' => true
233
+ ));
234
+ return;
235
+ }
236
+ } catch (Mage_Core_Exception $e) {
237
+ $this->_getSession()->addError($e->getMessage());
238
+ $this->_getSession()->setCustomerData($data);
239
+ $this->getResponse()->setRedirect($this->getUrl('*/customer/edit', array('id' => $customer->getId())));
240
+ } catch (Exception $e) {
241
+ $this->_getSession()->addException($e,
242
+ Mage::helper('adminhtml')->__('An error occurred while saving the customer.'));
243
+ $this->_getSession()->setCustomerData($data);
244
+ $this->getResponse()->setRedirect($this->getUrl('*/customer/edit', array('id'=>$customer->getId())));
245
+ return;
246
+ }
247
+ }
248
+ $this->getResponse()->setRedirect($this->getUrl('*/customer'));
249
+ }
250
+ }
app/code/community/Bk/Customerdetails/controllers/ExtendedController.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bk_Customerdetails_ExtendedController extends Mage_Core_Controller_Front_Action
4
+ {
5
+ /**
6
+ * Checking if user is logged in or not
7
+ * If not logged in then redirect to customer login
8
+ */
9
+ public function preDispatch()
10
+ {
11
+ parent::preDispatch();
12
+ if (!Mage::getSingleton('customer/session')->authenticate($this)) {
13
+ $this->setFlag('', 'no-dispatch', true);
14
+ // adding message in customer login page
15
+ Mage::getSingleton('core/session')
16
+ ->addSuccess(Mage::helper('customerdetails')->__('Please sign in or create a new account'));
17
+ }
18
+ }
19
+
20
+ /**
21
+ * Retrieve Customerdetails helper
22
+ *
23
+ * @return Bk_Customerdetails_Helper_Data
24
+ */
25
+ protected function _getHelper()
26
+ {
27
+ return Mage::helper('customerdetails');
28
+ }
29
+
30
+ /**
31
+ * @return Customer Extended Info
32
+ */
33
+ public function infoAction() {
34
+ $handles = array('default');
35
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
36
+ $handles[] = 'customer_account';// setting the handle for same layout
37
+ }
38
+ $this->loadLayout($handles);
39
+ $this->getLayout()->getBlock('head')->setTitle($this->__('Extended Information'));
40
+ $this->renderLayout();
41
+ }
42
+
43
+ public function saveExtendedInfoAction() {
44
+ if (!$this->_validateFormKey()) {
45
+ return $this->_redirect('*/*/info');
46
+ }
47
+
48
+ if ($this->getRequest()->isPost()) {
49
+ $post = $this->getRequest()->getPost();
50
+ $_collection = Mage::getModel('customerdetails/extendedinfo')->load($post['entity_id'], 'entity_id');
51
+
52
+ unset($post['info_id']);
53
+ unset($post['entity_id']);
54
+ unset($post['form_key']);
55
+
56
+ try {
57
+ $_collection->setData('matriculation_year', $post['matriculation_year']);
58
+ $_collection->setData('matriculation_school', $post['matriculation_school']);
59
+ $_collection->setData('matriculation_city', $post['matriculation_city']);
60
+ $_collection->setData('matriculation_stream', $post['matriculation_stream']);
61
+ $_collection->setData('matriculation_marks', $post['matriculation_marks']);
62
+ $_collection->setData('intermediate_year', $post['intermediate_year']);
63
+ $_collection->setData('intermediate_school', $post['intermediate_school']);
64
+ $_collection->setData('intermediate_city', $post['intermediate_city']);
65
+ $_collection->setData('intermediate_stream', $post['intermediate_stream']);
66
+ $_collection->setData('intermediate_marks', $post['intermediate_marks']);
67
+ $_collection->setData('graduation_year', $post['graduation_year']);
68
+ $_collection->setData('graduation_institute', $post['graduation_institute']);
69
+ $_collection->setData('graduation_university', $post['graduation_university']);
70
+ $_collection->setData('graduation_city', $post['graduation_city']);
71
+ $_collection->setData('graduation_stream', $post['graduation_stream']);
72
+ $_collection->setData('graduation_marks', $post['graduation_marks']);
73
+ $_collection->setData('pgraduation_year', $post['pgraduation_year']);
74
+ $_collection->setData('pgraduation_institute', $post['pgraduation_institute']);
75
+ $_collection->setData('pgraduation_university', $post['pgraduation_university']);
76
+ $_collection->setData('pgraduation_city', $post['pgraduation_city']);
77
+ $_collection->setData('pgraduation_stream', $post['pgraduation_stream']);
78
+ $_collection->setData('pgraduation_marks', $post['pgraduation_marks']);
79
+ $_collection->save();
80
+ } catch (Mage_Core_Exception $e) {
81
+ Mage::getSingleton('core/session')->addError($e->getMessage());
82
+ $this->_redirect('*/*/info');
83
+ return;
84
+ }
85
+ }
86
+
87
+ $this->_redirect('*/*/info');
88
+ }
89
+
90
+ }
app/code/community/Bk/Customerdetails/etc/config.xml ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Bk_Customerdetails>
5
+ <version>1.0.0</version>
6
+ </Bk_Customerdetails>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <customerdetails>
11
+ <class>Bk_Customerdetails_Helper</class>
12
+ </customerdetails>
13
+ </helpers>
14
+ <blocks>
15
+ <customerdetails><class>Bk_Customerdetails_Block</class></customerdetails>
16
+ </blocks>
17
+ <models>
18
+ <customerdetails>
19
+ <class>Bk_Customerdetails_Model</class>
20
+ <resourceModel>customerdetails_mysql4</resourceModel>
21
+ </customerdetails>
22
+ <customerdetails_mysql4>
23
+ <class>Bk_Customerdetails_Model_Mysql4</class>
24
+ <entities>
25
+ <extendedinfo>
26
+ <table>customer_extended_info</table>
27
+ </extendedinfo>
28
+ </entities>
29
+ </customerdetails_mysql4>
30
+ </models>
31
+ <resources>
32
+ <customerdetails_setup>
33
+ <setup>
34
+ <module>Bk_Customerdetails</module>
35
+ </setup>
36
+ <connection>
37
+ <use>core_setup</use>
38
+ </connection>
39
+ </customerdetails_setup>
40
+ <customerdetails_read>
41
+ <connection>
42
+ <use>core_read</use>
43
+ </connection>
44
+ </customerdetails_read>
45
+ <customerdetails_write>
46
+ <connection>
47
+ <use>core_write</use>
48
+ </connection>
49
+ </customerdetails_write>
50
+ </resources>
51
+ </global>
52
+ <frontend>
53
+ <routers>
54
+ <customerdetails>
55
+ <use>standard</use>
56
+ <args>
57
+ <module>Bk_Customerdetails</module>
58
+ <frontName>customerdetails</frontName>
59
+ </args>
60
+ </customerdetails>
61
+ </routers>
62
+ <layout>
63
+ <updates>
64
+ <customerdetails>
65
+ <file>customerdetails.xml</file>
66
+ </customerdetails>
67
+ </updates>
68
+ </layout>
69
+ </frontend>
70
+ <adminhtml>
71
+ <layout>
72
+ <updates>
73
+ <customerdetails>
74
+ <file>customerdetails.xml</file>
75
+ </customerdetails>
76
+ </updates>
77
+ </layout>
78
+ </adminhtml>
79
+ <admin>
80
+ <routers>
81
+ <adminhtml>
82
+ <args>
83
+ <modules>
84
+ <customerdetails after="Mage_Adminhtml">Bk_Customerdetails</customerdetails>
85
+ </modules>
86
+ </args>
87
+ </adminhtml>
88
+ </routers>
89
+ <routers>
90
+ <adminhtml>
91
+ <args>
92
+ <modules>
93
+ <customerdetails before="Mage_Adminhtml">Bk_Customerdetails_Adminhtml</customerdetails>
94
+ </modules>
95
+ </args>
96
+ </adminhtml>
97
+ </routers>
98
+ </admin>
99
+ </config>
app/code/community/Bk/Customerdetails/sql/customerdetails_setup/install-1.0.0.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $this->startSetup();
4
+
5
+ $this->run("
6
+
7
+ CREATE TABLE IF NOT EXISTS {$this->getTable('customer_extended_info')} (
8
+ `info_id` int(10) unsigned NOT NULL auto_increment,
9
+ `entity_id` int(10) unsigned NOT NULL,
10
+ `matriculation_year` int(11) NOT NULL,
11
+ `matriculation_school` TEXT NOT NULL default '',
12
+ `matriculation_city` VARCHAR (1024) NOT NULL default '',
13
+ `matriculation_stream` VARCHAR (1024) default '',
14
+ `matriculation_marks` VARCHAR (50) NOT NULL default '',
15
+ `intermediate_year` int(11) NOT NULL,
16
+ `intermediate_school` TEXT NOT NULL default '',
17
+ `intermediate_city` VARCHAR (1024) NOT NULL default '',
18
+ `intermediate_stream` VARCHAR (1024) default '',
19
+ `intermediate_marks` VARCHAR (50) NOT NULL default '',
20
+ `graduation_year` int(11) NOT NULL,
21
+ `graduation_college` TEXT NOT NULL default '',
22
+ `graduation_university` TEXT NOT NULL default '',
23
+ `graduation_city` VARCHAR (1024) NOT NULL default '',
24
+ `graduation_stream` VARCHAR (1024) default '',
25
+ `graduation_marks` VARCHAR (50) NOT NULL default '',
26
+ `pgraduation_year` int(11) NOT NULL,
27
+ `pgraduation_college` TEXT NOT NULL default '',
28
+ `pgraduation_university` TEXT NOT NULL default '',
29
+ `pgraduation_city` VARCHAR (1024) NOT NULL default '',
30
+ `pgraduation_stream` VARCHAR (1024) default '',
31
+ `pgraduation_marks` VARCHAR (50) NOT NULL default '',
32
+ `others` TEXT NOT NULL default '',
33
+ `created_at` TIMESTAMP DEFAULT 0,
34
+ `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
35
+ PRIMARY KEY (`info_id`)
36
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Collection: Page';
37
+
38
+ ALTER TABLE `customer_extended_info` ADD CONSTRAINT `FK_CUSTOMER_ENTITY_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `customer_entity`(`entity_id`) ON DELETE CASCADE ON UPDATE NO ACTION;
39
+
40
+ ");
41
+
42
+ $this->endSetup();
app/design/adminhtml/default/default/layout/customerdetails.xml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <adminhtml_customer_edit>
4
+ <reference name="customer_edit_tabs">
5
+ <action method="addTab">
6
+ <name>extended_information</name>
7
+ <block>customerdetails/adminhtml_customer_tab</block>
8
+ </action>
9
+ </reference>
10
+ </adminhtml_customer_edit>
11
+ </layout>
app/design/adminhtml/default/default/template/customerdetails/customer/tab.phtml ADDED
@@ -0,0 +1,319 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php
3
+ $customerId = $this->getRequest()->getParam('id');
4
+ $customerInfo = Mage::getModel('customerdetails/extendedinfo')->load($customerId, 'entity_id');
5
+
6
+ $matric_year = array();
7
+ for ($i=1991; $i <= 2021; $i++) {
8
+ if($i == $customerInfo->getMatriculationYear())
9
+ $matric_year[] = '<option selected value="'.$i.'">'.$i.'</option>';
10
+ $matric_year[] = '<option value="'.$i.'">'.$i.'</option>';
11
+ }
12
+
13
+ $intermediate_year = array();
14
+ for ($i=1991; $i <= 2021; $i++) {
15
+ if($i == $customerInfo->getIntermediateYear())
16
+ $intermediate_year[] = '<option selected value="'.$i.'">'.$i.'</option>';
17
+ $intermediate_year[] = '<option value="'.$i.'">'.$i.'</option>';
18
+ }
19
+
20
+ $graduation_year = array();
21
+ for ($i=1991; $i <= 2021; $i++) {
22
+ if($i == $customerInfo->getGraduationYear())
23
+ $graduation_year[] = '<option selected value="'.$i.'">'.$i.'</option>';
24
+ $graduation_year[] = '<option value="'.$i.'">'.$i.'</option>';
25
+ }
26
+
27
+ $pgraduation_year = array();
28
+ for ($i=1991; $i <= 2021; $i++) {
29
+ if($i == $customerInfo->getPgraduationYear())
30
+ $pgraduation_year[] = '<option selected value="'.$i.'">'.$i.'</option>';
31
+ $pgraduation_year[] = '<option value="'.$i.'">'.$i.'</option>';
32
+ }
33
+ ?>
34
+
35
+
36
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
37
+ <input type="hidden" name="entity_id" id="entity_id" value="<?php echo $customerId; ?>" />
38
+ <div class="entry-edit-head">
39
+ <h4 class="icon-head head-edit-form fieldset-legend">Matriculation Information</h4>
40
+ <div class="form-buttons"></div>
41
+ </div>
42
+ <div class="fieldset">
43
+ <table class="form-list" cellspacing="0">
44
+ <tbody>
45
+ <tr>
46
+ <td class="label">
47
+ <label for="matriculation_year"><?php echo $this->__('Matriculation Year') ?> <span class="required">*</span></label>
48
+ </td>
49
+ <td class="value">
50
+ <div class="input-box">
51
+ <select style="" class="validate-select required-entry" title="Matriculation Year" name="bk[matriculation_year]" id="matriculation_year" defaultvalue="0">
52
+ <option value="">Please select year of completion</option>
53
+ <?php
54
+ foreach ($matric_year as $options) {
55
+ echo $options;
56
+ }
57
+ ?>
58
+ </select>
59
+ </div>
60
+ </td>
61
+ </tr>
62
+ <tr>
63
+ <td class="label">
64
+ <label for="matriculation_school"><?php echo $this->__('School') ?> <span class="required">*</span></label>
65
+ </td>
66
+ <td class="value">
67
+ <div>
68
+ <input type="text" name="bk[matriculation_school]" id="matriculation_school" value="<?php echo $customerInfo->getMatriculationSchool() ?>" title="<?php echo $this->__('Matriculation School') ?>" class="input-text required-entry" />
69
+ </div>
70
+ </td>
71
+ </tr>
72
+ <tr>
73
+ <td class="label">
74
+ <label for="matriculation_city"><?php echo $this->__('City') ?> <span class="required">*</span></label>
75
+ </td>
76
+ <td class="value">
77
+ <div>
78
+ <input type="text" name="bk[matriculation_city]" id="matriculation_city" value="<?php echo $customerInfo->getMatriculationCity() ?>" title="<?php echo $this->__('City') ?>" class="input-text required-entry" />
79
+ </div>
80
+ </td>
81
+ </tr>
82
+ <tr>
83
+ <td class="label">
84
+ <label for="matriculation_stream"><?php echo $this->__('Stream') ?> <span class="required">*</span></label>
85
+ </td>
86
+ <td class="value">
87
+ <div>
88
+ <input type="text" name="bk[matriculation_stream]" id="matriculation_stream" value="<?php echo $customerInfo->getMatriculationStream() ?>" title="<?php echo $this->__('Stream') ?>" class="input-text required-entry" />
89
+ </div>
90
+ </td>
91
+ </tr>
92
+ <tr>
93
+ <td class="label">
94
+ <label for="matriculation_marks"><?php echo $this->__('Marks/Grade') ?> <span class="required">*</span></label>
95
+ </td>
96
+ <td class="value">
97
+ <div>
98
+ <input type="text" name="bk[matriculation_marks]" id="matriculation_marks" value="<?php echo $customerInfo->getMatriculationMarks() ?>" title="<?php echo $this->__('Marks/Grade') ?>" class="input-text required-entry" />
99
+ </div>
100
+ </td>
101
+ </tr>
102
+ </tbody>
103
+ </table>
104
+ </div>
105
+ <div class="entry-edit-head">
106
+ <h4 class="icon-head head-edit-form fieldset-legend">Intermediate Information</h4>
107
+ <div class="form-buttons"></div>
108
+ </div>
109
+ <div class="fieldset">
110
+ <table class="form-list" cellspacing="0">
111
+ <tr>
112
+ <td class="label">
113
+ <label for="intermediate_year"><?php echo $this->__('Intermediate Year') ?> <span class="required">*</span></label>
114
+ </td>
115
+ <td class="value">
116
+ <div class="input-box">
117
+ <select style="" class="validate-select required-entry" title="Intermediate Year" name="bk[intermediate_year]" id="intermediate_year" defaultvalue="0">
118
+ <option value="">Please select year of completion</option>
119
+ <?php
120
+ foreach ($intermediate_year as $options) {
121
+ echo $options;
122
+ }
123
+ ?>
124
+ </select>
125
+ </div>
126
+ </td>
127
+ </tr>
128
+ <tr>
129
+ <td class="label">
130
+ <label for="intermediate_school"><?php echo $this->__('School/Institute') ?> <span class="required">*</span></label>
131
+ </td>
132
+ <td class="value">
133
+ <div>
134
+ <input type="text" name="bk[intermediate_school]" id="intermediate_school" value="<?php echo $customerInfo->getIntermediateSchool() ?>" title="<?php echo $this->__('Intermediate Institute') ?>" class="input-text required-entry" />
135
+ </div>
136
+ </td>
137
+ </tr>
138
+ <tr>
139
+ <td class="label">
140
+ <label for="intermediate_city"><?php echo $this->__('City') ?> <span class="required">*</span></label>
141
+ </td>
142
+ <td class="value">
143
+ <div>
144
+ <input type="text" name="bk[intermediate_city]" id="intermediate_city" value="<?php echo $customerInfo->getIntermediateCity() ?>" title="<?php echo $this->__('City') ?>" class="input-text required-entry" />
145
+ </div>
146
+ </td>
147
+ </tr>
148
+ <tr>
149
+ <td class="label">
150
+ <label for="intermediate_stream"><?php echo $this->__('Stream') ?> <span class="required">*</span></label>
151
+ </td>
152
+ <td class="value">
153
+ <div>
154
+ <input type="text" name="bk[intermediate_stream]" id="intermediate_stream" value="<?php echo $customerInfo->getIntermediateStream() ?>" title="<?php echo $this->__('Stream') ?>" class="input-text required-entry" />
155
+ </div>
156
+ </td>
157
+ </tr>
158
+ <tr>
159
+ <td class="label">
160
+ <label for="intermediate_marks"><?php echo $this->__('Marks/Grade') ?> <span class="required">*</span></label>
161
+ </td>
162
+ <td class="value">
163
+ <div>
164
+ <input type="text" name="bk[intermediate_marks]" id="intermediate_marks" value="<?php echo $customerInfo->getIntermediateMarks() ?>" title="<?php echo $this->__('Marks/Grade') ?>" class="input-text required-entry" />
165
+ </div>
166
+ </td>
167
+ </tr>
168
+ </table>
169
+ </div>
170
+ <div class="entry-edit-head">
171
+ <h4 class="icon-head head-edit-form fieldset-legend">Graduation Information</h4>
172
+ <div class="form-buttons"></div>
173
+ </div>
174
+ <div class="fieldset">
175
+ <table class="form-list" cellspacing="0">
176
+ <tr>
177
+ <td class="label">
178
+ <label for="graduation_year"><?php echo $this->__('Graduation Year') ?> <span class="required">*</span></label>
179
+ </td>
180
+ <td class="value">
181
+ <div class="input-box">
182
+ <select style="" class="validate-select required-entry" title="Graduation Year" name="bk[graduation_year]" id="graduation_year" defaultvalue="0">
183
+ <option value="">Please select year of completion</option>
184
+ <?php
185
+ foreach ($graduation_year as $options) {
186
+ echo $options;
187
+ }
188
+ ?>
189
+ </select>
190
+ </div>
191
+ </td>
192
+ </tr>
193
+ <tr>
194
+ <td class="label">
195
+ <label for="graduation_institute"><?php echo $this->__('Graduation College') ?> <span class="required">*</span></label>
196
+ </td>
197
+ <td class="value">
198
+ <div>
199
+ <input type="text" name="bk[graduation_college]" id="graduation_college" value="<?php echo $customerInfo->getGraduationCollege() ?>" title="<?php echo $this->__('Graduation College') ?>" class="input-text required-entry" />
200
+ </div>
201
+ </td>
202
+ </tr>
203
+ <tr>
204
+ <td class="label">
205
+ <label for="graduation_university"><?php echo $this->__('Graduation University') ?> <span class="required">*</span></label>
206
+ </td>
207
+ <td class="value">
208
+ <div>
209
+ <input type="text" name="bk[graduation_university]" id="graduation_university" value="<?php echo $customerInfo->getGraduationUniversity() ?>" title="<?php echo $this->__('Graduation University') ?>" class="input-text required-entry" />
210
+ </div>
211
+ </td>
212
+ </tr>
213
+ <tr>
214
+ <td class="label">
215
+ <label for="graduation_city"><?php echo $this->__('City') ?> <span class="required">*</span></label>
216
+ </td>
217
+ <td class="value">
218
+ <div>
219
+ <input type="text" name="bk[graduation_city]" id="graduation_city" value="<?php echo $customerInfo->getGraduationCity() ?>" title="<?php echo $this->__('City') ?>" class="input-text required-entry" />
220
+ </div>
221
+ </td>
222
+ </tr>
223
+ <tr>
224
+ <td class="label">
225
+ <label for="graduation_stream"><?php echo $this->__('Stream') ?> <span class="required">*</span></label>
226
+ </td>
227
+ <td class="value">
228
+ <div>
229
+ <input type="text" name="bk[graduation_stream]" id="graduation_stream" value="<?php echo $customerInfo->getGraduationStream() ?>" title="<?php echo $this->__('Stream') ?>" class="input-text required-entry" />
230
+ </div>
231
+ </td>
232
+ </tr>
233
+ <tr>
234
+ <td class="label">
235
+ <label for="graduation_marks"><?php echo $this->__('Marks/Grade') ?> <span class="required">*</span></label>
236
+ </td>
237
+ <td class="value">
238
+ <div>
239
+ <input type="text" name="bk[graduation_marks]" id="graduation_marks" value="<?php echo $customerInfo->getGraduationMarks() ?>" title="<?php echo $this->__('Marks/Grade') ?>" class="input-text required-entry" />
240
+ </div>
241
+ </td>
242
+ </tr>
243
+ </table>
244
+ </div>
245
+ <div class="entry-edit-head">
246
+ <h4 class="icon-head head-edit-form fieldset-legend">Post Graduation Information</h4>
247
+ <div class="form-buttons"></div>
248
+ </div>
249
+ <div class="fieldset">
250
+ <table class="form-list" cellspacing="0">
251
+ <tr>
252
+ <td class="label">
253
+ <label for="pgraduation_year"><?php echo $this->__('Post Graduation Year') ?> <span class="required">*</span></label>
254
+ </td>
255
+ <td class="value">
256
+ <div class="input-box">
257
+ <select style="" class="validate-select required-entry" title="Post Graduation Year" name="bk[pgraduation_year]" id="pgraduation_year" defaultvalue="0">
258
+ <option value="">Please select year of completion</option>
259
+ <?php
260
+ foreach ($pgraduation_year as $options) {
261
+ echo $options;
262
+ }
263
+ ?>
264
+ </select>
265
+ </div>
266
+ </td>
267
+ </tr>
268
+ <tr>
269
+ <td class="label">
270
+ <label for="pgraduation_institute"><?php echo $this->__('Post Graduation College') ?> <span class="required">*</span></label>
271
+ </td>
272
+ <td class="value">
273
+ <div>
274
+ <input type="text" name="bk[pgraduation_college]" id="pgraduation_college" value="<?php echo $customerInfo->getPgraduationCollege() ?>" title="<?php echo $this->__('Post Graduation College/Institute') ?>" class="input-text required-entry" />
275
+ </div>
276
+ </td>
277
+ </tr>
278
+ <tr>
279
+ <td class="label">
280
+ <label for="pgraduation_university"><?php echo $this->__('Post Graduation University') ?> <span class="required">*</span></label>
281
+ </td>
282
+ <td class="value">
283
+ <div>
284
+ <input type="text" name="bk[pgraduation_university]" id="pgraduation_university" value="<?php echo $customerInfo->getPgraduationUniversity() ?>" title="<?php echo $this->__('PostGraduation University') ?>" class="input-text required-entry" />
285
+ </div>
286
+ </td>
287
+ </tr>
288
+ <tr>
289
+ <td class="label">
290
+ <label for="pgraduation_city"><?php echo $this->__('City') ?> <span class="required">*</span></label>
291
+ </td>
292
+ <td class="value">
293
+ <div>
294
+ <input type="text" name="bk[pgraduation_city]" id="pgraduation_city" value="<?php echo $customerInfo->getPgraduationCity() ?>" title="<?php echo $this->__('City') ?>" class="input-text required-entry" />
295
+ </div>
296
+ </td>
297
+ </tr>
298
+ <tr>
299
+ <td class="label">
300
+ <label for="pgraduation_stream"><?php echo $this->__('Stream') ?> <span class="required">*</span></label>
301
+ </td>
302
+ <td class="value">
303
+ <div>
304
+ <input type="text" name="bk[pgraduation_stream]" id="pgraduation_stream" value="<?php echo $customerInfo->getPgraduationStream() ?>" title="<?php echo $this->__('Stream') ?>" class="input-text required-entry" />
305
+ </div>
306
+ </td>
307
+ </tr>
308
+ <tr>
309
+ <td class="label">
310
+ <label for="pgraduation_marks"><?php echo $this->__('Marks/Grade') ?> <span class="required">*</span></label>
311
+ </td>
312
+ <td class="value">
313
+ <div>
314
+ <input type="text" name="bk[pgraduation_marks]" id="pgraduation_marks" value="<?php echo $customerInfo->getPgraduationMarks() ?>" title="<?php echo $this->__('Marks/Grade') ?>" class="input-text required-entry" />
315
+ </div>
316
+ </td>
317
+ </tr>
318
+ </table>
319
+ </div>
app/design/frontend/base/default/layout/customerdetails.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <!--adding new link to Customer Myaccount links-->
4
+ <customer_account>
5
+ <reference name="customer_account_navigation">
6
+ <action method="addLink" module="Bk_Customerdetails">
7
+ <name>Additional Details</name>
8
+ <path>customerdetails/extended/info</path>
9
+ <label>Additional Details</label>
10
+ </action>
11
+ </reference>
12
+ </customer_account>
13
+ <!-- adding collection page block to customer myaccount-->
14
+
15
+ <customerdetails_extended_info>
16
+ <reference name="my.account.wrapper">
17
+ <block type="customerdetails/extended_info" name="customer.extended.info" as="customer_extended_info" template="bkcustomerdetails/form.phtml" />
18
+ <!-- <block type="customer/form_edit" name="customer.extended.info" as="customer_extended_info" template="bkcustomerdetails/form.phtml" /> -->
19
+ </reference>
20
+ </customerdetails_extended_info>
21
+
22
+ </layout>
app/design/frontend/base/default/template/bkcustomerdetails/form.phtml ADDED
@@ -0,0 +1,269 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ $customerId = $this->getCustomerId();
29
+ $customerInfo = $this->getCustomerInfo();
30
+ //echo "<pre>";print_r($customerInfo->getMatriculationYear());
31
+
32
+ $matric_year = array();
33
+ for ($i=1991; $i <= 2021; $i++) {
34
+ if($i == $customerInfo->getMatriculationYear())
35
+ $matric_year[] = '<option selected value="'.$i.'">'.$i.'</option>';
36
+ $matric_year[] = '<option value="'.$i.'">'.$i.'</option>';
37
+ }
38
+
39
+ $intermediate_year = array();
40
+ for ($i=1991; $i <= 2021; $i++) {
41
+ if($i == $customerInfo->getIntermediateYear())
42
+ $intermediate_year[] = '<option selected value="'.$i.'">'.$i.'</option>';
43
+ $intermediate_year[] = '<option value="'.$i.'">'.$i.'</option>';
44
+ }
45
+
46
+ $graduation_year = array();
47
+ for ($i=1991; $i <= 2021; $i++) {
48
+ if($i == $customerInfo->getGraduationYear())
49
+ $graduation_year[] = '<option selected value="'.$i.'">'.$i.'</option>';
50
+ $graduation_year[] = '<option value="'.$i.'">'.$i.'</option>';
51
+ }
52
+
53
+ $pgraduation_year = array();
54
+ for ($i=1991; $i <= 2021; $i++) {
55
+ if($i == $customerInfo->getPgraduationYear())
56
+ $pgraduation_year[] = '<option selected value="'.$i.'">'.$i.'</option>';
57
+ $pgraduation_year[] = '<option value="'.$i.'">'.$i.'</option>';
58
+ }
59
+ //print_r($customerInfo->getIntermediateYear());
60
+
61
+ // $customerInfo->setData('matriculation_year',5000);
62
+ // $customerInfo->save();
63
+ ?>
64
+
65
+
66
+
67
+ <div class="page-title">
68
+ <h1><?php echo $this->__('Additional Information'); ?></h1>
69
+ </div>
70
+ <?php echo $this->getMessagesBlock()->toHtml() ?>
71
+ <form action="<?php echo $this->getUrl('customerdetails/extended/saveExtendedInfo') ?>" method="post" id="form-validate" autocomplete="off">
72
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
73
+ <input type="hidden" name="entity_id" id="entity_id" value="<?php echo $customerId; ?>" />
74
+ <div class="fieldset">
75
+ <?php //echo $this->getBlockHtml('formkey')?>
76
+ <h2 class="legend"><?php echo $this->__('Matriculation') ?></h2>
77
+ <ul class="form-list">
78
+ <li>
79
+ <label for="matriculation_year" class="required"><em>*</em><?php echo $this->__('Matriculation Year') ?></label>
80
+ <div class="input-box">
81
+ <select style="" class="validate-select required-entry" title="Matriculation Year" name="matriculation_year" id="matriculation_year" defaultvalue="0">
82
+ <option value="">Please select year of completion</option>
83
+ <?php
84
+ foreach ($matric_year as $options) {
85
+ echo $options;
86
+ }
87
+ ?>
88
+ </select>
89
+ </div>
90
+ </li>
91
+ <li>
92
+ <label for="matriculation_school" class="required"><em>*</em><?php echo $this->__('School') ?></label>
93
+ <div>
94
+ <input type="text" name="matriculation_school" id="matriculation_school" value="<?php echo $customerInfo->getMatriculationSchool() ?>" title="<?php echo $this->__('Matriculation School') ?>" class="input-text required-entry" />
95
+ </div>
96
+ </li>
97
+ <li>
98
+ <label for="matriculation_city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
99
+ <div>
100
+ <input type="text" name="matriculation_city" id="matriculation_city" value="<?php echo $customerInfo->getMatriculationCity() ?>" title="<?php echo $this->__('City') ?>" class="input-text required-entry" />
101
+ </div>
102
+ </li>
103
+ <li>
104
+ <label for="matriculation_stream" class="required"><em>*</em><?php echo $this->__('Stream') ?></label>
105
+ <div>
106
+ <input type="text" name="matriculation_stream" id="matriculation_stream" value="<?php echo $customerInfo->getMatriculationStream() ?>" title="<?php echo $this->__('Stream') ?>" class="input-text required-entry" />
107
+ </div>
108
+ </li>
109
+ <li>
110
+ <label for="matriculation_marks" class="required"><em>*</em><?php echo $this->__('Marks/Grade') ?></label>
111
+ <div>
112
+ <input type="text" name="matriculation_marks" id="matriculation_marks" value="<?php echo $customerInfo->getMatriculationMarks() ?>" title="<?php echo $this->__('Marks/Grade') ?>" class="input-text required-entry" />
113
+ </div>
114
+ </li>
115
+ </ul>
116
+ </div>
117
+ <div class="fieldset">
118
+ <?php //echo $this->getBlockHtml('formkey')?>
119
+ <h2 class="legend"><?php echo $this->__('Intermediate') ?></h2>
120
+ <ul class="form-list">
121
+ <li>
122
+ <label for="intermediate_year" class="required"><em>*</em><?php echo $this->__('Intermediate Year') ?></label>
123
+ <div class="input-box">
124
+ <select style="" class="validate-select required-entry" title="Intermediate Year" name="intermediate_year" id="intermediate_year" defaultvalue="0">
125
+ <option value="">Please select year of completion</option>
126
+ <?php
127
+ foreach ($intermediate_year as $options) {
128
+ echo $options;
129
+ }
130
+ ?>
131
+ </select>
132
+ </div>
133
+ </li>
134
+ <li>
135
+ <label for="intermediate_school" class="required"><em>*</em><?php echo $this->__('School/Institute') ?></label>
136
+ <div>
137
+ <input type="text" name="intermediate_school" id="intermediate_school" value="<?php echo $customerInfo->getIntermediateSchool() ?>" title="<?php echo $this->__('Intermediate Institute') ?>" class="input-text required-entry" />
138
+ </div>
139
+ </li>
140
+ <li>
141
+ <label for="intermediate_city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
142
+ <div>
143
+ <input type="text" name="intermediate_city" id="intermediate_city" value="<?php echo $customerInfo->getIntermediateCity() ?>" title="<?php echo $this->__('City') ?>" class="input-text required-entry" />
144
+ </div>
145
+ </li>
146
+ <li>
147
+ <label for="intermediate_stream" class="required"><em>*</em><?php echo $this->__('Stream') ?></label>
148
+ <div>
149
+ <input type="text" name="intermediate_stream" id="intermediate_stream" value="<?php echo $customerInfo->getIntermediateStream() ?>" title="<?php echo $this->__('Stream') ?>" class="input-text required-entry" />
150
+ </div>
151
+ </li>
152
+ <li>
153
+ <label for="intermediate_marks" class="required"><em>*</em><?php echo $this->__('Marks/Grade') ?></label>
154
+ <div>
155
+ <input type="text" name="intermediate_marks" id="intermediate_marks" value="<?php echo $customerInfo->getIntermediateMarks() ?>" title="<?php echo $this->__('Marks/Grade') ?>" class="input-text required-entry" />
156
+ </div>
157
+ </li>
158
+ </ul>
159
+ </div>
160
+ <div class="fieldset">
161
+ <?php //echo $this->getBlockHtml('formkey')?>
162
+ <h2 class="legend"><?php echo $this->__('Graduation') ?></h2>
163
+ <ul class="form-list">
164
+ <li>
165
+ <label for="graduation_year" class="required"><em>*</em><?php echo $this->__('Graduation Year') ?></label>
166
+ <div class="input-box">
167
+ <select style="" class="validate-select required-entry" title="Graduation Year" name="graduation_year" id="graduation_year" defaultvalue="0">
168
+ <option value="">Please select year of completion</option>
169
+ <?php
170
+ foreach ($graduation_year as $options) {
171
+ echo $options;
172
+ }
173
+ ?>
174
+ </select>
175
+ </div>
176
+ </li>
177
+ <li>
178
+ <label for="graduation_institute" class="required"><em>*</em><?php echo $this->__('Graduation College/Institute') ?></label>
179
+ <div>
180
+ <input type="text" name="graduation_institute" id="graduation_institute" value="<?php echo $customerInfo->getGraduationCollege() ?>" title="<?php echo $this->__('Graduation College/Institute') ?>" class="input-text required-entry" />
181
+ </div>
182
+ </li>
183
+ <li>
184
+ <label for="graduation_university" class="required"><em>*</em><?php echo $this->__('Graduation University') ?></label>
185
+ <div>
186
+ <input type="text" name="graduation_university" id="graduation_university" value="<?php echo $customerInfo->getGraduationUniversity() ?>" title="<?php echo $this->__('Graduation University') ?>" class="input-text required-entry" />
187
+ </div>
188
+ </li>
189
+ <li>
190
+ <label for="graduation_city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
191
+ <div>
192
+ <input type="text" name="graduation_city" id="graduation_city" value="<?php echo $customerInfo->getGraduationCity() ?>" title="<?php echo $this->__('City') ?>" class="input-text required-entry" />
193
+ </div>
194
+ </li>
195
+ <li>
196
+ <label for="graduation_stream" class="required"><em>*</em><?php echo $this->__('Stream') ?></label>
197
+ <div>
198
+ <input type="text" name="graduation_stream" id="graduation_stream" value="<?php echo $customerInfo->getGraduationStream() ?>" title="<?php echo $this->__('Stream') ?>" class="input-text required-entry" />
199
+ </div>
200
+ </li>
201
+ <li>
202
+ <label for="graduation_marks" class="required"><em>*</em><?php echo $this->__('Marks/Grade') ?></label>
203
+ <div>
204
+ <input type="text" name="graduation_marks" id="graduation_marks" value="<?php echo $customerInfo->getGraduationMarks() ?>" title="<?php echo $this->__('Marks/Grade') ?>" class="input-text required-entry" />
205
+ </div>
206
+ </li>
207
+ </ul>
208
+ </div>
209
+ <div class="fieldset">
210
+ <?php //echo $this->getBlockHtml('formkey')?>
211
+ <h2 class="legend"><?php echo $this->__('Post Graduation') ?></h2>
212
+ <ul class="form-list">
213
+ <li>
214
+ <label for="pgraduation_year" class="required"><em>*</em><?php echo $this->__('Post Graduation Year') ?></label>
215
+ <div class="input-box">
216
+ <select style="" class="validate-select required-entry" title="Post Graduation Year" name="pgraduation_year" id="pgraduation_year" defaultvalue="0">
217
+ <option value="">Please select year of completion</option>
218
+ <?php
219
+ foreach ($pgraduation_year as $options) {
220
+ echo $options;
221
+ }
222
+ ?>
223
+ </select>
224
+ </div>
225
+ </li>
226
+ <li>
227
+ <label for="pgraduation_institute" class="required"><em>*</em><?php echo $this->__('Post Graduation College/Institute') ?></label>
228
+ <div>
229
+ <input type="text" name="pgraduation_institute" id="pgraduation_institute" value="<?php echo $customerInfo->getPgraduationCollege() ?>" title="<?php echo $this->__('Post Graduation College/Institute') ?>" class="input-text required-entry" />
230
+ </div>
231
+ </li>
232
+ <li>
233
+ <label for="pgraduation_university" class="required"><em>*</em><?php echo $this->__('Post Graduation University') ?></label>
234
+ <div>
235
+ <input type="text" name="pgraduation_university" id="pgraduation_university" value="<?php echo $customerInfo->getPgraduationUniversity() ?>" title="<?php echo $this->__('PostGraduation University') ?>" class="input-text required-entry" />
236
+ </div>
237
+ </li>
238
+ <li>
239
+ <label for="pgraduation_city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
240
+ <div>
241
+ <input type="text" name="pgraduation_city" id="pgraduation_city" value="<?php echo $customerInfo->getPgraduationCity() ?>" title="<?php echo $this->__('City') ?>" class="input-text required-entry" />
242
+ </div>
243
+ </li>
244
+ <li>
245
+ <label for="pgraduation_stream" class="required"><em>*</em><?php echo $this->__('Stream') ?></label>
246
+ <div>
247
+ <input type="text" name="pgraduation_stream" id="pgraduation_stream" value="<?php echo $customerInfo->getPgraduationStream() ?>" title="<?php echo $this->__('Stream') ?>" class="input-text required-entry" />
248
+ </div>
249
+ </li>
250
+ <li>
251
+ <label for="pgraduation_marks" class="required"><em>*</em><?php echo $this->__('Marks/Grade') ?></label>
252
+ <div>
253
+ <input type="text" name="pgraduation_marks" id="pgraduation_marks" value="<?php echo $customerInfo->getPgraduationMarks() ?>" title="<?php echo $this->__('Marks/Grade') ?>" class="input-text required-entry" />
254
+ </div>
255
+ </li>
256
+ </ul>
257
+ </div>
258
+ <div class="buttons-set">
259
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
260
+ <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
261
+ <button type="submit" title="<?php echo $this->__('Save') ?>" class="button"><span><span><?php echo $this->__('Save') ?></span></span></button>
262
+ </div>
263
+ </form>
264
+ <script type="text/javascript">
265
+ //<![CDATA[
266
+ var dataForm = new VarienForm('form-validate', true);
267
+
268
+ //]]>
269
+ </script>
app/etc/modules/Bk_Customerdetails.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <modules>
3
+ <Bk_Customerdetails>
4
+ <active>true</active>
5
+ <codePool>community</codePool>
6
+ </Bk_Customerdetails>
7
+ </modules>
8
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Customer_Additional_Info</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="https://opensource.org/licenses/osl-3.0.php"> Open Software License</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This extension is very useful to save customer education details.</summary>
10
+ <description>This extension lets both admin and customer to manage customer's education details in brief. </description>
11
+ <notes>First stable release.</notes>
12
+ <authors><author><name>Bikash Kaushik</name><user>bikashkaushik</user><email>bikashkaushik10@gmail.com</email></author></authors>
13
+ <date>2016-11-04</date>
14
+ <time>06:20:43</time>
15
+ <contents><target name="magecommunity"><dir name="Bk"><dir name="Customerdetails"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><file name="Tab.php" hash="4368eef9d1d84b9cc04ef45a33b51a6f"/></dir></dir><dir name="Extended"><file name="Info.php" hash="94d250fb104d6f34fde82ea6983dae26"/></dir></dir><dir name="Helper"><file name="Data.php" hash="08dcf551f4351972401f1ae27eef80b3"/></dir><dir name="Model"><file name="Extendedinfo.php" hash="cc50e9f44bee1654785653685b1cdd70"/><dir name="Mysql4"><dir name="Extendedinfo"><file name="Collection.php" hash="544426351bf14d1d71dcbe7907c8d6ff"/></dir><file name="Extendedinfo.php" hash="6637961f4db97bcc43335dadb37814d1"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CustomerController.php" hash="1f7997ae0906a20d1659112e3eec2a85"/></dir><file name="ExtendedController.php" hash="80fd2db707a5ee88075134f4c83e25fd"/></dir><dir name="etc"><file name="config.xml" hash="b37e37fb215e79c16d52172228f98cb8"/></dir><dir name="sql"><dir name="customerdetails_setup"><file name="install-1.0.0.php" hash="e856be0ea754aa1d80e03d84e22a6cca"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="customerdetails.xml" hash="b3e75c43312fa4c647fc8bc7fb03ae2d"/></dir><dir name="template"><dir name="customerdetails"><dir name="customer"><file name="tab.phtml" hash="7f23d56d9820ee7e0e78ffaf3d8d5d86"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="customerdetails.xml" hash="4bfcd698ebba81310cc5ab1d08b0ed34"/></dir><dir name="template"><dir name="bkcustomerdetails"><file name="form.phtml" hash="9a559d26a5ee0c763aa3a72bfd7e542e"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Bk_Customerdetails.xml" hash="9c7709d1f2aa7dddcaf95283faec38ad"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.1.0</min><max>7.0.0</max></php></required></dependencies>
18
+ </package>