<?php 
	error_reporting(0);
	ini_set(“display_errors”, 0);
	set_time_limit(0);

	ini_set("upload_max_filesize", "10M");
	ini_set("max_execution_time", "-1");
	ini_set("memory_limit", "-1");
	ini_set("realpath_cache_size", "-1");
	
	session_start();
	if (!empty($_SESSION)) {
		header("Location: new_cadastro.php?idlote=".$_GET['idlote']);
		die();
	}

	    // Funcao para Calcular valor da Parcela - Tabela Price
	function Price($Valor, $Parcelas, $Juros) {

		$Juros = bcdiv($Juros,100,15);
		$E=1.0;
		$cont=1.0;

		for($k=1;$k<=$Parcelas;$k++)
		{
			$cont= bcmul($cont,bcadd($Juros,1,15),15);
			$E=bcadd($E,$cont,15);
		}
		$E=bcsub($E,$cont,15);

		$Valor = bcmul($Valor,$cont,15);
		return bcdiv($Valor,$E,15);
	}


	$lote = $_GET['idlote'];
	$crm_cli = $_GET['crm_cli'];

	include "conexao.php";


	    //Query Suprema para pegar todas config do empreendimento e o valor do lote 
	$dados = null;

	$query = mysqli_query($db, "SELECT EC.descricao_empreendimento, lote.lote, produto.quadra, EMP.idempreendimento, PG.plano_pagamento AS plano_p, lote.idlote, lote.valor AS valor_lote, DE.desconto_empreendimento AS desconto, DE.parcela_max AS max_parcela_avista, PE.parc_entrada AS parcela_entrada, EM.percentual_entrada, CO.taxa_financiamento, CO.taxa_entrada, CO.correcao_finan_fixo, EI.percen_lote, EI.taxa_inter, EI.status_ativo, EI.status_parc_unica, EI.trava_inter, EI.price, EI.sac, EI.semjuros, EI.juros_financiamento, EI.trava_financiamento, EMP.indice_correcao FROM lote INNER JOIN produto ON lote.produto_idproduto = produto.idproduto INNER JOIN empreendimento AS EMP ON produto.empreendimento_idempreendimento = EMP.idempreendimento INNER JOIN empreendimento_cadastro AS EC ON EMP.empreendimento_cadastro_id = EC.idempreendimento_cadastro INNER JOIN (SELECT * FROM plano_pagamento WHERE idplano > 0 ORDER BY idplano DESC ) AS PG ON EMP.idempreendimento = PG.empreendimento_id LEFT JOIN desconto_empreendimento AS DE ON EMP.idempreendimento = DE.empreendimento_id LEFT JOIN (SELECT MAX(parcelamento_entrada) AS parc_entrada, empreendimento_id FROM parcelamento_entrada GROUP BY empreendimento_id ORDER BY idparcelamento_entrada DESC) AS PE ON EMP.idempreendimento = PE.empreendimento_id LEFT JOIN (SELECT * FROM `entrada_minima` WHERE `identrada_minima` > 0 ORDER BY `identrada_minima` DESC) AS EM ON EMP.idempreendimento = EM.empreendimento_id LEFT JOIN (SELECT * FROM correcao ORDER BY correcao.idcorrecao DESC) AS CO ON EMP.idempreendimento = CO.empreendimento_id LEFT JOIN (SELECT EI.idempreendimento_inter, EI.empreendimento_id, EI.percen_lote, EI.taxa_inter, EI.status_ativo, EI.status_parc_unica, EI.trava_inter, EI.price, EI.sac, EI.semjuros, EI.juros_financiamento, EI.trava_financiamento FROM empreendimento_inter AS EI INNER JOIN (SELECT empreendimento_id, MAX(idempreendimento_inter) AS maior FROM empreendimento_inter GROUP BY empreendimento_id ORDER BY idempreendimento_inter DESC) AS AUX ON EI.idempreendimento_inter  = AUX.maior GROUP BY EI.empreendimento_id) AS EI ON EMP.idempreendimento = EI.empreendimento_id WHERE lote.idlote = $lote GROUP BY PE.parc_entrada")or die(mysqli_error($db));

	if(mysqli_num_rows($query)){
		$dados = [];

		while ($assoc = mysqli_fetch_assoc($query)) {
			$dados[] = $assoc;
		}
	}


	$dados[0]['valo_minimo_entrada'] = ($dados[0]['percentual_entrada'] * $dados[0]['valor_lote']) / 100;
	$dados[0]['valor_minimo_inter'] = ($dados[0]['percen_lote'] * $dados[0]['valor_lote']) / 100;

	 $dados[0]['valor_desconto'] = ($dados[0]['desconto'] * $dados[0]['valor_lote']) / 100;
	    // var_dump($dados);
	    // die();
?>

<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->

<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	
	<title>Immobile business</title>
	<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
	<meta content="" name="description" />
	<meta content="" name="author" />

	<!-- ================== BEGIN BASE CSS STYLE ================== -->
	<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet">
	<link href="https://immobilebusiness.com.br/admin//assets/plugins/jquery-ui/themes/base/minified/jquery-ui.min.css" rel="stylesheet" />
	<link href="https://immobilebusiness.com.br/admin/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
	<link href="https://immobilebusiness.com.br/admin/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
	<link href="https://immobilebusiness.com.br/admin/assets/css/animate.min.css" rel="stylesheet" />
	<link href="https://immobilebusiness.com.br/admin/assets/css/style.min.css" rel="stylesheet" />
	<link href="https://immobilebusiness.com.br/admin/assets/css/style-responsive.min.css" rel="stylesheet" />
	<link href="https://immobilebusiness.com.br/admin/assets/css/theme/default.css" rel="stylesheet" id="theme" />
	<link href="https://immobilebusiness.com.br/admin/assets/plugins/select2/dist/css/select2.min.css" rel="stylesheet" />

	<!-- ================== END BASE CSS STYLE ================== -->

	<!-- ================== BEGIN PAGE LEVEL STYLE ================== -->
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.1/bootstrap-editable/css/bootstrap-editable.css" />
	<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
	<!-- ================== END PAGE LEVEL STYLE ================== -->


	<link rel="stylesheet" href="css/acc-wizard.min.css" />

	<!-- ================== BEGIN BASE JS ================== -->
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/pace/pace.min.js"></script>

	<style type="text/css">
		@media screen and (max-width: 600px) {
			ol.acc-wizard-sidebar{
				display: none;
			}

			.info-span{
				float: left!important;
			}

			div#especial{
				min-height: 200px;
			}

			div#demonstrativo_1{
				display: none!important;
			}

			div.fab{
				display: block!important;
			}
		}

		form#cad-cliente .acc-wizard-step{
			display: none!important;
		}

		.info-span{
			font-style: italic; 
			font-size: 18px; 
		}

		div.fab{
			display: none;
		}

		strong{
			font-size: 14px!important;
			font-weight: 500!important;
		}

		.panel > .panel-heading {
			background-image: none;
			background-color: #047b6e;
			color: white;

		}

		.animate-text:hover {
          /*-webkit-animation: jello-horizontal 1s 0.3s 1 both;
          animation: jello-horizontal 1s 0.3s 1 both;*/
      }


      .bounce-top {
          /*-webkit-animation: bounce-top 1s both;
          animation: bounce-top 1s both;*/
      }

      .fab{
      	position: fixed;
      	bottom:10px;
      	right:10px;
      }

      .fab button{
      	cursor: pointer;
      	width: 48px;
      	height: 48px;
      	border-radius: 30px;
      	background-color: #047b6e;
      	border: none;
      	box-shadow: 0 1px 5px rgba(0,0,0,.4);
      	font-size: 24px;
      	color: white;

      	-webkit-transition: .2s ease-out;
      	-moz-transition: .2s ease-out;
      	transition: .2s ease-out;
      }

      .fab button:focus{
      	outline: none;
      }

      .fab button.main{
      	position: absolute;
      	width: 60px;
      	height: 60px;
      	border-radius: 30px;
      	background-color: #047b6e;
      	right: 0;
      	bottom: 0;
      	z-index: 20;
      }

      .fab button.main:before{
      	content: '+';
      }

      .fab button.main:active,
      .fab button.main:focus{
      	outline: none;
      	background-color: #00acac;
      	box-shadow: 0 3px 8px rgba(0,0,0,.5);
      }
  </style>

  <style type="text/css">

  	.incompleto{
  		border: 2px solid red;
  		color: red;
  	}

  	.completo{
  		border: 2px solid green!important;
  		color: green!important;
  	}

  	.estorado{
  		border: 2px solid #f59c1a;
  		color: #f59c1a;
  	}

  	.panel-heading{
  		max-height: 40px!important;
  	}
  </style>

