403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/skyweb24.popuppro/admin/includes/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/skyweb24.popuppro/admin/includes/tab_abtest_item.php
<?

use \Bitrix\Main\Application,
    \Bitrix\Main\Page\Asset,
    \Bitrix\Main\Localization\Loc;

Loc::loadMessages(__FILE__);

global $APPLICATION, $request, $abtestTable;

CJSCore::RegisterExt(
    'abtest',
    [
        "js" => ["/bitrix/js/skyweb24.popuppro/abtest_script.js"],
        'lang' => "/bitrix/modules/skyweb24.popuppro/lang/ru/admin/tab_abtest_item.php"
    ]
);
CJSCore::Init(['abtest']);
if ((!empty($request['apply']) || !empty($request['save'])) && check_bitrix_sessid()) {

    $result = $abtestTable->saveSetting($request);

    if (empty($result['errorMessage'])) {
        if (!empty($request['save'])) {
            LocalRedirect($APPLICATION->GetCurPage() . '?lang=' . LANGUAGE_ID);
        }
        elseif (!empty($request['id']) && $request['id'] == 'new') {
            LocalRedirect($APPLICATION->GetCurPage() . '?id=' . $result['id'] . '&add=success&lang=' . LANGUAGE_ID);
        }

        $info = new CAdminMessage([
            "TYPE" => "OK",
            "MESSAGE" => loc::getMessage("SKYWEB24_POPUPPRO_ABTEST_EDIT_UPDATE_SUCCESS")
        ]);
        echo $info->Show();
    }
    else {
        $info = new CAdminMessage([
            "TYPE" => "ERROR",
            "MESSAGE" => $result['errorMessage']
        ]);
        echo $info->Show();
    }

}
?>
<form class="abtest_setting"
      method="post"
      action="<? echo $APPLICATION->GetCurPage() ?>?id=<?= $request['id'] ?>&lang=<?= LANGUAGE_ID ?>">
    <?
    $aTabs = [
        [
            "DIV" => "skyweb24_popuppro_abtest_edit",
            "TAB" => Loc::getMessage("SKYWEB24_POPUPPRO_ABTEST_EDIT_TAB_NAME"),
            "TITLE" => Loc::getMessage("SKYWEB24_POPUPPRO_ABTEST_EDIT_TAB_TITLE")
        ]
    ];

    $tabControl = new CAdminTabControl("tabControl_import", $aTabs);
    $tabControl->Begin();
    $tabControl->BeginNextTab();

    $abTestController = new \Skyweb24\Popuppro\Abtest\Controller();
    $dataDefaultFields = $abtestTable->getDefaultData();
    $dataFields = $abtestTable->getData($request['id']);

    $arPopupActiveIds = [];
    $arPopups = [];
    $rsPopups = \Skyweb24\Popuppro\Entity\PopupproTable::getList([
        "select" => ["id", "name", "active", "type"],
        "order" => ["id" => "asc"]
    ]);

    while ($arPopup = $rsPopups->fetch()) {
        $arPopups[$arPopup['type']][] = $arPopup;
        if ($arPopup['active'] == "Y") {
            array_push($arPopupActiveIds, $arPopup['id']);
        }
    }


    ?>
    <tr>
        <td style="text-align: right" width="50%">
            <?= Loc::getMessage("SKYWEB24_POPUPPRO_ABTEST_EDIT_LABEL_NAME") ?>
        </td>
        <td style="text-align: left" width="50%">
            <input type="text" name="name" value="<?= $dataFields['name']; ?>">
        </td>
    </tr>
    <tr>
        <td style="text-align: right" width="50%">
            <?= Loc::getMessage("SKYWEB24_POPUPPRO_ABTEST_EDIT_LABEL_WORK_TIME") ?>
        </td>
        <td style="text-align: left" width="50%">
            <select name="work_time" style="width: 200px;">
                <? foreach ($dataDefaultFields['work_time'] as $defaultValue => $defaultName): ?>
                    <? $selected = ($dataFields['work_time'] == $defaultValue) ? "selected" : ""; ?>
                    <option <?= $selected; ?> value="<?= $defaultValue; ?>"><?= $defaultName ?></option>
                <? endforeach; ?>
            </select>
        </td>
    </tr>
    <tr>
        <td style="text-align: right" width="50%">
            <?= Loc::getMessage("SKYWEB24_POPUPPRO_ABTEST_EDIT_LABEL_CHANCE") ?>
        </td>
        <td style="text-align: left" width="50%">
            <select name="chance" class="abtest-traffic-select" style="width: 200px;">
                <? foreach ($dataDefaultFields['chance'] as $defaultValue => $defaultName): ?>
                    <? $selected = ($dataFields['chance'] == $defaultValue) ? "selected" : ""; ?>
                    <option <?= $selected; ?> value="<?= $defaultValue; ?>"><?= $defaultName ?></option>
                <? endforeach; ?>
            </select>
        </td>
    </tr>
    <tr class="heading">
        <td align="center" colspan="2"><?= Loc::getMessage("SKYWEB24_POPUPPRO_ABTEST_EDIT_LABEL_TESTS") ?></td>
    </tr>
    <tr>
        <td colspan="2">
            <div class="adm-info-message-wrap adm-info-message-green">
                <div class="adm-info-message">
                    <div class="adm-info-message-title"><?= Loc::getMessage("SKYWEB24_POPUPPRO_ABTEST_EDIT_INFO_WINDOW_SETTING") ?></div>
                    <div class="adm-info-message-icon"></div>
                </div>
            </div>
        </td>
    </tr>
    <? if (!empty($arPopups)): ?>
        <tr>
            <td colspan="2">
                <div id="abtest_list" class="adm-ab-edit-list">
                    <table class="internal test-item" style="width: 100%; margin-bottom: 10px; ">
                        <tbody>
                        <tr class="heading">
                            <td colspan="2" style="text-align: left !important; ">
                                <?= Loc::getMessage("SKYWEB24_POPUPPRO_ABTEST_EDIT_LABEL_POPUPS"); ?>
                            </td>
                        </tr>
                        <tr>
                            <td style="vertical-align: top;">
                                <table style="width: 400px; float: right; ">
                                    <tbody>
                                    <tr>
                                        <td style="width: 20px; background: #498ec5; text-shadow: none; color: #ffffff !important; font-weight: bold; text-align: center; padding: 10px !important;">A</td>
                                        <td style="background: rgb(203, 213, 220); font-weight: bold; ">
                                            <?= loc::getMessage("SKYWEB24_POPUPPRO_ABTEST_EDIT_LABEL_SELECTED_POPUP"); ?>
                                            <span>-</span>
                                            <span class="abtest-traffic-count _a"><?=100 - $dataFields['chance'];?>%</span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"
                                            style="background: rgb(236, 239, 241); padding-left: 41px !important; padding-right: 41px!important;"
                                            class="container_popup_a">
                                            <select class="value-input old-value-input select-window" name="popup_id_a"
                                                    style="width: 320px; margin-bottom: 15px;">
                                            </select>

                                            <div class="adm-info-message-wrap adm-info-message-red"
                                                 style="display: none;">
                                                <div class="adm-info-message">
                                                    <div class="adm-info-message-title">
                                                        <?= Loc::getMessage("SKYWEB24_POPUPPRO_ABTEST_EDIT_WINDOW_NO_ACTIVE"); ?>
                                                    </div>
                                                    <div class="adm-info-message-icon"></div>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </td>
                            <td style="vertical-align: top;">
                                <table style="width: 400px;">
                                    <tbody>
                                    <tr>
                                        <td style="width: 20px; background: rgb(255, 118, 36); text-shadow: none; color: #ffffff !important; font-weight: bold; text-align: center; padding: 10px !important;">B</td>
                                        <td style="background: rgb(203, 213, 220); font-weight: bold; ">
                                            <?= loc::getMessage("SKYWEB24_POPUPPRO_ABTEST_EDIT_LABEL_TEST_POPUP"); ?>
                                            <span>-</span>
                                            <span class="abtest-traffic-count _b"><?=$dataFields['chance'];?>%</span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"
                                            style="background: rgb(236, 239, 241); padding-left: 41px !important; padding-right: 41px!important;"
                                            class="container_popup_b">
                                            <select class="value-input old-value-input select-window" name="popup_id_b"
                                                    style="width: 100%;margin-bottom: 15px;">
                                            </select>
                                            <div class="adm-info-message-wrap adm-info-message-red"
                                                 style="display: none;">
                                                <div class="adm-info-message">
                                                    <div class="adm-info-message-title">
                                                        <?= Loc::getMessage("SKYWEB24_POPUPPRO_ABTEST_EDIT_WINDOW_NO_ACTIVE"); ?>
                                                    </div>
                                                    <div class="adm-info-message-icon"></div>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </td>
        </tr>
    <? endif; ?>
    <? if($dataFields['active'] == "Y") :?>
        <tr>
            <td align="left" colspan="2">
                <div class="adm-info-message-wrap">
                    <div class="adm-info-message" id="math-hint" style="color: red;">
                        <?= Loc::getMessage("SKYWEB24_POPUPPRO_ABTEST_EDIT_LABEL_STAT_ACTION_WARNING") ?>
                        <a href="/bitrix/admin/skyweb24_popuppro_abtest_report.php?id=<?=$dataFields['id'];?>&lang=<?=LANGUAGE_ID;?>"><?= Loc::getMessage("SKYWEB24_POPUPPRO_ABTEST_EDIT_LABEL_STAT_URL") ?></a>
                    </div>
                </div>
            </td>
        </tr>
    <? endif; ?>
    <? $tabControl->Buttons(["back_url" => $APPLICATION->GetCurPage() . '?lang=' . LANGUAGE_ID]);
    $tabControl->End();
    echo bitrix_sessid_post(); ?>
</form>


<script>
    BX.ready(function () {

        new BX.SelectPopupConstructor(JSON.parse('<?=\Bitrix\Main\Web\Json::encode([
            "popups" => $arPopups,
            "activeListIds" => $arPopupActiveIds,
            "popup_id_a" => $dataFields['popup_id_a'],
            "popup_id_b" => $dataFields['popup_id_b']
        ]);?>'));
    });
</script>

Youez - 2016 - github.com/yon3zu
LinuXploit