<div class="animated fadeIn">
    <div class="row">
        <div class="col-md-12">
            <div class="box-title-section">
                <div class="form-inline">
                    <div class="form-group">
                        <label class="mr-1 text-value text-primary">Aguardando Retorno Hoje</label>
                    </div>
                </div>
                <hr>
            </div>
        </div>
        <div class="col-md-12">
            <div class="row">
                
                <?php foreach($naoAguardandoRetorno as $notificacao ){ ?>
                
                <div class="col-md-2 col-sm-4">
                    <div class="card">
                        <div class="card-body text-center">
                            <div class="text-muted small text-uppercase font-weight-bold"><?php e($notificacao->name) ?></div>
                            <div class="text-value-lg py-3"><?php e($notificacao->qnt) ?></div>
                            <a href="<?php e($notificacao->link == ''?'#':base_url($notificacao->link)) ?>" _target="_blank" class="btn btn-sm btn-success" ><i class="icon-arrow-right-circle "></i> Atender</a>
                        </div>
                    </div>
                </div>
                
                <?php } ?>
                
            </div>
        </div>
    </div>
    
    <div class="row">
        <div class="col-md-12">
            <div class="box-title-section">
                <div class="form-inline">
                    <div class="form-group">
                        <label class="mr-1 text-value text-primary">Aguardando atendimento</label>
                    </div>
                </div>
                <hr>
            </div>
        </div>
        <div class="col-md-12">
            <div class="row">
                
                <?php foreach($naoAtendidas as $notificacao ){ ?>
                
                <div class="col-md-2 col-sm-4">
                    <div class="card">
                        <div class="card-body text-center">
                            <div class="text-muted small text-uppercase font-weight-bold"><?php e($notificacao->name) ?></div>
                            <div class="text-value-lg py-3"><?php e($notificacao->qnt) ?></div>
                            <a href="<?php e($notificacao->link == ''?'#':base_url($notificacao->link)) ?>" _target="_blank" class="btn btn-sm btn-success" ><i class="icon-arrow-right-circle "></i> Atender</a>
                        </div>
                    </div>
                </div>
                
                <?php } ?>
                
            </div>
        </div>
    </div>
    
    
    
    <div class="row">
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-header"><a href="#" data-toggle="collapse" data-target="#collapsePrecadastros" aria-expanded="false" class="collapsed"><i class="icon-user-follow"></i> Leads Signature Park Sul</a>
                            <div class="card-header-actions">
                                <a class="card-header-action btn-minimize" href="#" data-toggle="collapse" data-target="#collapsePrecadastros" aria-expanded="false" class="collapsed">
                                    <i class="icon-arrow-up"></i>
                                </a>
                            </div>
                        </div>
                        <div class="collapse show" id="collapsePrecadastros" data-parent="#accordion">
                            <div class="card-body">
                                <div class="table-container table-responsive">
                                    <table class="display table table-striped table-bordered" style="width:100%">
                                        <thead>
                                            <tr>
                                                <th>Nome</th>
                                                <th>E-mail</th>
                                                <th style="min-width: 85px;">Telefone</th>
                                                <th>Origem</th>
                                                <th>Data captura/envio de e-mail</th>
                                                <th>Unidade</th>
                                                <th>Situação</th>
                                                <th style="min-width: 130px;">Último atendimento</th>
                                                <th style="min-width: 130px;">Proximo atendimento</th>
                                                <th style="min-width: 185px;">Ação</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php foreach($capturas as $id=>$captura) { ?>
                                            
                                            <tr id="divImovel_<?php e($id) ?>" class="trData" data-atendimento='<?php e(json_encode($captura->atendimento)) ?>'>
                                                <td><?php e($captura->nome); ?></td>
                                                <td><?php e($captura->email); ?></td>
                                                <td><?php e($captura->telefone); ?></td>
                                                <td><?php e($captura->mensagem == ''?'Landingpage':$captura->mensagem); ?></td>
                                                <?php 
                                                    $nenv = '<span class="d-none">000000000</span>'.'<span class="badge badge-danger">Não enviado</span>'; 
                                                    $denv = '<span class="d-none">'.$captura->datetime_captura.'</span>'.(date("d/m/Y H:i:s", strtotime($captura->datetime_captura)));
                                                ?>
                                                <td><?php e($captura->datetime_captura == 0 ? $nenv:$denv); ?></td>
                                                
                                                <td><?php e($captura->tipo_imovel); ?></td>
                                                
                                                <td><?php e(HCaptura::lp('signature')->captura($captura)->bgStatus() ); ?></td>
                                                
                                                <td><p class="resumo-text m-0"><?php e(end($captura->atendimento)->observacao??''); ?></p></td>
                                                <?php 
                                                    $proximo_contato = end($captura->atendimento)->proximo_contato??'';
                                                    if($proximo_contato == 0 || $proximo_contato == '0000-00-00 00:00:00'){
                                                         $proximo_contato = '';
                                                         $alert = '<span class="d-none">z'.$proximo_contato.'</span>';
                                                    }else{
                                                        $alert = '<span class="d-none">a'.$proximo_contato.'</span>'.
                                                                 '<span class="badge badge-danger">'.date("d/m/Y", strtotime($proximo_contato)).'</span>';
                                                    }
                                                    $normal = '<span class="d-none">b'.$proximo_contato.'</span>'.(date("d/m/Y", strtotime($proximo_contato)));
                                                ?>
                                                <td>
                                                    <?php 
                                                    $proximo_contato = end($captura->atendimento)->proximo_contato??'';
                                                    if($proximo_contato == 0 || $proximo_contato == '0000-00-00 00:00:00'){
                                                         $proximo_contato = '';
                                                         $alert = '<span class="d-none">z'.$proximo_contato.'</span>';
                                                    }else{
                                                        $alert = '<span class="d-none">a'.$proximo_contato.'</span>'.
                                                                 '<span class="badge badge-danger">'.date("d/m/Y", strtotime($proximo_contato)).'</span>';
                                                    }
                                                    $normal = '<span class="d-none">b'.$proximo_contato.'</span>'.(date("d/m/Y", strtotime($proximo_contato)));
                                                    
                                                    e($proximo_contato <= date("Y-m-d H:i:s") ? $alert:$normal);
                                                    ?>
                                                </td>
                                               
                                                <td class="tdAction_<?php e($id) ?>" >
                                                    <span class='d-none'><?php e(empty($captura->atendimento) ? 0 : 1); ?></span>
                                                    
                                                    
                                                    <?php if(!empty($captura->atendimento)){ ?>
                                                    <a href="<?php e(base_url().'atendimento/interessado/'.$captura->atendimento[0]->id_atendimento).'/signature'; ?>" class="actAtendimento btn btn-success mb-1" data-id="<?php e($id); ?>" data-toggle="tooltip" data-original-title="Visualizar atendimento">
                                                        <i class="icon-check"></i>
                                                    </a>
                                                    <?php }else{ ?>
                                                    <a href="javascript:;" class="addAtendimentoGeral btn btn-primary mb-1" data-interesse="signature" data-atendimento='<?php e(json_encode($captura)) ?>' data-toggle="tooltip" data-original-title="Adicionar atendimento">
                                                        <i class="icon-plus"></i>
                                                    </a>
                                                    <?php } ?>
                                                    
                                                    <button type="button" class="btn btn-secondary copyLink mb-1" data-toggle="tooltip" data-original-title="Clique e Copie link para a página de ativação">
                                                        <i class="icon-link icons"></i>
                                                        <input class="linkToCopy" value="<?php e(base_url("landingpage/resultado/codigovipsignature/").$captura->key_captura); ?>" style="position: absolute; z-index: -999; opacity: 0;" />
                                                    </button>
                                                    
                                                    <?php if($captura->status_captura < 3){ ?>
                                                    <button type="button" class="btn btn-secondary mb-1 openModalResend" data-toggle="tooltip" data-original-title="Reenviar e-mail de ativação" data-resend='<?php e(json_encode(array('email'=>$captura->email,'key_captura'=>$captura->key_captura,'id_campanha'=>58)));?>'>
                                                        <i class="fa fa-envelope-o"></i> 
                                                    </button>
                                                    <?php } ?>
                                                    
                                                    <li class="list-inline-item" data-toggle="tooltip" data-placement="top" title="" data-original-title="Dispensar">
                                                        <button class="btn btn-danger mb-1 set_leed" data-id="<?php e($captura->id_captura); ?>" data-origem="Signature" type="button" data-toggle="modal" data-target="#dangerModal">
                                                            <i class="icon-dislike"></i>
                                                        </button>
                                                    </li>
                                                    
                                                </td>
                                            </tr>
                                            <?php } ?>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
    
    
    <div class="row">
        <div class="col-md-12">
            <div class="box-title-section">
                <div class="form-inline">
                    <div class="form-group">
                        <label class="mr-1 text-value text-primary" for="periodo">Relatório por período</label>
                        <select name="periodo" class="form-control" id="periodo">
                            <option value="dia" >Diário</option>
                            <option value="semana" >Semanal</option>
                            <option value="mes" selected>Mensal</option>
                        </select>
                    </div>
                </div>
                <hr>
            </div>
        </div>
    </div>
    <!--
    <div class="row">
        <div class="col-md-12">
            <div class="card">
               <div class="card-header">Meus atendimentos</div>
               <div class="card-body">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="card-group mb-5">
                                <div class="card text-white bg-info">
                                    <div class="card-body pb-0">
                                        <a href="#" class="btn btn-transparent p-0 float-right">
                                            <i class="icon-user-follow font-2xl"></i>
                                        </a>
                                        <div class="text-value">Total <span class="meuAtendimentosTotal novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></span></div>
                                        <div><span class="meuAtendimentosUltimos novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></span></div>
                                    </div>
                                    <div class="chart-wrapper mt-3 mx-3" style="height:70px;">
                                        <canvas class="chart" id="card-chart2" height="70"></canvas>
                                    </div>
                                </div>
                                <div class="card">
                                    <div class="card-body">
                                        <div class="h1 text-muted text-right mb-4">
                                            <i class="icon-globe"></i>
                                        </div>
                                        <div class="text-value meuCapturasAtual novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></div>
                                    <small class="text-muted text-uppercase font-weight-bold">Por captura</small>
                                    <div class="progress progress-xs my-2">
                                        <div class="progress-bar bg-primary" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
                                    </div>
                                    <small class="text-muted">Período anterior <strong class="meuCapturasAnterior novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></strong></small>
                                </div>
                            </div>
                            <div class="card">
                                <div class="card-body">
                                    <div class="h1 text-muted text-right mb-4">
                                        <i class="icon-globe"></i>
                                    </div>
                                    <div class="text-value meuOportunidadesAtual novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></div>
                                    <small class="text-muted text-uppercase font-weight-bold">por oportunidade</small>
                                    <div class="progress progress-xs my-2">
                                        <div class="progress-bar bg-primary" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
                                    </div>
                                    <small class="text-muted">Período anterior <strong class="meuOportunidadesAnterior novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></strong></small>
                                </div>
                            </div>
                            <div class="card">
                                <div class="card-body">
                                    <div class="h1 text-muted text-right mb-4">
                                        <i class="icon-globe"></i>
                                    </div>
                                    <div class="text-value meuOutrosAtual novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></div>
                                    <small class="text-muted text-uppercase font-weight-bold">outros</small>
                                    <div class="progress progress-xs my-2">
                                        <div class="progress-bar bg-primary" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
                                    </div>
                                    <small class="text-muted">Período anterior <strong class="meuOutrosAnterior novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></strong></small>
                                </div>
                            </div>
                        </div>
                    </div>   
                        
                     </div>
                     
                     
               </div>
           </div>
       </div>
   </div>
    -->
    
    <!--
    Oportunidades OLX
    <div class="row">
        <div class="col-md-12">
            <div class="card">
               <div class="card-header">Oportunidades OLX</div>
               <div class="card-body">
                    <div class="row">
                       <div class="col">
                          <div class="callout callout-info">
                             <small class="text-muted">Atendidas</small>
                             <br>
                             <strong class="h4 atendidasAtual novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></strong>
                            <br>
                            <small class="text-muted">Período anterior <strong class="atendidasAnterior novoLoad"><i class="fa fa-circle-o-notch fa-spin fa-fw"></i> </strong></small>
                          </div>
                       </div>
                       <div class="col">
                          <div class="callout callout-danger">
                            <small class="text-muted text-uppercase font-weight-bold">Negadas</small>
                            <br>
                            <strong class="h4 negadasAtual novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></strong>
                            <br>
                            <small class="text-muted">Período anterior <strong class="negadasAnterior novoLoad"><i class="fa fa-circle-o-notch fa-spin fa-fw"></i> </strong></small>
                          </div>
                       </div>
                       <div class="col">
                          <div class="callout callout-warning">
                             <small class="text-muted">Agurdando Retorno</small>
                             <br>
                             <strong class="h4 aguardandoAtual novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></strong>
                            <br>
                            <small class="text-muted">Período anterior <strong class="aguardandoAnterior novoLoad"><i class="fa fa-circle-o-notch fa-spin fa-fw"></i> </strong></small>
                          </div>
                       </div>
                       <div class="col">
                          <div class="callout callout-success">
                             <small class="text-muted">Aceitas</small>
                             <br>
                             <strong class="h4 aceitasAtual novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></strong>
                            <br>
                            <small class="text-muted">Período anterior <strong class="aceitasAnterior novoLoad"><i class="fa fa-circle-o-notch fa-spin fa-fw"></i> </strong></small>
                          </div>
                       </div>
                    </div>
               </div>
            </div>
        </div>
    </div>-->
    
    <div class="row">
        <div class="col-md-12">
            <div class="card">
               <div class="card-header">Atendimentos Gerais</div>
               <div class="card-body">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="card-group mb-5">
                                <div class="card text-white bg-info">
                                    <div class="card-body pb-0">
                                        <a href="#" class="btn btn-transparent p-0 float-right">
                                            <i class="icon-user-follow font-2xl"></i>
                                        </a>
                                        <div class="text-value">Total <span class="atendimentosTotal novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></span></div>
                                        <div><span class="atendimentosUltimos novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></span></div>
                                    </div>
                                    <div class="chart-wrapper mt-3 mx-3" style="height:70px;">
                                        <canvas class="chart" id="card-chart1" height="70"></canvas>
                                    </div>
                                </div>
                                <div class="card">
                                    <div class="card-body">
                                        <div class="h1 text-muted text-right mb-4">
                                            <i class="icon-globe"></i>
                                        </div>
                                        <div class="text-value capturasAtual novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></div>
                                    <small class="text-muted text-uppercase font-weight-bold">Por captura</small>
                                    <div class="progress progress-xs my-2">
                                        <div class="progress-bar bg-primary" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
                                    </div>
                                    <small class="text-muted">Período anterior <strong class="capturasAnterior novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></strong></small>
                                </div>
                            </div>
                            <div class="card">
                                <div class="card-body">
                                    <div class="h1 text-muted text-right mb-4">
                                        <i class="icon-globe"></i>
                                    </div>
                                    <div class="text-value oportunidadesAtual novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></div>
                                    <small class="text-muted text-uppercase font-weight-bold">por oportunidade</small>
                                    <div class="progress progress-xs my-2">
                                        <div class="progress-bar bg-primary" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
                                    </div>
                                    <small class="text-muted">Período anterior <strong class="oportunidadesAnterior novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></strong></small>
                                </div>
                            </div>
                            <div class="card">
                                <div class="card-body">
                                    <div class="h1 text-muted text-right mb-4">
                                        <i class="icon-globe"></i>
                                    </div>
                                    <div class="text-value outrosAtual novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></div>
                                    <small class="text-muted text-uppercase font-weight-bold">outros</small>
                                    <div class="progress progress-xs my-2">
                                        <div class="progress-bar bg-primary" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
                                    </div>
                                    <small class="text-muted">Período anterior <strong class="outrosAnterior novoLoad "><i class="fa fa-circle-o-notch fa-spin fa-fw"></i></strong></small>
                                </div>
                            </div>
                        </div>
                    </div>   
                        
                     </div>
                     
                     
                </div>
                <hr class="mt-0"><br>
                <div class="card-body">
                        <div class="table-container table-responsive">
                            <table id="dataTable" class="display table table-striped table-bordered" style="width:100%">
                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>Nome</th>
                                        <th>Hoje</th>
                                        <th>Ontem</th>
                                        <th>Semana atual</th>
                                        <th>Semana anterior</th>
                                        <th>Mês atual</th>
                                        <th>Mês anterior</th>
                                        <th>Total</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php foreach($atendentes as $aten) { ?>
                                    <tr class="trData" >
                                        <td><?php e($aten->id_cadastro); ?></td>
                                        <td><?php e($aten->nome); ?></td>
                                        <td><?php e($aten->dia_atual); ?></td>
                                        <td><?php e($aten->dia_anterior); ?></td>
                                        <td><?php e($aten->semana_atual); ?></td>
                                        <td><?php e($aten->semana_anterior); ?></td>
                                        <td><?php e($aten->mes_atual); ?></td>
                                        <td><?php e($aten->mes_anterior); ?></td>
                                        <td><?php e($aten->qnt); ?></td>
                                    </tr>
                                    <?php } ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
            </div>
        </div>
    </div>