<style type="text/css">
  	.space{
  		height:10px;
  	}

  	.radio-button * {
  		box-sizing: border-box;
  	}

  	.radio-button {
  		display: inline-block;
  	}

  	.radio-button > input {
  		display: none;
  	}

  	.radio-button > label {
  		vertical-align: top;
  		font-size: 18px;
  	}

  	.radio-button > [type="radio"] + label:before {
  		color: #777;
  		content: '';
  		display: inline-block;
  		min-height: 20px;
  		height: 20px;
  		width: 20px;
  		border: 2px solid #777;
  		border-radius: 100%;
  		margin-right: 3px;
  		font-size: 15px;
  		vertical-align: top;
  		text-align: center;
  		transition: all 0.3s linear;
  		content: '';
  	}

  	.radio-button.radio-square > [type="radio"] + label:before{
  		border-radius:0px;
  	}

  	.radio-button.radio-rounded > [type="radio"] + label:before{
  		border-radius:25%;
  	}


  	.radio-button.radio-blue > [type="radio"] + label:before{
  		border: 2px solid #ccc;
  	}

  	.radio-button > [type="radio"]:not(:checked) + label:before {
  		background-color: transparent;
  	}

  	.radio-button > [type="radio"]:not(:checked) + label:hover:before {
  		background: -moz-radial-gradient(center, ellipse cover, rgba(124, 188, 10, 0.7) 0%, rgba(157, 213, 58, 0) 100%);
  		background: -webkit-radial-gradient(center, ellipse cover, rgba(124, 188, 10, 0.7) 0%, rgba(157, 213, 58, 0) 100%);
  		background: radial-gradient(ellipse at center, rgba(124, 188, 10, 0.7) 0%, rgba(157, 213, 58, 0) 100%);
  		filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#b37cbc0a', endColorstr='#009dd53a', GradientType=1);
  	}

  	.radio-button > [type="radio"]:checked + label:before {
  		background: -moz-radial-gradient(center, ellipse cover, rgba(124, 188, 10, 1) 0%, rgba(128, 194, 23, 1) 49%, rgba(161, 213, 79, 1) 50%, rgba(161, 213, 78, 1) 53%, rgba(157, 213, 58, 0) 100%);
  		background: -webkit-radial-gradient(center, ellipse cover, rgba(124, 188, 10, 1) 0%, rgba(128, 194, 23, 1) 49%, rgba(161, 213, 79, 1) 50%, rgba(161, 213, 78, 1) 53%, rgba(157, 213, 58, 0) 100%);
  		background: radial-gradient(ellipse at center, rgba(124, 188, 10, 1) 0%, rgba(128, 194, 23, 1) 49%, rgba(161, 213, 79, 1) 50%, rgba(161, 213, 78, 1) 53%, rgba(157, 213, 58, 0) 100%);
  		filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#7cbc0a', endColorstr='#009dd53a', GradientType=1);
  	}

  	.radio-button.radio-blue > [type="radio"]:checked + label:before {
  		background: #337ab7;
  		background: -moz-linear-gradient(top,  #337ab7 0, #265a88 100%);
  		background: -webkit-linear-gradient(top,  #337ab7 0,#265a88 100%);
  		background: linear-gradient(to bottom,  #337ab7 0,#265a88 100%);
  		filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#337ab7', endColorstr='#265a88',GradientType=0 );

  	}

  	.radio-button.radio-blue > [type="radio"]:not(:checked) + label:hover:before{
  		background: -moz-linear-gradient(top,  rgba(51,122,183,0.37) 0, rgba(51,122,183,0.37) 0%, rgba(38,90,136,0.62) 100%);
  		background: -webkit-linear-gradient(top,  rgba(51,122,183,0.37) 0,rgba(51,122,183,0.37) 0%,rgba(38,90,136,0.62) 100%);
  		background: linear-gradient(to bottom,  rgba(51,122,183,0.37) 0,rgba(51,122,183,0.37) 0%,rgba(38,90,136,0.62) 100%);
  		filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5e337ab7', endColorstr='#9e265a88',GradientType=0 );

  	}
</style>

  <!-- ================== END BASE JS ================== -->
</head>
<body>

	<div id="content" class="content" style="margin: 0!important;">
		<div class="panel panel-inverse">
			<div class="panel-heading">
				<h4 class="panel-title">
					<a href="#simulacao" data-parent="#accordion-demo" data-toggle="collapse" style="text-transform: uppercase; font-size: 16px;">
						Simulação de Venda <?php echo " - ".$dados[0]["descricao_empreendimento"]." /Q: ".$dados[0]["quadra"]." L: ".$dados[0]["lote"] ?>
					</a>
				</h4>
			</div>

			<div class="panel-body" style="min-height: 650px;">
				<div class="row" id="especial" >
					<div class="row">
						<?php 
							$today = date('Y-m-d');
						?>
					</div>

					<div class="panel-body col-md-8">
						<div class="row acc-wizard">
							<div class="col-md-4" style="display: none!important;">
								<ol class="acc-wizard-sidebar">
									<li class="acc-wizard-todo animate-text"><a href="#aux_desconto" style="font-size: 16px; text-transform: uppercase;">A vista</a></li>
									<li class="acc-wizard-todo animate-text"><a href="#avista" style="font-size: 16px; text-transform: uppercase;">A vista</a></li>
									<li class="acc-wizard-todo animate-text"><a href="#entrada" style="font-size: 16px; text-transform: uppercase;">Entrada</a></li>
									<li class="acc-wizard-todo animate-text"><a  href="#intermediaria" style="font-size: 16px; text-transform: uppercase;">Intermediaria</a></li>
									<li class="acc-wizard-todo acc-wizard-active animate-text"><a href="#parcela_unica" style="font-size: 16px; text-transform: uppercase;">Parcela Única</a></li>
									<li class="acc-wizard-todo animate-text"><a href="#parcelamento" style="font-size: 16px; text-transform: uppercase;">Parcelamento</a></li>
								</ol>
							</div>

							<div class="col-md-12" style="padding-right: 2em;">
								<div id="accordion-demo" class="panel-group">
									<div class="row" align="center">
										<div class="radio-button radio-blue radio-rounded">
										  <input id="chkTest4" type="radio" name="testRadio2" tipo="avista"/>
										  <label for="chkTest4">Á Vista</label>
										</div>
										<div class="radio-button radio-blue radio-rounded">
										  <input id="chkTest5" type="radio" name="testRadio2" tipo="parcelado" checked/>
										  <label for="chkTest5">Parcelamento</label>
										</div>
									</div>
									<div class="panel panel-inverse avista hidden">
										<div class="panel-heading" style="height: 150%;">
											<h4 class="panel-title">
												<a href="#avista" class="animate-text" data-parent="#accordion-demo" data-toggle="collapse" style="text-transform: uppercase; font-size: 14px;">
													A vista
												</a>
											</h4>
										</div>
										<div id="avista" class="panel-collapse collapse" style="height: 36.4px;">
											<!-- <div class="panel-body">

												<div class="row">
													<div class="form-group col-md-6">
														<label for="avista">Digite o Valor do Pagamento A vista</label>
														<input class="form-control money" id="sinal" money > 
													</div>

													<div class="form-group col-md-6">
														<label for="data_sinal">Digite a data do Pagaemento A vista</label>
														<input type="date" min="<?php echo($today) ?>" class="form-control" id="data_sinal" > 
													</div>
												</div>

												<div class="acc-wizard-step">
													<button class="btn btn-success" type="submit">Próxima Etapa</button>
												</div>
											</div>  -->

											<div class="panel-body">

												<div class="row">
													<div class="form-group col-md-6">
					                              <!-- <label for="avista">Digite o Valor do Pagamento A vista</label>
					                              	<input class="form-control money" id="sinal" money > --> 
					                              	<label for="avista">Selecione Uma opção</label>
					                              	<select class="form-control" id="sinal">
					                              		<option value="-1">Selecione</option>
					                              		<?php 
					                              		$query_aux = mysqli_query($db, "SELECT *, CAST(((CAST(`desconto_empreendimento` AS DECIMAL(10,2)) * ".$dados[0]['valor_lote'].") / 100) AS DECIMAL(10,2)) AS desconto FROM `desconto_empreendimento` WHERE `empreendimento_id` = ".$dados[0]['idempreendimento']." ORDER BY CAST(`parcela_max` AS UNSIGNED INTEGER) ASC");

					                                    // echo "SELECT *, CAST(((CAST(`desconto_empreendimento` AS DECIMAL(10,2)) * ".$dados[0]['valor_lote'].") / 100) AS DECIMAL(10,2)) AS desconto FROM `desconto_empreendimento` WHERE `empreendimento_id` = ".$dados[0]['idempreendimento']." ORDER BY CAST(`parcela_max` AS UNSIGNED INTEGER) DESC";
					                                    // die();

					                              		$ultima_parc = 1;
					                              		while ($assoc_aux = mysqli_fetch_assoc($query_aux)) {

					                              			if(($ultima_parc < $assoc_aux['parcela_max']) || $ultima_parc == 1 ){
					                              				for ($i = $ultima_parc; $i <= $assoc_aux['parcela_max'] ; $i++) { 
					                              					$ultima_parc = $i + 1;

					                              					$valor_aux = ($dados[0]['valor_lote'] - $assoc_aux['desconto'])/$i;

					                              					?>
					                              					<option qnt="<?php echo $i; ?>" valor="<?php echo $valor_aux ?>" desconto="<?php echo $assoc_aux['desconto']; ?>"><?php echo $i; ?> x R$ <?php echo number_format(round($valor_aux, 2), 2, ',', '.') ?></option>
					                              					<?php
					                              				}
					                              			}

					                              		}

					                              		?>                                
					                              	</select>
					                              </div>

					                              <div class="form-group col-md-6">
					                              	<label for="data_sinal">Digite a data do Pagaemento A vista</label>
					                              	<input type="date" min="<?php echo($today) ?>" value="<?php echo($today) ?>" class="form-control" id="data_sinal" > 
					                              </div>
					                          </div>

					                          <div class="acc-wizard-step">
					                          	<button class="btn btn-success" type="submit">Próxima Etapa</button>
					                          </div>
					                      </div> 
										</div> 
									</div>

									<div class="panel panel-inverse parcelado">
										<div class="panel-heading" style="height: 150%;">
											<h4 class="panel-title">
												<a href="#entrada" class="animate-text" data-parent="#accordion-demo" data-toggle="collapse" style="text-transform: uppercase; font-size: 14px;">
													Parcelas de Entrada
												</a>
											</h4>
										</div>
										<div id="entrada" class="panel-collapse collapse" style="height: 36.4px;">
											<div class="panel-body">
												<div class="form-group" id="modifica_entrada_original">

													<label for="parcelamento_entrada">Selecione a Forma de Entrada</label>
													<select class="form-control" id="parcelamento_entrada">
														<option value="-1">Selecione</option>
														<option qnt='1' valor='<?php echo($dados[0]["valo_minimo_entrada"]) ?>'>1 x R$ <?php echo number_format($dados[0]["valo_minimo_entrada"], 2,",",".") ?></option>
														<?php 

														for ($i = 0 ; $i < ($dados[0]['parcela_entrada'] - 1) ; $i++) { 

															$valor_parcela = Price($dados[0]["valo_minimo_entrada"], ($i+2), $dados[0]["taxa_entrada"]);

															?>
															<option qnt='<?php echo($i+2) ?>' valor='<?php echo(round($valor_parcela, 2)) ?>'><?php echo ($i+2).' x  R$ '.number_format(round($valor_parcela, 2), 2, ',', '.') ; ?></option>                                                                    
															<?php
														}

														?>
													</select>
												</div>

												<div class="form-group" id="modifica_entrada_original">
													<label>Selecione a data da 1º Parcela</label>
													<input type="date" min="<?php echo($today) ?>" value="<?php echo($today) ?>" name="data_entrada" id="data_entrada" class="form-control">
												</div>


												<label><input type="checkbox" id="modifica_entrada" value="modifica_entrada"> Desejo Escolher A Entrada</label>

												<div class="row hidden" id="modifica_entrada">
													<div class="form-group col-md-6">
														<label style="color: #000; font-size: 14px;">Valor Restante</label>
														<input type="text" class="form-control incompleto" style=" font-size: 18px; font-weight: bold;" name="valor_restante_entrada" id="valor_restante_entrada" disabled value="<?php echo  'R$ '.number_format($dados[0]["valo_minimo_entrada"], 2, ',', '.'); ?>" valor-total="<?php echo $dados[0]["valo_minimo_entrada"] ;?>" valor-total-price="<?php echo $dados[0]["valo_minimo_entrada"] ;?>">
													</div>
													<div class="col-md-6" style="padding-top: 2%;">
														<button type="button" class="btn btn-success" id="add_parcela_entrada">Adicionar Parcela</button>
													</div>
												</div>

												<div class="row hidden" id="modifica_entrada" style="overflow-x: scroll;">
													<table class="table table-striped" >
														<thead>
															<tr>           
																<th>Valor Total</th>
																<th>Vencimento 1 Parcela</th>
																<th>Intervalo Dias</th>
																<th>Quantidade Parcelas</th>
																<th>Ação</th>
															</tr>
														</thead>
														<tbody id="pacelas_entrada">

															<tr class="hidden">
																<td>
																	<input type="text" name="valor_parcela_entrada" class="form-control money" value="R$ 0,00" style="width: 180px!important;">
																</td>

																<td>
																	<input type="date" min="<?php echo($today);?>" class="form-control date" name="venc_parcela_entrada" value="<?php echo($today);?>" placeholder="Vencimento Parcela" />
																</td>

																<td>
																	<input type="number" name="intervalo_entrada" placeholder="Valor em Dias" class="form-control" value="30" style="width: 80px!important;">
																</td>

																<td>
																	<input type="number" name="qnt_entrada" class="form-control" value="1">
																</td>

																<td>
																	<button href="#" class="btn btn-danger remove_entrada" >Excluir</button>
																</td>
															</tr>
														</tbody>
													</table>
												</div>

												<div class="acc-wizard-step">
													<button class="btn btn-success" type="submit">Próxima Etapa</button>
												</div>
											</div> 
										</div> 
									</div>

									<?php 


									if($dados[0]['status_ativo'] == '1'){
										?>

										<div class="panel panel-inverse hidden">
											<div class="panel-heading" style="height: 150%;">
												<h4 class="panel-title">
													<a href="#intermediaria"  class="animate-text" data-parent="#accordion-demo" data-toggle="collapse" style="text-transform: uppercase; font-size: 14px;">
														Parcelas Intermediárias
													</a>
												</h4>
											</div>
											<div id="intermediaria" class="panel-collapse collapse" style="height: 36.4px;">
												<div class="panel-body">
													<div class="form-group" id="modifica_inter_original">

														<label for="parcelamento_inter">Selecione a Forma de Intermediaria</label>
														<select class="form-control" id="parcelamento_inter">
															<option>Selecione</option>
															<option qnt='1' valor='<?php echo($dados[0]["valor_minimo_inter"]) ?>'>1 x R$ <?php echo number_format($dados[0]["valor_minimo_inter"], 2, ',', '.'); ?></option>
															<?php 

															for ($i = 0 ; $i < 9 ; $i++) { 

																$valor_parcela = Price($dados[0]["valor_minimo_inter"], ($i+2), $dados[0]["taxa_inter"]);

																?>
																<option qnt='<?php echo($i+2) ?>' valor='<?php echo(round($valor_parcela, 2)) ?>'><?php echo ($i+2).' x R$ '.number_format(round($valor_parcela, 2), 2, ',', '.') ; ?></option>                                                                    
																<?php
															}

															?>
														</select>
													</div>

													<div class="row" id="modifica_inter_original">
														<div class="form-group col-md-6" >
															<label>Selecione a data da 1º Parcela</label>
															<input type="date" min="<?php echo($today) ?>" name="data-inter" id="data_inter" class="form-control">
														</div>

														<div class="form-group col-md-6">
															<label>Informe o Periodo (mês)</label>
															<input type="number" name="intervalo-inter" id="intervalo-inter" class="form-control" value="1">
														</div>
													</div>



													<?php 
													if($dados[0]['trava_inter'] != 1){
														?>
														<label><input type="checkbox" value="modifica_inter"> Desejo Escolher A Intermediaria</label>
														<?php
													}
													?>

													<div class="row hidden" id="modifica_inter">
														<div class="form-group col-md-6">
															<label style="color: #000; font-size: 14px;">Valor Restante</label>
															<input type="text" class="form-control incompleto" style=" font-size: 18px; font-weight: bold;" name="valor_restante_intermediaria" id="valor_restante_intermediaria" disabled value="<?php echo  'R$ '.number_format($dados[0]['valor_minimo_inter'], 2, ',', '.'); ?>" valor-total="<?php echo $dados[0]['valor_minimo_inter'] ;?>" valor-total-price="<?php echo $dados[0]["valor_minimo_inter"] ;?>">
														</div>
														<div class="col-md-6" style="padding-top: 2%;">
															<button type="button" class="btn btn-success" id="add_parcela_intermediaria">Adicionar Parcela</button>
														</div>
													</div>

													<div class="row hidden" id="modifica_inter" style="overflow-x: scroll;">
														<table class="table table-striped" >
															<thead>
																<tr>           
																	<th>Valor Total</th>
																	<th>Vencimento Parcela</th>
																	<th>Intervalo</th>
																	<th>Quantidade Parcelas</th>
																	<th>Ação</th>
																</tr>
															</thead>
															<tbody id="intermediaria">

																<tr class="hidden">
																	<td>
																		<input type="text" name="valor_parcela_intermediaria" class="form-control money" value="R$ 0,00">
																	</td>

																	<td>
																		<input type="date" min="<?php echo($today) ?>" class="form-control date" name="venc_parcela_intermediaria" value="" placeholder="Vencimento Parcela" />
																	</td>

																	<td>
																		<input type="number" name="intervalo_intermediaria" class="form-control" value="30">
																	</td>

																	<td>
																		<input type="number" name="qnt_intermediaria" class="form-control" value="1">
																	</td>

																	<td>
																		<button class="btn btn-danger remove_intermediaria" >Excluir</button>
																	</td>
																</tr>
															</tbody>
														</table>
													</div>

													<div class="acc-wizard-step">
														<button class="btn btn-success" type="submit">Próxima Etapa</button>
													</div>
												</div> 
											</div> 
										</div>

										<?php
									}

									?>

									<?php 
									if($dados[0]['status_parc_unica'] == '1'){
										?>

										<div class="panel panel-inverse hidden">
											<div class="panel-heading" style="height: 150%;">
												<h4 class="panel-title">
													<a href="#parcela_unica" class="animate-text" data-parent="#accordion-demo" data-toggle="collapse" style="text-transform: uppercase; font-size: 14px;">
														Parcela Única
													</a>
												</h4>
											</div>
											<div id="parcela_unica" class="panel-collapse collapse" style="height: 36.4px;">
												<div class="panel-body">
													<div class="form-group">
														<label for="parcela_unica">Digite o Valor da Parcela Unica</label>
														<input class="form-control money" id="parcela_unica" value="R$ 0,00" >  
													</div>

													<div class="acc-wizard-step">
														<button class="btn btn-success" type="submit">Próxima Etapa</button>
													</div>
												</div> 
											</div> 
										</div>

										<?php
									}

									?>

									<div class="panel panel-inverse parcelado">
										<div class="panel-heading" style="height: 150%;">
											<h4 class="panel-title">
												<a href="#parcelamento" class="animate-text" data-parent="#accordion-demo" data-toggle="collapse" style="text-transform: uppercase; font-size: 14px;">
													Parcelas Financiamento
												</a>
											</h4>
										</div>
										<div id="parcelamento" class="panel-collapse collapse" style="height: 36.4px;">
											<div class="panel-body">

												<div class="row" style="margin-bottom: 15px;">
													<div class="form-group row col-md-5" style="padding: 0px;">
														<label for="data-financiamento" class="col-md-5 col-form-label" style="padding-top: 2%;">Data 1ª Parcela</label>
														<div class="col-md-7" style="padding: 0px;">
															<input class="form-control col-md-8" type="date" min="<?php echo($today) ?>" id="data-financiamento" name="data-primeira">
														</div>
													</div>

													<div class="form-check form-check-inline col-md-4 hidden" id="forma-juros" align="center" style="padding: 0px;">
														<?php 

														$total = 0;

														$total += $dados[0]['price'];
														$total += $dados[0]['sac'];
														$total += $dados[0]['semjuros'];


														if($dados[0]['price'] == 1){
															?>
															<input class="form-check-input" type="radio" name="armotiza" id="price" value="1" <?php if($total < 2){echo "checked disabled";} ?>>
															<label class="form-check-label" for="price">Price</label>
															<?php
														}   

														if($dados[0]['sac'] == 1){
															?>
															<input class="form-check-input" type="radio" name="armotiza" id="sac" value="1" <?php if($total < 2){echo "checked disabled";} ?>>
															<label class="form-check-label" for="sac">SAC</label>
															<?php
														}

														if($dados[0]['semjuros'] == 1){
															?>
															<input class="form-check-input" type="radio" name="armotiza" id="semjuros" value="1" <?php if($total < 2){echo "checked disabled";} ?>>
															<label class="form-check-label" for="semjuros">Sem Juros</label>
															<?php
														} 
														?>
													</div>

													<div class="col-md-2 hidden" id="taxa_financiamento_vdd" style="padding: 0px;">
														<label>Taxa Juros (mensal)</label>
														<input type="text" class="form-control" name="taxa_financiamento_vdd" id="taxa_financiamento_vdd" value="<?php echo($dados[0]['juros_financiamento']);  ?>"  <?php if($dados[0]['trava_financiamento'] == 1){echo "disabled";} ?>>
													</div>
												</div>

												<div class="form-group row cold-md-6 hidden" id="modifica_financiamento_original">

													<label for="parcelamento_financiamento">Selecione a Forma do Financiamento</label>
													<select class="form-control" id="parcelamento_financiamento">
													</select>
												</div>

												<div class="form-group hidden cold-md-6" id="modifica_financiamento_sac">
													<button type="button" class="btn btn-success" id="SAC-modal" data-toggle="modal" data-target="#modalSAC">Ver Parcelas</button>
												</div>

											</div> 
										</div> 
									</div>

									<div class="panel panel-inverse">
										<div class="panel-heading" style="height: 150%;">
											<h4 class="panel-title">
												<a href="#cad-cliente" class="animate-text" data-parent="#accordion-demo" data-toggle="collapse" style="text-transform: uppercase; font-size: 14px;">
													Cadastro de Cliente
												</a>
											</h4>
										</div>
										<div id="cad-cliente" class="panel-collapse collapse" style="height: 36.4px;">
											<div class="panel-body">
												<form method="POST" id="cad-cliente">

													<select id="select" class="hidden">
														<option value="-1"></option>
													</select>

													<span style="font-style: italic; font-size: 18px;">Informações da Venda</span>
													<span class="info-span" style="float: right;">* Campos Obrigatórios</span>

													<hr/>
													<div class="row">
														<div class="form-group col-md-6">
															<label for="cod-corretor" class="destaque">Nº Corretor *</label>
															<input type="text" name="cod-corretor" class="form-control" required value="1">
														</div>
													</div>

													<span class="info-span">Informações Pessoais</span>
													<hr/>

													<div class="row">
														<div class="form-group col-md-6">
															<label for="cpf" class="destaque">CPF *</label>
															<input type="text" name="cpf" class="form-control" required id="masked-input-cpf">
														</div>
														<div class="form-group col-md-6">
															<label for="nome" class="destaque">Nome *</label>
															<input type="text" name="nome" class="form-control" required id="nome">
														</div>
													</div>

													<div class="row">
														<div class="form-group col-md-6">
															<label for="cod-corretor" class="destaque">Telefone *</label>
															<input type="number" name="telefone" class="form-control" required id="cod-corretor">
														</div>
														<div class="form-group col-md-6">
															<label for="email" class="destaque">E-mail</label>
															<input type="email" name="email" class="form-control" id="email">
														</div>
													</div>

													<span style="font-style: italic; font-size: 18px;">Informações Endereço</span>
													<hr/>

													<div class="row">
														<div class="form-group col-md-6">
															<label for="cep" class="destaque">CEP *</label>
															<input type="number" name="cep" required class="form-control" id="cep">
														</div>
														<div class="form-group col-md-6">
															<label for="rua" class="destaque">Rua *</label>
															<input type="text" name="rua" class="form-control" required id="rua">
														</div>
													</div>

													<div class="row">
														<div class="form-group col-md-6">
															<label for="numero" class="destaque">Número *</label>
															<input type="number" name="numero" class="form-control" required id="numero">
														</div>
														<div class="form-group col-md-6">
															<label for="cidade" class="destaque">Cidade *</label>
															<input type="text" name="cidade" class="form-control" required id="cidade">
														</div>
													</div>

													<div class="row">
														<div class="form-group col-md-6">
															<label for="bairro" class="destaque">Bairro *</label>
															<input type="text" name="bairro" required class="form-control" id="bairro">
														</div>

														<div class="form-group col-md-6">
															<label for="estado" class="destaque">Estado *</label>
															<input type="text" name="estado" class="form-control" required id="estado">
														</div>
													</div>

													<div>
														<button class="btn" type="submit" style="background-color: #047b6e; color: #FFF;">Salvar Cliente</button>
														<span class="" style="font-size: 16px; font-style: italic; color: red; float: right;" id="status-cli">
															Cliente não Cadastrado!
														</span>
													</div>
												</form>
											</div> 
										</div> 
									</div>

								</div>
							</div>
						</div>
					</div> 

					<div class="alert alert-success col-md-4 shadow" style="padding: 10px; background-color:#FFF; color: #000; height: 250px;">
						<div class="row" id="demonstrativo_1">
							<h4 class="alert-heading" style="text-align: center; font-size: 24px; font-weight: 600;">SIMULAÇÃO DE VENDA</h4>
							<form >

								<div class="form-group hidden avista" style="margin: 2px;">
									<strong>Desconto</strong>
									<input type="text" id='exibe_desconto' class="form-control" style="color: #000; font-weight: 600; font-size: 18px;" disabled value="R$ 0,00">
								</div>

								<div class="form-group  hidden avista" style="margin: 2px;">
									<strong>A vista</strong>
									<input type="text" id='exibe_avista' class="form-control" style="color: #000; font-weight: 600; font-size: 18px;" disabled value="R$ 0,00">
								</div>

								<div class="form-group parcelado" style="margin: 2px;">
									<strong>Entrada:</strong>
									<input type="text" class="form-control" id="exibe_entrada" style="color: #000; font-weight: 600; font-size: 18px;" disabled value="R$ 0,00">
								</div>


								<?php 

								if($dados[0]['status_ativo'] == '1'){
									?>
									<div class="form-group hidden" style="margin: 2px;">
										<strong>Intermediaria:</strong>
										<input type="text" class="form-control" id="exibe_intermediaria" style="color: #000; font-weight: 600; font-size: 18px;" disabled value="R$ 0,00">
									</div>
									<?php
								}
								?>

								<?php 

								if($dados[0]['status_parc_unica'] == '1'){
									?>
									<div class="form-group hidden" style="margin: 2px;">
										<strong>Parcela Unica:</strong>
										<input type="text" class="form-control" id="exibe_unica" style="color: #000; font-weight: 600; font-size: 18px;" disabled value="R$ 0,00">
									</div>
									<?php
								}
								?>



								<div class="form-group parcelado" style="margin: 2px;">
									<strong>Financiamento:</strong>
									<input type="text" id="exibe_total_fin" class="form-control" style="color: #000; font-weight: 600; font-size: 18px;" disabled value="R$ 0,00">
								</div>

								<div class="form-group" style="margin: 2px;">
									<strong>Valor do Lote:</strong>
									<input type="text" class="form-control" style="color: green; font-weight: 600; font-size: 18px;" id="exibe_valor_lote" disabled valor="<?php echo $dados[0]['valor_lote']; ?>" value="<?php echo 'R$ '.number_format($dados[0]['valor_lote'], 2, ',', '.') ?>">
								</div>

								<div class="form-group" style="margin: 2px;">
									<strong>Saldo Devedor:</strong>
									<input type="text" id="exibe_financiamento" class="form-control" style="color: red; font-weight: 600; font-size: 18px;" disabled value="<?php echo 'R$ '.number_format($dados[0]['valor_lote'], 2, ',', '.') ?>" valor-financiamento="<?php echo $dados[0]['valor_lote']; ?>">
								</div>
							</form>
						</div>

						<div class="row">
							<div class="col-xs-7">
								<button type="button" class="btn btn-success" id="gera_pdf_demonstrativo" style="margin-top: 3%; border: none;">Enviar Proposta</button>
							</div>

							<div class="col-xs-5">
								<!-- <button type="button" class="btn btn-success primeiraModal" name="age" id="age" data-toggle="modal" data-target="#add_data_Modal" style="margin-top: 3%;">Cadastrar Cliente</button> -->

								<!-- <button type="button" class="btn btn-warning" data-toggle="modal" data-target="#modal-cliente" style="margin-top: 5%;  border: none;">Clientes</button> -->
							</div>

							<input type="text" class="hidden" id="id-user">
						</div>
					</div>
				</div>
			</div> 

			<div class="fab">
				<button class="main" data-toggle="modal" data-target="#modal-simulacao">
				</button>
			</div>
		</div>
	</div>

	<div class="modal" role="dialog" id="modalSAC">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<h5 class="modal-title">Financiamento pela Price</h5>
					<button type="button" class="close" data-dismiss="modal" aria-label="Fechar">
						<span aria-hidden="true">&times;</span>
					</button>
				</div>
				<div class="modal-body">
					<div class="form-group">
						<label>Quantidade Parcelas</label>
						<input class="form-control" type="number" name="quantidade_parc_sac" id="quantidade_parc_sac">
					</div>

					<div class="row" id="finan_sac" style="overflow-y: scroll; height: 400px;">
						<table class="table table-striped" >
							<thead>
								<tr>           
									<th>Parcela Número</th>
									<th>Valor Parcela</th>
									<th>Vencimento</th>
								</tr>
							</thead>
							<tbody id="finan_sac">

								<tr class="hidden">
									<td>
									</td>

									<td>
									</td>

									<td>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>

	<div id="modal-aviso" class="modal fade" role="dialog">
		<div class="modal-dialog">
			<!-- Modal content-->
			<div class="modal-content" >
				<div class="modal-body">
					<h3 style="text-align: center; color: red;">Preencha corretamente toda Simulação!</h3>
				</div>
				<div class="modal-footer" >
					<button type="button" class="btn btn-defaut" data-dismiss="modal" >Fechar</button>
				</div>
			</div>
		</div>
	</div>

	<div id="modal-simulacao" class="modal fade" role="dialog">
		<div class="modal-dialog">
			<!-- Modal content-->
			<div class="modal-content" >
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Fechar">
						<span aria-hidden="true">&times;</span>
					</button>
				</div>
				<div class="modal-body" style="height: 550px;" id="demonstrativo_2">
					<div class="alert alert-success col-md-12 shadow" style="padding: 10px; background-color:#FFF; color: #000; height: 250px;">
						<h4 class="alert-heading" style="text-align: center; font-size: 24px; font-weight: 600;">SIMULAÇÃO DE VENDA</h4>
						<form >

							<div class="form-group hidden" style="margin: 2px;">
								<strong>Desconto</strong>
								<input type="text" id='exibe_desconto' class="form-control" style="color: #000; font-weight: 600; font-size: 18px;" disabled value="R$ 0,00">
							</div>

							<div class="form-group" style="margin: 2px;">
								<strong>A vista</strong>
								<input type="text" id='exibe_avista' class="form-control" style="color: #000; font-weight: 600; font-size: 18px;" disabled value="R$ 0,00">
							</div>

							<div class="form-group" style="margin: 2px;">
								<strong>Entrada:</strong>
								<input type="text" class="form-control" id="exibe_entrada" style="color: #000; font-weight: 600; font-size: 18px;" disabled value="R$ 0,00">
							</div>


							<?php 

							if($dados[0]['status_ativo'] == '1'){
								?>
								<div class="form-group hidden" style="margin: 2px;">
									<strong>Intermediaria:</strong>
									<input type="text" class="form-control" id="exibe_intermediaria" style="color: #000; font-weight: 600; font-size: 18px;" disabled value="R$ 0,00">
								</div>
								<?php
							}
							?>

							<?php 

							if($dados[0]['status_parc_unica'] == '1'){
								?>
								<div class="form-group hidden" style="margin: 2px;">
									<strong>Parcela Unica:</strong>
									<input type="text" class="form-control" id="exibe_unica" style="color: #000; font-weight: 600; font-size: 18px;" disabled value="R$ 0,00">
								</div>
								<?php
							}
							?>



							<div class="form-group" style="margin: 2px;">
								<strong>Financiamento:</strong>
								<input type="text" id="exibe_total_fin" class="form-control" style="color: #000; font-weight: 600; font-size: 18px;" disabled value="R$ 0,00">
							</div>

							<div class="form-group" style="margin: 2px;">
								<strong>Valor do Lote:</strong>
								<input type="text" class="form-control" style="color: green; font-weight: 600; font-size: 18px;" id="exibe_valor_lote" disabled valor="<?php echo $dados[0]['valor_lote']; ?>" value="<?php echo 'R$ '.number_format($dados[0]['valor_lote'], 2, ',', '.') ?>">
							</div>

							<div class="form-group" style="margin: 2px;">
								<strong>Saldo Devedor:</strong>
								<input type="text" id="exibe_financiamento" class="form-control" style="color: red; font-weight: 600; font-size: 18px;" disabled value="<?php echo 'R$ '.number_format($dados[0]['valor_lote'], 2, ',', '.') ?>" valor-financiamento="<?php echo $dados[0]['valor_lote']; ?>">
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>

	<div id="modal-sucesso-cliente" class="modal fade" role="dialog">
		<div class="modal-dialog">
			<!-- Modal content-->
			<div class="modal-content" >
				<div class="modal-body">
					<h3 style="text-align: center;">Sucesso ao Cadastrar o cliente!</h3>
				</div>
				<div class="modal-footer" >
					<button type="button" class="btn btn-defaut" data-dismiss="modal" >Fechar</button>
				</div>
			</div>
		</div>
	</div>

	<div id="modal7" class="modal fade" role="dialog">
		<div class="modal-dialog">
			<!-- Modal content-->
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" id="close">&times;</button>
				</div>
				<div class="modal-body" id="salvar" align="center">
					<h4 class="modal-title" align="center" id="salvar">Salvo com sucesso!</h4>
				</div>
				<div class="modal-footer" id="footer_salvar">
					<button type="button" class="btn btn-defaut" data-dismiss="modal" >Fechar</button>
				</div>
			</div>
		</div>
	</div>

	<div id="modal-cliente" class="modal fade" role="dialog">
		<div class="modal-dialog">
			<!-- Modal content-->
			<div class="modal-content">
				<div class="modal-header">
					<div class="row">
						<div class="col-md-8">
							<h3 class="modal-title">Apresentação de Clientes</h3>
						</div>
						<div class="col-md-2">
							<button type="button" class="btn btn-primary primeiraModal" name="age" id="age" data-toggle="modal" data-target="#add_data_Modal">Cadastrar Cliente</button>
						</div>
						<div class="col-md-2">
							<button type="button" class="close" data-dismiss="modal" id="close">&times;</button>
						</div>

					</div>

				</div>
				<div class="modal-body">
					<div class="form-group">
						<label>Cliente (Titular)</label>
						<select class="default-select2 form-control" id="select" name="cliente_idcliente" required="" style="width: 100%;">
							<option value="-1">Escolha</option>
						</select>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-success" data-dismiss="modal" >Continuar</button>
				</div>
			</div>
		</div>
	</div>

	<script src="https://immobilebusiness.com.br/admin/assets/plugins/jquery/jquery-1.9.1.min.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/js/apps.min.js"></script>
	<script src="js/acc-wizard.js"></script>
	<script src="js/price.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/jquery/jquery-migrate-1.1.0.min.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/jquery-ui/ui/minified/jquery-ui.min.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/slimscroll/jquery.slimscroll.min.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/jquery-cookie/jquery.cookie.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/js/form-plugins.demo.min.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/ionRangeSlider/js/ion-rangeSlider/ion.rangeSlider.min.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/ionRangeSlider/js/ion-rangeSlider/ion.rangeSlider.min.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/bootstrap-timepicker/js/bootstrap-timepicker.min.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/password-indicator/js/password-indicator.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/bootstrap-combobox/js/bootstrap-combobox.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/bootstrap-select/bootstrap-select.min.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/bootstrap-tagsinput/bootstrap-tagsinput.min.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/bootstrap-tagsinput/bootstrap-tagsinput-typeahead.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/jquery-tag-it/js/tag-it.min.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/bootstrap-daterangepicker/moment.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/bootstrap-daterangepicker/daterangepicker.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/select2/dist/js/select2.min.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/bootstrap-eonasdan-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/js/form-plugins.demo.min.js"></script>
	<script src="https://immobilebusiness.com.br/admin/assets/plugins/masked-input/masked-input.min.js"></script>
	<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
	<script src="js/acc-wizard.js"></script>


	<script>

		const num_financiamento = <?php echo $dados[0]["plano_p"] ; ?>;
		const taxa_financiamento = <?php echo $dados[0]["taxa_financiamento"] ; ?>;
		const juros_entrada = <?php echo $dados[0]["taxa_entrada"] ; ?>;
		const taxa_inter = <?php echo $dados[0]['taxa_inter']; ?>;
		const percentual_inter = <?php echo $dados[0]['percen_lote']; ?>;
		const DAY = 24 * 60 * 60 * 1000;

		const corretor = <?php echo 1; ?>;
		const lote_id = <?php echo $lote; ?> ;
		const indice_correcao = <?php echo $dados[0]['indice_correcao']; ?> ;

		$(document).ready(function() {
			App.init();
			FormPlugins.init();

			 $('#cpf').mask('000.000.000-00');
		});
	</script>
	<script src="js/new_venda.js"></script>
	<script src="js/cad_cliente_simulacao.js"></script>
	<!-- <script src="js/modais_jean.js"></script> -->
</body>
</html>