Пример #1
0
function UpdateSplitTest($Id, &$Arr)
{
    global $Db, $Logs, $nsProduct, $Lang, $nsUser;
    extract($Arr);
    if (!$Name) {
        $ErrArr['Name'] = $Lang['MustFill'];
    }
    if (!ValidVar($Rem)) {
        $Rem = 0;
    }
    if (isset($ErrArr)) {
        $Logs->Err($Lang['FormErr']);
        $GLOBALS['ErrArr'] = $ErrArr;
        return;
    }
    $Query = "UPDATE " . PFX . "_tracker_camp_piece SET NAME = ?, DESCRIPTION = ? WHERE ID = {$Id}";
    $Db->Query($Query, $Name, $Descr);
    $Query = "UPDATE " . PFX . "_tracker_split_test SET REMEMBER_PAGE = '{$Rem}' WHERE SUB_ID={$Id}";
    $Db->Query($Query);
    if (ValidVar($Watch) == 1 && !CheckSubWatch($Id, $nsUser->UserId())) {
        SetSubWatch($Id, $nsUser->UserId());
    } else {
        RemoveSubWatch($Id, $nsUser->UserId());
    }
    $WrRes = true;
    $WrRes = SaveSplitToFile($Id, "split_test.nodb");
    //if (!$WrRes) $Logs->Err($Lang['WriteErr']);
    //if ($WrRes)
    $nsProduct->Redir("split_test", "RUpd=1&EditId={$Id}");
}
Пример #2
0
function UpdateSubCampaign($Id, &$Arr)
{
    global $Db, $Logs, $nsProduct, $Lang, $nsUser;
    extract($Arr);
    if (!$Name) {
        $ErrArr['Name'] = $Lang['MustFill'];
    }
    if (!ValidVar($Type)) {
        $Type = 0;
    }
    if (isset($ErrArr)) {
        $Logs->Err($Lang['FormErr']);
        $GLOBALS['ErrArr'] = $ErrArr;
        return;
    }
    $Query = "UPDATE " . PFX . "_tracker_camp_piece SET NAME = ?, DESCRIPTION = ? WHERE ID = {$Id}";
    $Db->Query($Query, $Name, $Descr);
    $Query = "SELECT ID FROM " . PFX . "_tracker_sub_campaign WHERE SRC_ID != '' AND SRC_ID='" . escape_string($SrcId) . "' AND SUB_ID!={$Id} AND SRC!='' ";
    $CheckId = $Db->ReturnValue($Query);
    if ($CheckId) {
        $Logs->Err($Lang['UniSrc']);
        return;
    }
    $Query = "UPDATE " . PFX . "_tracker_sub_campaign SET TYPE='{$Type}', SRC_ID=? WHERE SUB_ID={$Id}";
    $Db->Query($Query, $SrcId);
    if (ValidVar($Watch) == 1 && !CheckSubWatch($Id, $nsUser->UserId())) {
        SetSubWatch($Id, $nsUser->UserId());
    } else {
        RemoveSubWatch($Id, $nsUser->UserId());
    }
    $nsProduct->Redir("sub_camp", "RUpd=1&EditId={$Id}");
}