</div>












<?php $x=0; if($x==1){ ?>
<div class="animated fadeIn">
    <div class="row">
        
        <!-- /.col-->
        <div class="col-md-12">
            <!-- /.row-->
            <div class="row">
                <div class="col-md-4">
                    <div class="card-group mb-5">
                        <div class="card">
                            <div class="card-body">
                                <div class="h1 text-muted text-right mb-4">
                                    <i class="icon-globe"></i>
                                </div>
                                <div class="text-value"><?php e($contLand); ?></div>
                                <small class="text-muted text-uppercase font-weight-bold">Landingpage</small>
                                <div class="progress progress-xs my-2">
                                    <div class="progress-bar bg-primary" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
                                </div>
                                <small class="text-muted">Ativaram <strong class=""><?php e($contLandAtivo); ?></strong></small>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- /.row-->
            <div class="row">
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-header"><a href="#" data-toggle="collapse" data-target="#collapsePrecadastros" aria-expanded="false" class="collapsed"><i class="icon-user-follow"></i> Leads Signature Park Sul</a>
                            <div class="card-header-actions">
                                <a class="card-header-action btn-minimize" href="#" data-toggle="collapse" data-target="#collapsePrecadastros" aria-expanded="false" class="collapsed">
                                    <i class="icon-arrow-up"></i>
                                </a>
                            </div>
                        </div>
                        <div class="collapse show" id="collapsePrecadastros" data-parent="#accordion">
                            <div class="card-body">
                                <div class="table-container table-responsive">
                                    <table class="display table table-striped table-bordered" style="width:100%">
                                        <thead>
                                            <tr>
                                                <th>Nome</th>
                                                <th>E-mail</th>
                                                <th style="min-width: 85px;">Telefone</th>
                                                <th>Origem</th>
                                                <th>Data captura/envio de e-mail</th>
                                                <th>Unidade</th>
                                                <th>Situação</th>
                                                <th style="min-width: 130px;">Último atendimento</th>
                                                <th style="min-width: 130px;">Proximo atendimento</th>
                                                <th style="min-width: 185px;">Ação</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php foreach($capturas as $id=>$captura) { ?>
                                            
                                            <tr id="divImovel_<?php e($id) ?>" class="trData" data-atendimento='<?php e(json_encode($captura->atendimento)) ?>'>
                                                <td><?php e($captura->nome); ?></td>
                                                <td><?php e($captura->email); ?></td>
                                                <td><?php e($captura->telefone); ?></td>
                                                <td><?php e($captura->mensagem == ''?'Landingpage':$captura->mensagem); ?></td>
                                                <?php 
                                                    $nenv = '<span class="d-none">000000000</span>'.'<span class="badge badge-danger">Não enviado</span>'; 
                                                    $denv = '<span class="d-none">'.$captura->datetime_captura.'</span>'.(date("d/m/Y H:i:s", strtotime($captura->datetime_captura)));
                                                ?>
                                                <td><?php e($captura->datetime_captura == 0 ? $nenv:$denv); ?></td>
                                                
                                                <td><?php e($captura->tipo_imovel); ?></td>
                                                
                                                <td><?php e(HCaptura::lp('signature')->captura($captura)->bgStatus() ); ?></td>
                                                
                                                <td><p class="resumo-text m-0"><?php e(end($captura->atendimento)->observacao??''); ?></p></td>
                                                <?php 
                                                    $proximo_contato = end($captura->atendimento)->proximo_contato??'';
                                                    if($proximo_contato == 0 || $proximo_contato == '0000-00-00 00:00:00'){
                                                         $proximo_contato = '';
                                                         $alert = '<span class="d-none">z'.$proximo_contato.'</span>';
                                                    }else{
                                                        $alert = '<span class="d-none">a'.$proximo_contato.'</span>'.
                                                                 '<span class="badge badge-danger">'.date("d/m/Y", strtotime($proximo_contato)).'</span>';
                                                    }
                                                    $normal = '<span class="d-none">b'.$proximo_contato.'</span>'.(date("d/m/Y", strtotime($proximo_contato)));
                                                ?>
                                                <td>
                                                    <?php 
                                                    $proximo_contato = end($captura->atendimento)->proximo_contato??'';
                                                    if($proximo_contato == 0 || $proximo_contato == '0000-00-00 00:00:00'){
                                                         $proximo_contato = '';
                                                         $alert = '<span class="d-none">z'.$proximo_contato.'</span>';
                                                    }else{
                                                        $alert = '<span class="d-none">a'.$proximo_contato.'</span>'.
                                                                 '<span class="badge badge-danger">'.date("d/m/Y", strtotime($proximo_contato)).'</span>';
                                                    }
                                                    $normal = '<span class="d-none">b'.$proximo_contato.'</span>'.(date("d/m/Y", strtotime($proximo_contato)));
                                                    
                                                    e($proximo_contato <= date("Y-m-d H:i:s") ? $alert:$normal);
                                                    ?>
                                                </td>
                                               
                                                <td class="tdAction_<?php e($id) ?>" >
                                                    <span class='d-none'><?php e(empty($captura->atendimento) ? 0 : 1); ?></span>
                                                    
                                                    
                                                    <?php if(!empty($captura->atendimento)){ ?>
                                                    <a href="<?php e(base_url().'atendimento/interessado/signature/'.$captura->atendimento[0]->id_atendimento); ?>" class="actAtendimento btn btn-success mb-1" data-id="<?php e($id); ?>" data-toggle="tooltip" data-original-title="Visualizar atendimento">
                                                        <i class="icon-check"></i>
                                                    </a>
                                                    <?php }else{ ?>
                                                    <a href="javascript:;" class="addAtendimentoGeral btn btn-primary mb-1" data-interesse="signature" data-atendimento='<?php e(json_encode($captura)) ?>' data-toggle="tooltip" data-original-title="Adicionar atendimento">
                                                        <i class="icon-plus"></i>
                                                    </a>
                                                    <?php } ?>
                                                    
                                                    <button type="button" class="btn btn-secondary copyLink mb-1" data-toggle="tooltip" data-original-title="Clique e Copie link para a página de ativação">
                                                        <i class="icon-link icons"></i>
                                                        <input class="linkToCopy" value="<?php e(base_url("landingpage/resultado/codigovipsignature/").$captura->key_captura); ?>" style="position: absolute; z-index: -999; opacity: 0;" />
                                                    </button>
                                                    
                                                    <?php if($captura->status_captura < 3){ ?>
                                                    <button type="button" class="btn btn-secondary mb-1 openModalResend" data-toggle="tooltip" data-original-title="Reenviar e-mail de ativação" data-resend='<?php e(json_encode(array('email'=>$captura->email,'key_captura'=>$captura->key_captura,'id_campanha'=>58)));?>'>
                                                        <i class="fa fa-envelope-o"></i> 
                                                    </button>
                                                    <?php } ?>
                                                    
                                                    <li class="list-inline-item" data-toggle="tooltip" data-placement="top" title="" data-original-title="Dispensar">
                                                        <button class="btn btn-danger mb-1 set_leed" data-id="<?php e($captura->id_captura); ?>" data-origem="Signature" type="button" data-toggle="modal" data-target="#dangerModal">
                                                            <i class="icon-dislike"></i>
                                                        </button>
                                                    </li>
                                                    
                                                </td>
                                            </tr>
                                            <?php } ?>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="modalResend" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
    <div class="modal-dialog modal-success" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">Reenviar E-mail de Ativação</h4>
                <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
            </div>
            <div class="modal-body">
                <p>Tem certeza que deseja reenviar o e-mail de ativação para o cliente?</p>
            </div>
            <div class="modal-footer">
                <a href="javascript:;" class="btn btn-success btn_resend">Reenviar</a>
                <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancelar</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="dangerModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
    <div class="modal-dialog modal-danger" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">Atendimento</h4>
                <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
            </div>
            <div class="modal-body">
                <p><strong>Deseja finalizar esse atendimento?</strong> Informe o motivo abaixo.</p>
                <form id="formNegarAtendimento" action="" method="post">
                    <div class="form-group">
                       <label for="motivo">Motivo</label>
                       <textarea name="motivo" id="motivo" class="form-control" required="required"></textarea>
                    </div>
                </form>
                <div class="erroFormNegarAnuncio"></div>
            </div>
            <div class="modal-footer">
                <button class="btn btn-danger btnNegarAtendimento" type="button">Finalizar</button>
                <button class="btn btn-secondary" type="button" data-dismiss="modal">Fechar</button>
            </div>
        </div>
    </div>
</div>

<?php } ?>