<?php
session_start();
require('config.php');
require('conexao.php');
if(!isset($_SESSION['logInSucces'])){
  ?><script type="text/javascript">window.location.href="index.php"</script><?
}
?>
<!DOCTYPE html>
<html>
<head>
	<title>Dashboard</title>
	    <meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
	<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
	<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.2/underscore-min.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/accounting.js/0.4.1/accounting.min.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>

    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
</head>
<body>
	<div class="status"><center><p></p></center></div>
	<div class="wrapper">
		<div class="sidebar">
			<div class="sidebar-wrapper">
				<div class="logo">
					<a href="#" class="simple-text">
						<center>
						<img src="img/logo.png">
						</center>
					</a>
				</div>
				<center>
				<ul class="nav">
					<a href="?action=home" class="btn-control active" key="control"><li ><i class="fas fa-cogs"></i> Painel Inicial</li></a>
					<a href="?action=user" class="btn-control" key="user"><li><i class="fas fa-users"></i> Usuarios</li></a>
					<a href="?action=equipe" class="btn-control" key="user"><li><i class="fas fa-users"></i> Equipe</li></a>
					<a href="?action=pay" class="btn-control" key="user"><li><i class="fas fa-money-bill"></i> Planos</li></a>
					<a href="?action=userpend" class="btn-control" key="user"><li><i class="fas fa-user-clock"></i> Clientes Vencidos</li></a>
										<!--<a href="?action=teste" class="btn-control" key="user"><li><i class="fas fa-user-clock"></i> Clientes Testes</li></a>-->
                     <a href="?action=tv" class="btn-control" key="epi"><li><i class="fas fa-tv"></i> TV</li></a>
					
										
					<a href="?action=video" class="btn-control" key="vid"><li><i class="fas fa-video"></i> Videos</li></a>
					        
					<a href="?action=serie" class="btn-control" key="epi"><li><i class="fas fa-video"></i> Series</li></a>
					<a href="?action=sair" class="btn-control" key="sair"><li><i class="fas fa-sign-out-alt"></i> Sair</li></a>
				</ul>
				</center>
				
			</div>

		</div>
		<div class="content">
			<div class="header-content">
				<h2>Painel de Controle</h2>
				<button class="sidebar-show"><i class="fas fa-bars"></i></button>
			</div>		
			<div class="loading">
				<div class="spinner"></div>
			</div>
			<div class="conteudo">
				<?php
				$action = null;
				if(isset($_GET['action'])){
					$action = $_GET['action'];
				}
				switch ($action) {
					case 'home':
						include_once('pages/dash.php');
						break;
					
					case 'equipe':
						include_once('pages/user.php');
						break;
					case 'video':
						include_once('pages/vid.php');
						break;
					case 'serie':
						include_once('pages/epi.php');
						break;
					case 'filmEdit':
						include_once('pages/vid-edit.php');
						break;
					case 'epiEdit':
						include_once('pages/epi-edit.php');
						break;
					case 'userEdit':
						include_once('pages/user-edit.php');
						break;
					case 'user':
						include_once('pages/users.php');
						break;
					case 'usersEdit':
						include_once('pages/users-edit.php');
						break;
						case 'tv':
						include_once('pages/tv.php');
						break;
					case 'tvadd':
						include_once('pages/tvadd.php');
						break;
					case 'tvedit':
						include_once('pages/tvedit.php');
						break;
					case 'pay':
						include_once('pages/payment.php');
						break;
					case 'pay-add':
						include_once('pages/payment-add.php');
						break;
					case 'userpend':
						include_once('pages/userpend.php');
						break;
					case 
					 'userpend':
						include_once('pages/usertste.php');
						case 
						'sair':
						unset(
							$_SESSION['loginAdmin'],
							$_SESSION['logInSucces']);
						?><script type="text/javascript">window.location.href="index.php"</script><?
						break;


					default:
						include_once('pages/dash.php');
						break;
				}
				
			?>
			</div>
			
			<div class="footer">
				
				<center>MARKVOD</center>
			
			</div>
		
		</div>

	</div>
</body>
</html>
<script type="text/javascript">
	$('.sidebar-show').click(function(){
		var check = $('.content').hasClass('contentSlide');
		if(check == false){
			$('.content').addClass('contentSlide');
			$('.sidebar').addClass('showSidebar');
			$('.sidebar-show').html('<i class="fas fa-times"></i>');
		}else{
			$('.content').removeClass('contentSlide');
			$('.sidebar').removeClass('showSidebar');
			$('.sidebar-show').html('<i class="fas fa-bars"></i>');
		}
	});
	
function status_close(){
	setTimeout(function(){
		$('.status').css('display','none');
	},2500);
}
function loading(){

					$('.loading').css('display','block');
						$('.loading').css('opacity','1');
						setTimeout(function(){
							$('.header-content h2').html('Videos');
							$('.loading').css('display','none');
							$('.loading').css('opacity','0');
						},500);
}
</script>