
<?php
    include_once('../conexao.php');
    @session_start();
    include_once('../verificar_autenticacao.php');
 ?>


 <?php 

 if($_SESSION['nivel_usuario'] != 'Professor' && $_SESSION['nivel_usuario'] != 'Administrador'){
 	header('Location: ../login.php');
 	exit();
 }

  ?>


<!DOCTYPE html>
<html lang="pt-br">
<head>


	<!--ICONE FAVICON BARRA DE TITULO -->
<link rel="apple-touch-icon" sizes="57x57" href="/img/fav/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/img/fav//apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/img/fav//apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/img/fav//apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/img/fav//apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/img/fav//apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/img/fav//apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/img/fav//apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/img/fav//apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192"  href="/img/fav//android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/fav//favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/img/fav//favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/img/fav//favicon-16x16.png">
<link rel="manifest" href="/img/fav/manifest.json">
<meta name="msapplication-TileColor" content="#f4c0a6">
<meta name="msapplication-TileImage" content="/img/fav/ms-icon-144x144.png">
<meta name="theme-color" content="#f4c0a6">
<!--FIM DO ICONE FAVICON BARRA DE TITULO -->


	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<meta name="description" content="Portal de Cursos da Escola Q-Cursos Networks, Participe das nossas formações e seja um profissional reconhecido!!">
	<meta name="author" content="Hugo Vasconcelos">
	<meta name="keywords" content="cursos, portal de cursos, curso de tecnologia, cursos de programação, cursos online">
	<title>Painel Professor</title>


	<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">

	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css">

	<link rel="stylesheet" href="../css/estilos-site.css">
	<link rel="stylesheet" href="../css/estilos-padrao.css">
	<link rel="stylesheet" href="../css/cursos.css">
	<link rel="stylesheet" href="../css/painel.css">
	<link rel="stylesheet" href="../css/cards.css">


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>


<script src="js/validation.js"></script>

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>


</head>


<body id="page-top">

<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
	<div class="container">
		<a class="navbar-brand js-scroll-trigger" href="../index.php#page-top" target="_blank">
		<img src="../img/logo-qcursos.png" class="img-logo"> <span class="texto-logo">Q-Cursos</span></a>

		<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" arial-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle Navigation">
			Menu <i class="fas fa-bars"></i>
	    </button>

	    <div class="collapse navbar-collapse" id="navbarResponsive">

			<ul class="navbar-nav ml-auto nav-flex-icons">


				 <li class="nav-item dropdown mr-3">
			        <a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink-333" data-toggle="dropdown"
			          aria-haspopup="true" aria-expanded="false">
			          <i class="fas fa-user"></i>
			        </a>
			        <div class="dropdown-menu dropdown-menu-right dropdown-default"
			          aria-labelledby="navbarDropdownMenuLink-333">
			          <a class="dropdown-item" href="../logout.php">Sair</a>

			          <?php 

			          if($_SESSION['nivel_usuario'] == 'Administrador'){
						 	
						 	?>

						 	 <a class="dropdown-item" href="../painel-admin/painel_admin.php">Painél do Administrador</a>
			          <a class="dropdown-item" href="../painel-professor/painel_professor.php">Painél dos Professores</a>

						 	<?php
						 }

			           ?>

			         
			        </div>
			      </li>

			      <?php 
      
				      //RECUPERAR FOTO DO BANCO

				    $cpf = $_SESSION['cpf_usuario'];



				    $query = "select * from professores where cpf = '$cpf' ";
				    $result = mysqli_query($conexao, $query);

				    while($res = mysqli_fetch_array($result)){
				          $nome = $res["nome"];
				          $cpf = $res["cpf"];
							$foto = $res["foto"];
							       ?>

					<li class="nav-item avatar mt-1 mr-1">
				        <a class="nav-link p-0" href="#">
				          <img src="../img/perfil/<?php echo $foto; ?>" class="rounded-circle z-depth-0"
				            alt="avatar image" width="35" height="35">
				        </a>

				   </li>
				   <li class="nav-item avatar mt-2">
				  	 <span class="text-muted "><a class="nome_usuario" href="painel_professor.php?acao=perfil&cpf=<?php echo $_SESSION['cpf_usuario']; ?>"><?php echo $nome; ?> </a> </span>
			     	<li class="nav-item avatar">

			     	<?php } ?>
			     
	   		 </ul>
	   	</div>

		
	</div>


</nav>

  <div class="container_admin">
   	<div class="row"> 
   		<div class="col-lg-2 col-md-3 col-sm-12" >

		 <!-- Sidebar -->
		    <div class="bg-light" id="sidebar-wrapper">


		      
		      <div class="list-group list-group-flush">

		      	  <a class="text-dark" href="painel_professor.php?acao=home"><span class="list-group-item ativo">Painél Professor</a></span>
		      	
		         <a href="painel_professor.php?acao=perfil&cpf=<?php echo $_SESSION['cpf_usuario']; ?>" class="list-group-item list-group-item-action bg-light"><i class="fas fa-user-friends mr-1"></i>Editar Perfil</a>
		        <a href="painel_professor.php?acao=cursos" class="list-group-item list-group-item-action bg-light"><i class="fas fa-book-reader mr-1"></i>Curso</a>
		       
		      </div>
		    </div>

		</div>


	    <div class="col-lg-10 col-md-9 col-sm-12">

			<!--CARREGAMENTO DAS DEMAIS PÁGINAS DO PAINÉL -->
			<?php
			if(@$_GET['acao'] == 'perfil'){
				include_once('perfil.php');
			}elseif(@$_GET['acao'] == 'cursos' or isset($_GET['txtpesquisarCursos'])){
				include_once('cursos.php');
			}
			else{
				include_once('home.php');
			}
			
			?>

		</div>
	        
	</div>

</div>



