GetGroupRight("sale"); if ($saleModulePermissions < "W") $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED")); IncludeModuleLangFile(__FILE__); require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/sale/include.php"); require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/sale/prolog.php"); $ID = IntVal($ID); /// redirect to newer version if(CSaleLocation::isLocationProEnabled()) LocalRedirect('/bitrix/admin/sale_location_node_edit.php'.($ID ? '?id='.$ID : '')); ClearVars(); $langCount = 0; $arSysLangs = Array(); $arSysLangNames = Array(); $db_lang = CLangAdmin::GetList(($b="sort"), ($o="asc"), array("ACTIVE" => "Y")); while ($arLang = $db_lang->Fetch()) { $arSysLangs[$langCount] = $arLang["LID"]; $arSysLangNames[$langCount] = htmlspecialcharsbx($arLang["NAME"]); $langCount++; } $aTabs = array( array("DIV" => "edit1", "TAB" => GetMessage("SLN_TAB_LOCATION"), "ICON" => "sale", "TITLE" => GetMessage("SLN_TAB_LOCATION_DESCR")), array("DIV" => "edit2", "TAB" => GetMessage("SLN_TAB_LOCATION_ZIP"), "ICON" => "sale", "TITLE" => GetMessage("SLN_TAB_LOCATION_ZIP_DESCR")) ); $tabControl = new CAdminTabControl("tabControl", $aTabs); $strError = ""; $bInitVars = false; if ((strlen($save)>0 || strlen($apply)>0) && $REQUEST_METHOD=="POST" && $saleModulePermissions=="W" && check_bitrix_sessid()) { $SORT = IntVal($SORT); if ($SORT<=0) $SORT = 100; //$COUNTRY_ID = IntVal($COUNTRY_ID); if ($CHANGE_COUNTRY!="Y") $CHANGE_COUNTRY = "N"; if ($WITHOUT_CITY!="Y") $WITHOUT_CITY = "N"; if ($ID>0 && $COUNTRY_ID<=0 && $CHANGE_COUNTRY=="Y") $strError .= GetMessage("ERROR_SELECT_COUNTRY")."
"; if (($COUNTRY_ID<=0 || $ID>0 && $COUNTRY_ID>0 && $CHANGE_COUNTRY=="Y") && $COUNTRY_ID != "") { $COUNTRY_NAME = Trim($COUNTRY_NAME); if (strlen($COUNTRY_NAME)<=0) $strError .= GetMessage("ERROR_COUNTRY_NAME")."
"; for ($i = 0, $max = count($arSysLangs); $i < $max; $i++) { ${"COUNTRY_NAME_".$arSysLangs[$i]} = Trim(${"COUNTRY_NAME_".$arSysLangs[$i]}); if (strlen(${"COUNTRY_NAME_".$arSysLangs[$i]})<=0) $strError .= GetMessage("ERROR_COUNTRY_NAME_LANG")." [".$arSysLangs[$i]."] ".$arSysLangNames[$i].".
"; } } if ($WITHOUT_CITY!="Y") { $CITY_NAME = Trim($CITY_NAME); if (strlen($CITY_NAME)<=0) $strError .= GetMessage("ERROR_CITY_NAME")."
"; for ($i = 0, $max = count($arSysLangs); $i < $max; $i++) { ${"CITY_NAME_".$arSysLangs[$i]} = Trim(${"CITY_NAME_".$arSysLangs[$i]}); if (strlen(${"CITY_NAME_".$arSysLangs[$i]})<=0) $strError .= GetMessage("ERROR_CITY_NAME_LANG")." [".$arSysLangs[$i]."] ".$arSysLangNames[$i].".
"; } } //isset region if (isset($_POST["REGION_ID"]) && $_POST["REGION_ID"] != "") { $REGION_ID = Trim($REGION_ID); for ($i = 0, $max = count($arSysLangs); $i < $max; $i++) { ${"REGION_NAME_".$arSysLangs[$i]} = Trim(${"REGION_NAME_".$arSysLangs[$i]}); if (strlen(${"REGION_NAME_".$arSysLangs[$i]})<=0 && $_POST["REGION_ID"] == 0) $strError .= GetMessage("ERROR_REGION_NAME_LANG")." [".$arSysLangs[$i]."] ".$arSysLangNames[$i].".
"; } } if (strlen($strError)<=0) { $arFields = array( "SORT" => $SORT, "COUNTRY_ID" => $COUNTRY_ID, "CHANGE_COUNTRY" => (($CHANGE_COUNTRY=="Y")?"Y":"N"), "WITHOUT_CITY" => (($WITHOUT_CITY=="Y")?"Y":"N"), "REGION_ID" => $REGION_ID ); if ($COUNTRY_ID<=0 || $ID>0 && $COUNTRY_ID>0 && $CHANGE_COUNTRY=="Y") { $arCountry = array( "NAME" => $COUNTRY_NAME, "SHORT_NAME" => $COUNTRY_SHORT_NAME ); for ($i = 0, $max = count($arSysLangs); $i < $max; $i++) { $arCountry[$arSysLangs[$i]] = array( "LID" => $arSysLangs[$i], "NAME" => ${"COUNTRY_NAME_".$arSysLangs[$i]}, "SHORT_NAME" => ${"COUNTRY_SHORT_NAME_".$arSysLangs[$i]} ); } $arFields["COUNTRY"] = $arCountry; } if ($WITHOUT_CITY!="Y") { $arCity = array( "NAME" => $CITY_NAME, "SHORT_NAME" => $CITY_SHORT_NAME ); if ($REGION_ID > 0) $regionTmp = $REGION_ID; else $regionTmp = ''; $arCity["REGION_ID"] = $regionTmp; for ($i = 0, $max = count($arSysLangs); $i < $max; $i++) { $arCity[$arSysLangs[$i]] = array( "LID" => $arSysLangs[$i], "NAME" => ${"CITY_NAME_".$arSysLangs[$i]}, "SHORT_NAME" => ${"CITY_SHORT_NAME_".$arSysLangs[$i]}, ); } $arFields["CITY"] = $arCity; } //region if (isset($_POST["REGION_ID"]) && $_POST["REGION_ID"] != "") { $arRegion = array( "NAME" => $REGION_NAME, "SHORT_NAME" => $REGION_SHORT_NAME ); for ($i = 0, $max = count($arSysLangs); $i < $max; $i++) { $arRegion[$arSysLangs[$i]] = array( "LID" => $arSysLangs[$i], "NAME" => ${"REGION_NAME_".$arSysLangs[$i]}, "SHORT_NAME" => ${"REGION_SHORT_NAME_".$arSysLangs[$i]} ); } $arFields["REGION"] = $arRegion; } $arFields["LOC_DEFAULT"] = "N"; if (strlen($LOC_DEFAULT) > 0) $arFields["LOC_DEFAULT"] = $LOC_DEFAULT; if ($ID>0) { if (!CSaleLocation::Update($ID, $arFields)) $strError .= GetMessage("ERROR_EDIT_LOCAT")."
"; } else { $ID = CSaleLocation::Add($arFields); if (IntVal($ID)<=0) $strError .= GetMessage("ERROR_ADD_LOCAT")."
"; } if ($ID > 0 && strlen($strError) <= 0) { $arZipList = $_REQUEST["ZIP"]; CSaleLocation::SetLocationZIP($ID, $arZipList); } } if (strlen($strError)>0) $bInitVars = True; else { if (strlen($save)>0) LocalRedirect("sale_location_admin.php?lang=".LANG.GetFilterParams("filter_", false)); else LocalRedirect("sale_location_edit.php?lang=".LANG."&ID=".$ID.GetFilterParams("filter_", false)); } } if ($ID>0) { $db_location = CSaleLocation::GetList(Array("SORT"=>"ASC"), Array("ID"=>$ID), LANG); if (!$db_location->ExtractFields("str_")) { $ID = 0; } $arZipList = array(); $rsZipList = CSaleLocation::GetLocationZIP($ID); while ($arZip = $rsZipList->Fetch()) { $arZipList[] = $arZip; } } if ($bInitVars) { $DB->InitTableVarsForEdit("b_sale_location", "", "str_"); if (is_array($_REQUEST['ZIP'])) { $arZipList = array(); foreach ($_REQUEST['ZIP'] as $zip) { $arZipList[] = array('ZIP' => $zip); } } } if (!is_array($arZipList)) $arZipList = array(); $sDocTitle = ($ID>0) ? str_replace("#ID#", $ID, GetMessage("SALE_EDIT_RECORD")) : GetMessage("SALE_NEW_RECORD"); $APPLICATION->SetTitle($sDocTitle); require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_after.php"); /*********************************************************************/ /******************** BODY *****************************************/ /*********************************************************************/ ?> GetMessage("SLN_2FLIST"), "ICON" => "btn_list", "LINK" => "/bitrix/admin/sale_location_admin.php?lang=".LANG.GetFilterParams("filter_") ) ); if ($ID > 0 && $saleModulePermissions >= "W") { $aMenu[] = array("SEPARATOR" => "Y"); $aMenu[] = array( "TEXT" => GetMessage("SLN_NEW_LOCATION"), "ICON" => "btn_new", "LINK" => "/bitrix/admin/sale_location_edit.php?lang=".LANG.GetFilterParams("filter_") ); $aMenu[] = array( "TEXT" => GetMessage("SLN_DELETE_LOCATION"), "ICON" => "btn_delete", "LINK" => "javascript:if(confirm('".GetMessage("SLN_DELETE_LOCATION_CONFIRM")."')) window.location='/bitrix/admin/sale_location_admin.php?action=delete&ID[]=".$ID."&lang=".LANG."&".bitrix_sessid_get()."#tb';", ); } $context = new CAdminContextMenu($aMenu); $context->Show(); ?>

Fatal error: Uncaught Error: Call to undefined function bitrix_sessid_post() in D:\ktt\ttepla.com\public_html\bitrix\modules\sale\distr\admin\location_edit.php:281 Stack trace: #0 {main} thrown in D:\ktt\ttepla.com\public_html\bitrix\modules\sale\distr\admin\location_edit.php on line 281