Dealer_Inquery - Version 1.1.5

Version Notes

Dealer Inquery

Download this release

Release Info

Developer Capacity Web Solutions
Extension Dealer_Inquery
Version 1.1.5
Comparing to
See all releases


Code changes from version 0.1.1 to 1.1.5

Files changed (19) hide show
  1. app/code/{local → community}/CapacityWebSolutions/Inquiry/Block/Inquiry.php +1 -1
  2. app/code/{local → community}/CapacityWebSolutions/Inquiry/Block/Manage/Inquiry.php +0 -0
  3. app/code/{local → community}/CapacityWebSolutions/Inquiry/Helper/Data.php +0 -0
  4. app/code/{local → community}/CapacityWebSolutions/Inquiry/Model/Inquiry.php +0 -0
  5. app/code/{local → community}/CapacityWebSolutions/Inquiry/Model/Mysql4/Inquiry.php +0 -0
  6. app/code/{local → community}/CapacityWebSolutions/Inquiry/Model/Mysql4/Inquiry/Collection.php +0 -0
  7. app/code/community/CapacityWebSolutions/Inquiry/controllers/IndexController.php +181 -0
  8. app/code/community/CapacityWebSolutions/Inquiry/controllers/Manage/InquiryController.php +200 -0
  9. app/code/{local → community}/CapacityWebSolutions/Inquiry/etc/config.xml +0 -0
  10. app/code/{local → community}/CapacityWebSolutions/Inquiry/etc/system.xml +0 -0
  11. app/code/{local → community}/CapacityWebSolutions/Inquiry/sql/inquiry_setup/mysql4-install-0.1.0.php +4 -2
  12. app/code/local/CapacityWebSolutions/Inquiry/controllers/IndexController.php +0 -137
  13. app/code/local/CapacityWebSolutions/Inquiry/controllers/Manage/InquiryController.php +0 -47
  14. app/design/adminhtml/default/default/template/inquiry/inquiry.phtml +16 -9
  15. app/design/adminhtml/default/default/template/inquiry/view.phtml +36 -23
  16. app/design/frontend/default/default/template/inquiry/inquiry.phtml +63 -66
  17. app/design/frontend/default/default/template/inquiry/thanks.phtml +1 -0
  18. app/etc/modules/CapacityWebSolutions_Inquiry.xml +1 -1
  19. package.xml +7 -7
app/code/{local → community}/CapacityWebSolutions/Inquiry/Block/Inquiry.php RENAMED
@@ -11,7 +11,7 @@ class CapacityWebSolutions_Inquiry_Block_Inquiry extends Mage_Core_Block_Templat
11
  public function getAllInquires()
12
  {
13
  if($collection = Mage::getModel("inquiry/inquiry")->getCollection())
14
- $collection->setOrder('createddt',"Desc")->load();
15
  return $collection;
16
  }
17
 
11
  public function getAllInquires()
12
  {
13
  if($collection = Mage::getModel("inquiry/inquiry")->getCollection())
14
+ $collection->setOrder('createddt',"Asc")->load();
15
  return $collection;
16
  }
17
 
