Your IP : 172.28.240.42


Current Path : /var/www/html/clients/tatneft-nhs.ru/back/modules/mod_footer/
Upload File :
Current File : /var/www/html/clients/tatneft-nhs.ru/back/modules/mod_footer/mod_footer.php

<?php
/**
* @version		$Id: mod_footer.php 10079 2008-02-28 13:39:08Z ircmaxell $
* @package		Joomla
* @copyright	Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// no direct access
defined('_JEXEC') or die('Restricted access');

// global $mainframe;
// 
// $date =& JFactory::getDate();
// $cur_year	= $date->toFormat('%Y');
// $csite_name	= $mainframe->getCfg('sitename');
// 
// if (JString::strpos(JText :: _('FOOTER_LINE1'), '%date%')) {
// 	$line1 = ereg_replace('%date%', $cur_year, JText :: _('FOOTER_LINE1'));
// } else {
// 	$line1 = JText :: _('FOOTER_LINE1');
// }
// 
// if (JString::strpos($line1, '%sitename%')) {
// 	$lineone = ereg_replace('%sitename%', $csite_name, $line1);
// } else {
// 	$lineone = $line1;
// }
// 
// require(JModuleHelper::getLayoutPath('mod_footer'));

$cont = file_get_contents("http://www.cbr.ru/scripts/XML_daily.asp");
$pattern = "/<CharCode>(.*?)<\/CharCode>\s*<Nominal>(.*)<\/Nominal>\s*<Name>(.*)<\/Name>\s*<Value>(.*)<\/Value>/im";

$cnt =  preg_match_all($pattern,$cont,$matches);

if($cnt != FALSE)
{
  
  //$count_currencies = count($matches[1]);
echo '<p style="color:#fff;vertical-align:middle;">';
    $curr_abbr = $matches[1][4];
    //$curr_nominal = $matches[2][$i];
    //$curr_name = $matches[3][$i];
    $curr_value = $matches[4][4];
    echo /*'<img src="http://tatneft-nhs.ru/images/dollar.png" />'.*/$curr_abbr.' - '.$curr_value.'<br/>';
    $curr_abbr = $matches[1][5];
    //$curr_nominal = $matches[2][$i];
    //$curr_name = $matches[3][$i];
    $curr_value = $matches[4][5];
    echo /*'<img src="http://tatneft-nhs.ru/images/euro.png" />'.*/$curr_abbr.' - '.$curr_value;
echo '</p>';
echo '<p style="color:#fff;"><a href="http://www.cbr.ru/" style="color:#fff;">По данным ЦБ РФ (http://www.cbr.ru)</a></p>';
} // if($cnt != FALSE)
else{echo '<p><a href="http://www.cbr.ru/" style="color:#fff;">http://www.cbr.ru</a></p>';}