db_query($sql, "could not delete exchange rate $rate_id");
}
-//---------------------------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+// Retrieve exchange rate as of date $date from external source (usually inet)
+//
+function retrieve_exrate($curr_b, $date)
+{
+ global $Hooks;
+
+ if (method_exists($Hooks, 'retrieve_exrate'))
+ return $Hooks->retrieve_exrate($curr_b, $date);
+ else
+ return get_ecb_rate($curr_b);
+}
+//-----------------------------------------------------------------------------
function get_ecb_rate($curr_b)
{
}
if (isset($_POST['get_rate']))
{
- $_POST['BuyRate'] = exrate_format(get_ecb_rate($_POST['curr_abrev']));
+ $_POST['BuyRate'] =
+ exrate_format(retrieve_exrate($_POST['curr_abrev'], $_POST['date_']));
$Ajax->activate('BuyRate');
}
small_amount_row(_("Exchange Rate:"), 'BuyRate', null, '',
language::set_language($_SESSION['language']->code);
+// include $Hooks object if locale file exists
+if(@include_once($path_to_root . "/lang/".$_SESSION['language']->code."/locale.inc"))
+{
+ $Hooks = new Hooks();
+}
+
include_once($path_to_root . "/config.php");
include_once($path_to_root . "/includes/main.inc");