<!DOCTYPE html>
<html lang='ru'>
<head>
    <title>Защита от ботов</title>
    <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
    <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css'>
    <link rel='stylesheet' href='/statics/antibot.css'>
    <script type='text/javascript' src='/statics/jquery.min.js'></script>
	<script type='text/javascript' src='/statics/signalr-client.min.js'></script>
</head>

<body class='payment payment-secuses'>
    <div class='text-center payment-box'>
        <div>
            <i id='FaWait' class='fa fa-cogs payment-icon' style='display: none'></i>
            <i id='FaError' class='fa fa-wheelchair-alt payment-icon' style='color: #F04E51'></i>
        </div>
        <h3 class='payment-title'>AntiBot</h3>
        <p class='payment-text' id='InfoText'>У вас должен быть включён JavaScript и Cookie</p>

        <div class='block'>
            <div class='copyright'>
                <div style='margin-bottom: 10px;'>
                    © 2018 <strong>ISPCore</strong>. All rights reserved.
                </div>
                <div>
                    <a href='/'>Главная сайта</a> / <a href='http://core-system.org/' target='_blank'>ISPCore System</a>
                </div>
            </div>
        </div>
    </div>

    <script>
        $('#InfoText').text('Пожалуйста подождите, идет проверка браузера')
        $('#FaWait').show()
        $('#FaError').hide()
    </script>

    <script>
	    HubConnection = new signalR.HttpConnection('http://molodart.com.ua/core/AntiBotHub');
	    Hub = new signalR.HubConnection(HubConnection);

        Hub.on('OnError', (error) => {
            $('#InfoText').text(error)
            $('#FaError').show()
            $('#FaWait').hide()
        })

	    Hub.on('OnCookie', (cookie, HourToCookie) => {
            var date = new Date(new Date().getTime() + (60 * 1000) * 60 * HourToCookie);
            document.cookie = 'isp.ValidCookie='+cookie+'; path=/; expires=' + date.toUTCString();

            $.post('http://molodart.com.ua/core/check/cookie', $('#form').serializeArray(), function (data) {
                var json = JSON.parse(JSON.stringify(data));
                if (json.result) {
                    location.reload();
                }
                else {
                    $('#InfoText').text('В вашем браузере отключена поддержка Cookie')
                    $('#FaError').show()
                    $('#FaWait').hide()
                }
            })
        })

	    Hub.start().then(function () {
		    Hub.invoke('GetValidCookie', '74.125.76.35', '425f115e363e88107f99ad347ee11412');
	    })
    </script>
</body>
</html>