<?php 
	include_once($config->diretorio_raiz()."/cabecalho.php");
	include_once($config->diretorio_raiz()."/rodape.php");
	include_once($config->diretorio_raiz()."/nav_bar.php");
	include_once($config->diretorio_raiz()."/nav_side.php");
	
?>

<div class="container" id="conteudo" style="background: white;  " >
	<?php
		if($array == null)
		{
			echo "<font style='color: red'>Arquivo inválido</font>";
			exit();
		}
		if(trim($codigoDuplicado) != "")
		{
			echo "<font style='color: red'>Existe um layou cadastrado com as mesmas colunas! Código: ".$codigoDuplicado." Nome: ".$nomeDuplicado."!</font><bR>";
		}
	?>
	<form action='src/controller/Bi_layout_importacaoControllerUser.php?mod=confirmar' id="formDadosbi_layout_importacao"   method="POST">
		<div class='filtroForm' >
			<label>Nome<span class="form_obrigatorio">*</span></label>
			<input name="nome" type="text" class="form" required  />
		</div> 
		<div class='filtroForm' >
			<label>Descrição<span class="form_obrigatorio">*</span></label>
			<input name="descricao" type="text" class="form" required  />
		</div>
		<div class='filtroForm' >
			<label> </label>
			<input type="button" value="Confirmar" class="btnSuccess" onclick="salvarDados('formDadosbi_layout_importacao');" />
		</div>
		<br>
		<label>Exibindo apenas 10 linhas</label>
		<input name="jsonArray" type="text"  style="visibility: hidden;" value="<?php echo base64_encode(json_encode($array["cabecalho"])); ?>" />
		<input type="text"  style="visibility: hidden; height: 0;" name="linha_inicia_cabecalho" placeholder="000000000000000000000000" data-mask="000000000000000000000000"   required value="<?php echo $iniciaCabecalhoLinha;?>" valueDefault="<?php echo $iniciaCabecalhoLinha;?>"  />
		<input type="text"  style="visibility: hidden; height: 0;" name="coluna_testa_fim" placeholder="000000000000000000000000" data-mask="000000000000000000000000"    value="<?php echo $colunaTestaFim;?>" valueDefault="<?php echo $colunaTestaFim;?>"  />
		<input type="text"  style="visibility: hidden; height: 0;" name="texto_teste_fim" placeholder="Texto finaliza"     value="<?php echo $textoTesteFim;?>" valueDefault="<?php echo $textoTesteFim;?>"  />
	
	</form>

<?php
 echo "<table class='table' style='width: 100%; overflow: auto;'>";
 echo "<tr>";
 foreach($array["cabecalho"] as $colunas)
 {
	 echo "<td>
	 Nome: ".$colunas["nome"]."<br>
	 Tipo: ".$colunas["tipo"]."<br>
	 Mascara: ".$colunas["mascara"]."
	 </td>";
 }
 echo "</tr>";
 $qtdLinha = 0;
 foreach($array["conteudo"] as $linhas)
 {
	 $qtdLinha += 1;
	 echo "<tr>";
	 foreach($linhas as $colunas)
	 {
		 echo "<td>".$colunas."</td>";
	 }
	 echo "</tr>";
	 if($qtdLinha == 10)
	 {
		break;
	 }
 }
 echo "</table>";
 ?>
 </div>