<?php if (!empty($capAguardandoRetorno)){ ?>
<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($capAguardandoRetorno as $k=>$notificacao ){ ?>
            <div class="col-md-2 col-sm-4">
                <div class="card card-<?php e($notificacao->UUID) ?>">
                    <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>
                        <button href="javascript:;" class="btn btn-sm btn-primary btn-<?php e($notificacao->UUID) ?> btn-card btn-select" data-uuid="<?php e($notificacao->UUID) ?>" ><i class="icon-arrow-right-circle "></i> Atender</button>
                    </div>
                </div>
            </div>
            <?php } ?>
        </div>
    </div>
</div>
<?php } ?>

<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 1Atendimento</label>
                </div>
            </div>
            <hr>
        </div>
    </div>
    <div class="col-md-12">
        <div class="row">
            <?php foreach($capNaoAtendidas as $k=>$notificacao ){?>
            <div class="col-md-2 col-sm-4">
                <div class="card card-<?php e($notificacao->UUID) ?>">
                    <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 qnt-<?php e($notificacao->UUID) ?>"><?php e($notificacao->qnt) ?></div>
                        <button href="javascript:;" class="btn btn-sm btn-primary btn-<?php e($notificacao->UUID) ?> btn-card btn-select" data-uuid="<?php e($notificacao->UUID) ?>" ><i class="icon-arrow-right-circle "></i> Atender</button>
                    </div>
                </div>
            </div>
            <?php } ?>
        </div>
    </div>
</div>

<div class="row">
    <!-- /.col-->
    <div class="col-md-12">
        <!-- /.row-->
        <div class="row divTabelasLoad text-center d-none">
            <div class="col-md-12">
                <div class="card">
                    <div class="card-body">
                        <i class="fa fa-spinner fa-spin fa-3x fa-fw"></i>
                        <span class="sr-only">Loading...</span>
                    </div>
                </div>
            </div>
        </div> 
        
        <div class="row divTabelas d-none">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">
                        <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 class="collapse show" id="collapsePrecadastros" data-parent="#accordion">
                            <div class="table-container table-responsive">
                                <table id="tbCapturasNaoAtendidas" 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>LP</th>-->
                                            <th>Data captura</th>
                                            <th>Interesse</th>
                                            <th>Parceiro</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>
                                        
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        
                        <div class="box-title-section">
                            <div class="form-inline">
                                <div class="form-group">
                                    <label class="mr-1 text-value text-primary">Aguardando Retorno</label>
                                </div>
                            </div>
                            <hr>
                        </div>
                        
                        <div class="collapse show" id="collapsePrecadastros" data-parent="#accordion">
                            <div class="table-container table-responsive">
                                <table id="tbCapAguardandoRetorno" 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>LP</th>-->
                                            <th>Data captura</th>
                                            <th>Interesse</th>
                                            <th>Parceiro</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></tbody>
                                </table>
                            </div>
                        </div>
                        
                        <div class="box-title-section">
                            <div class="form-inline">
                                <div class="form-group">
                                    <label class="mr-1 text-value text-primary">Finalizados</label>
                                </div>
                            </div>
                            <hr>
                        </div>
                        
                        <div class="collapse show" id="collapsePrecadastros" data-parent="#accordion">
                            <div class="table-container table-responsive">
                                <table id="tbCapturasAtendimentoFinalizado" 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>LP</th>-->
                                            <th>Data captura</th>
                                            <th>Interesse</th>
                                            <th>Parceiro</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></tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
    
<div class="modal fade" id="atendimentoRapidoModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
    <div class="modal-dialog modal-primary" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">Atendimento Rápido</h4>
                <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
            </div>
            <form id="formAtendimentoRapido" action="" method="post">
                <div class="modal-body">
                    <p><strong>O cliente já foi contactado?</strong> Descreva o seu atendimento abaixo.</p>
                    <div class="form-group">
                       <label for="observacao">Observação</label>
                       <textarea name="observacao"  class="form-control" required="required"></textarea>
                    </div>
                    <div class="form-group">
                        <label for="novo_contato">Tentar um novo contato?</label>
                        <div class="radio">
                            <label class="radio-inline mr-2"><input type="radio" name="novo_contato" value="sim" id="novo_contato" checked> Sim</label>
                            <label class="radio-inline"><input type="radio" name="novo_contato" value="nao"> Não, já finalizei.</label>
                        </div>
                    </div>
                    <div class="erroFormAtenderAnuncio"></div>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-primary btnAtenderAnuncio_ " type="submit"><i class="fa fa-check"></i> Adicionar</button>
                    <button class="btn btn-secondary" type="button" data-dismiss="modal">Fechar</button>
                </div>
            </form>
        </div>
    </div>
</div>

<div class="modal fade" id="finalizarAtendimentoModal" 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 Rápido</h4>
                <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
            </div>
            <form id="formFinalizarAtendimentoRapido" action="" method="post">
                <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="submit">Finalizar</button>
                    <button class="btn btn-secondary" type="button" data-dismiss="modal">Fechar</button>
                </div>
            </form>
        </div>
    </div>
</div>