вывод на сайте выбора валюты
|
1 2 3 4 5 6 7 8 9 10 11 12 |
<? if (!$select_cy):?> <form method="post"> <select id="select_cy" name="select_cy" onchange="this.form.submit()"> <option value="RUB">RUB</option> <option <?if($_SESSION['select_id'] == "USD"){echo 'selected';}?> value="USD">USD</option> <option <?if($_SESSION['select_id'] == "EUR"){echo 'selected';}?> value="EUR">EUR</option> <option <?if($_SESSION['select_id'] == "UAH"){echo 'selected';}?> value="UAH">UAH</option> <option <?if($_SESSION['select_id'] == "BYN"){echo 'selected';}?> value="BYN">BYN</option> <option <?if($_SESSION['select_id'] == "KGS"){echo 'selected';}?> value="KGS">KGS</option> </select> </form> <? endif; ?> |
вывод валюты
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
<? if( $price["CURRENCY"] === "RUB" ){ $RUB_VAL = $price['BASE_PRICE']; //сумма в USD $USD_VAL = CCurrencyRates::ConvertCurrency($RUB_VAL, "RUB", "USD"); $EUR_VAL = CCurrencyRates::ConvertCurrency($RUB_VAL, "RUB", "EUR"); $UAH_VAL = CCurrencyRates::ConvertCurrency($RUB_VAL, "RUB", "UAH"); $BYN_VAL = CCurrencyRates::ConvertCurrency($RUB_VAL, "RUB", "BYN"); $KGS_VAL = CCurrencyRates::ConvertCurrency($RUB_VAL, "RUB", "KGS"); } ?> <?if($_SESSION['select_id'] == "RUB"):?> <strong><?=CurrencyFormat( $RUB_VAL, ".")?> RUB</strong> <? endif;?> <?if($_SESSION['select_id'] == "USD"):?> <strong><?=CurrencyFormat( $USD_VAL, ".")?> USD</strong> <? endif;?> <?if($_SESSION['select_id'] == "EUR"):?> <strong><?=CurrencyFormat( $EUR_VAL, ".")?> EUR</strong> <? endif;?> <?if($_SESSION['select_id'] == "UAH"):?> <strong><?=CurrencyFormat( $EUR_VAL, ".")?> UAH</strong> <? endif;?> <?if($_SESSION['select_id'] == "BYN"):?> <strong><?=CurrencyFormat( $EUR_VAL, ".")?> BYN</strong> <? endif;?> <?if($_SESSION['select_id'] == "KGS"):?> <strong><?=CurrencyFormat( $EUR_VAL, ".")?> KGS</strong> <? endif;?> |