Skip to content

Instantly share code, notes, and snippets.

@howardhenry
Last active February 23, 2016 14:44
Show Gist options
  • Save howardhenry/ded7d72699e967617180 to your computer and use it in GitHub Desktop.
Save howardhenry/ded7d72699e967617180 to your computer and use it in GitHub Desktop.
<?php
$conn = Mage::getSingleton('core/resource')->getConnection('core_read');
$result = $conn->fetchAll("SELECT * FROM masked_table_name");
foreach($result as $row) {
$masked_value_1 = $row['masked_value_1'];
$masked_value_2 = $row['masked_value_2'];
$masked_value_3 = $row['masked_value_3'];
}
?>
<div class="content-header">
<table cellspacing="0" class="grid-header">
<tr>
<td><h3><?=$this->__('Landed Price Formula Variables')?></h3></td>
<td class="a-right">
<button onclick="editForm.submit()" class="scalable save" type="button"><span>Update Price Variables</span></button>
</td>
</tr>
</table>
</div>
<div class="entry-edit">
<form id="edit_form" name="edit_form" method="post" action="<?=$this->getUrl('*/*/post')?>">
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
<!--h4 class="icon-head head-edit-form fieldset-legend"><?php /*$this->__('This fieldset name') */?></h4>-->
<p>Current landed price formula:<br /><br />
<strong>masked_value_1</strong> (USD) = product_weight * $<?php echo $masked_value_1; ?><br />
<strong>masked_value_2</strong> (USD) = $<?php echo $masked_value_2; ?><br />
<strong>masked_value_3</strong> (JMD) = $<?php echo $masked_value_3; ?>/currency_rate<br />
<!-- Hidden formula -->
</p>
<fieldset id="my-fieldset">
<table cellspacing="0" class="form-list">
<tr>
<td class="label"><?=$this->__('masked_value_1')?> <span class="required">*</span></td>
<td class="input-ele a-right" style="width: 10px;">$&nbsp;</td>
<td class="input-ele"><input class="input-text required-entry" value="<?php echo $masked_value_1; ?>" type="number"/></td>
</tr>
<tr>
<td class="label"><?=$this->__('masked_value_2')?> <span class="required">*</span></td>
<td class="input-ele a-right" style="width: 10px;">$&nbsp;</td>
<td class="input-ele"><input class="input-text required-entry" value="<?php echo $masked_value_2; ?>" type="number" /></td>
</tr>
<tr>
<td class="label"><?=$this->__('masked_value_3')?> <span class="required">*</span></td>
<td class="input-ele a-right" style="width: 10px;">$&nbsp;</td>
<td class="input-ele"><input class="input-text required-entry" value="<?php echo $masked_value_3; ?>" type="number"/></td>
</tr>
</table>
</fieldset>
</form>
</div>
<script type="text/javascript">
var editForm = new varienForm('edit_form');
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment