<?php

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

$sys = new System();

// パラメータ
$rtn	= array();
$rs		= null;
$pId	= $sys -> getDataPost(PARAM_P_ID);

$rs = $sys -> accessSelect('LIST_MST_EXCHANGE_FEE', array($pId));

// データが存在する場合
if($sys -> isLoopData($rs)) {

	foreach($rs as $row) {

		// 卸値の取得
		$rtn['whole_' . $sys -> getColumnData($row, COLUMN_FROM_CURRENCY) . DELIMIT_UNDER_BAR . $sys -> getColumnData($row, COLUMN_TO_CURRENCY)] = $sys -> intToCurrency($sys -> getColumnData($row, COLUMN_WHOLE), PERCENT);

		// マークアップの取得
		$rtn['markup_' . $sys -> getColumnData($row, COLUMN_FROM_CURRENCY) . DELIMIT_UNDER_BAR . $sys -> getColumnData($row, COLUMN_TO_CURRENCY)] = $sys -> intToCurrency($sys -> getColumnData($row, COLUMN_MARKUP), PERCENT);
	}
}

echo json_encode($rtn);
?>
