<div class="animated fadeIn page-incorporadora">
    
    <input class="incorporadora" type="hidden" data-incorporadora='<?php e(json_encode($incorporadora))?>'>
    <input class="id_empreendimento" type="hidden" data-id_empreendimento="<?php e($empreendimento->id_empreendimento)?>">
    <input class="id_imovel" type="hidden" data-id_imovel="<?php e($imovel->id_imovel??'')?>">
    <input class="id_config" type="hidden" data-id_config="<?php e($lpConfig->id_config??'')?>">
    <input class="id_inv_midia" type="hidden" data-id_inv_midia="<?php e($lpConfig->id_inv_midia??'')?>">
    
    <div class="row">
        <div class="col-md-6 col-lg-4">
            
            
            
            
            
            
            <div class="card">
                <div class="card-header">Incorporadora: <a href="<?php e(base_url("administrativo/incorporadora/resumo/").$incorporadora->id_incorporadora); ?>"><?php e($incorporadora->razao_social); ?></a></div>
                <div class="card-body">
                    
                    
                <!-------------Card Moderacao-------------------------- -->   
                <?php if($imovel !== null){ ?>
                    <?php if ($imovel->lixeira > 0 ){ ?>
                        <div class="card text-white <?php e($bgLixeira)?> ">
                            <div class="card-body">
                                <div class="text-value"><?php e($statusLixeira)?></div>
                                <div>Status: <?php e(HImovel::getStatus($imovel->status)->text)?></div>
                                <div class="progress progress-white progress-xs my-2">
                                <!--<div class="progress-bar" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>-->
                                </div>
                                    
                                <a href="#" class="btn btn-sm btn-info btnRestaurarImovel">Restaurar</a>
                                    
                                <?php if ($imovel->status != 2): ?>
                                    <a href="#" class="btn btn-sm btn-warning btnModerarImovel">Enviar para Moderação</a>
                                <?php endif; ?>
                                <?php if ($imovel->status != 3): ?>
                                    <a href="#" class="btn btn-sm btn-success btnPublicarImovel">Publicar</a>
                                <?php endif; ?>
                                <?php if ($imovel->status != 4): ?>
                                    <a href="#" class="btn btn-sm btn-danger" type="button" data-toggle="modal" data-target="#dangerModal">Bloquear</a> 
                                <?php endif; ?>
                            </div>
                        </div>
                    <?php }else{ ?>
                        <div class="card text-white <?php e(HImovel::getStatus($imovel->status)->bdg)?> ">
                            <div class="card-body">
                                <div class="text-value"><?php e(HImovel::getStatus($imovel->status)->text)?></div>
                                <div>...</div>
                                <div class="progress progress-white progress-xs my-2">
                                <!--<div class="progress-bar" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>-->
                                </div>
                                <?php if ($imovel->status != 2): ?>
                                    <a href="#" class="btn btn-sm btn-warning btnModerarImovel">Enviar para Moderação</a>
                                <?php endif; ?>
                                <?php if ($imovel->status != 3): ?>
                                    <a href="#" class="btn btn-sm btn-success btnPublicarImovel">Publicar</a>
                                <?php endif; ?>
                                <?php if ($imovel->status != 4): ?>
                                    <a href="#" class="btn btn-sm btn-danger" type="button" data-toggle="modal" data-target="#dangerModal">Bloquear</a> 
                                <?php endif; ?>
                            </div>
                        </div>
                    <?php } ?>
                <?php } ?>
                    <!-----FIM-----Card Moderacao-------------------------- --> 
                    
                    <div id="accordion">
                        <div class="form-group">
                            <h5><a class="text-dark" data-toggle="collapse" href="#collapseEmpreendimento" aria-expanded="true" aria-controls="collapseEmpreendimento">Empreendimento: <?php e($empreendimento->uuid_empreendimento) ?></a></h5>
                            <hr>
                        </div>
                        <div class="collapse show" id="collapseEmpreendimento" aria-labelledby="collapseEmpreendimento" data-parent="#accordion">
                            <ul class="nav nav-pills flex-column" role="tablist">
                                <li class="nav-item">
                                    <a class="nav-link active" id="propostaEmpreendimento-tab" data-toggle="tab" href="#propostaEmpreendimento" role="tab" aria-controls="propostaEmpreendimento" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Proposta
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" id="cadastroEmpreendimento-tab" data-toggle="tab" href="#cadastroEmpreendimento" role="tab" aria-controls="cadastroEmpreendimento" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Empreendimento
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" id="enderecoEmpreendimento-tab" data-toggle="tab" href="#enderecoEmpreendimento" role="tab" aria-controls="enderecoEmpreendimento" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Endereço
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" id="responsavelEmpreendimento-tab" data-toggle="tab" href="#responsavelEmpreendimento" role="tab" aria-controls="responsavelEmpreendimento" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Responsável
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" id="parceiro-tab" data-toggle="tab" href="#parceiro" role="tab" aria-controls="parceiro" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        House/Imobiliária
                                    </a>
                                </li>
                            </ul>
                        </div>
                        
                        <div class="form-group mt-4">
                            <h5><a class="text-dark collapsed" data-toggle="collapse" href="#collapseAdmin" aria-expanded="true" aria-controls="collapseAdmin">Administrativo</a></h5>
                            <hr>
                        </div>
                        <div class="collapse" id="collapseAdmin" aria-labelledby="collapseAdmin" data-parent="#accordion">
                            <ul class="nav nav-pills flex-column" role="tablist">
                                <li class="nav-item">
                                    <a class="nav-link" id="roteiroAtendimento-tab" data-toggle="tab" href="#roteiroAtendimento" role="tab" aria-controls="adminEmpreendimento" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Roteiro de atendimento
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" id="arquivosEmpreendimento-tab" data-toggle="tab" href="#arquivosEmpreendimento" role="tab" aria-controls="adminEmpreendimento" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Arquivos
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" id="servicosEmpreendimento-tab" data-toggle="tab" href="#servicosEmpreendimento" role="tab" aria-controls="servicosEmpreendimento" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Serviços
                                    </a>
                                </li>
                            </ul>
                        </div>
                        
                        <div class="form-group mt-4">
                            <h5><a class="text-dark collapsed" data-toggle="collapse" href="#collapseImovel" aria-expanded="true" aria-controls="collapseImovel">Imóvel</a></h5>
                            <hr>
                        </div>
                        
                        <div class="collapse" id="collapseImovel" aria-labelledby="collapseImovel" data-parent="#accordion">
                            
                            <button class="btn btn-primary btn-sm btnAddImovel <?php e(($imovel == null)?"":"d-none") ?>" type="button"><i class="fa fa-plus"></i> Criar imóvel</button>
                        
                            <ul class="nav nav-pills flex-column checkImovel <?php e(($imovel == null)?"d-none":"") ?>" role="tablist">
                                <li class="nav-item">
                                    <a class="nav-link" id="faseEmpreendimento-tab" data-toggle="tab" href="#faseEmpreendimento" role="tab" aria-controls="faseEmpreendimento" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Fase do empreendimento
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" id="excelEmpreendimento-tab" data-toggle="tab" href="#excelEmpreendimento" role="tab" aria-controls="excelEmpreendimento" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Unidades - Excel
                                    </a>
                                </li>
                            </ul>
                        </div>
                        
                        <?php if($imovel !== null){ ?>
                        
                        <div class="form-group mt-4">
                            <h5><a class="text-dark collapsed" data-toggle="collapse" href="#collapseInversimentos" aria-expanded="true" aria-controls="collapseInversimentos">Financeiro</a></h5>
                            <hr>
                        </div>
                        
                        <div class="collapse" id="collapseInversimentos" aria-labelledby="collapseInversimentos" data-parent="#accordion">
                        
                            <ul class="nav nav-pills flex-column" role="tablist">
                                <li class="nav-item">
                                    <a class="nav-link" id="valoresEmpreendimento-tab" data-toggle="tab" href="#valoresEmpreendimento" role="tab" aria-controls="valoresEmpreendimento" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Valores
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" id="valoresMidias-tab" data-toggle="tab" href="#valoresMidias" role="tab" aria-controls="valoresMidias" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Mídias
                                    </a>
                                </li>
                            </ul>
                        </div>
                        
                        <div class="form-group mt-4">
                            <h5><a class="text-dark collapsed" data-toggle="collapse" href="#collapseLandingpage" aria-expanded="false" aria-controls="collapseLandingpage">Fluxo de captura</a></h5>
                            <hr>
                        </div>
                        <div class="collapse" id="collapseLandingpage" aria-labelledby="collapseLandingpage" data-parent="#accordion">
                        
                            <button class="btn btn-primary btn-sm btnCriaLp <?php e(($lpConfig !== null)?"d-none":"") ?>" type="button"><i class="fa fa-plus"></i> Criar página de captura</button>
                            
                            <?php if(($lpConfig !== null)){ ?>
                            
                            <div class="form-group mb-4">
                                <h6>Página de captura - Landing page</h66>
                                <hr>
                            </div>
                            
                            <a href="<?php e(base_url("lancamento/").$imovel->id_imovel); ?>" class="btn btn-primary btn-sm mb-4" type="button" target="_blank"><i class="fa fa-eye"></i> Visualizar LP</a>
                            
                            <ul class="nav nav-pills flex-column checkLpConfig" role="tablist">
                                <li class="nav-item">
                                    <a class="nav-link" id="cores-tab" data-toggle="tab" href="#cores" role="tab" aria-controls="cores" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Definição de cores
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" id="infoTopo-tab" data-toggle="tab" href="#infoTopo" role="tab" aria-controls="infoTopo" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Informações do topo
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" id="chamadaPromocional-tab" data-toggle="tab" href="#chamadaPromocional" role="tab" aria-controls="chamadaPromocional" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Chamada promocional
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" id="galeria-tab" data-toggle="tab" href="#galeria" role="tab" aria-controls="galeria" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Galeria
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" id="unidades-tab" data-toggle="tab" href="#unidades" role="tab" aria-controls="unidades" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Unidades
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" id="formulario-tab" data-toggle="tab" href="#formulario" role="tab" aria-controls="formulario" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Formulário
                                    </a>
                                </li>
                                <?php $sobre=0; if($sobre==1){ ?>
                                <li class="nav-item">
                                    <a class="nav-link" id="sobre-tab" data-toggle="tab" href="#sobre" role="tab" aria-controls="sobre" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Sobre
                                    </a>
                                </li>
                                <?php } ?>
                                <li class="nav-item">
                                    <a class="nav-link" id="diferenciais-tab" data-toggle="tab" href="#diferenciais" role="tab" aria-controls="diferenciais" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Diferenciais
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" id="comodidades-tab" data-toggle="tab" href="#comodidades" role="tab" aria-controls="comodidades" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Comodidades
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" id="rodape-tab" data-toggle="tab" href="#rodape" role="tab" aria-controls="rodape" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Rodapé
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" id="configSeo-tab" data-toggle="tab" href="#configSeo" role="tab" aria-controls="configSeo" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        SEO
                                    </a>
                                </li>
                            </ul>
                            
                            <div class="form-group mt-4">
                                <h6>Páginas de resultado</h6>
                                <hr>
                            </div>
                            <ul class="nav nav-pills flex-column" role="tablist">
                                <li class="nav-item">
                                    <a class="nav-link" id="paginaResultado-tab" data-toggle="tab" href="#paginaResultado" role="tab" aria-controls="paginaResultado" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Definições
                                    </a>
                                </li>
                            </ul>
                            
                            <div class="form-group mt-4">
                                <h6>Config</h6>
                                <hr>
                            </div>
                            <ul class="nav nav-pills flex-column" role="tablist">
                                <li class="nav-item">
                                    <a class="nav-link" id="fluxoEmails-tab" data-toggle="tab" href="#fluxoEmails" role="tab" aria-controls="fluxoEmails" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Fluxo de e-mails
                                    </a>
                                </li><!--
                                <li class="nav-item">
                                    <a class="nav-link" id="configSeo-tab" data-toggle="tab" href="#configSeo" role="tab" aria-controls="configSeo" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        SEO
                                    </a>
                                </li>-->
                                <li class="nav-item">
                                    <a class="nav-link" id="configTags-tab" data-toggle="tab" href="#configTags" role="tab" aria-controls="configTags" aria-selected="false">
                                        <span class="boxcheck"></span>
                                        Tags
                                    </a>
                                </li>
                            </ul>
                            
                            <?php } ?>
                        </div>
                        
                        <?php } ?>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-6 col-lg-8">
            <div class="tab-content">
                
                <?php e($ac_empreendimento); ?>
                
                <?php e($ac_administrativo); ?>
                
                <?php if ($imovel != null){ ?>
                
                    <?php e($ac_imovel); ?>
                    
                    <?php e($ac_investimento); ?>
                    
                    <?php if(($lpConfig !== null)){ e($ac_landingpage); } ?>
                
                <?php } ?>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="gerarContrato" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-primary" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">Gerar contrato</h4>
                <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
            </div>
            <div class="modal-body">
                <form action="" class="formGeraContrato">
                    <div class="form-group">
                        <label for="planos">Planos</label>
                        
                        <?php $i=1; $count = count($planos); foreach($planos as $plano){ ?>
                        <div class="form-check">
                            <input type="radio" name="id_plano" class="form-check-input" id="<?php e("plano-".$plano->id_plano) ?>" value="<?php e($plano->id_plano) ?>" <?php if($i==1) { ?>required="required" <?php } e($count==1?"checked":"")?> >
                            <label class="form-check-label" for="plano1"><?php e($plano->plano) ?> - <?php e($plano->comissao) ?>%</label>
                        </div>
                        <?php $i++; } ?>
                        
                    </div>
                    <div class="form-group">
                        <label for="con_link">Link do contrato no drive</label>
                        <input type="text" name="con_link" class="form-control" id="con_link" required="required">
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button class="btn btn-success btnGerarContrato" type="button" data-empreendimento ='<?php e(json_encode($empreendimento)); ?>' data-con_data='<?php e(date("Y-m-d H:i:s")); ?>'>Gerar</button>
                <button class="btn btn-outline-danger" type="button" data-dismiss="modal">Fechar</button>
            </div>
        </div>
    </div>
</div>

<!-- Modal -->
<div id="modalAceitaContrato" class="modal fade modal-aceita-contrato"  aria-hidden="true">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title">Contrato de prestação de serviço</h3>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <p>Estamos muito felizes com essa parceria de sucesso entre o Comdono e <?php e($empreendimento->emp_nome_fantasia); ?>.</p>
                <p><a href="<?php e($empreendimento->con_link); ?>" target="_blank">Clique aqui</a> para visualizar o contrato.</p>
                <p>Após ler e preencher os campos solicitados, marque "Li e aceito termos do contrato" e em seguida confirme.</p>
                <div class="content-form mt-4">
                    <form name="formContrato" id="formContrato" method="post">
                       
                        <div class="custom-control custom-checkbox">
                            <input type="checkbox" name="con_status" class="custom-control-input" id="con_status" value="Assinado" required="required">
                            <label class="custom-control-label" for="con_status">Li e aceito termos do contrato</label>
                        </div>
                        <div class="msgContrato"></div>
                        <div class="row mt-4">
                            <div class="offset-lg-8 col-lg-4">
                                <div class="form-group m-0">
                                    <button type="submit" class="btn btn-success m-0 btnContrato">Confirmar</button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>


<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAOAGU-4BBR5aS8X31cflK-7bp43EpHXsI&libraries=places" type="text/javascript" async defer></script>













<!-- /.fim -->