<? session_start();
include("include/db-connect.php");
?>
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="UTF-8" />
<title>Administration</title>

<link rel="stylesheet" type="text/css" href="view/stylesheet/stylesheet.css" />
<script type="text/javascript" src="view/javascript/jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="view/javascript/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>
<link type="text/css" href="view/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
<script type="text/javascript" src="view/javascript/jquery/tabs.js"></script>
<script type="text/javascript" src="view/javascript/jquery/superfish/js/superfish.js"></script>
<script type="text/javascript" src="view/javascript/common.js"></script>
<script type="text/javascript">
//-----------------------------------------
// Confirm Actions (delete, uninstall)
//-----------------------------------------
$(document).ready(function(){
    // Confirm Delete
    $('#form').submit(function(){
        if ($(this).attr('action').indexOf('delete',1) != -1) {
            if (!confirm('Delete/Uninstall cannot be undone! Are you sure you want to do this?')) {
                return false;
            }
        }
    });
    // Confirm Uninstall
    $('a').click(function(){
        if ($(this).attr('href') != null && $(this).attr('href').indexOf('uninstall', 1) != -1) {
            if (!confirm('Delete/Uninstall cannot be undone! Are you sure you want to do this?')) {
                return false;
            }
        }
    });
        });
    </script>
</head>
<body>
<div id="container">
    <div id="header">
  <div class="div1">
  
    <div class="div2" style="font-size:20px;"><? echo $TITLE; ?></div>
      </div>
  </div>
<div id="content">


<?php
if($_REQUEST['cap']=='inval')
{
?>
<div style="margin-left:600px;color:#F00;">Wrong captcha code</div>
<?php } ?>

<?php
if($_REQUEST['param']=='err')
{
?>
<div style="margin-left:600px;color:#F00;">Wrong username or password</div>
<?php } ?>




  <div class="box" style="width: 400px; min-height: 300px; margin-top: 40px; margin-left: auto; margin-right: auto;">
    <div class="heading">
      <h1><img src="view/image/lockscreen.png" alt="" /> Please enter your login details.</h1>
    </div>
    
    
    
    <div class="content" style="min-height: 150px; overflow: hidden;">
                  <form action="checklogin.php" method="post" enctype="multipart/form-data" id="form">
        <table style="width: 100%;">
          <tr>
            <td style="text-align: center;" rowspan="4"><img src="view/image/login.png" alt="Please enter your login details." /></td>
          </tr>
          <tr>
            <td>Username:<br />
              <input type="text" name="uname" value="" style="margin-top: 4px;" />
              <br />
              <br />
              Password:<br />
              <input type="password" name="upass" value="" style="margin-top: 4px;" />
                            <br />
             <!-- <a href="http://amarasudhan.com/admin/index.php?route=common/forgotten">Forgotten Password</a>-->
                            </td>
          </tr>
          
          
          <? function GeraHash($qtd){ 
$Caracteres = 'ABCDEFGHIJKLMOPQRSTUVXWYZ'; 
$QuantidadeCaracteres = strlen($Caracteres); 
$QuantidadeCaracteres--; 
$Hash=NULL; 
    for($x=1;$x<=$qtd;$x++){ 
        $Posicao = rand(0,$QuantidadeCaracteres); 
        $Hash .= substr($Caracteres,$Posicao,1); 
    } 
return $Hash; 
} 
$randum_number=GeraHash(6);
$_SESSION['randum_number']=$randum_number; ?>
          <tr>
            <td>Captcha Code:<br />
              <div style="width:116px;height:30px;background:#036;border-radius:5px;color:#FFF;letter-spacing:6px;padding:10px 0px 0px 10px;font-size:20px;"><? echo $randum_number; ?></div>
              <br />
              <br />
              Enter Captcha Code:<br />
               <input id="captcha_code" name="captcha_code" type="text" autocomplete="off" class="required" placeholder="Enter the code above here">
                            <br />
             <!-- <a href="http://amarasudhan.com/admin/index.php?route=common/forgotten">Forgotten Password</a>-->
                            </td>
          </tr>
          
          
          
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
          <td></td>
            <td style="text-align: ;"><a onclick="$('#form').submit();" class="button">Login</a></td>
          </tr>
        </table>
               <!-- <input type="hidden" name="redirect" value="http://amarasudhan.com/admin/index.php?route=extension/module" />-->
              </form>
    </div>
  </div>
</div>
<script type="text/javascript"><!--
$('#form input').keydown(function(e) {
	if (e.keyCode == 13) {
		$('#form').submit();
	}
});
//--></script> 
</div>
<div id="footer">Copyright &copy; 2014 | Powered by <a href="http://linikantech.com/" target="_blank">Linikantech</a><!--<a href="http://www.opencart.com">OpenCart</a> &copy; 2009-2016 All Rights Reserved.<br />Version 1.5.6.4--></div>
</body></html>