<?php
require 'sessao.php';
level2();
?>
<!DOCTYPE html>
<html lang=pt-br>
<meta http-equiv=content-type content="text/html;charset=UTF-8" />
<head>
<meta charset=utf-8>
<title>TS3BLACK - Domínios Públicos</title>
<link rel=icon href=login/img/apple-touch-icon.png>
<link rel=stylesheet href=css/bootstrap.min.css>
<link rel=stylesheet href=css/font-awesome.min.css>
<link rel=stylesheet href=css/typicons.min.css>
<link rel=stylesheet href=css/varello-theme.min.css>
<link rel=stylesheet href=css/varello-skins.min.css>F
<link rel=stylesheet href=css/animate.min.css>
<link rel=stylesheet href=css/icheck-all-skins.css>
<link rel=stylesheet href=css/icheck-skins/flat/_all.css>
<script src=https://use.fontawesome.com/449b46a4f1.js></script>
<script src=assets/js/jquery-1.11.3.min.js></script>
<link href='https://fonts.googleapis.com/css?family=Hind+Vadodara:400,500,600,700,300' rel=stylesheet type=text/css>
<link rel=manifest href=manifest.json>
<meta name=msapplication-TileColor content=#ffffff>
<meta name=msapplication-TileImage content=ms-icon-144x144.png>
<meta name=theme-color content=#ffffff> <meta http-equiv=X-UA-Compatible content="IE=edge">
<meta name=viewport content="width=device-width, initial-scale=1"></head>
<body>
</div> <div class="notifications top-right"></div>
<div class=wrapper>
<div class=page-wrapper>
<aside class=left-sidebar>
<section class=sidebar-user-panel>
<div id=user-panel-slide-toggleable>
<span class=user-panel-logged-in-text><span class="fa fa-circle-o text-success user-panel-status-icon"></span> Conectado como <strong><?php
require_once 'sql.php'; 
$nome = $_SESSION['nome'];
echo'
                        '.$nome.' ';
?></strong></span>
</div>
</section>
<?php
                  require_once 'menu.php';
                  require_once 'menu_admin.php';
                  ?>
</aside> <header class=top-header>
<a href=index.html>
<img src=images/logo-painel.png class=top-header-logo width=65px height="75px alt=">
</a>
<nav class="navbar navbar-default">
<div class=container-fluid>
<div class=navbar-header>
<button type=button class=navbar-sidebar-toggle data-toggle-sidebar>
<span class="typcn typcn-arrow-left visible-sidebar-sm-open"></span>
<span class="typcn typcn-arrow-right visible-sidebar-sm-closed"></span>
<span class="typcn typcn-arrow-left visible-sidebar-md-open"></span>
<span class="typcn typcn-arrow-right visible-sidebar-md-closed"></span>
</button>
</div>
<ul class="nav navbar-nav navbar-left">
<li>
</li>
</ul>
<ul class="nav navbar-nav navbar-right" data-dropdown-in=flipInX data-dropdown-out=zoomOut>
<li class="hidden-sm hidden-xs hidden-md"><a>Bem vindo ao painel da <strong>TS3BLACK</strong>.COM</a></li>
<li><a href=logout.php><span class="fa fa-sign-in"></span></a></li>
</ul>
</div>
</nav>
</header>
<div class=content-wrapper>
<section class=content-header></br>
<ol class=breadcrumb>
<li><a href=index.php><i class="fa fa-home"></i>&nbsp;Home</a></li>
<li class=active>Domínios Públicos</li>
</ol>
</section>
<div class=main>
<div class=main>
<div class=container>
<div class=row>
<div class=col-md-12>
<div class="widget stacked">
<div class="widget stacked widget-table action-table">
<div class=widget-header>
</div>
<?php
					// mensagem de error
			if (isset($_GET['deletado'])){
			echo '<div class="alert alert-success alert-dismissable">
                                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
								<center>DOMÍNIO PÚBLICO APAGADO COM SUCESSO!</center>
								</div>';}
								?>
<div class=widget-content>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Domínios</th>
<th class=td-actions>Ações</th>
</tr>
</thead>
<tbody>
<?php
										
										// seleciona o banco de dados
										$sql_select = "SELECT * FROM `domains` WHERE `id_user`='0'";
										$resultado = mysql_query($sql_select);
										// mensagem de error com conecxão com o banco de dados
										if (!$resultado){
										echo'<td>Não foi possível listar seus domínios</td>';}
										// se o houver conecxão com o banco de dados ele ira seguir em diante
										else {
										while($registro = mysql_fetch_assoc($resultado)){

										// botões
										$botoes ='<a href="deletepu.php?id='.$registro['id'].'" class="btn btn-info"><span class="fa fa-trash-o"></span> Deletar</a>';	
									//lista os domínis e ips
									echo'<tr>
								<td>'.$registro['dominio'].'</td>
								<td class="td-actions">'.$botoes.'</td>
								</tr>';
										} 

										}
										?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div> </div>
</br></br>
<script>document.write(unescape("%3Cdiv%20class%3D%22container-fluid%22%3E%0A%20%20%20%20%0A%3Cfooter%20class%3D%22content-wrapper-footer%22%3E%0A%20%20%20%20%26copy%3B%20Copyright%20%A9%202017%20-%20%3Cfont%20color%3D%2241adff%22%3ETS3BLACK.COM%3C/font%3E%20-%20Desenvolvido%20por%3A%20%3Ca%20href%3D%22https%3A//www.cloudadvanced.com.br/%22%20target%3D%22_blank%22%3ECloud%20Advanced%3C/a%3E.%0A%3C/footer%3E%3C/div%3E%0A%3C/br%3E"));</script>
</br>
</div>
</div>
</div>
<script src=js/Chart.min.js></script>
<script src=js/jquery-1.12.3.min.js></script>
<script src=js/bootstrap.min.js></script>
<script src=js/jquery.piety.min.js></script>
<script src=js/varello-theme.js></script>
<script src=js/icheck.min.js></script>
<script src=js/dropdown.js></script></body>
</html>