%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 18.118.24.228 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/wizards/bitrix/demo/modules/sale/ |
Upload File : |
<? if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); if(!CModule::IncludeModule('sale')) return; $siteID = $arParams["site_id"]; if(strlen($arParams["site_id"]) <= 0) $siteID = "s1"; $dbSite = CSite::GetByID($siteID); if($arSite = $dbSite -> Fetch()) $lang = $arSite["LANGUAGE_ID"]; if(strlen($lang) <= 0) $lang = "ru"; //Locations include_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/csv_data.php"); $csvFile = new CCSVData(); $csvFile->LoadFile(dirname(__FILE__)."/data/".$lang."/loc.csv"); $csvFile->SetPos($_SESSION["LOC_POST"]); $csvFile->SetFieldsType("R"); $csvFile->SetFirstHeader(false); $csvFile->SetDelimiter(","); $arLocation = Array(); $arLocationMap = Array(); $arSysLangs = Array(); $db_lang = CLangAdmin::GetList(($b="sort"), ($o="asc"), array("ACTIVE" => "Y")); while ($arLang = $db_lang->Fetch()) { $arSysLangs[] = $arLang["LID"]; } $i = 0; while ($arRes = $csvFile->Fetch()) { $i++; if($i >=1000) { $_SESSION["LOC_POST"] = $csvFile->GetPos(); break; } if(IntVal($CurCountryID)<=0) { $dbCountry = CSaleLocation::GetCountryList(Array("ID"=>"DESC")); if($arCountry = $dbCountry->Fetch()) $CurCountryID = $arCountry["ID"]; } $arArrayTmp = array(); for ($ind = 1; $ind < count($arRes); $ind+=2) { if (in_array($arRes[$ind], $arSysLangs)) { $arArrayTmp[$arRes[$ind]] = array( "LID" => $arRes[$ind], "NAME" => $arRes[$ind + 1] ); if ($arRes[$ind] == $lang) { $arArrayTmp["NAME"] = $arRes[$ind + 1]; } } } if (is_array($arArrayTmp) && strlen($arArrayTmp["NAME"])>0) { if (ToUpper($arRes[0])=="S") { $CurCountryID = CSaleLocation::AddCountry($arArrayTmp); $CurCountryID = IntVal($CurCountryID); if ($CurCountryID>0) { $LLL = CSaleLocation::AddLocation(array("COUNTRY_ID" => $CurCountryID)); } } elseif (ToUpper($arRes[0])=="T" && $CurCountryID>0) { $city_id = 0; $LLL = 0; if ($city_id <= 0) { $city_id = CSaleLocation::AddCity($arArrayTmp); $city_id = IntVal($city_id); $arLocationMap[ToUpper($arArrayTmp["NAME"])] = $city_id; } if ($city_id > 0) { if (IntVal($LLL) <= 0) { $LLL = CSaleLocation::AddLocation( array( "COUNTRY_ID" => $CurCountryID, "CITY_ID" => $city_id )); $arLocation[] = $LLL; } } } } } $_SESSION["LOC_POST"] = $csvFile->GetPos(); $DB->Commit(); ?>