本文整理汇总了PHP中CSaleLocation::GetRegionLangByID方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleLocation::GetRegionLangByID方法的具体用法?PHP CSaleLocation::GetRegionLangByID怎么用?PHP CSaleLocation::GetRegionLangByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleLocation
的用法示例。
在下文中一共展示了CSaleLocation::GetRegionLangByID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$arResult['FIELDS']['tab_params'][] = array('id' => 'COUNTRY_NAME_' . $arSysLangs[$i], 'name' => GetMessage('CRM_LOC_FIELD_NAME'), 'value' => htmlspecialcharsEx($arCountry["NAME"]), 'required' => true, 'type' => 'text');
$arResult['FIELDS']['tab_params'][] = array('id' => 'COUNTRY_SHORT_NAME_' . $arSysLangs[$i], 'name' => GetMessage('CRM_LOC_FIELD_SHORT_NAME'), 'value' => htmlspecialcharsEx($arCountry["SHORT_NAME"]), 'type' => 'text');
}
/* REGION SECTION */
$arResult['FIELDS']['tab_params'][] = array('id' => 'loc_region', 'name' => GetMessage('CRM_LOC_SECTION_REGION'), 'type' => 'section');
$arRegionList[CRM_LOC_NEW_REGION] = '< ' . GetMessage('CRM_LOC_NEW_REGION') . ' >';
$arRegionList[CRM_LOC_WITHOUT_REGION] = '< ' . GetMessage('CRM_LOC_WITHOUT_REGION') . ' >';
$arRegionArr = CCrmLocations::getRegionsNames($arLoc['COUNTRY_ID']);
foreach ($arRegionArr as $regionID => $region) {
$arRegionList[$regionID] = $region;
}
$arResult['FIELDS']['tab_params'][] = array('id' => 'REGION_ID', 'name' => GetMessage('CRM_LOC_FIELD_REGION_ID'), 'value' => intval($arLoc['REGION_ID']) > 0 ? $arLoc['REGION_ID'] : '', 'type' => 'list', 'required' => true, 'items' => $arRegionList);
$arResult['FIELDS']['tab_params'][] = array('id' => 'REGION_NAME', 'name' => GetMessage('CRM_LOC_FIELD_NAME'), 'value' => htmlspecialcharsEx($arLoc['REGION_NAME_ORIG']), 'required' => true, 'type' => 'text');
$arResult['FIELDS']['tab_params'][] = array('id' => 'REGION_SHORT_NAME', 'name' => GetMessage('CRM_LOC_FIELD_SHORT_NAME'), 'value' => htmlspecialcharsEx($arLoc['REGION_SHORT_NAME']), 'type' => 'text');
for ($i = 0; $i < $countLang; $i++) {
$arRegion = CSaleLocation::GetRegionLangByID($arLoc['REGION_ID'], $arSysLangs[$i]);
/*
$arResult['FIELDS']['tab_params'][] = array(
'id' => 'R_LANG_'.$arSysLangs[$i],
'value' => '<b>['.$arSysLangs[$i].'] '.$arSysLangNames[$i].'</b>',
'colspan' => true,
'type' => 'label'
);
*/
$arResult['FIELDS']['tab_params'][] = array('id' => 'REGION_NAME_' . $arSysLangs[$i], 'name' => GetMessage('CRM_LOC_FIELD_NAME'), 'value' => htmlspecialcharsEx($arRegion["NAME"]), 'required' => true, 'type' => 'text');
$arResult['FIELDS']['tab_params'][] = array('id' => 'REGION_SHORT_NAME_' . $arSysLangs[$i], 'name' => GetMessage('CRM_LOC_FIELD_SHORT_NAME'), 'value' => htmlspecialcharsEx($arRegion["SHORT_NAME"]), 'type' => 'text');
}
/* CITY SECTION */
$arResult['FIELDS']['tab_params'][] = array('id' => 'loc_city', 'name' => GetMessage('CRM_LOC_SECTION_CITY'), 'type' => 'section');
$arCity = CSaleLocation::GetCityByID($arLoc['CITY_ID']);
$arResult['FIELDS']['tab_params'][] = array('id' => 'WITHOUT_CITY', 'name' => GetMessage('CRM_LOC_FIELD_WITHOUT_CITY'), 'value' => intval($locID) > 0 && !is_null($arLoc['CITY_ID']) && $arCity ? 'N' : 'Y', 'type' => 'checkbox');
示例2: UpdateRegion
/**
* The function modifies the parameters of the region
*
* @param int $ID region code
* @param array $arFields array with parameters region
* @return int $ID code region
*/
public static function UpdateRegion($ID, $arFields)
{
global $DB;
$ID = intval($ID);
if ($ID <= 0 || !CSaleLocation::RegionCheckFields("UPDATE", $arFields)) {
return false;
}
foreach (GetModuleEvents("sale", "OnBeforeRegionUpdate", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($ID, &$arFields)) === false) {
return false;
}
}
$strUpdate = $DB->PrepareUpdate("b_sale_location_region", $arFields);
$strSql = "UPDATE b_sale_location_region SET " . $strUpdate . " WHERE ID = " . $ID . "";
$DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
$db_lang = CLangAdmin::GetList($b = "sort", $o = "asc", array("ACTIVE" => "Y"));
while ($arLang = $db_lang->Fetch()) {
if ($arCntLang = CSaleLocation::GetRegionLangByID($ID, $arLang["LID"])) {
$strUpdate = $DB->PrepareUpdate("b_sale_location_region_lang", $arFields[$arLang["LID"]]);
//print_r($arFields);die();
$strSql = "UPDATE b_sale_location_region_lang SET " . $strUpdate . " WHERE ID = " . $arCntLang["ID"] . "";
} else {
$arInsert = $DB->PrepareInsert("b_sale_location_region_lang", $arFields[$arLang["LID"]]);
$strSql = "INSERT INTO b_sale_location_region_lang(REGION_ID, " . $arInsert[0] . ") " . "VALUES(" . $ID . ", " . $arInsert[1] . ")";
}
$DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
}
foreach (GetModuleEvents("sale", "OnRegionUpdate", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($ID, $arFields));
}
return $ID;
}
示例3: UpdateRegion
public static function UpdateRegion($ID, $arFields)
{
global $DB;
$ID = intval($ID);
if ($ID <= 0 || !CSaleLocation::RegionCheckFields("UPDATE", $arFields)) {
return false;
}
foreach (GetModuleEvents("sale", "OnBeforeRegionUpdate", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($ID, &$arFields)) === false) {
return false;
}
}
if (self::isLocationProMigrated()) {
try {
$locId = self::getLocationIdByRegionId($ID);
if (!$locId) {
return false;
}
$res = Location\LocationTable::update($locId, self::refineFieldsForSaveCRC($item['ID'], $arFields), array('REBALANCE' => false));
if ($res->isSuccess()) {
return $ID;
}
return false;
} catch (Exception $e) {
return false;
}
} else {
$strUpdate = $DB->PrepareUpdate("b_sale_location_region", $arFields);
$strSql = "UPDATE b_sale_location_region SET " . $strUpdate . " WHERE ID = " . $ID . "";
$DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
$db_lang = CLangAdmin::GetList($b = "sort", $o = "asc", array("ACTIVE" => "Y"));
while ($arLang = $db_lang->Fetch()) {
if ($arCntLang = CSaleLocation::GetRegionLangByID($ID, $arLang["LID"])) {
$strUpdate = $DB->PrepareUpdate("b_sale_location_region_lang", $arFields[$arLang["LID"]]);
$strSql = "UPDATE b_sale_location_region_lang SET " . $strUpdate . " WHERE ID = " . $arCntLang["ID"] . "";
} else {
$arInsert = $DB->PrepareInsert("b_sale_location_region_lang", $arFields[$arLang["LID"]]);
$strSql = "INSERT INTO b_sale_location_region_lang(REGION_ID, " . $arInsert[0] . ") " . "VALUES(" . $ID . ", " . $arInsert[1] . ")";
}
$DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
}
}
foreach (GetModuleEvents("sale", "OnRegionUpdate", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($ID, $arFields));
}
return $ID;
}
示例4: GetMessage
<td>
<?php
echo GetMessage("SALE_SHORT_NAME");
?>
:
</td>
<td>
<input type="text" name="REGION_SHORT_NAME" value="<?php
echo $str_REGION_SHORT_NAME;
?>
" size="30">
</td>
</tr>
<?php
for ($i = 0; $i < count($arSysLangs); $i++) {
$arRegion = CSaleLocation::GetRegionLangByID($str_REGION_ID, $arSysLangs[$i]);
$str_REGION_NAME = htmlspecialcharsEx($arRegion["NAME"]);
$str_REGION_SHORT_NAME = htmlspecialcharsEx($arRegion["SHORT_NAME"]);
//if ($bInitVars)
//{
// $str_REGION_NAME = htmlspecialcharsEx(${"REGION_NAME_".$arSysLangs[$i]});
// $str_REGION_SHORT_NAME = htmlspecialcharsEx(${"REGION_SHORT_NAME_".$arSysLangs[$i]});
//}
?>
<tr>
<td align="center" colspan="2">
<b>[<?php
echo $arSysLangs[$i];
?>
] <?php
echo $arSysLangNames[$i];
示例5: array
$arCountry['COUNTRY_NAME_' . $arSysLangs[$i]] = $arLngCountry['NAME'];
$arCountry['COUNTRY_SHORT_NAME_' . $arSysLangs[$i]] = $arLngCountry['SHORT_NAME_'];
}
$arReturn['COUNTRY'] = $arCountry;
$arRegions = CCrmLocations::getRegionsNames($ID);
$arReturn['COUNTRY']['REGIONS'] = array();
foreach ($arRegions as $id => $region) {
$arReturn['COUNTRY']['REGIONS'][] = array($id, $region);
}
break;
case 'get_region_params':
$arRegion = CSaleLocation::GetRegionByID($ID);
$arRegion['REGION_NAME'] = $arRegion['NAME'];
$arRegion['REGION_SHORT_NAME'] = $arRegion['SHORT_NAME'];
unset($arRegion['NAME']);
unset($arRegion['SHORT_NAME']);
$countLang = count($arSysLangs);
for ($i = 0; $i < $countLang; $i++) {
$arLngCountry = CSaleLocation::GetRegionLangByID($ID, $arSysLangs[$i]);
$arRegion['REGION_NAME_' . $arSysLangs[$i]] = $arLngCountry['NAME'];
$arRegion['REGION_SHORT_NAME_' . $arSysLangs[$i]] = $arLngCountry['SHORT_NAME_'];
}
$arReturn['REGION'] = $arRegion;
break;
}
} else {
$arReturn['ERROR'][] = GetMessage('CRM_LOC_EDT_ERROR_ACCESS_DENIED');
}
$arReturn = $APPLICATION->ConvertCharsetArray($arReturn, SITE_CHARSET, 'utf-8');
echo json_encode($arReturn);
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/epilog_after.php";