コード例 #1
0
    if ($_REQUEST['action_target'] == 'selected') {
        $arID = array();
        $rsData = CAdvContract::GetList($by, $order, $arFilter);
        while ($arRes = $rsData->Fetch()) {
            $arID[] = $arRes['ID'];
        }
    }
    foreach ($arID as $ID) {
        $ob = new CAdvContract();
        if (IntVal($ID) <= 0) {
            continue;
        }
        $ID = IntVal($ID);
        switch ($_REQUEST['action']) {
            case "delete":
                if (!CAdvContract::Delete($ID)) {
                    $lAdmin->AddGroupError(GetMessage("DELETE_ERROR"), $ID);
                }
                break;
            case "activate":
            case "deactivate":
                $arFields = array("ACTIVE" => $_REQUEST['action'] == "activate" ? "Y" : "N");
                if (!$ob->Set($arFields, $ID)) {
                    $lAdmin->AddGroupError(GetMessage("MAIN_EDIT_ERROR") . $ob->LAST_ERROR, $ID);
                }
                break;
        }
    }
}
$rsContracts = CAdvContract::GetList($by, $order, $arFilter, $is_filtered);
$rsData = new CAdminResult($rsContracts, $sTableID);
コード例 #2
0
ファイル: index.php プロジェクト: Satariall/izurit
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule('advertising')) {
    return;
}
__IncludeLang(GetLangFileName(dirname(__FILE__) . "/lang/", '/' . basename(__FILE__)));
//Matrix
$arWeekday = array("SUNDAY" => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), "MONDAY" => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), "TUESDAY" => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), "WEDNESDAY" => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), "THURSDAY" => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), "FRIDAY" => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), "SATURDAY" => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23));
$contractId = false;
$rsADV = CAdvContract::GetList($v1 = "s_sort", $v2 = "desc", array("NAME" => 'Eshop', 'DESCRIPTION' => GetMessage("CONTRACT_DESC") . " [" . WIZARD_SITE_ID . "]"), $is_filtered);
if ($arADV = $rsADV->Fetch()) {
    $contractId = $arADV["ID"];
    if (WIZARD_INSTALL_DEMO_DATA) {
        CAdvContract::Delete($arADV["ID"]);
        $contractId = false;
    }
}
if ($contractId == false) {
    $arFields = array('ACTIVE' => 'Y', 'NAME' => 'Eshop', 'SORT' => 1000, 'DESCRIPTION' => GetMessage("CONTRACT_DESC") . " [" . WIZARD_SITE_ID . "]", 'EMAIL_COUNT' => 1, 'arrTYPE' => array('ALL'), 'arrWEEKDAY' => $arWeekday, 'arrSITE' => array(WIZARD_SITE_ID));
    $contractId = CAdvContract::Set($arFields, 0, 'N');
    //Types
    $arTypes = array(array("SID" => "MAIN", "ACTIVE" => "Y", "SORT" => 1, "NAME" => GetMessage("DEMO_ADV_MAIN_TYPE"), "DESCRIPTION" => ""), array("SID" => "PARALLAX", "ACTIVE" => "Y", "SORT" => 2, "NAME" => GetMessage("DEMO_ADV_PARALLAX_TYPE"), "DESCRIPTION" => ""));
    foreach ($arTypes as $arFields) {
        $dbResult = CAdvType::GetByID($arTypes["SID"], $CHECK_RIGHTS = "N");
        if ($dbResult && $dbResult->Fetch()) {
            continue;
        }
        CAdvType::Set($arFields, "", $CHECK_RIGHTS = "N");
    }