Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class RonisBT_Feedback_IndexController extends Mage_Core_Controller_Front_Action{
- public function indexAction(){
- $this->loadLayout();
- $this->renderLayout();
- }
- ublic function postAction()
- {
- $data = $this->getRequest()->getPost();
- $session = Mage::getSingleton('core/session');
- $person = Mage::getModel('feedback/block');
- $person->setData('name', $data['name']);
- $person->setData('email', $data['email']);
- $person->setData('phone', $data['phone']);
- $person->setData('subject', $data['subject']);
- $person->setData('massage', $data['massage']);
- $person->setData('status', '1');
- $person->setData('user_agent', $data['user_agent']);
- $person->setData('remote_ip', $data['remote_ip']);
- $person->setData('created_at', date("Y-m-d H:i:s"));
- $person->setData('update_at', '');
- // $person->setData($data);
- try{
- $person->save();
- var_dump($person->save());die;
- $session->addSuccess('Add a person sucessfully');
- }catch(Exception $e){
- $session->addError('Add Error');
- }
- $this->_redirect('feedback/index/index');
- }
- }
- <?php
- class RonisBT_Feedback_Model_Resource_Block extends Mage_Core_Model_Mysql4_Abstract{
- public function _construct()
- {
- $this->_init('feedback/block', 'feedback_id');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement