Add php files
This commit is contained in:
16
modules/Currencies/getNBPCurrencyExchange.php
Executable file
16
modules/Currencies/getNBPCurrencyExchange.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
$c_id = $_REQUEST['c_id'];
|
||||
$d = $_REQUEST['date'];
|
||||
|
||||
|
||||
if (!$c_id || !$d) {echo '-1'; return;}
|
||||
global $timedate;
|
||||
$d = explode('-',reset(explode(" ",$timedate->to_db($d))));
|
||||
$date = date("Y-m-d",@mktime(0,0,0,$d[1],$d[2],$d[0])+3600*24);
|
||||
|
||||
$w = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT value FROM currency_nbp_archive WHERE currency_id='$c_id' AND date='$date'"));
|
||||
|
||||
echo $w['value']; return;
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user