public static function update_io_fee() { $id = Core::validate(self::getVar('id')); $fieldName = Core::validate(self::getVar('fieldName')); $value = Core::validate(self::getVar('value')); $goodInput = false; switch ($fieldName) { case 'input_fee': case 'input_min': case 'output_fee': case 'output_min': if ($value != null && Core::isDouble($value) && $value >= 0) { $goodInput = true; } break; case 'input_max': case 'output_max': if ($value == null || Core::isDouble($value) && $value >= 0) { $goodInput = true; if ($value == null) { $value = "NULL"; } } break; default: break; } if ($goodInput == true) { CurrencyPaymentSystem::update($id, array($fieldName => $value)); Core::printSuccessJson(''); } else { Core::printErrorJson('Invalid input: ' . $value); } }
private static function transactionLimits($currencyId, $paymentSystemName, $type = 0) { $paySystem = new PaymentSystem(); $paySystem->findBy(array('name' => $paymentSystemName)); $curPaySystem = new CurrencyPaymentSystem(); $result = $curPaySystem->findBy(array('cur_id' => $currencyId, 'system_id' => $paySystem->getId())); if (!$result) { $system_fee = 0.0; $fee = 0.0; $min = 0.0; $max = null; } else { if ($type == 1) { $system_fee = $curPaySystem->getSystemFee(); $fee = $curPaySystem->getOutputFee(); $min = $curPaySystem->getOutputMin(); $max = $curPaySystem->getOutputMax(); } else { $system_fee = $curPaySystem->getSystemFee(); $fee = $curPaySystem->getInputFee(); $min = $curPaySystem->getInputMin(); $max = $curPaySystem->getInputMax(); } } return array('system_fee' => $system_fee, 'fee' => $fee, 'min' => $min, 'max' => $max); }
<!-- /money/YM_transaction/ --> <input class="inButton btn" type="button" value="<?php print Core::translateToCurrentLocale('In'); ?> "> <input class="outButton btn" type="button" value="<?php print Core::translateToCurrentLocale('Out'); ?> "> </div> </div> <div class="alert submitValueDialog"> <div class="formArrow"></div> <a class="submitValueDialog-close" ><img src="/public/img/other/close_wallet.png"></a> <?php $systems = CurrencyPaymentSystem::availablePaymentSystems($value['CurName']); if (count($systems) > 1) { ?> <select id="payment-select"> <?php foreach ($systems as $system) { ?> <option value="<?php print $system['name']; ?> "><?php print $system['trade_name']; ?> </option> <?php }