<html>
<?php
//configuracao da sessao de login
session_start();
require('config.php');

if((!isset ($_SESSION['login']) == true) and (!isset ($_SESSION['senha']) == true))
{
  unset($_SESSION['login']);
  unset($_SESSION['senha']);
  header('location:index.php');
}

//vejo qual usuário esta lojado para montar o menu advanced
$user_logado = $_SESSION['login'];

?>
<script language="javascript" type="text/javascript">
    function Reboot()
        {
            var x;
            var r=confirm("Deseja rebootar o roteador agora?  ");
            if (r==true)
            {
                window.open('reboot.php', 'principal');
            }
            else
            {
            
            }
            
        }
</script>
<head>
	<title>menu</title>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="css/bootstrap.min.css">
	<script src="dist/jquery.slim.min.js"></script>
	<script src="dist/popper.min.js"></script>
	<script src="dist/bootstrap.bundle.min.js"></script>
	
</head>

<body style="background-color:#343A40">
<div class="container">	

<?php
//pegar ip do servidor para gerar URL
$url =  $_SERVER['SERVER_ADDR'];

?>

<table class="table table-dark" border="0" width="100%">
	<tr>
		<td><img src="images/icon_status.png" width=16 height=16><a href="http://<?php echo $url;?>:8080/dns/phpsysinfo-3.4.2/index.php?disp=bootstrap" target="principal"> Status</a></td>
	</tr>
	
	<tr>
		<td><img src="images/icon_network.png" width=16 height=16><a href="http://<?php echo $url;?>:58053/" target="principal"> Bind</a></td>
	</tr>

	<tr>
		<td><img src="images/icon_tools.png" width=16 height=16><a href="tools.php" target="principal"> Tools </a></td>
	</tr>
	
	<tr>
		<td><img src="images/icon_reboot.png" width=16 height=16><a href="#" onclick="Reboot();"> Reboot </a></td>
	</tr>

	<tr>
		<td><img src="images/icon_logout.png" width=16 height=16><a href="logout.php" target="_parent"> Logout </a></td>
	</tr>

</table>

</div>
</body>
</html>
