<?php

include_once($_SERVER['DOCUMENT_ROOT'] . '/lib/config.php');

$sys = new System();

// パラメータ
$rtn			= array();
$fromCurrency	= $sys -> getDataPost(PARAM_TRANSFER_FROM_CURRENCY);
$toCurrency		= $sys -> getDataPost(PARAM_TRANSFER_TO_CURRENCY);
$transferType	= $sys -> getDataPost(PARAM_TRANSFER_TYPE);

if($fromCurrency == NO_STRING) {
	$fromCurrency = USD;
}

if($toCurrency == NO_STRING) {
	$toCurrency = USD;
}

// 文字列返却
if($transferType == NO_COUNT) {
	echo $fromCurrency . ' 1 = ' . $toCurrency . ' ' . $sys -> getRateCommon($fromCurrency, $toCurrency);
} else if($transferType == VAL_INT_1) {
	echo $toCurrency . ' 1 = ' . $fromCurrency . ' ' . $sys -> getRateCommon($toCurrency, $fromCurrency);
}

?>
