當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CSaleLocation::ClearAllLocationZIP方法代碼示例

本文整理匯總了PHP中CSaleLocation::ClearAllLocationZIP方法的典型用法代碼示例。如果您正苦於以下問題:PHP CSaleLocation::ClearAllLocationZIP方法的具體用法?PHP CSaleLocation::ClearAllLocationZIP怎麽用?PHP CSaleLocation::ClearAllLocationZIP使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CSaleLocation的用法示例。


在下文中一共展示了CSaleLocation::ClearAllLocationZIP方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: CCSVData

				include_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/csv_data.php");

				$csvFile = new CCSVData();
				$csvFile->LoadFile($_SERVER['DOCUMENT_ROOT'].WIZARD_SERVICE_RELATIVE_PATH."/locations/ru/zip_ussr.csv");
				$csvFile->SetFieldsType("R");
				$csvFile->SetFirstHeader(false);
				$csvFile->SetDelimiter(";");

				if (is_set($_SESSION, 'ZIP_POS'))
				{
					$numZIP = $_SESSION["NUM_ZIP"];
					$csvFile->SetPos($_SESSION["ZIP_POS"]);
				}
				else
				{
					CSaleLocation::ClearAllLocationZIP();

					unset($_SESSION["NUM_ZIP"]);
					$numZIP = 0;
				}

				$bFinish = true;
				$arLocationsZIP = array();
				$tt = 0;
				$REGION = "";
				while ($arRes = $csvFile->Fetch())
				{
					$tt++;
					$CITY = $arRes[1];
					if(strlen($arRes[3]) > 0)
						$REGION = $arRes[3];
開發者ID:ASDAFF,項目名稱:entask.ru,代碼行數:31,代碼來源:step1.php

示例2: saleLocationImport


//.........這裏部分代碼省略.........
                    //echo '<script>Import('.($LOADZIP == "Y" ? 2 : 3).')</script>';
                }
                break;
            case 2:
                $time_limit = ini_get('max_execution_time');
                if ($time_limit < ZIP_STEP_LENGTH) {
                    set_time_limit(ZIP_STEP_LENGTH + 5);
                }
                $start_time = time();
                $finish_time = $start_time + ZIP_STEP_LENGTH;
                if ($LOADZIP == "Y" && file_exists($sTmpFilePath . DLZIPFILE)) {
                    $rsLocations = CSaleLocation::GetList(array(), array("LID" => 'ru'), false, false, array("ID", "CITY_NAME_LANG", "REGION_NAME_LANG"));
                    $arLocationMap = array();
                    while ($arLocation = $rsLocations->Fetch()) {
                        if (strlen($arLocation["REGION_NAME_LANG"]) > 0) {
                            if (strlen($arLocation["CITY_NAME_LANG"]) > 0) {
                                $arLocationMap[$arLocation["CITY_NAME_LANG"]][$arLocation["REGION_NAME_LANG"]] = $arLocation["ID"];
                            }
                        } else {
                            $arLocationMap[$arLocation["CITY_NAME_LANG"]] = $arLocation["ID"];
                        }
                    }
                    $DB->StartTransaction();
                    include_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/csv_data.php";
                    $csvFile = new CCSVData();
                    $csvFile->LoadFile($sTmpFilePath . DLZIPFILE);
                    $csvFile->SetFieldsType("R");
                    $csvFile->SetFirstHeader(false);
                    $csvFile->SetDelimiter(";");
                    if (is_set($_SESSION, 'ZIP_POS')) {
                        $numZIP = $_SESSION["NUM_ZIP"];
                        $csvFile->SetPos($_SESSION["ZIP_POS"]);
                    } else {
                        CSaleLocation::ClearAllLocationZIP();
                        unset($_SESSION["NUM_ZIP"]);
                        $numZIP = 0;
                    }
                    $bFinish = true;
                    $tt = 0;
                    $REGION = "";
                    while ($arRes = $csvFile->Fetch()) {
                        $tt++;
                        $CITY = $arRes[1];
                        if (strlen($arRes[3]) > 0) {
                            $REGION = $arRes[3];
                        }
                        if (array_key_exists($CITY, $arLocationMap)) {
                            if (strlen($REGION) > 0) {
                                $ID = $arLocationMap[$CITY][$REGION];
                            } else {
                                $ID = $arLocationMap[$CITY];
                            }
                        } else {
                            $ID = 0;
                        }
                        if ($ID) {
                            CSaleLocation::AddLocationZIP($ID, $arRes[2]);
                            $numZIP++;
                        }
                        if ($tt == 10) {
                            $tt = 0;
                            $cur_time = time();
                            if ($cur_time >= $finish_time) {
                                $cur_step = $csvFile->GetPos();
                                $amount = $csvFile->iFileLength;
                                $_SESSION["ZIP_POS"] = $cur_step;
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:67,代碼來源:location_import.php


注:本文中的CSaleLocation::ClearAllLocationZIP方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。