<?php
include("conexao.php");
include_once("functions.php");
include_once(Idioma(1));
global $_TRA;
$idioma = empty($_COOKIE['idioma']) ? "br" : $_COOKIE['idioma'];

$VerificarInfoSite = VerificarInfoSite();

$SQL = "SELECT status FROM captcha";
$SQL = $painel_geral->prepare($SQL);
$SQL->execute();
$Ln = $SQL->fetch();
$captcha = $Ln['status'];
?>
<!DOCTYPE html>
<html lang="<?php echo $idioma; ?>" class="body-full-height">
    
    <head>        
        <!-- META SECTION -->
        <title><?php echo $VerificarInfoSite[0]. " - " .$_TRA['Entrar']; ?></title>  
        <meta name="robots" content="noindex">      
        <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" />
        <!--<link rel="icon" type="image/png" href="<?php echo $logoimg ?>" />-->
        <link rel="icon" href="favicon.ico" type="image/x-icon" />
        
        <meta name="description" content="Entre com seu usuário e senha."/>
    
        <!-- Chrome, Firefox OS and Opera -->
        <meta name="theme-color" content="#cd5bcd">
        <!-- Windows Phone -->
        <meta name="msapplication-navbutton-color" content="#cd5bcd">
        <!-- iOS Safari -->
        <meta name="apple-mobile-web-app-status-bar-style" content="#cd5bcd">

        <meta property="og:image" content="img/ico_pro.png">
    
        <!-- END META SECTION -->
        
        <!-- CSS INCLUDE -->        
        <link rel="stylesheet" type="text/css" id="theme" href="css/theme-dark-head-light.css"/>
        <link rel="stylesheet" type="text/css" id="theme" href="css/custom.css"/>
        <link rel="stylesheet" type="text/css" id="theme" href="css/custom-colors.css"/>
        <link rel="stylesheet" type="text/css" id="theme" href="css/natal.css"/>
        
        <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Comfortaa" />
        <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Muli" />
        <!-- EOF CSS INCLUDE -->                                     
    </head>
    <body>

        <div class="login-container">
            <!--NATAL-->
            <!--<div class="i-large"></div>
            <div class="i-medium"></div>
            <div class="i-small"></div>-->
        
            <div class="login-box animated fadeInDown">
                <div class="login-logo"><?php echo $VerificarInfoSite[0]; ?></div>
				<div class="login-legenda"><?php echo $VerificarInfoSite[1]; ?></div>
                <div class="login-body">
                    <!--<div class="login-title" style="text-align: center;"><img src="img/natal/papai_noel1.gif" style="max-width: 40%;"/></div>-->
                    <div class="login-title" style="color: #75798f;"><strong><?php echo $_TRA['SBV']; ?></strong>, <?php echo $_TRA['Entrar']; ?></div>
                    <form id="FormLogin" name="FormLogin" class="FormLogin form-horizontal" method="POST" action="javascript:FormLogin()">
                    <div class="form-group">
                        <div class="col-md-12">
                            <input type="text" name="usuario" id="usuario" class="form-control" placeholder="<?php echo $_TRA['Usuario']; ?>"/>
                        </div>
                    </div>
                    <div class="form-group">

                        <div class="col-md-12">
                            <div class="input-group">
                            <input type="password" name="senha" id="senha" class="form-control inputPassword" placeholder="<?php echo $_TRA['Senha']; ?>">
                            <span style="cursor: pointer; line-height: 33px!important; background-color: #a94980!important;" class="input-group-addon viewPassword"><i style="font-size: 25px; cursor: pointer; display: inline-block;" class="fa fa-eye" aria-hidden="true"></i><i style="font-size: 25px; cursor: pointer; display: none;" class="fa fa-eye-slash" aria-hidden="true"></i></span>
                        </div>
                        </div>
                    </div>
                    
                    <?php
					if($captcha == "S"){
					?>
                    
                    <div class="form-group">
                   		<center>
                   	 		<div id="StatusCaptcha">
           						<?php include ("CaptchaImg.php"); ?>
           					</div>
                        </center>
                    </div>
                    
                    <div class="form-group pointer" onClick="NovoCaptcha()">
                   	 	<div class="col-md-12 text-right">
                    		Novo Captcha
                    	</div>
                    </div>
                    
                    <div class="form-group">
                        <div class="col-md-12">
                            <input type="text" name="captcha" id="captcha" class="form-control" placeholder="Digite o Captcha"/>
                        </div>
                    </div>
                    
                    <?php
					}
					?>
                    
                    <div class="form-group">
                   	    <div id="StatusLogin"></div>
                    	<div class="col-md-12">
                            <button style="background-image: linear-gradient(to right, #995193 0%, #ba426d 51%, #9a5192 100%);" onClick="FazerLoginIPTV()" class="btn btn-danger btn-block"><?php echo $_TRA['Entrar']; ?></button>
                        </div>
                    </div>
                    
                    </form>
                </div>
                <div class="login-footer">
                    <div class="pull-left">
                        &copy; <?php echo date("Y");?> <?php echo $VerificarInfoSite[0]; ?> 
                    </div>
                </div>
            </div>
            
        </div>
<script type="text/javascript" src="js/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript" src="js/plugins/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="js/plugins.js"></script>  
<script type="text/javascript" src="js/actions.js"></script>

<script>
    //Ver Senha
$('.viewPassword').click(function() {
    
    if($('.fa-eye').is(":visible")) {
        
        $('.fa-eye').hide();
        $('.fa-eye-slash').show();
        $('.inputPassword').attr('type', 'text');
        
    } else {
        
        $('.fa-eye-slash').hide();
        $('.fa-eye').show();
        $('.inputPassword').attr('type', 'password');
        
    }
    
});

<?php
if($captcha == "S"){
?>
function NovoCaptcha(){
			
			panel_refresh($(".login-container"));

			$.post('CaptchaImg.php', function(resposta) {
				
			setTimeout(panel_refresh($(".login-container")),500);
				
			$("#StatusCaptcha").html('');
			$("#StatusCaptcha").html(resposta);
						
			});
				
}
<?php
}
?>
	
function FazerLoginIPTV(){
 
	    var Data = $(".FormLogin").serialize();
		 
		panel_refresh($(".login-container"));
				
		$.post('validar-login.php', Data, function(resposta) {
			
				setTimeout(panel_refresh($(".login-container")),500);
			
				$("#StatusGeral").html('');
				$("#StatusGeral").append(resposta);
		});
}
</script>

<div id="StatusGeral"></div>

    </body>
</html>






