Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. <?php
  2.  
  3. class masked_name__Adminhtml_masked_name__Controller extends Mage_Adminhtml_Controller_Action
  4. {
  5. public function indexAction()
  6. {
  7. $this->loadLayout()->renderLayout();
  8. }
  9.  
  10. public function postAction()
  11. {
  12. $post = $this->getRequest()->getPost();
  13. try {
  14. if (empty($post)) {
  15. Mage::throwException($this->__('Invalid form data.'));
  16. }
  17.  
  18. /* form processing */
  19. Mage::app()->getRequest()->getPost();
  20. $masked_value_1 = Mage::app()->getRequest()->getParam('masked_value_1');
  21. $masked_value_2 = Mage::app()->getRequest()->getParam('masked_value_2');
  22. $masked_value_3 = Mage::app()->getRequest()->getParam('masked_value_3');
  23.  
  24. $conn = Mage::getSingleton('core/resource')->getConnection('core_write');
  25. $conn->query("UPDATE masked_table_name SET masked_input_1='" . $masked_value_1 . "', masked_input_2='" . $masked_value_2 . "', masked_input_3='" . $masked_value_3 . "' WHERE id='10'");
  26.  
  27. $message = $this->__('Landed price variable have been successfully updated.');
  28. Mage::getSingleton('adminhtml/session')->addSuccess($message);
  29. } catch (Exception $e) {
  30. Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
  31. }
  32. $this->_redirect('*/*');
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement