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


PHP CSaleLocation::GetCountryList方法代碼示例

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


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

示例1: getCountriesNames

 public static function getCountriesNames()
 {
     $arCNames = array();
     $dbCountList = CSaleLocation::GetCountryList(array("NAME" => "ASC"), array(), LANGUAGE_ID);
     while ($arCountry = $dbCountList->Fetch()) {
         $arCNames[$arCountry["ID"]] = $arCountry["NAME_ORIG"] . " [" . $arCountry["NAME_LANG"] . "]";
     }
     return $arCNames;
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:9,代碼來源:crm_locations.php

示例2: GetLocationString

 public static function GetLocationString($locationId, $siteId = SITE_ID, $langId = LANGUAGE_ID)
 {
     $locationString = '';
     if (!\Bitrix\Sale\SalesZone::checkLocationId($locationId, $siteId)) {
         $locationId = 0;
     }
     $countryId = $regionId = $cityId = 0;
     if ($locationId > 0) {
         if ($arLocation = CSaleLocation::GetByID($locationId)) {
             $countryId = $arLocation["COUNTRY_ID"];
             $regionId = $arLocation["REGION_ID"];
             $cityId = $arLocation["CITY_ID"];
         }
     }
     //check in location city
     $bEmptyCity = "N";
     $arCityFilter = array("!CITY_ID" => "NULL", ">CITY_ID" => "0");
     if ($countryId > 0) {
         $arCityFilter["COUNTRY_ID"] = $countryId;
     }
     $rsLocCount = CSaleLocation::GetList(array(), $arCityFilter, false, false, array("ID"));
     if (!$rsLocCount->Fetch()) {
         $bEmptyCity = "Y";
     }
     //check in location region
     $bEmptyRegion = "N";
     $arRegionFilter = array("!REGION_ID" => "NULL", ">REGION_ID" => "0");
     if ($countryId > 0 && $regionId > 0) {
         $arRegionFilter["COUNTRY_ID"] = $countryId;
     }
     if ($regionId > 0) {
         $arRegionFilter["REGION_ID"] = $regionId;
     }
     $rsLocCount = CSaleLocation::GetList(array(), $arRegionFilter, false, false, array("ID"));
     if (!$rsLocCount->Fetch()) {
         $bEmptyRegion = "Y";
     }
     //check if exist another city
     if ($bEmptyCity == "Y" && $bEmptyRegion == "Y") {
         $arCityFilter = array("!CITY_ID" => "NULL", ">CITY_ID" => "0");
         $rsLocCount = CSaleLocation::GetList(array(), $arCityFilter, false, false, array("ID"));
         if ($rsLocCount->Fetch()) {
             $bEmptyCity = "N";
         }
     }
     //location value
     if ($locationId > 0) {
         if ($arLocation = CSaleLocation::GetByID($locationId)) {
             if ($bEmptyRegion == "Y" && $bEmptyCity == "Y") {
                 $countryId = $locationId;
             } else {
                 $countryId = $arLocation["COUNTRY_ID"];
             }
             if ($bEmptyCity == "Y") {
                 $regionId = $arLocation["ID"];
             } else {
                 $regionId = $arLocation["REGION_ID"];
             }
             $cityId = $locationId;
         }
     }
     //select country
     $arCountryList = array();
     if ($bEmptyRegion == "Y" && $bEmptyCity == "Y") {
         $rsCountryList = CSaleLocation::GetList(array("SORT" => "ASC", "NAME_LANG" => "ASC"), array("LID" => $langId), false, false, array("ID", "COUNTRY_ID", "COUNTRY_NAME_LANG"));
     } else {
         $rsCountryList = CSaleLocation::GetCountryList(array("SORT" => "ASC", "NAME_LANG" => "ASC"));
     }
     while ($arCountry = $rsCountryList->GetNext()) {
         if (!\Bitrix\Sale\SalesZone::checkCountryId($arCountry["ID"], $siteId)) {
             continue;
         }
         if ($bEmptyRegion == "Y" && $bEmptyCity == "Y") {
             $arCountry["NAME_LANG"] = $arCountry["COUNTRY_NAME_LANG"];
         }
         $arCountryList[] = $arCountry;
         if ($arCountry["ID"] == $countryId && strlen($arCountry["NAME_LANG"]) > 0) {
             $locationString .= $arCountry["NAME_LANG"];
         }
     }
     if (count($arCountryList) <= 0) {
         $arCountryList = array();
     } elseif (count($arCountryList) == 1) {
         $countryId = $arCountryList[0]["ID"];
     }
     //select region
     $arRegionList = array();
     if ($countryId > 0 || count($arCountryList) <= 0) {
         $arRegionFilter = array("LID" => $langId, "!REGION_ID" => "NULL", "!REGION_ID" => "0");
         if ($countryId > 0) {
             $arRegionFilter["COUNTRY_ID"] = IntVal($countryId);
         }
         if ($bEmptyCity == "Y") {
             $rsRegionList = CSaleLocation::GetList(array("SORT" => "ASC", "NAME_LANG" => "ASC"), $arRegionFilter, false, false, array("ID", "REGION_ID", "REGION_NAME_LANG"));
         } else {
             $rsRegionList = CSaleLocation::GetRegionList(array("SORT" => "ASC", "NAME_LANG" => "ASC"), $arRegionFilter);
         }
         while ($arRegion = $rsRegionList->GetNext()) {
             if (!\Bitrix\Sale\SalesZone::checkRegionId($arRegion["ID"], $siteId)) {
                 continue;
//.........這裏部分代碼省略.........
開發者ID:rasuldev,項目名稱:torino,代碼行數:101,代碼來源:location.php

示例3: array

        }
        if ($arResult["EMPTY_CITY"] == "Y") {
            $arParams["REGION"] = $arLocation["ID"];
        } else {
            $arParams["REGION"] = $arLocation["REGION_ID"];
        }
        $arParams["CITY"] = $arParams["CITY_OUT_LOCATION"] == "Y" ? $arParams["LOCATION_VALUE"] : $arLocation["CITY_ID"];
    }
}
$locationString = "";
//select country
$arResult["COUNTRY_LIST"] = array();
if ($arResult["EMPTY_REGION"] == "Y" && $arResult["EMPTY_CITY"] == "Y") {
    $rsCountryList = CSaleLocation::GetList(array("SORT" => "ASC", "NAME_LANG" => "ASC"), array("LID" => LANGUAGE_ID), false, false, array("ID", "COUNTRY_ID", "COUNTRY_NAME_LANG"));
} else {
    $rsCountryList = CSaleLocation::GetCountryList(array("SORT" => "ASC", "NAME_LANG" => "ASC"));
}
while ($arCountry = $rsCountryList->GetNext()) {
    if (!SalesZone::checkCountryId($arCountry["ID"], $arParams["SITE_ID"])) {
        continue;
    }
    if ($arResult["EMPTY_REGION"] == "Y" && $arResult["EMPTY_CITY"] == "Y") {
        $arCountry["NAME_LANG"] = $arCountry["COUNTRY_NAME_LANG"];
    }
    $arResult["COUNTRY_LIST"][] = $arCountry;
    if ($arCountry["ID"] == $arParams["COUNTRY"] && strlen($arCountry["NAME_LANG"]) > 0) {
        $locationString .= $arCountry["NAME_LANG"];
    }
}
if (count($arResult["COUNTRY_LIST"]) <= 0) {
    $arResult["COUNTRY_LIST"] = array();
開發者ID:webgksupport,項目名稱:alpina,代碼行數:31,代碼來源:component.php

示例4: GetMessage

			<select name="COUNTRY_ID" OnChange="SetContact()">
				<option value="0"><?php 
echo GetMessage("NEW_COUNTRY");
?>
</option>
				<option value="" <?php 
if (isset($COUNTRY_ID) && $COUNTRY_ID == "" || $str_COUNTRY_ID == "0") {
    echo " selected";
}
?>
><?php 
echo GetMessage("WITHOUT_COUNTRY");
?>
</option>
				<?php 
$db_contList = CSaleLocation::GetCountryList(array("NAME" => "ASC"), array(), LANG);
while ($arContList = $db_contList->Fetch()) {
    ?>
<option value="<?php 
    echo $arContList["ID"];
    ?>
"<?php 
    if (IntVal($arContList["ID"]) == IntVal($str_COUNTRY_ID)) {
        echo " selected";
    }
    ?>
><?php 
    echo htmlspecialcharsEx($arContList["NAME_ORIG"]);
    ?>
 [<?php 
    echo htmlspecialcharsEx($arContList["NAME_LANG"]);
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:31,代碼來源:location_edit.php

示例5: array

$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") {
開發者ID:Satariall,項目名稱:izurit,代碼行數:31,代碼來源:step5.php

示例6: in_array

									<option value=''<?php 
                echo in_array("", $sales_zone_countries) ? " selected" : "";
                ?>
><?php 
                echo GetMessage("SMO_LOCATION_ALL");
                ?>
</option>
									<option value='NULL'<?php 
                echo in_array("NULL", $sales_zone_countries) ? " selected" : "";
                ?>
><?php 
                echo GetMessage("SMO_LOCATION_NO_COUNTRY");
                ?>
</option>
									<?php 
                $dbCountryList = CSaleLocation::GetCountryList(array("NAME_LANG" => "ASC"));
                ?>
									<?php 
                while ($arCountry = $dbCountryList->fetch()) {
                    ?>
										<option value="<?php 
                    echo $arCountry["ID"];
                    ?>
"<?php 
                    echo in_array($arCountry["ID"], $sales_zone_countries) ? " selected" : "";
                    ?>
><?php 
                    echo htmlspecialcharsbx($arCountry["NAME_LANG"]);
                    ?>
</option>
									<?php 
開發者ID:webgksupport,項目名稱:alpina,代碼行數:31,代碼來源:options.php

示例7: getAllCountries

 /**
  * getAllCountries() - get all cities from DB
  * $langId - id site version  (ru, en ...)
  */
 public static function getAllCountries($langId = LANGUAGE_ID)
 {
     $resLocDB = CSaleLocation::GetCountryList(array("NAME_LANG" => "ASC"), array(), $langId);
     $allCountries = array();
     while ($resLoc = $resLocDB->fetch()) {
         $allCountries[] = $resLoc;
     }
     return $allCountries;
 }
開發者ID:VitaliiSestrenskyi,項目名稱:sest,代碼行數:13,代碼來源:sestrenskyiClass.php


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