<?
//$_SERVER["DOCUMENT_ROOT"] = __DIR__;
define('STOP_STATISTICS', true);
define('NO_KEEP_STATISTIC', 'Y');
define('NO_AGENT_STATISTIC', 'Y');
define('DisableEventsCheck', true);
define('BX_SECURITY_SHOW_MESSAGE', true);
define('NOT_CHECK_PERMISSIONS', true);

$_SERVER['DOCUMENT_ROOT'] = dirname(__DIR__, 1);
require_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_before.php'); 
CModule::IncludeModule('iblock');

$car_search_res = CIBlockElement::GetList( [ "ID" => "ASC" ], [ "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_NEW, ], false, [], [] );

$c = 0;
$uids = [];
while($car_search_ob = $car_search_res->GetNextElement())
{
	$car_existed = $car_search_ob->GetFields();
	$car_existed['PROPERTIES'] = $car_search_ob->GetProperties();

	$uids[$car_existed['PROPERTIES']['UID']['VALUE']] = $car_existed['CODE'];
}

print count($uids);

file_put_contents("./uids_codes_2022_11_30.json", json_encode($uids));

die();

?>