$head = "/home/httpd/softclub/www/templates/header.txt";
$foot = "/home/httpd/softclub/www/templates/footer.txt";
$path1 = "http://www.cbr.ru/currency_base/D_print.asp?date_req=";
$path2 = "http://www.cbr.ru/currency_base/M_print.asp?";
$all_curency = array(
"USD" => 0.01,
"EUR" => 0.01,
"GBP" => 0.01,
"JPY" => 0.01,
"UAH" => 0.01,
"RUB" => 1,
"HKD" => 0.01
// "AZM" => 0.01
);
$all_curency_name = array (
"HKD" => 'Гонконгских долларов',
"AZM" => 'Азербайджанских манатов'
);
$ammount[0] = doubleval($_POST["denga"]);
$ammount[1] = $_POST["valuta"];
include $head;
class money {
function connect($page) {
global $path1, $path2;
$day = date("d");
$month = date("m");
$year = date("y");
$Year = date("Y");
if ($page == 1) {
$path1 .= $day . "/" . $month . "/" . $year;
@$fp = fopen($path1, "r");
if (!$fp) {
echo "Ошибка подключения к серверу ЦБ!
Попробуйте воспользоваться конвертором позднее...";
mail("gooru@airsoftclub.ru","Ошибка подключения к серверу ЦБ!","Давай уже почини!");
return 0;
} else {
$readed_source = fread($fp, 100000);
fclose($fp);
return $readed_source;
}
}
if ($page == 2) {
$path2 .= "year=$Year&month=$month";
@$fp = fopen($path2, "r");
if (!$fp) {
echo "Ошибка подключения к серверу ЦБ!
Попробуйте воспользоваться конвертором позднее...";
mail("gooru@airsoftclub.ru","Ошибка подключения к серверу ЦБ!","Давай уже почини!");
return 0;
} else {
$readed_source = fread($fp, 100000);
fclose($fp);
return $readed_source;
}
}
}
function select() {
global $all_curency, $all_curency_name;
$inc = (!$inc) ? $this->connect(1) : $inc;
while (list($curency, $rate) = each ($all_curency)) {
if ($curency != "RUB") {
preg_match("/
КОНВЕРТЕР FPS В M/S И НАОБОРОТ
Переводит футы в метры и наоборот. if (($m_s != "") || ($fps != "")) { if ($fps != $oldfps) { $m_s = $fps / 3.2808; $m_s = number_format($m_s, 2, '.', ''); $oldfps = $fps; } else if ($fps == $oldfps) { $fps = $m_s * 3.2808; $fps = number_format($fps, 2, '.', ''); $oldfps = $fps; } } $ps = "