示例#1
0
 }
 $arFields["LOC_DEFAULT"] = "N";
 if (isset($_POST['LOC_DEFAULT']) && strlen($_POST['LOC_DEFAULT']) > 0) {
     $arFields["LOC_DEFAULT"] = $_POST['LOC_DEFAULT'];
 }
 if ($ID > 0) {
     $ID = CSaleLocation::Update($ID, $arFields);
     if (IntVal($ID) <= 0) {
         if ($ex = $APPLICATION->GetException()) {
             $strError .= $ex->GetString() . "<br>";
         } else {
             $strError .= GetMessage("CRM_LOC_UPDATE_UNKNOWN_ERROR") . "<br>";
         }
     }
 } else {
     $ID = CSaleLocation::Add($arFields);
     if (IntVal($ID) <= 0) {
         if ($ex = $APPLICATION->GetException()) {
             $strError = $ex->GetString() . "<br>";
         } else {
             $strError .= GetMessage("CRM_LOC_ADD_UNKNOWN_ERROR") . "<br>";
         }
     }
 }
 if ($ID > 0 && strlen($strError) <= 0) {
     $arZipList = $_REQUEST["ZIP"];
     CSaleLocation::SetLocationZIP($ID, $arZipList);
 }
 //			die();
 if (strlen($strError) <= 0) {
     LocalRedirect(isset($_POST['apply']) || strlen($strError) > 0 ? CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_LOCATIONS_EDIT'], array('loc_id' => $ID)) : CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_LOCATIONS_LIST'], array('loc_id' => $ID)));