app/code/{local → community}/CapacityWebSolutions/Inquiry/Block/Manage/Inquiry.php RENAMED
File without changes
app/code/{local → community}/CapacityWebSolutions/Inquiry/Helper/Data.php RENAMED
File without changes
app/code/{local → community}/CapacityWebSolutions/Inquiry/Model/Inquiry.php RENAMED
File without changes
app/code/{local → community}/CapacityWebSolutions/Inquiry/Model/Mysql4/Inquiry.php RENAMED
File without changes
app/code/{local → community}/CapacityWebSolutions/Inquiry/Model/Mysql4/Inquiry/Collection.php RENAMED
File without changes
app/code/community/CapacityWebSolutions/Inquiry/controllers/IndexController.php ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @copyright Copyright (c) 2010 Capacity Web Solutions Pvt. Ltd (http://www.capacitywebsolutions.com)
4
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
5
+ */
6
+ class CapacityWebSolutions_Inquiry_IndexController extends Mage_Core_Controller_Front_Action
7
+ {
8
+ public function indexAction()
9
+ {
10
+ $this->loadLayout(array('default'));
11
+ $this->renderLayout();
12
+ }
13
+
14
+ public function delAction()
15
+ {
16
+ $getUrl=Mage::getSingleton('adminhtml/url')->getSecretKey("adminhtml_mycontroller","delAction");
17
+
18
+ $delid = $this->getRequest()->getParam('delid');
19
+ if(!empty($delid))
20
+ {
21
+ $collection = Mage::getModel("inquiry/inquiry")->load($delid);
22
+
23
+ if($collection->delete())
24
+ {
25
+ Mage::getSingleton('core/session')->addSuccess("Inquire deleted successfully.");
26
+ }
27
+ else
28
+ {
29
+ Mage::getSingleton('core/session')->addError("Sorry inquire is not deleted.");
30
+ }
31
+ }
32
+
33
+ $this->_redirectReferer();
34
+ }
35
+
36
+
37
+ public function thanksAction()
38
+ {
39
+ $this->loadLayout(array('default'));
40
+ $this->renderLayout();
41
+ if($_POST['SUBMIT']=='SUBMIT')
42
+ {
43
+ $fname = $this->getRequest()->getParam("fname");
44
+ $lname = $this->getRequest()->getParam("lname");
45
+ $company = $this->getRequest()->getParam("company");
46
+ $taxvat = $this->getRequest()->getParam("account_taxvat");
47
+ $address = $this->getRequest()->getParam("address");
48
+ $city = $this->getRequest()->getParam("city");
49
+ $state = $this->getRequest()->getParam("state_id");
50
+ $country = $this->getRequest()->getParam("country");
51
+ $zip = $this->getRequest()->getParam("zip");
52
+ $phone = $this->getRequest()->getParam("phone");
53
+ $email = $this->getRequest()->getParam("email");
54
+ $website = $this->getRequest()->getParam("website");
55
+ $bdesc = addslashes($this->getRequest()->getParam("bdesc"));
56
+ $headers = "";
57
+ $country1 = explode('$$$',$country);
58
+ $insertArr = array("firstname"=>$fname,"lastname"=>$lname,"company"=>$company,"address"=>$address,"taxvat"=>$taxvat,"city"=>$city,"state"=>$state,"country"=>$country,"zip"=>$zip,"phone"=>$phone,"email"=>$email,"website"=>$website,"desc"=>$bdesc,"iscustcreated"=>0,"status"=>1,"createddt"=>date('Y-m-d H:i:s'));
59
+ $collection = Mage::getModel("inquiry/inquiry");
60
+ $collection->setData($insertArr); //
61
+ $collection->save();//echo "<pre>";print_r($collection);die;
62
+
63
+
64
+ $adminContent = '<table border="1">
65
+ <tr>
66
+ <td>
67
+ <table border="0">
68
+ <tr>
69
+ <Td><label>Hello Administrator,</label></Td>
70
+ </tr>
71
+ <tr>
72
+ <Td><p>Mr/Ms. '.$fname.' '.$lname.' have filled dealer inquiry form and details are below.</p></td>
73
+ </tr>
74
+ <tr>
75
+ <td>
76
+ <table border="0">
77
+ <tr>
78
+ <td><label>First Name:</label></td>
79
+ <td><label>'.$fname.'</label></td>
80
+ </tr>
81
+ <tr>
82
+ <td><label>Last Name:</label></td>
83
+ <td><label>'.$lname.'</label></td>
84
+ </tr>
85
+ <tr>
86
+ <td><label>Company:</label></td>
87
+ <td><label>'.$company.'</label></td>
88
+ </tr>
89
+ <tr>
90
+ <td><label>TAX/VAT Number:</label></td>
91
+ <td><label>'.$taxvat.'</label></td>
92
+ </tr>
93
+ <tr>
94
+ <td><label>Address:</label></td>
95
+ <td><label>'.$address.'</label></td>
96
+ </tr>
97
+
98
+ <tr>
99
+ <td><label>City:</label></td>
100
+ <td><label>'.$city.'</label></td>
101
+ </tr>
102
+ <tr>
103
+ <td><label>State/Province:</label></td>
104
+ <td><label>'.$state.'</label></td>
105
+ </tr>
106
+ <tr>
107
+ <td><label>Country:</label></td>
108
+ <td><label>'.$country1[1].'</label></td>
109
+ </tr>
110
+
111
+ <tr>
112
+ <td><label>ZIP/Postal Code:</label></td>
113
+ <td><label>'.$zip.'</label></td>
114
+ </tr>
115
+ <tr>
116
+ <td><label>Contact Phone Number:</label></td>
117
+ <td><label>'.$phone.'</label></td>
118
+ </tr>
119
+ <tr>
120
+ <td><label>Email:</label></td>
121
+ <td><label>'.$email.'</label></td>
122
+ </tr>
123
+ <tr>
124
+ <td><label>Website:</label></td>
125
+ <td><label>'.$website.'</label></td>
126
+ </tr>
127
+ <tr>
128
+ <td valign="top" width="15%"><label>Business Description:</label></td>
129
+ <td><label>'.$bdesc.'</label></td>
130
+ </tr>
131
+ <tr><td colspan="2">&nbsp;</td></tr>
132
+ <tr>
133
+ <td colspan="2"><label>Thank You.</label></td>
134
+ </tr>
135
+ </table>
136
+ </td>
137
+ </tr>
138
+ </table>
139
+ </td>
140
+ </tr>
141
+ </table>';
142
+ $adminSubject = "New Dealer Inquiry from dealer";
143
+ $adminName = Mage::getStoreConfig('trans_email/ident_general/name'); //sender name
144
+ $adminEmail = Mage::getStoreConfig('trans_email/ident_general/email');
145
+ $headers .= 'MIME-Version: 1.0'."\r\n";
146
+ $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
147
+ $headers .= 'From:'. $adminName.' <'.$adminEmail.'>';
148
+ ///Comment the mail functionality while using in local in below than ver1.4.1
149
+ //beginning og mail functionality.......................
150
+ mail($adminEmail,$adminSubject,$adminContent,$headers);
151
+
152
+ $customerContent = '<table border="0">
153
+ <tr>
154
+ <td>
155
+ <table border="0">
156
+ <tr>
157
+ <Td>Hello '.$fname.' '.$lname.',</Td>
158
+ </tr>
159
+ <tr>
160
+ <Td><p>Thank you for contacting '.$adminName.'. A company representative will contact you with more information within two business days.</p></Td>
161
+ </tr>
162
+ <tr><td colspan="2">&nbsp;</td></tr>
163
+ <tr>
164
+ <td colspan="2">Thank You.</td>
165
+ </tr>
166
+ </table>
167
+ </td>
168
+ </tr>
169
+ </table>';
170
+ $headers = "";
171
+ $adminName = Mage::getStoreConfig('trans_email/ident_general/name'); //sender name
172
+ $custSubject = "Thank you for contacting ".$adminName."";
173
+ $headers .= 'MIME-Version: 1.0'."\r\n";
174
+ $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
175
+ $headers .= 'From:'. $adminName.' <'.$adminEmail.'>';
176
+ //end mail functionaliy...............
177
+ mail($email,$custSubject,$customerContent,$headers);
178
+ }
179
+ }
180
+ }
181
+ ?>
app/code/community/CapacityWebSolutions/Inquiry/controllers/Manage/InquiryController.php ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @copyright Copyright (c) 2010 Capacity Web Solutions Pvt. Ltd (http://www.capacitywebsolutions.com)
4
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
5
+ */
6
+ class CapacityWebSolutions_Inquiry_Manage_InquiryController extends Mage_Adminhtml_Controller_Action
7
+ {
8
+ public function indexAction()
9
+ {
10
+ $action = $custId = "";
11
+ $action = $this->getRequest()->getParam('ac');
12
+ $delid = $this->getRequest()->getParam('delid');
13
+
14
+ if($action == "del" && !empty($delid))
15
+ {
16
+ $collection = Mage::getModel("inquiry/inquiry")->load($delid);
17
+
18
+ if($collection->delete())
19
+ {
20
+ Mage::getSingleton('core/session')->addSuccess("Inquire deleted successfully.");
21
+ }
22
+ else
23
+ {
24
+ Mage::getSingleton('core/session')->addError("Sorry inquire is not deleted.");
25
+ }
26
+ }
27
+
28
+ $this->_title($this->__('Dealer Inquiry'));
29
+ $this->loadLayout();
30
+ $this->_setActiveMenu('inquiry');
31
+ $this->_addContent($this->getLayout()->createBlock('core/template'));
32
+ $this->renderLayout();
33
+ }
34
+ public function viewAction()
35
+ {
36
+ $delid = $this->getRequest()->getParam('delid');
37
+
38
+ $this->_title($this->__('Dealer Detail'));
39
+
40
+ $this->loadLayout();
41
+ $this->_setActiveMenu('inquiry');
42
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Dashboard'), Mage::helper('adminhtml')->__('Dashboard'));
43
+ $this->_addContent($this->getLayout()->createBlock('core/template'));
44
+ $this->renderLayout();
45
+
46
+ }
47
+ public function createCustomerAction()
48
+ {
49
+ $del = $this->getRequest()->getParam('multival');
50
+ $values = explode('~~',$del);
51
+ $country11 = $values[9];
52
+ $country1 = explode('$$$',$country11);
53
+ function RandomPassword($PwdLength=8, $PwdType='standard')
54
+ {
55
+ // $PwdType can be one of these:
56
+ // test .. .. .. always returns the same password = "test"
57
+ // any .. .. .. returns a random password, which can contain strange characters
58
+ // alphanum . .. returns a random password containing alphanumerics only
59
+ // standard . .. same as alphanum, but not including l10O (lower L, one, zero, upper O)
60
+ $Ranges='';
61
+
62
+ if('test'==$PwdType) return 'test';
63
+ elseif('standard'==$PwdType) $Ranges='65-78,80-90,97-107,109-122,50-57';
64
+ elseif('alphanum'==$PwdType) $Ranges='65-90,97-122,48-57';
65
+ elseif('any'==$PwdType) $Ranges='40-59,61-91,93-126';
66
+
67
+ if($Ranges<>'')
68
+ {
69
+ $Range=explode(',',$Ranges);
70
+ $NumRanges=count($Range);
71
+ mt_srand(time()); //not required after PHP v4.2.0
72
+ $p='';
73
+ for ($i = 1; $i <= $PwdLength; $i++)
74
+ {
75
+ $r=mt_rand(0,$NumRanges-1);
76
+ list($min,$max)=explode('-',$Range[$r]);
77
+ $p.=chr(mt_rand($min,$max));
78
+ }
79
+ return $p;
80
+ }
81
+ }
82
+ $randompass = RandomPassword(9,'standard');
83
+
84
+ $customer = Mage::getModel('customer/customer');
85
+ $website_id = 1;
86
+
87
+ $customer->setWebsiteId($website_id);
88
+ $customer->loadByEmail($values[0]);
89
+ if(!$customer->getId())
90
+ {
91
+ $groups = Mage::getResourceModel('customer/group_collection')->getData();
92
+ $groupID = '1';
93
+ $customer->setData('group_id', $groupID );
94
+ $customer->setData('website_id', '1' );
95
+ $customer->setData('is_active', '1');
96
+ $customer->setData('customer_activated', '1');
97
+ $customer->setStatus(1);
98
+ $customer->setEmail($values[0]);
99
+ $customer->setFirstname($values[1]);
100
+ $customer->setLastname($values[2]);
101
+ $customer->setTaxvat($values[10]);
102
+ //$customer->setPassword($randompass);
103
+ $customer->setPassword($values[1].'pass');
104
+ $customer->setConfirmation(null);
105
+ $customer->save();
106
+ if($customer->save())
107
+ {
108
+ //If you use this extension on local then please comment the mail functionality to use it properly.
109
+ ///Beginning of Mail functionality.......
110
+ $adminEmail = Mage::getStoreConfig('trans_email/ident_general/email');
111
+ $adminName = Mage::getStoreConfig('trans_email/ident_general/name');
112
+ $fromEmail = $adminEmail;
113
+ $fromName = $adminName;
114
+
115
+ $toEmail = $values[0];
116
+ $toName = $values[1].$values[2];
117
+
118
+ $body = '<table border="1">
119
+ <tr>
120
+ <td>
121
+ <table border="0">
122
+ <tr>
123
+ <Td>Hello '.$values[1].' '.$values[2].',</Td>
124
+ </tr>
125
+ <tr>
126
+ <Td><p>Thank You for Register with '.$adminName.'.Your Login Details for access your Account.....</p></Td>
127
+ </tr>
128
+ <tr>
129
+ <Td><p>Login Email :&nbsp; '.$values[0].' </p></Td>
130
+ </tr>
131
+ <tr>
132
+ <Td><p>Login Password :&nbsp; '.$randompass.' </p></Td>
133
+ </tr>
134
+ <tr>
135
+ <Td><p>You can login directly in your account from here with given login details..... &nbsp;<br /><br />'. Mage::getBaseUrl().'customer/account/login/</p></Td>
136
+ </tr>
137
+ <tr><td colspan="2">&nbsp;</td></tr>
138
+ <tr>
139
+ <td colspan="2">Thank You.</td>
140
+ </tr>
141
+ </table>
142
+ </td>
143
+ </tr>
144
+ </table>';
145
+ $subject = " Registration Details of Dealer Inquiry ";
146
+
147
+ $mail = new Zend_Mail();
148
+
149
+ $mail->setBodyHtml($body);
150
+
151
+ $mail->setFrom($fromEmail, $fromName);
152
+
153
+ $mail->addTo($toEmail, $toName);
154
+
155
+ $mail->setSubject($subject);
156
+
157
+ try {
158
+ $mail->send();
159
+ }
160
+ catch(Exception $ex) {
161
+ Mage::getSingleton('core/session')
162
+ ->__('Unable to send email.');
163
+ }
164
+ ///End of Mail functionality.......
165
+ Mage::getSingleton('core/session')->addSuccess("Customer Account Created successfully.");
166
+ }
167
+ //Build billing and shipping address for customer, for checkout
168
+ $_custom_address = array (
169
+ 'street' => array (
170
+ '0' => $values[4],
171
+ //'1' => $values[11],
172
+ ),
173
+ 'firstname' => $values[1],
174
+ 'lastname' => $values[2],
175
+ 'company' => $values[3],
176
+ 'city' => $values[5],
177
+ 'region_id' => '',
178
+ 'region' => $values[6],
179
+ 'postcode' => $values[7],
180
+ 'country_id' => $country1[0],
181
+ 'telephone' => $values[8],
182
+ );
183
+
184
+ $customAddress = Mage::getModel('customer/address');
185
+ $customAddress->setData($_custom_address)
186
+ ->setCustomerId($customer->getId())
187
+ ->setIsDefaultBilling('1')
188
+ ->setIsDefaultShipping('1')
189
+ ->setSaveInAddressBook('1');
190
+
191
+ try {
192
+ $customAddress->save();
193
+ }
194
+ catch (Exception $ex) {
195
+ }
196
+ $this->_redirectReferer();
197
+ }
198
+ }
199
+ }
200
+ ?>
app/code/{local → community}/CapacityWebSolutions/Inquiry/etc/config.xml RENAMED
File without changes
app/code/{local → community}/CapacityWebSolutions/Inquiry/etc/system.xml RENAMED
File without changes
app/code/{local → community}/CapacityWebSolutions/Inquiry/sql/inquiry_setup/mysql4-install-0.1.0.php RENAMED
@@ -6,15 +6,17 @@ $installer->startSetup();
6
 
7
  $installer->run("
8
 
9
-
10
  CREATE TABLE IF NOT EXISTS `dealerinquiry` (
11
  `dealerid` int(11) NOT NULL AUTO_INCREMENT,
12
  `firstname` varchar(25) NOT NULL,
13
  `lastname` varchar(25) NOT NULL,
14
  `company` varchar(100) NOT NULL,
15
  `address` varchar(255) NOT NULL,
16
- `ciry` varchar(25) NOT NULL,
 
17
  `state` varchar(25) NOT NULL,
 
18
  `zip` varchar(6) NOT NULL,
19
  `phone` varchar(15) NOT NULL,
20
  `email` varchar(100) NOT NULL,
6
 
7
  $installer->run("
8
 
9
+ -- DROP TABLE IF EXISTS {$this->getTable('dealerinquiry')};
10
  CREATE TABLE IF NOT EXISTS `dealerinquiry` (
11
  `dealerid` int(11) NOT NULL AUTO_INCREMENT,
12
  `firstname` varchar(25) NOT NULL,
13
  `lastname` varchar(25) NOT NULL,
14
  `company` varchar(100) NOT NULL,
15
  `address` varchar(255) NOT NULL,
16
+ `taxvat` varchar(25) NOT NULL,
17
+ `city` varchar(25) NOT NULL,
18
  `state` varchar(25) NOT NULL,
19
+ `country` varchar(255) NOT NULL,
20
  `zip` varchar(6) NOT NULL,
21
  `phone` varchar(15) NOT NULL,
22
  `email` varchar(100) NOT NULL,
app/code/local/CapacityWebSolutions/Inquiry/controllers/IndexController.php DELETED
@@ -1,137 +0,0 @@
1
- <?php
2
- /**
3
- * @copyright Copyright (c) 2010 Capacity Web Solutions Pvt. Ltd (http://www.capacitywebsolutions.com)
4
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
5
- */
6
- class CapacityWebSolutions_Inquiry_IndexController extends Mage_Core_Controller_Front_Action
7
- {
8
- public function indexAction()
9
- {
10
- $this->loadLayout(array('default'));
11
- $this->renderLayout();
12
- }
13
-
14
- public function thanksAction()
15
- {
16
- $this->loadLayout(array('default'));
17
- $this->renderLayout();
18
- $fname = $this->getRequest()->getParam("fname");
19
- $lname = $this->getRequest()->getParam("lname");
20
- $company = $this->getRequest()->getParam("company");
21
- $address = $this->getRequest()->getParam("address");
22
- $city = $this->getRequest()->getParam("city");
23
- $state = $this->getRequest()->getParam("state_id");
24
- $zip = $this->getRequest()->getParam("zip");
25
- $phone = $this->getRequest()->getParam("phone");
26
- $email = $this->getRequest()->getParam("email");
27
- $website = $this->getRequest()->getParam("website");
28
- $bdesc = addslashes($this->getRequest()->getParam("bdesc"));
29
- $$headers = "";
30
- $insertArr = array("firstname"=>$fname,"lastname"=>$lname,"company"=>$company,"address"=>$address,"ciry"=>$city,"state"=>$state,"zip"=>$zip,"phone"=>$phone,"email"=>$email,"website"=>$website,"desc"=>$bdesc,"iscustcreated"=>0,"status"=>1,"createddt"=>date('Y-m-d H:i:s'));
31
- $adminContent = '<table border="0">
32
- <tr>
33
- <td>
34
- <table border="0">
35
- <tr>
36
- <Td>Hello Administrator,</Td>
37
- </tr>
38
- <tr>
39
- <Td><p>Mr/Ms. '.$fname.' '.$lname.' have filled dealer inquiry form and details are below.</p></Td>
40
- </tr>
41
- <tr>
42
- <td>
43
- <table border="0">
44
- <tr>
45
- <td>First Name:</td>
46
- <td>'.$fname.'</td>
47
- </tr>
48
- <tr>
49
- <td>Last Name:</td>
50
- <td>'.$lname.'</td>
51
- </tr>
52
- <tr>
53
- <td>Company:</td>
54
- <td>'.$company.'</td>
55
- </tr>
56
- <tr>
57
- <td>Address:</td>
58
- <td>'.$address.'</td>
59
- </tr>
60
- <tr>
61
- <td>City:</td>
62
- <td>'.$city.'</td>
63
- </tr>
64
- <tr>
65
- <td>State / Province:</td>
66
- <td>'.$state.'</td>
67
- </tr>
68
- <tr>
69
- <td>ZIP / Postal Code:</td>
70
- <td>'.$zip.'</td>
71
- </tr>
72
- <tr>
73
- <td>Contact Phone Number:</td>
74
- <td>'.$phone.'</td>
75
- </tr>
76
- <tr>
77
- <td>Email:</td>
78
- <td>'.$email.'</td>
79
- </tr>
80
- <tr>
81
- <td>Website:</td>
82
- <td>'.$website.'</td>
83
- </tr>
84
- <tr>
85
- <td valign="top" width="15%">Business Description:</td>
86
- <td>'.$bdesc.'</td>
87
- </tr>
88
- <tr><td colspan="2">&nbsp;</td></tr>
89
- <tr>
90
- <td colspan="2">Thank You.</td>
91
- </tr>
92
- </table>
93
- </td>
94
- </tr>
95
- </table>
96
- </td>
97
- </tr>
98
- </table>';
99
- $adminSubject = "New Dealer Inquiry from dealer";
100
- $adminEmail = Mage::getStoreConfig('trans_email/ident_general/email');
101
- $headers .= 'From: Admin <'.$adminEmail.'>';
102
- $headers .= 'MIME-Version: 1.0'."\r\n";
103
- $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
104
- mail($adminEmail,$adminSubject,$adminContent,$headers);
105
-
106
- $customerContent = '<table border="0">
107
- <tr>
108
- <td>
109
- <table border="0">
110
- <tr>
111
- <Td>Hello '.$fname.',</Td>
112
- </tr>
113
- <tr>
114
- <Td><p>Thank you for contacting us. A company representative will contact you with more information within two business days.</p></Td>
115
- </tr>
116
- <tr><td colspan="2">&nbsp;</td></tr>
117
- <tr>
118
- <td colspan="2">Thank You.</td>
119
- </tr>
120
- </table>
121
- </td>
122
- </tr>
123
- </table>';
124
- $headers = "";
125
- $custSubject = "Thank you for contacting East End Imports.";
126
- $headers .= 'From: Admin <'.$adminEmail.'>';
127
- $headers .= 'MIME-Version: 1.0'."\r\n";
128
- $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
129
- mail($email,$custSubject,$customerContent,$headers);
130
-
131
- $collection = Mage::getModel("inquiry/inquiry");
132
- $collection->setData($insertArr);
133
- $collection->save();
134
-
135
- }
136
- }
137
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/CapacityWebSolutions/Inquiry/controllers/Manage/InquiryController.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- /**
3
- * @copyright Copyright (c) 2010 Capacity Web Solutions Pvt. Ltd (http://www.capacitywebsolutions.com)
4
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
5
- */
6
- class CapacityWebSolutions_Inquiry_Manage_InquiryController extends Mage_Adminhtml_Controller_Action
7
- {
8
- public function indexAction()
9
- {
10
- $action = $custId = "";
11
- $action = $this->getRequest()->getParam('ac');
12
- $delid = $this->getRequest()->getParam('delid');
13
- if($action == "del" && !empty($delid))
14
- {
15
- $collection = Mage::getModel("inquiry/inquiry")->load($delid);
16
-
17
- if($collection->delete())
18
- {
19
- Mage::getSingleton('core/session')->addSuccess("Inquire deleted successfully.");
20
- }
21
- else
22
- {
23
- Mage::getSingleton('core/session')->addError("Sorry inquire is not deleted.");
24
- }
25
- }
26
-
27
- $this->_title($this->__('Dealer Inquiry'));
28
-
29
- $this->loadLayout();
30
- $this->_setActiveMenu('inquiry');
31
- $this->_addContent($this->getLayout()->createBlock('core/template'));
32
- $this->renderLayout();
33
- }
34
- public function viewAction()
35
- {
36
- $delid = $this->getRequest()->getParam('delid');
37
- $this->_title($this->__('Dealer Detail'));
38
-
39
- $this->loadLayout();
40
- $this->_setActiveMenu('inquiry');
41
- $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Dashboard'), Mage::helper('adminhtml')->__('Dashboard'));
42
- $this->_addContent($this->getLayout()->createBlock('core/template'));
43
- $this->renderLayout();
44
-
45
- }
46
- }
47
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/inquiry/inquiry.phtml CHANGED
@@ -15,7 +15,7 @@
15
  <div class="content-header">
16
  <table cellspacing="0">
17
  <tr>
18
- <td><h3 class="head-dashboard"><?php echo $this->__('Delear Inquiries') ?></h3></td>
19
  </tr>
20
  </table>
21
  </div>
@@ -31,7 +31,7 @@
31
  <th><span class="nobr"><a class="not-sort" title="asc" name="title">Sr#</a></span></th>
32
  <th><span class="nobr"><a class="not-sort" title="desc" name="identifier">First Name</a></span></th>
33
  <th><span class="nobr"><a class="not-sort" title="asc" name="root_template">Last Name</a></span></th>
34
- <th><span class="nobr"><a class="not-sort" title="asc" name="is_active">Company</a></span></th>
35
  <th><span class="nobr"><a class="not-sort" title="asc" name="creation_time">Email</a></span></th>
36
  <th><span class="nobr"><a class="not-sort" title="asc" name="update_time">Is Created</a></span></th>
37
  <th><span class="nobr"><a class="not-sort" title="asc" name="update_time">Created Date</a></span></th>
@@ -44,25 +44,32 @@
44
  {
45
  ?>
46
  <?php
47
- $i = 0;
48
  foreach($collections as $item)
49
  {
50
  $IsCreated = $this->getIsCreated($item['email']);
51
  ?>
52
- <tr class="even pointer">
53
- <td class="" align="center"><?php $this->getIsCreated();echo ++$i;?></td>
 
54
  <td class="a-left "><?php echo $item['firstname'];?></td>
55
  <td class="a-left "><?php echo $item['lastname'];?></td>
56
  <td class="a-left "><?php echo $item['company'];?></td>
57
  <td class="a-left "><?php echo $item['email'];?></td>
58
  <td class="a-left "><?php echo $IsCreated==0? "<font color='#FF0000'>Not Created</font>" : "<font color='#009933'>Created</font>";?></td>
59
  <td class="a-left "><?php echo date("F j, Y",strtotime($item['createddt']));?></td>
60
- <td class="a-left ">&nbsp;<a href="<?php echo $this->getUrl("inquiry/manage_inquiry/index/ac/del/delid/".$item['dealerid'])?>" onclick="javascript:return confirm('Are sure you want to delete this Inquire?')"><img src="<?php echo $this->getSkinurl()."images/icon_btn_delete.gif";?>" alt="Delete" title="Delete" /></a>&nbsp;&nbsp;<a href="<?php echo $this->getUrl("inquiry/manage_inquiry/view/delid/".$item['dealerid'])?>"><img src="<?php echo $this->getSkinurl()."images/fam_page_white.gif";?>" alt="View" title="View" /></a>
61
- <?php if($IsCreated==0) {?>
62
- &nbsp;&nbsp;<a href="<?php echo $this->getUrl("adminhtml/customer/new")?>" target="_blank"><img src="<?php echo $this->getSkinurl()."images/fam_page_white_edit.gif";?>" alt="Create Customer" title="Create Customer" /></a></td>
 
 
 
 
 
 
63
  <?php } ?>
64
  </tr>
65
- <?php
66
  }
67
  }
68
  else
15
  <div class="content-header">
16
  <table cellspacing="0">
17
  <tr>
18
+ <td><h3 class="head-dashboard"><?php echo $this->__('Dealer Inquiries') ?></h3></td>
19
  </tr>
20
  </table>
21
  </div>
31
  <th><span class="nobr"><a class="not-sort" title="asc" name="title">Sr#</a></span></th>
32
  <th><span class="nobr"><a class="not-sort" title="desc" name="identifier">First Name</a></span></th>
33
  <th><span class="nobr"><a class="not-sort" title="asc" name="root_template">Last Name</a></span></th>
34
+ <th><span class="nobr"><a class="not-sort" title="asc" name="is_active">Company Name</a></span></th>
35
  <th><span class="nobr"><a class="not-sort" title="asc" name="creation_time">Email</a></span></th>
36
  <th><span class="nobr"><a class="not-sort" title="asc" name="update_time">Is Created</a></span></th>
37
  <th><span class="nobr"><a class="not-sort" title="asc" name="update_time">Created Date</a></span></th>
44
  {
45
  ?>
46
  <?php
47
+ $i = 1;
48
  foreach($collections as $item)
49
  {
50
  $IsCreated = $this->getIsCreated($item['email']);
51
  ?>
52
+
53
+ <tr class="even pointer">
54
+ <td class="" align="center"><?php echo $i;//$this->getIsCreated();?></td>
55
  <td class="a-left "><?php echo $item['firstname'];?></td>
56
  <td class="a-left "><?php echo $item['lastname'];?></td>
57
  <td class="a-left "><?php echo $item['company'];?></td>
58
  <td class="a-left "><?php echo $item['email'];?></td>
59
  <td class="a-left "><?php echo $IsCreated==0? "<font color='#FF0000'>Not Created</font>" : "<font color='#009933'>Created</font>";?></td>
60
  <td class="a-left "><?php echo date("F j, Y",strtotime($item['createddt']));?></td>
61
+ <td class="a-left ">&nbsp;
62
+
63
+
64
+ <a href="<?php echo $this->getUrl("inquiry/index/del/delid/".$item['dealerid'])?>" onclick="javascript:return confirm('Are you sure to delete this Inquire?')"><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)."adminhtml/default/default/images/icon_btn_delete.gif";?>" alt="Delete" title="Delete" /></a>&nbsp;&nbsp;
65
+
66
+ <a href="<?php echo Mage::helper("adminhtml")->getUrl("inquiry/manage_inquiry/view/delid/".$item['dealerid']);?>"><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)."adminhtml/default/default/images/fam_page_white.gif";?>" alt="View" title="View" /></a>
67
+
68
+ <?php if($IsCreated==0) {?>
69
+ &nbsp;&nbsp;<a href="<?php echo Mage::helper("adminhtml")->getUrl("inquiry/manage_inquiry/createCustomer/multival/".$item['email'].'~~'.$item['firstname'].'~~'.$item['lastname'].'~~'.$item['company'].'~~'.$item['address'].'~~'.$item['city'].'~~'.$item['state'].'~~'.$item['zip'].'~~'.$item['phone'].'~~'.$item['country'].'~~'.$item['taxvat']);?>" onclick="javascript:return confirm('Are you sure to create the account?')"><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)."adminhtml/default/default/images/fam_page_white_edit.gif";?>" alt="Create Customer" title="Create Customer" /></a></td>
70
  <?php } ?>
71
  </tr>
72
+ <?php $i++;
73
  }
74
  }
75
  else
app/design/adminhtml/default/default/template/inquiry/view.phtml CHANGED
@@ -3,9 +3,10 @@
3
  * @copyright Copyright (c) 2010 Capacity Web Solutions Pvt. Ltd (http://www.capacitywebsolutions.com)
4
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
5
  */
6
-
7
  $item = $this->getAllDealer($this->getRequest()->getParam("delid"));
8
  $IsCreated = $this->getIsCreated($item['email']);
 
9
  ?>
10
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
11
  <html lang="en">
@@ -17,15 +18,17 @@
17
  <div class="content-header">
18
  <table cellspacing="0">
19
  <tr>
20
- <td><h3 class="head-dashboard"><?php echo $this->__('Delear Details') ?></h3></td>
21
  </tr>
22
  </table>
23
  </div>
24
-
25
- <div class="back"><a href="<?php echo $this->getUrl("inquiry/manage_inquiry/")?>"><span><font size="4px">&laquo;</font> Back</span></a>&nbsp;&nbsp;
26
- <?php if($IsCreated==0) {?>
27
- |&nbsp;&nbsp;<a href="<?php echo $this->getUrl("adminhtml/customer/new")?>" target="_blank">Create Customer</a>
28
- <?php } ?>
 
 
29
  </div>
30
  <div class="grid">
31
  <div class="hor-scroll">
@@ -35,56 +38,66 @@
35
  <tbody>
36
 
37
  <tr class="even pointer">
38
- <td class=""width="15%">First Name:</td>
39
  <td class="a-left "><?php echo $item['firstname'];?></td>
40
  </tr>
41
  <tr class="even pointer">
42
- <td class=""width="15%">Last Name:</td>
43
  <td class="a-left "><?php echo $item['lastname'];?></td>
44
  </tr>
45
  <tr class="even pointer">
46
- <td class=""width="15%">Company:</td>
47
  <td class="a-left "><?php echo $item['company'];?></td>
48
  </tr>
 
49
  <tr class="even pointer">
50
- <td class=""width="15%">Address:</td>
 
 
 
 
 
51
  <td class="a-left "><?php echo $item['address'];?></td>
52
  </tr>
53
  <tr class="even pointer">
54
- <td class=""width="15%">City:</td>
55
- <td class="a-left "><?php echo $item['ciry'];?></td>
56
  </tr>
57
  <tr class="even pointer">
58
- <td class=""width="15%">State:</td>
59
  <td class="a-left "><?php echo $item['state'];?></td>
60
  </tr>
61
  <tr class="even pointer">
62
- <td class=""width="15%">Zip:</td>
 
 
 
 
63
  <td class="a-left "><?php echo $item['zip'];?></td>
64
  </tr>
65
  <tr class="even pointer">
66
- <td class=""width="15%">Phone:</td>
67
  <td class="a-left "><?php echo $item['phone'];?></td>
68
  </tr>
69
  <tr class="even pointer">
70
- <td class=""width="15%">Email:</td>
71
  <td class="a-left "><?php echo $item['email'];?></td>
72
  </tr>
73
  <tr class="even pointer">
74
- <td class=""width="15%">Website:</td>
75
- <td class="a-left "><?php echo $item['website'];?></td>
76
  </tr>
77
  <tr class="even pointer">
78
- <td class=""width="15%">Is Created:</td>
79
  <td class="a-left "><?php echo $IsCreated==0? "<font color='#FF0000'>Not Created</font>" : "<font color='#009933'>Created</font>";?></td>
80
  </tr>
81
  <tr class="even pointer">
82
- <td class=""width="15%">Created Date:</td>
83
  <td class="a-left "><?php echo date("F j, Y",strtotime($item['createddt']));?></td>
84
  </tr>
85
  <tr class="even pointer">
86
- <td class=""width="15%">Business Description:</td>
87
- <td class="a-left "><p><?php echo stripslashes($item['desc']);?></p></td>
88
  </tr>
89
  </tr>
90
  </tbody>
3
  * @copyright Copyright (c) 2010 Capacity Web Solutions Pvt. Ltd (http://www.capacitywebsolutions.com)
4
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
5
  */
6
+ $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat');
7
  $item = $this->getAllDealer($this->getRequest()->getParam("delid"));
8
  $IsCreated = $this->getIsCreated($item['email']);
9
+
10
  ?>
11
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
12
  <html lang="en">
18
  <div class="content-header">
19
  <table cellspacing="0">
20
  <tr>
21
+ <td><h3 class="head-dashboard"><?php echo $this->__('Dealer Details') ?></h3></td>
22
  </tr>
23
  </table>
24
  </div>
25
+ <?php $prevurl = Mage::helper("adminhtml")->getUrl("inquiry/manage_inquiry/index/"); ?>
26
+ <div class="back"><a href="<?php echo $prevurl;?>"><span><font size="4px">&laquo;</font> Back</span></a>&nbsp;&nbsp;
27
+ <?php if($IsCreated==0) {?>
28
+ &nbsp;&nbsp;<a href="<?php echo Mage::helper("adminhtml")->getUrl("inquiry/manage_inquiry/createCustomer/multival/".$item['email'].'~~'.$item['firstname'].'~~'.$item['lastname'].'~~'.$item['company'].'~~'.$item['address'].'~~'.$item['city'].'~~'.$item['state'].'~~'.$item['zip'].'~~'.$item['phone'].'~~'.$item['country'].'~~'.$item['taxvat']);?>" onclick="javascript:return confirm('Are you sure to create the account?')">Create Customer</a>
29
+ <?php }
30
+ $country1 = explode('$$$',$item['country']);
31
+ ?>
32
  </div>
33
  <div class="grid">
34
  <div class="hor-scroll">
38
  <tbody>
39
 
40
  <tr class="even pointer">
41
+ <td class=""width="15%">First Name</td>
42
  <td class="a-left "><?php echo $item['firstname'];?></td>
43
  </tr>
44
  <tr class="even pointer">
45
+ <td class=""width="15%">Last Name</td>
46
  <td class="a-left "><?php echo $item['lastname'];?></td>
47
  </tr>
48
  <tr class="even pointer">
49
+ <td class=""width="15%">Company Name</td>
50
  <td class="a-left "><?php echo $item['company'];?></td>
51
  </tr>
52
+ <?php if($_taxvat->isEnabled()):?>
53
  <tr class="even pointer">
54
+ <td class=""width="15%">Tax/VAT Number</td>
55
+ <td class="a-left "><?php if($item['taxvat']==""): echo "-";else:echo $item['taxvat'];endif;?></td>
56
+ </tr>
57
+ <?php endif; ?>
58
+ <tr class="even pointer">
59
+ <td class=""width="15%">Address</td>
60
  <td class="a-left "><?php echo $item['address'];?></td>
61
  </tr>
62
  <tr class="even pointer">
63
+ <td class=""width="15%">City</td>
64
+ <td class="a-left "><?php echo $item['city'];?></td>
65
  </tr>
66
  <tr class="even pointer">
67
+ <td class=""width="15%">State</td>
68
  <td class="a-left "><?php echo $item['state'];?></td>
69
  </tr>
70
  <tr class="even pointer">
71
+ <td class=""width="15%">Country</td>
72
+ <td class="a-left "><?php echo $country1[1];?></td>
73
+ </tr>
74
+ <tr class="even pointer">
75
+ <td class=""width="15%">Zip</td>
76
  <td class="a-left "><?php echo $item['zip'];?></td>
77
  </tr>
78
  <tr class="even pointer">
79
+ <td class=""width="15%">Phone</td>
80
  <td class="a-left "><?php echo $item['phone'];?></td>
81
  </tr>
82
  <tr class="even pointer">
83
+ <td class=""width="15%">Email</td>
84
  <td class="a-left "><?php echo $item['email'];?></td>
85
  </tr>
86
  <tr class="even pointer">
87
+ <td class=""width="15%">Website</td>
88
+ <td class="a-left "><?php if($item['website']==""): echo "-";else:echo $item['website'];endif; ?></td>
89
  </tr>
90
  <tr class="even pointer">
91
+ <td class=""width="15%">Is Created</td>
92
  <td class="a-left "><?php echo $IsCreated==0? "<font color='#FF0000'>Not Created</font>" : "<font color='#009933'>Created</font>";?></td>
93
  </tr>
94
  <tr class="even pointer">
95
+ <td class=""width="15%">Created Date</td>
96
  <td class="a-left "><?php echo date("F j, Y",strtotime($item['createddt']));?></td>
97
  </tr>
98
  <tr class="even pointer">
99
+ <td class=""width="15%">Business Description</td>
100
+ <td class="a-left "><p><?php if($item['desc']==""): echo "-"; else:echo stripslashes($item['desc']);endif;?></p></td>
101
  </tr>
102
  </tr>
103
  </tbody>
app/design/frontend/default/default/template/inquiry/inquiry.phtml CHANGED
@@ -3,8 +3,12 @@
3
  * @copyright Copyright (c) 2010 Capacity Web Solutions Pvt. Ltd (http://www.capacitywebsolutions.com)
4
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
5
  */
 
 
6
  ?>
7
 
 
 
8
  <div id="about-copy">
9
  <h1>Dealer inquiries</h1>
10
  <p>Please fill in this form if you are interested in becoming a distributor. We are interested in partnering with local distributors and retailers throughout North America. We will also be accepting a limited amount of applications from Online retailers for our drop ship program. A company representative will contact you with more information within two business days.</p>
@@ -23,13 +27,31 @@
23
  <td>Last Name&nbsp;<span class="required">*</span></td>
24
  <td><input type="text" name="lname" size="45" class="input-text required-entry" /> </td>
25
  </tr>
 
26
  <tr>
27
- <td>Company&nbsp;<span class="required">*</span></td>
28
  <td><input type="text" name="company" size="45" class="input-text required-entry" /> </td>
29
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  <tr>
31
  <td>Address&nbsp;<span class="required">*</span></td>
32
- <td><input type="text" name="address" size="45" class="input-text required-entry" /> </td>
33
  </tr>
34
  <tr>
35
  <td>City&nbsp;<span class="required">*</span></td>
@@ -37,74 +59,38 @@
37
  </tr>
38
  <tr>
39
  <td>State / Province&nbsp;<span class="required">*</span></td>
40
- <td>
41
- <select name="state_id" class="drop" class="input-text required-entry"><option value="AL">Alabama</option>
42
- <option value="AK">Alaska</option>
43
- <option value="AZ">Arizona</option>
44
-
45
- <option value="AR">Arkansas</option>
46
- <option value="CA">California</option>
47
- <option value="CO">Colorado</option>
48
- <option value="CT">Connecticut</option>
49
- <option value="DC">D.C.</option>
50
- <option value="DE">Delaware</option>
51
- <option value="FL">Florida</option>
52
- <option value="GA">Georgia</option>
53
- <option value="HI">Hawaii</option>
54
-
55
- <option value="ID">Idaho</option>
56
- <option value="IL">Illinois</option>
57
- <option value="IN">Indiana</option>
58
- <option value="IA">Iowa</option>
59
- <option value="KS">Kanasas</option>
60
- <option value="KY">Kentucky</option>
61
- <option value="LA">Louisiana</option>
62
- <option value="ME">Maine</option>
63
- <option value="MD">Maryland</option>
64
-
65
- <option value="MA">Massachusetts</option>
66
- <option value="MI">Michigan</option>
67
- <option value="MN">Minnesota</option>
68
- <option value="MS">Mississippi</option>
69
- <option value="MO">Missouri</option>
70
- <option value="MT">Montana</option>
71
- <option value="NE">Nebraska</option>
72
- <option value="NV">Nevada</option>
73
- <option value="NH">New Hampshire</option>
74
-
75
- <option value="NJ">New Jersey</option>
76
- <option value="NM">New Mexico</option>
77
- <option value="NY">New York</option>
78
- <option value="NC">North Carolina</option>
79
- <option value="ND">North Dakota</option>
80
- <option value="OH">Ohio</option>
81
- <option value="OK">Oklahoma</option>
82
- <option value="OR">Oregon</option>
83
- <option value="PA">Pennsylvania</option>
84
-
85
- <option value="RI">Rhode Island</option>
86
- <option value="SC">South Carolina</option>
87
- <option value="SD">South Dakota</option>
88
- <option value="TN">Tennessee</option>
89
- <option value="TX">Texas</option>
90
- <option value="UT">Utah</option>
91
- <option value="VT">Vermont</option>
92
- <option value="VA">Virginia</option>
93
- <option value="WA">Washington</option>
94
-
95
- <option value="WV">West Virginia</option>
96
- <option value="WI">Wisconsin</option>
97
- <option value="WY">Wyoming</option>
98
- </select>
99
- </td>
100
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  <tr>
102
  <td>ZIP / Postal Code&nbsp;<span class="required">*</span></td>
103
- <td><input type="text" name="zip" id="zip" size="45" class="input-text validate-zip required-entry input-text" /> </td>
104
  </tr>
105
  <tr>
106
- <td>Contact Phone Number&nbsp;<span class="required">*</span></td>
107
- <td><input type="text" name="phone" size="45" class="input-text validate-phoneLax input-text required-entry" /> </td>
108
  </tr>
109
  <tr>
110
  <td>Email&nbsp;<span class="required">*</span></td>
@@ -121,7 +107,7 @@
121
  <tr>
122
  <td>&nbsp;</td>
123
  <td>
124
- <button type="submit" class="button"><img src="<?php echo $this->getSkinUrl('images/button_submit.jpg') ?>" alt="Submit" /></button>
125
  </td>
126
  </tr>
127
  </table>
@@ -131,4 +117,15 @@
131
  //< ![CDATA[
132
  var customForm = new VarienForm('dealerInquiry');
133
  //]]>
 
 
 
 
 
 
 
 
 
 
 
134
  </script>
3
  * @copyright Copyright (c) 2010 Capacity Web Solutions Pvt. Ltd (http://www.capacitywebsolutions.com)
4
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
5
  */
6
+
7
+ $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat');
8
  ?>
9
 
10
+
11
+
12
  <div id="about-copy">
13
  <h1>Dealer inquiries</h1>
14
  <p>Please fill in this form if you are interested in becoming a distributor. We are interested in partnering with local distributors and retailers throughout North America. We will also be accepting a limited amount of applications from Online retailers for our drop ship program. A company representative will contact you with more information within two business days.</p>
27
  <td>Last Name&nbsp;<span class="required">*</span></td>
28
  <td><input type="text" name="lname" size="45" class="input-text required-entry" /> </td>
29
  </tr>
30
+
31
  <tr>
32
+ <td>Company Name&nbsp;<span class="required">*</span></td>
33
  <td><input type="text" name="company" size="45" class="input-text required-entry" /> </td>
34
  </tr>
35
+ <?php if($_taxvat->isEnabled()):
36
+ if($_taxvat->isRequired()):
37
+ ?>
38
+ <tr>
39
+ <td><label for="_accounttaxvat">Tax/VAT Number</label>&nbsp;<span class="required">*</span></td>
40
+ <td><input type="text" name="account_taxvat" size="45" class="input-text required-entry" /></td>
41
+ </tr>
42
+ <?php
43
+ else:
44
+ ?>
45
+ <tr>
46
+ <td><label for="_accounttaxvat">Tax/VAT Number</label>&nbsp;</td>
47
+ <td><input type="text" name="account_taxvat" size="45" /></td>
48
+ </tr>
49
+
50
+ <?php endif;endif; ?>
51
+
52
  <tr>
53
  <td>Address&nbsp;<span class="required">*</span></td>
54
+ <td><textarea name="address" cols="42" rows="2" class="input-text required-entry"></textarea></td>
55
  </tr>
56
  <tr>
57
  <td>City&nbsp;<span class="required">*</span></td>
59
  </tr>
60
  <tr>
61
  <td>State / Province&nbsp;<span class="required">*</span></td>
62
+
63
+ <td><input type="text" name="state_id" size="45" class="input-text required-entry" /> </td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  </tr>
65
+ <tr>
66
+ <td>Country&nbsp;<span class="required">*</span></td>
67
+ <td>
68
+ <select name="country" id="country" class="drop" class="input-text required-entry">
69
+ <?php
70
+ $countryCode = Mage::getStoreConfig('general/country/default');
71
+ $country_name=Mage::app()->getLocale()->getCountryTranslation($countryCode);
72
+ //echo $country_name;
73
+ $collection = Mage::getModel('directory/country')->getCollection();
74
+ foreach ($collection as $country)
75
+ {
76
+ $cid = $country->getId();
77
+ $cname = $country->getName();
78
+ ?>
79
+ <option value="<?php echo $cid.'$$$'.$cname; ?>" <?php if($cid == $countryCode) echo "SELECTED" ?> ><?php echo $cname; ?></option>
80
+ <?php
81
+ }
82
+ ?>
83
+ </select>
84
+ </td>
85
+ </tr>
86
+
87
  <tr>
88
  <td>ZIP / Postal Code&nbsp;<span class="required">*</span></td>
89
+ <td><input type="text" name="zip" id="zip" size="45" maxlength="10" class="required-entry input-text required-entry input-text required-entry validation-passed" /> </td>
90
  </tr>
91
  <tr>
92
+ <td>Contact Number&nbsp;<span class="required">*</span></td>
93
+ <td><input type="text" name="phone" size="45" onKeyPress="return isNumberKey(event)" maxlength="15" class="input-text validate input-text required-entry" /> </td>
94
  </tr>
95
  <tr>
96
  <td>Email&nbsp;<span class="required">*</span></td>
107
  <tr>
108
  <td>&nbsp;</td>
109
  <td>
110
+ <button type="submit" name="SUBMIT" value="SUBMIT" class="button"><img src="<?php echo $this->getSkinUrl('images/button_submit.jpg') ?>" alt="SUBMIT" /></button>
111
  </td>
112
  </tr>
113
  </table>
117
  //< ![CDATA[
118
  var customForm = new VarienForm('dealerInquiry');
119
  //]]>
120
+ function isNumberKey(evt)
121
+ {
122
+ var charCode = (evt.which) ? evt.which : evt.keyCode
123
+ if (charCode > 31 && (charCode < 48 || charCode > 57))
124
+ {
125
+ alert('Please Enter Numeric Values only');
126
+ return false;
127
+ }
128
+ return true;
129
+ }
130
+
131
  </script>
app/design/frontend/default/default/template/inquiry/thanks.phtml CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * @copyright Copyright (c) 2010 Capacity Web Solutions Pvt. Ltd (http://www.capacitywebsolutions.com)
4
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1
  <?php
2
+
3
  /**
4
  * @copyright Copyright (c) 2010 Capacity Web Solutions Pvt. Ltd (http://www.capacitywebsolutions.com)
5
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
app/etc/modules/CapacityWebSolutions_Inquiry.xml CHANGED
@@ -3,7 +3,7 @@
3
  <modules>
4
  <CapacityWebSolutions_Inquiry>
5
  <active>true</active>
6
- <codePool>local</codePool>
7
  </CapacityWebSolutions_Inquiry>
8
  </modules>
9
  </config>
3
  <modules>
4
  <CapacityWebSolutions_Inquiry>
5
  <active>true</active>
6
+ <codePool>community</codePool>
7
  </CapacityWebSolutions_Inquiry>
8
  </modules>
9
  </config>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Dealer_Inquery</name>
4
- <version>0.1.1</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>This extension is providing inquiry form.</summary>
10
- <description>Dealer filled the details like name, address, contact number, email, website and description inquiry form. It informs to customer and admin by email when customer submits inquiry form. This extension also provides customer listing who submit inquiry form in admin under &#x201C;Dealer Management &#x201C;section. You can view inquiry details of customer and also delete the inquiry information. This extension provides create customer link from dealer listing page.</description>
11
  <notes>Dealer Inquery</notes>
12
- <authors><author><name>Capacity Web Solutions</name><user>auto-converted</user><email>magento@capacitywebsolutions.com</email></author></authors>
13
- <date>2010-10-06</date>
14
- <time>07:51:02</time>
15
- <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="inquiry.xml" hash="ca5a9dd55f3aef957f8e3835518f44f8"/></dir><dir name="template"><dir name="inquiry"><file name="inquiry.phtml" hash="ac258b575619f74021aa00460a21e25e"/><file name="view.phtml" hash="a4eb056037ea0de33cc1306a10656733"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="inquiry.xml" hash="5aef78924cf5494891d4143a0375a1e3"/></dir><dir name="template"><dir name="inquiry"><file name="inquiry.phtml" hash="80d8f49a120d3f11f4e8dbe0df968c82"/><file name="thanks.phtml" hash="76aa188ec3cb4d5c15672f41c20aa888"/></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="CapacityWebSolutions"><dir name="Inquiry"><dir name="Block"><file name="Inquiry.php" hash="6ded5f3a89db3f2ead9d85b423cd9f0e"/><dir name="Manage"><file name="Inquiry.php" hash="9763614178f7d3b9988f4dda528ab2fc"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="337ab4ad7d39427c63a85956e5d07d88"/><dir name="Manage"><file name="InquiryController.php" hash="3403687c8c01a222505f25e404f6de9e"/></dir></dir><dir name="etc"><file name="config.xml" hash="563243d20691ea9fc803c46564c46044"/><file name="system.xml" hash="a7fa4e299399752f973cfb7c23b09946"/></dir><dir name="Helper"><file name="Data.php" hash="3727f4f66a8f27b8c2aee88808934919"/></dir><dir name="Model"><file name="Inquiry.php" hash="cf83fcc67ad4fa8906f3a73266e48827"/><dir name="Mysql4"><file name="Inquiry.php" hash="c248c2c9e909dc5d3d9179c470c2bb91"/><dir name="Inquiry"><file name="Collection.php" hash="31cfb1582d408a5495f3863fc84937f2"/></dir></dir></dir><dir name="sql"><dir name="inquiry_setup"><file name="mysql4-install-0.1.0.php" hash="23c2147085626771e46f75f1881c363f"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="images"><file name="button_submit.jpg" hash="c55995572964cf7462fcb452ff919dee"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="CapacityWebSolutions_Inquiry.xml" hash="8d654207ecb2796c7275e01299271474"/></dir></target></contents>
16
  <compatible/>
17
- <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Dealer_Inquery</name>
4
+ <version>1.1.5</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>This extension is providing inquiry form.</summary>
10
+ <description>Dealer filled the details like name, address, contact number, email, website and description inquiry form. It informs to customer and admin by email when customer submits inquiry form. This extension also provides customer listing who submit inquiry form in admin under &amp;amp;amp;#x201C;Dealer Management &amp;amp;amp;#x201C;section. You can view inquiry details of customer and also delete the inquiry information. This extension provides create customer link from dealer listing page.</description>
11
  <notes>Dealer Inquery</notes>
12
+ <authors><author><name>Capacity Web Solutions</name><user>capacitywebsolutions</user><email>magento@capacitywebsolutions.com</email></author></authors>
13
+ <date>2012-07-04</date>
14
+ <time>10:18:51</time>
15
+ <contents><target name="magecommunity"><dir name="CapacityWebSolutions"><dir name="Inquiry"><dir name="Block"><file name="Inquiry.php" hash="c57724e9f9ee110749fb069ecef725b8"/><dir name="Manage"><file name="Inquiry.php" hash="9763614178f7d3b9988f4dda528ab2fc"/></dir></dir><dir name="Helper"><file name="Data.php" hash="3727f4f66a8f27b8c2aee88808934919"/></dir><dir name="Model"><file name="Inquiry.php" hash="cf83fcc67ad4fa8906f3a73266e48827"/><dir name="Mysql4"><dir name="Inquiry"><file name="Collection.php" hash="31cfb1582d408a5495f3863fc84937f2"/></dir><file name="Inquiry.php" hash="c248c2c9e909dc5d3d9179c470c2bb91"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="c712d8d1a6e5e059c796db4569148542"/><dir name="Manage"><file name="InquiryController.php" hash="29be2a96b8308d4ba0f66a5d566a3fd4"/></dir></dir><dir name="etc"><file name="config.xml" hash="563243d20691ea9fc803c46564c46044"/><file name="system.xml" hash="a7fa4e299399752f973cfb7c23b09946"/></dir><dir name="sql"><dir name="inquiry_setup"><file name="mysql4-install-0.1.0.php" hash="e45204de22d11c996a2e2165fd168b40"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="CapacityWebSolutions_Inquiry.xml" hash="6cab57f39d7ee7c749a6076924a644ad"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="inquiry"><file name="inquiry.phtml" hash="ca32ddf5cf0bb8379e05d80072aea8e6"/><file name="view.phtml" hash="cc2c314a773639ca2e5711270267b7d8"/></dir></dir><dir name="layout"><file name="inquiry.xml" hash="ca5a9dd55f3aef957f8e3835518f44f8"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="inquiry"><file name="inquiry.phtml" hash="00757b932ca8ddc80ea4c90860231658"/><file name="thanks.phtml" hash="157c91baa6227dc09a17a6b3f65d5844"/></dir></dir></dir></dir></dir><dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="inquiry.xml" hash="5aef78924cf5494891d4143a0375a1e3"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="images"><file name="button_submit.jpg" hash="c55995572964cf7462fcb452ff919dee"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
+ <dependencies><required><php><min>5.0.0</min><max>5.5.2</max></php></required></dependencies>
18
  </package>