<?php $v->layout("_theme"); ?>
<div class="wrapper">
    <div class="login-body">
        <h2>EFETUAR LOGIN</h2>
        <?php
            if(isset($_POST['logar'])){
                $uemail = addslashes($_POST['uemail']);
                $upw = addslashes($_POST['upw']);
                
                if($uemail == '' || $upw == ''){
                    header("Location: ". url('login')."");
                    echo '<div class="alert alert-danger alert-dismissable">
                                <strong>Erro!</strong> Existem campos em branco.
                        </div>';
                }else{
                    $conexao = mysqli_connect('mysql27-farm36.kinghost.net', 'sistemafidesin', 'Um9x7605', 'sistemafidesin', '3306');
                    header("Location: ". url('login')."");
                }
            }
        ?>
        <form action="" method='POST' class='form-validate' id="test">
            <div class="form-group">
                <div class="email controls">
                    <input type="text" name='uemail' placeholder="Login" class='form-control' data-rule-required="true" autocomplete="off">
                </div>
            </div>
            <div class="form-group">
                <div class="pw controls">
                    <input type="password" name="upw" placeholder="Senha" class='form-control' data-rule-required="true" autocomplete="off">
                </div>
            </div>
            <div class="submit">
                <input type="submit" value="Logar" name="logar" class='btn btn-primary'>
            </div>
        </form>
        <div class="forget">
            <a href="#">
                <span></span>
            </a>
        </div>
    </div>
</div>
