
<?php
	include_once("cabecalho.php");
	include_once("rodape.php");
	include_once("nav_bar.php");
	include_once("nav_side.php");
?>
<div class="container" style="width: 100%; text-align: left; width: calc(100% - 220px); margin-left: 220px;  " id="conteudo2"></div>	
<div class="container" id="conteudo">
		
</div>
</body>
</html>
<?php
	
	if(isset($_GET["page"]))
	{
		if(isset($_GET["public"]) or isset($_GET["amp;public"]))
		{
			echo '<script>
					$("body").css("background","RGB(247, 248, 251)");
					$("#conteudo").load(dominio+"src/controller/Bi_paginaControllerUser.php?mod=pagina_view_public&codigo='.$_GET["page"].'");
				 </script>';
		}
		else
		{
			include("index.php");
			require_once("src/model/encrypt.php");
			echo "<script>abrir_pagina('".decrypt($_GET["page"])."');</script>";
		}
	}
?>
<script>
<?php 
	if(isset($_GET["sem_menu"]) and $_GET["sem_menu"] == "true")
	{
		//echo "$('#mySidenav').remove();";
		echo "openNav = function (){};";
		echo "$('.botaoDashLateral').remove();";
		echo "closeNav();";
	}
	if(isset($_GET["remove_todos_menus"]) and $_GET["remove_todos_menus"] == "true")
	{
		//echo "$('#mySidenav').remove();";
		echo "openNav = function (){};";
		echo "$('.botaoDashLateral').remove();";
		echo "closeNav();";
		echo '$(".navbar-header").remove();';
		echo '$(".dropdown_filtro").remove();';
		echo '$(".navbar-collapse").remove();';
	}
	if(isset($_GET["nome"]))
	{
		echo 'document.title = "'.$_GET["page"].'";';
	}		
?>
	$('.closebtn').click(function(){
		$("#conteudo2").css("margin-left", "15px");
		$("#conteudo2").css("width", "calc(100% - 17px)");
		//alert("close")
	});
	$('#btnOpenNav').click(function(){
		$("#conteudo2").css("margin-left", "220px");
		$("#conteudo2").css("width", "calc(100% - 220px)");
		//alert("open")
	});

	$( '#myNavbar' ).on( 'click', '.anav', function () { 
		$("#conteudo2").remove();
	});
	$( '#mySidenav' ).on( 'click', '.aside', function () { 
		$("#conteudo2").remove();
	});
	
	
	//montaTebelaBi($("form").attr("id"),$("form").attr("seletor"));
	window.onload = function(){
		setTimeout(function (){
			<?php 
				//echo "<br><br><br><br><br>".json_encode($_GET);
				foreach(array_keys($_GET) as $key) {
					$valor = $_GET[$key];
					if(explode("-",$valor) ==3)//data
					{
						$aData = explode("-",$valor);
						if(explode(" ", $aData[2]) == 1)
						{
							$valor = $aData[2]."/".$aData[2]."/".$aData[1];
						}
					}
					//echo "$('#".$key."').val('".$valor."'); ";
					echo "$(\"input[name='".$key."']\").val('".$valor."');";
				}
				if(isset($_GET["remove_todos_menus"]) and $_GET["remove_todos_menus"] == "true")
				{
					echo '$(".dropdown_filtro").remove();';
					echo '$("#btn_abrir_modal_filtropagina").remove();';
				}
			?>	
		  if(montaTebelaBi($("form").attr("id"),$("form").attr("seletor"))) {submet_todos_os_forms(this);  }
		},1000);
	};
	
</script>
