Last active
February 14, 2016 12:39
-
-
Save howardhenry/78db29f6164af5fe597b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class masked_name__Adminhtml_masked_name__Controller extends Mage_Adminhtml_Controller_Action | |
{ | |
public function indexAction() | |
{ | |
$this->loadLayout()->renderLayout(); | |
} | |
public function postAction() | |
{ | |
$post = $this->getRequest()->getPost(); | |
try { | |
if (empty($post)) { | |
Mage::throwException($this->__('Invalid form data.')); | |
} | |
/* form processing */ | |
Mage::app()->getRequest()->getPost(); | |
$masked_value_1 = Mage::app()->getRequest()->getParam('masked_value_1'); | |
$masked_value_2 = Mage::app()->getRequest()->getParam('masked_value_2'); | |
$masked_value_3 = Mage::app()->getRequest()->getParam('masked_value_3'); | |
$conn = Mage::getSingleton('core/resource')->getConnection('core_write'); | |
$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'"); | |
$message = $this->__('Landed price variable have been successfully updated.'); | |
Mage::getSingleton('adminhtml/session')->addSuccess($message); | |
} catch (Exception $e) { | |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); | |
} | |
$this->_redirect('*/*'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment