<?php  
include_once "./conexao/functions.php";
$config = buscarConfig();
// var_dump($_SESSION['verificar_logado']); die();
?>
<!DOCTYPE HTML>
<html>
<head>
	<title><?php echo $config['Titulo']; ?> | APP STORE</title>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1" />
	<!-- Favicon-->
	<link rel="icon" type="imagem/png" href="<?php echo $config['Logotipo_1']; ?>" />
	<link rel="stylesheet" href="assets/css/main.css" />
	<!-- Scripts -->
	<script src="https://code.jquery.com/jquery-3.1.1.js"></script>
	<script>
		$(document).ready(function(){
			$(".button1").click(function(){
				var texto = $(this).text();
				var $temp = $("<input>");
				$("body").append($temp);
				$temp.val(texto).select();
				document.execCommand("copy");
				$temp.remove();
				alert("Texto copiado!");
			});
		});
	</script>
</head>
<body id="top">
	<section id="banner" data-video="images/banner" style="background-image: url(<?php echo $config['Background']; ?>);">
		<div class="inner">
			<header>
				<h1>CENTRAL DE DOWNLOAD</h1>
			</header>
			<img width="100" height="100" src="<?php echo $config['Logotipo_1']; ?>" alt="" />
		</div>
	</section>
	<!-- Main -->
	<div id="main">
		<div class="inner">
			<!-- Boxes -->
			<div class="thumbnails">
				<?php  
				$meusApps = buscarApps();
				// var_dump($meusApps); die();
				foreach ($meusApps as $key => $value) {
					$ID_app     = $value['ID'];
					$nome_app   = $value['Nome'];
					$link_app   = $value['Link'];
					$status_app = $value['Status'];
					$imagem_app = $value['Imagem'];
					?>

					<?php if ($status_app != 0) {?>
						<div class="box">
							<a class="image fit"><img src="./control/actions/<?php echo $imagem_app; ?>" alt="" /></a>
							<div class="inner">
								<h3><?php echo $nome_app; ?></h3>
								<a href="control/actions/<?php echo $link_app; ?>" class="button style2 fit" data-poptrox="youtube,800x400">DOWNLOAD</a>									                               
							</div>
						</div>
					<?php }} ?>
					<?php if (empty($meusApps)) {?>
						<div class="box">
							<h2>Nenhum resultado encontrado</h2>
						</div>
					<?php } ?>
				</div>
			</div>
		</div>
		<!-- Footer -->
		<footer id="footer">
			<div class="inner">
				<h2><?php echo $config['Titulo']; ?></h2>
				<p class="copyright">&copy; GLOBAL WEB - IPTV SOLUTIONS</p>
			</div>
		</footer>
	</body>
	</html>