
<head>
	<style>
		.tabela_view tr:nth-child(even) {background-color: #f2f2f2;}
		.tabela_view { border-collapse: collapse;}
		.tabela, td, th {
		  padding: 10px;
		}
		/*#table, td, th {
		  border: 1px solid;
		}*/
	</style>
</head>
<script>
	listaInfoArmazenada = "<?php echo $bi_analise->getColunas_informarcao_analise_vertical(); ?>";
	listaColunaVerticalInfoArmazenada = "<?php echo $bi_analise->getColuna_analise_vertical(); ?>";
	listaInfoValoresArmazenada = "<?php echo $bi_analise->getColunas_valores_analise_vertical(); ?>";
	listaQuebraArmazenada = "<?php echo $bi_analise->getColunas_quebrar_parcial_analise_vertical(); ?>";
	listaInfoArmazenada = listaInfoArmazenada.replaceAll("`","");
	listaColunaVerticalInfoArmazenada = listaColunaVerticalInfoArmazenada.replaceAll("`","");
	listaInfoValoresArmazenada = listaInfoValoresArmazenada.replaceAll("`","");
	listaQuebraArmazenada = listaQuebraArmazenada.replaceAll("`","");
	listaCorDinamicaArmazenada = <?php if ($bi_analise->getJson_cor_dinamica_widget() ==""){echo "null";} else { echo $bi_analise->getJson_cor_dinamica_widget();} ?>;
	sequenci_linha_cor_dinamica = 0;
	$("#titulo_modal_analide").html("<b>Widget</b>");
</script>
<script src="js/analise_widget_query.js"></script>
<?php include("Etapa1_criacao.php"); ?>

<?php 
if($bi_analise->getCor_widget() == "" or $bi_analise->getCor_widget() == null)
{
	$bi_analise->setCor_widget("black");
}
if($bi_analise->getIcone_widget() == "" or $bi_analise->getIcone_widget() == null)
{
	$bi_analise->setIcone_widget("fa fa fa-dollar");
}
?>
<div id="etapa3" class="etapas_criar_analise" style=" display: none; width: 100%; max-width: 800px; margin: 0 auto; padding: 10px; padding-top: 0px;">
	<b style="color: #a6a6a6;">Etapa 3 de 4 - Configurar card</b> <Br>
	<a href="javaScript:void(0)" style=" font-weight: bold;" onclick="voltar_etapa2()"><i class="fa-solid fa-left-long"></i> Voltar etapa</a>
	<Br>
	
	<div style='  display: table; width: 100%; border-radius: 5px; padding: 15px; text-align: left; position: relative; background: white; border: solid 1px #f3f1f1; box-shadow: 0px 1px 3px 0px #d9d9d9;' >
		<div class="barra_vertical_widget" style='height: 100%; width: 5px; position: absolute; left: 0px; top: 0px; background: <?php echo $bi_analise->getCor_widget();?>; opacity: 0.6;'></div>
			<b style='color: #394d60; opacity: 0.8; margin-left: 5px;'>Título Widget</b> <br>
			<input type="text"  class="form " id="titulo" placeholder="Título" style="width: 150px;" value="<?php echo $bi_analise->getTitulo_widget_grafico(); ?>">
			<br>
			<div class='filtroForm'  style="width: 200px;">
				<b>Unidade medida/moeda (R$, %, KM)</b>
				<input type="text"  class="form " id="unidade_widget" placeholder="Unidade medida/moeda" style="width: 150px;" value="<?php echo $bi_analise->getUnidade_widget(); ?>">
				
				<b class="valor_widget" style='color: <?php echo $bi_analise->getCor_widget();?>; opacity: 0.9; margin-left: 5px;'><!--Valor exemplo--></b>
			</div>
			<div class='filtroForm'  style="width: 150px; ">
				<b style="margin-top: -3px;">Coluna Valor</b>
				<select class="form" id="select_colunas_valores_vertical"  placeholder="Tipo"  style="width: 150px; padding: 5px;">
					<option value=""></option>
				</select>
				<b class="valor_widget" style='color: <?php echo $bi_analise->getCor_widget();?>; opacity: 0.9; margin-left: 5px;'><!--Valor exemplo--></b>
			</div>
		
		<div class='filtroForm'  style="width: 200px; position: absolute; right: 50px; top: 0px; ">
			<label>Icone</label>
			<select class="form icone_fa" id="icone"  onchange="altera_cor_icone_prever()" placeholder="Icone" value="<?php echo $bi_analise->getIcone_widget();?>" style="width: 150px; padding: 5px; ">
				<?php include("fontes.php");?>
			</select><br><br>
			<center><i id="icone_widget" style=' color: <?php echo $bi_analise->getCor_widget();?>; opacity: 0.6; font-size: 30px;' class='<?php echo $bi_analise->getIcone_widget();?>'></i></center>
		</div>
		
	</div>
				
	
	<div class='filtroForm'  style="width: 100%; display: none;">
		<select class="form" id="select_colunas_info" placeholder="Tipo" multiple  style="width: 150px; padding: 5px; ">
				<option value=""></option>
		</select>
	</div>
	
	<Br>
	<div class='filtroForm'  style="width: 100%">
		<label>Cor</label><br>
		<input type="color" class="form" onchange="altera_cor_icone_prever()" id="cor" name="cor" value="<?php echo $bi_analise->getCor_widget();?>" style="width: 100%" />
	</div>
	
	<br>
	<div id="cores_dinamica"  style="width: 100%; padding: 10px;">
	
	</div>
	<Br>
	<a href="javaScript:void(0)" style="color: green; font-weight: bold;" onclick="add_regra_cor(null)">Adicionar regra cor dinámica</a>
		
	<Br>	<Br>
	<button class="btnSuccess btnSn" style="float: left;" onclick="avancar_analise_etapa4_widget()">Avançar etapa 4</button>
	<button class="btnSuccess btnSn" style="float: left; margin-left: 15px;" onclick="abrirAbaTipoData()"> Alterar tipo dado</button>
	<?php include("Alterar_tipo_dado.php"); ?>
</div>

<div id="etapa4" style=" display: none; width: 100%; max-width: 800px; margin: 0 auto; padding: 10px; padding-top: 0px;">
	<b style="color: #a6a6a6;">Etapa 4 de 4 - Configurar colunas</b> <Br>
	<a href="javaScript:void(0)" style=" font-weight: bold;" onclick="voltar_etapa3()"><i class="fa-solid fa-left-long"></i> Voltar etapa</a>
	<Br>
	
	<div id="config_coluna"  style="width: 100%; padding: 10px;">
	
	</div>
	
	<button class="btnSuccess btnSn" onclick="finalizar_analise_widget()">Finalizar</button>
</div>
	
<script>
	$('#icone option[value=\'<?php echo $bi_analise->getIcone_widget();?>\']').attr('selected','selected');
	
</script>