Kursy kruszców

<?

// — config block ————————————

require_once($_SERVER[„DOCUMENT_ROOT”] . „/functions.php”);
require_once($_SERVER[„DOCUMENT_ROOT”] . „/instal.php”);
require_once($_SERVER[„DOCUMENT_ROOT”] . „/config.php”);
$config = new Config();
// — end config block ————————————

$waluty = $config->waluty;

if (isset($_GET[‚id_name’]) && isset($_GET[‚date’]) && strcmp($_GET[‚date’],’today’) == 0) {
$today = mktime(0, 0, 0, date(„m”) , date(„d”), date(„Y”));
$tomorrow = mktime(0, 0, 0, date(„m”) , date(„d”)+1, date(„Y”));
$t = ”.date(„Y-m-d”, $today);
$to = ”.date(„Y-m-d”, $tomorrow);
echo printCurrencyArray($_GET[‚id_name’],
new DateTime( $t),
new DateTime( $to),
true);

}

else if ( isset($_GET[‚id_name’]) && isset($_GET[‚date’]) && strcmp($_GET[‚date’],’yesterday’) == 0) {
$today = mktime(0, 0, 0, date(„m”) , date(„d”), date(„Y”));
$yesterday = mktime(0, 0, 0, date(„m”) , date(„d”)-1, date(„Y”));
$t = ”.date(„Y-m-d”, $today);
$y = ”.date(„Y-m-d”, $yesterday);
echo printCurrencyArray($_GET[‚id_name’],
new DateTime( $y),
new DateTime( $t),
true);
}

else if ( isset($_GET[‚id_name’]) &&
isset($_GET[‚startY’]) && isset($_GET[‚startM’]) && isset($_GET[‚startD’]) &&
isset($_GET[‚endY’]) && isset($_GET[‚endM’]) && isset($_GET[‚endD’])
) {
echo printCurrencyArray($_GET[‚id_name’],
new DateTime( $_GET[‚startY’] .’-‚. $_GET[‚startM’] .’-‚. $_GET[‚startD’]),
new DateTime($_GET[‚endY’] .’-‚. $_GET[‚endM’] .’-‚. $_GET[‚endD’]),
true);

}

else{
echo ‚Wybierz z MENU po lewej jaka data Cie interesuje ‚;
}

foreach($waluty as $waluta){
//echo printCurrencyArray($waluta[‚id_name’], new DateTime(‚2011-12-01’), new DateTime(‚2011-12-29’), true);
}

?>