Your IP : 3.145.76.206


Current Path : /home/bitrix/ext_www/dev.ballu.in.ua/import/subscripts/
Upload File :
Current File : /home/bitrix/ext_www/dev.ballu.in.ua/import/subscripts/gate_price_load.php

<?
// на агентах
/*
if( strpos($_SERVER["PHP_SELF"], "DEV") !== false || strpos($_SERVER["PWD"], "DEV") !== false || $_SERVER["SERVER_NAME"] == "www.dev.ballu.ru" )
	$_SERVER["DOCUMENT_ROOT"] = "/home/bitrix/DEV/dev.ballu.ru";
else
	$_SERVER["DOCUMENT_ROOT"] = "/home/bitrix/PUB/ballu.ru";

require_once($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/prolog_before.php");

CModule::IncludeModule("rusklimat.exchange");

$price = new RusklimatExchangePrice;

$price->runExchange(true);

die();




$_SERVER["DOCUMENT_ROOT"] = __DIR__."/../..";

require $_SERVER["DOCUMENT_ROOT"]."/import/.config.php";
	
	$method = "price";
	//echo "hi";
	startTimer("price");
	$arRes = getRest("price");
	stopTimer("price");

	$prices = arFormatPrices($arRes["data"]);

	
	startTimer("els");
	$arElements = allElements($IBLOCK, ["ID","NAME","XML_ID"],"XML_ID");
	$arElements = cleanTilda($arElements);
	stopTimer("els");
//echol($prices);
	startTimer("remake");
	foreach($arElements as $id => $el){
		if(!empty($prices[$id])){
			$El = $el;
			// price = $el[]
			foreach($prices[$id] as $bush => $arPr){
				$El["PRICE"][$bush]=$arPr["norm"];
				$El["PRICE"][$bush."_NODISCOUNT"]=$arPr["old"];

			}
			//$out[$rl["ID"]]["PRICE"]=array(=>)
			//$El["price"] = $prices[$id];
			$out[$el["ID"]] = $El;
		} 
		//$arElements[$id]

	}

//echol($out);

	stopTimer("remake");
	$priceConfig = getPriceTypes();
	echol($priceConfig);
	startTimer("load");
	foreach($out as $id => $el){
		setBasePrice($id, $el["PRICE"]);
	}
	stopTimer("load");
	print_r($out[2436]);
	print_r($out[3796]);


	outTimers();




$fd = fopen($_SERVER["DOCUMENT_ROOT"]."/import/my_cron.txt","a"); 
fwrite($fd, "Обращение к gate_price_load - ".date("d.m.Y H:i")."\r\n"); 
fclose($fd);

	//echo(count($arRes));
*/
?>