<?php 
session_start();
include_once "phpconfig/config.php";
include_once "phpconfig/valida_login2.php";

if(!isset($_COOKIE['username'])) { $username=NULL; } else {$username=$_COOKIE['username'];}
if(!isset($_COOKIE['gravar'])) { $lembrar=NULL; } else {$lembrar='checked="yes"';}

if(!isset($_GET['log'])) 
{ 
  $log = '';$msg="";
} 
else 
{ 
  $log = $_GET['log'];

  switch ($log) {
    case '1': $msg = "Combinação de usuário e senha errados.";   break;
    case '2': $msg = "É necessário efetuar login.";   break; 
    case '3': $msg = "Logout efetuado com sucesso.";   break;
    case '4': $msg = "Login não efetuado.";   break;
	  default: $msg="";
  }

  $msg =   "<div class=\"alert fade in\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button><strong>$msg</div>";
}

?>
<!DOCTYPE html>
<html lang="pt-br>">
  <head>
    <meta charset="utf-8">
    <title><?php  echo sti("nome");  ?></title>
    <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">    
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Nuvon">

    <!-- Le styles -->
     <link rel="stylesheet" href="<?php  echo sti('adm'); ?>assets/css/bootstrap.css">
    
    <link href="<?php  echo sti('adm'); ?>assets/css/colorpicker.css" rel="stylesheet">
    <style>
      body {
        padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
      }
    </style>
 

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="<?php  echo sti("adm");  ?>assets/ico/favicon.png">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php  echo sti("adm");  ?>assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php  echo sti("adm");  ?>assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php  echo sti("adm");  ?>assets/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="<?php  echo sti("adm");  ?>assets/ico/apple-touch-icon-57-precomposed.png">
  </head>

  <body class="loginlogout">


    <div class="container">

 <div class="row-fluid">
        <div class="span12">

          <?php echo $msg; ?>
           

            <form class="well"  method="post" action="logar.php" >     <br/><br/>      

            <div class="input-prepend">          
               <span class="add-on"><i class="icon-user"></i></span><input type="text" name="username" value="<?php echo $username;   ?>" class="input-large" placeholder="Login">
            </div>
            <div class="input-prepend input-append"> 
                <span class="add-on"><i class="icon-lock"></i></span><input type="password" name="senha"id="appendedInputButton"  class="input-medium" placeholder="Password"><input type="submit" class="btn" name="logar" value="&nbsp;Logar&nbsp;"  />
            </div>

              <label class="checkbox">
  				  <!--input type="checkbox" name="gravar"  <?php  echo $lembrar  ?> > Gravar-->
  			     </label>
  			<!--a href="">Recuperar senha</a-->

 
            </form>
 
          <hr class="lloginnh" />
        	<footer class="lloginn" style="text-align:center">
       			 <p>&copy; <?php  echo sti('nome'); ?> <?php echo date("Y"); ?></a></p>
   		   </footer>
        </div>
      </div>


    </div><!--/.fluid-container-->

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->

  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

  <script src="//code.jquery.com/jquery-1.9.1.js"></script>
  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
  <script>
  $(function() {
    $( "#accordion" ).accordion({
      collapsible: true
    });
  });
  </script>

    <div id="dialog-message" title="Atenção" style='display:none'>
        <p>
            <span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span>
            <span id='modalmsg'></span>
        </p>

    </div>

  </body>
</html>