GET | POST handling
***************************************************************************/
$message = null;
$ID = intval($ID);
InitBVar($ACTIVE);
InitBVar($SAVE_STATISTIC);
InitBVar($USER_AGENT_IS_NULL);
// "save" on the current page was pressed
if ((strlen($save) > 0 || strlen($apply) > 0) && $REQUEST_METHOD == "POST" && $STAT_RIGHT >= "W" && check_bitrix_sessid()) {
    $arFields = array("DATE_START" => $_POST["DATE_START"], "DATE_END" => $_POST["DATE_END"], "SITE_ID" => $_POST["SITE_ID"], "ACTIVE" => $ACTIVE, "SAVE_STATISTIC" => $SAVE_STATISTIC, "IP_1" => $_POST["IP_1"], "IP_2" => $_POST["IP_2"], "IP_3" => $_POST["IP_3"], "IP_4" => $_POST["IP_4"], "MASK_1" => $_POST["MASK_1"], "MASK_2" => $_POST["MASK_2"], "MASK_3" => $_POST["MASK_3"], "MASK_4" => $_POST["MASK_4"], "USER_AGENT" => $_POST["USER_AGENT"], "USER_AGENT_IS_NULL" => $USER_AGENT_IS_NULL, "URL_TO" => $_POST["URL_TO"], "URL_FROM" => $_POST["URL_FROM"], "MESSAGE" => $_POST["MESSAGE"], "URL_REDIRECT" => $_POST["URL_REDIRECT"], "COMMENTS" => $_POST["COMMENTS"], "MESSAGE_LID" => $_POST["MESSAGE_LID"]);
    $obStopList = new CStoplist();
    if ($ID > 0) {
        $res = $obStopList->Update($ID, $arFields);
        $new = "N";
    } else {
        $res = $ID = $obStopList->Add($arFields);
        $new = "Y";
    }
    if ($res) {
        if (strlen($_POST["save"]) > 0) {
            LocalRedirect("stoplist_list.php?lang=" . LANG);
        } else {
            LocalRedirect($APPLICATION->GetCurPage() . "?lang=" . LANG . "&ID=" . $ID . "&tabControl_active_tab=" . urlencode($tabControl_active_tab));
        }
    } else {
        if ($e = $APPLICATION->GetException()) {
            $message = new CAdminMessage(GetMessage("STAT_ERROR"), $e);
        }
    }
}
ClearVars();