<?php 
    require_once(__DIR__."/config.php");
   
    //var_dump('ENTREI'); exit; 
    $cs = new cs;

    if(isset($_GET['sair']))
	{
	    session_destroy();
	    unset($_SESSION['info_usr']);
	    exit(header("Location:  /beta/login"));
	}

    if(!$cs->checkLog_unf()) {
		
		header("Location: /beta/login");
		exit;

	} else {
		
		header("Location: /beta/dashboard");
		exit;
	}

	// if(!isset($_SESSION['token_validar'])) {
	//     $_SESSION['token_validar'] = md5(rand());
	// }
    
	

	// $gerenciadores = $cs->fetchQuery($cs->executeQuery("SELECT * from gerenciadores"));

	// $usuarios      = $cs->fetchQuery($cs->executeQuery("SELECT * from usuarios"));

	// $profiles      = $cs->fetchQuery($cs->executeQuery("SELECT * from profiles"));

 //    $gerenciadores_id = [];

	// foreach ($gerenciadores as $value) {
	     
	//     array_push($gerenciadores_id, $value['id']);

	//     array_push($gerenciadores_id, $value['profiles_limitados']);	
	// }

	// var_dump($gerenciadores_id);