当前位置: 首页>>代码示例>>PHP>>正文


PHP CSaleLocation::AddLocationZIP方法代码示例

本文整理汇总了PHP中CSaleLocation::AddLocationZIP方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleLocation::AddLocationZIP方法的具体用法?PHP CSaleLocation::AddLocationZIP怎么用?PHP CSaleLocation::AddLocationZIP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSaleLocation的用法示例。


在下文中一共展示了CSaleLocation::AddLocationZIP方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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;
                                $_SESSION["NUM_ZIP"] = $numZIP;
                                $bFinish = false;
                                $arReturn['STEP'] = 2;
                                $arReturn['AMOUNT'] = $amount;
                                $arReturn['POS'] = $cur_step;
                                break;
                            }
                        }
                    }
                    $DB->Commit();
                    if ($bFinish) {
                        unset($_SESSION["ZIP_POS"]);
                        $numCity = CSaleLocation::_GetZIPImportStats();
                        $strOK = GetMessage('SL_IMPORT_ZIP_STATS');
                        $strOK = str_replace('#NUMZIP#', intval($numZIP), $strOK);
                        $strOK = str_replace('#NUMCITIES#', intval($numCity["CITY_CNT"]), $strOK);
                        $arReturn['MESSAGE'] = $strOK;
                        $arReturn['STEP'] = 3;
                        $arReturn['PB_REMOVE'] = true;
                        break;
                    }
                } else {
                    $arReturn['ERROR'] = GetMessage('SL_IMPORT_ERROR_NO_ZIP_FILE') . '<br>';
                    $arReturn['STEP'] = 3;
                    break;
                }
                break;
            case 3:
                $arReturn['COMPLETE'] = true;
                break;
        }
    }
    return $arReturn;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:location_import.php

示例2: array

				foreach($arLanguages as $langID)
				{
					$arArrayTmp[$langID] = array(
							"LID" => $langID,
							"NAME" => $shopLocation
						);
				}
				$city_id = CSaleLocation::AddCity($arArrayTmp);

				$location = CSaleLocation::AddLocation(
					array(
						"COUNTRY_ID" => $CurCountryID,
						"CITY_ID" => $city_id
					));
				if($bRus)
					CSaleLocation::AddLocationZIP($location, "101000");

				WizardServices::IncludeServiceLang("step1.php", $lang);
			}
			COption::SetOptionString('sale', 'location', $location);
	}
	//Order Prop Group
	if ($fizExist)
	{
		$dbSaleOrderPropsGroup = CSaleOrderPropsGroup::GetList(Array(), Array("PERSON_TYPE_ID" => $arGeneralInfo["personType"]["fiz"], "NAME" => GetMessage("SALE_WIZARD_PROP_GROUP_FIZ1")), false, false, array("ID"));
		if ($arSaleOrderPropsGroup = $dbSaleOrderPropsGroup->GetNext())
			$arGeneralInfo["propGroup"]["user_fiz"] = $arSaleOrderPropsGroup["ID"];

		$dbSaleOrderPropsGroup = CSaleOrderPropsGroup::GetList(Array(),Array("PERSON_TYPE_ID" => $arGeneralInfo["personType"]["fiz"], "NAME" => GetMessage("SALE_WIZARD_PROP_GROUP_FIZ2")), false, false, array("ID"));
		if ($arSaleOrderPropsGroup = $dbSaleOrderPropsGroup->GetNext())
			$arGeneralInfo["propGroup"]["adres_fiz"] = $arSaleOrderPropsGroup["ID"];
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:step1.php

示例3: time

     $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;
             $_SESSION["NUM_ZIP"] = $numZIP;
             $bFinish = false;
             $this->repeatCurrentService = true;
         }
     }
 }
开发者ID:vim84,项目名称:b-markt,代码行数:31,代码来源:locations.php


注:本文中的CSaleLocation::AddLocationZIP方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。