$statDB = CDatabase::GetModuleConnection('statistic');
IncludeModuleLangFile(__FILE__);
$err_mess = "File: " . __FILE__ . "<br>Line: ";
define("HELP_FILE", "stoplist_list.php");
/***************************************************************************
			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()) {
Esempio n. 2
0
            $arID[] = $arRes['ID'];
        }
    }
    foreach ($arID as $ID) {
        if (strlen($ID) <= 0) {
            continue;
        }
        $ID = intval($ID);
        switch ($_REQUEST['action']) {
            case "delete":
                $obStopList = new CStoplist();
                $obStopList->Delete($ID);
                break;
            case "activate":
            case "deactivate":
                $obStopList = new CStoplist();
                if (!$obStopList->SetActive($ID, $_REQUEST['action'] == "activate" ? "Y" : "N")) {
                    if ($e = $APPLICATION->GetException()) {
                        $lAdmin->AddUpdateError(GetMessage("SAVE_ERROR") . $ID . ": " . $e->GetString(), $ID);
                    }
                }
                break;
        }
    }
}
$rsData = CStoplist::GetList($by, $order, $arFilter, $is_filtered);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("STAT_STOP_PAGES")));
$arHeaders = array();
$arHeaders[] = array("id" => "ID", "content" => "ID", "sort" => "s_id", "default" => true);