<?php $__env->startSection('content'); ?>
    <div class="page-content">
        <div class="container-fluid">
            <div class="page-content-inner">
                <div class="row">
                    <div class="col-md-12">
                        <div class="portlet light">
                            <div class="col-md-12">
                                <span class="font-blue-madison title"><i class="fa fa-close"></i> Cancelamentos</span></span>
                                <hr>
                            </div>
                            <div class="portlet-body">
                                <?php if($total == 0): ?>
                                    <br/><br/><br/><br/><br/><br/><br/><br/>
                                    <div class="alert alert-success">
                                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                        <h2>Não há nenhum cancelamento pendente!</h2>
                                    </div>
                                    <br/><br/><br/><br/><br/><br/><br/><br/>
                                <?php else: ?>
                                    <table class="table table-striped table-hover table-light" id="table-cancelamentos">
                                        <thead>
                                            <tr>
                                                <td colspan="8" align="center">
                                                    <?php echo $paginacao; ?>

                                                </td>
                                            </tr>
                                            <tr class="uppercase bg-blue-madison">
                                                <th class="col-md-3 font-white orderby" onclick="orderby('u.name','<?php echo e($order->act); ?>','<?php echo e($order->url); ?>');"><span class="<?php echo e($order->seta); ?>" /> Cliente</th>
                                                <th class="col-md-2 font-white orderby" onclick="orderby('u.email','<?php echo e($order->act); ?>','<?php echo e($order->url); ?>');"><span class="<?php echo e($order->seta); ?>" /> Email</th>
                                                <th class="col-md-2 font-white orderby" onclick="orderby('data_solicitacao','<?php echo e($order->act); ?>','<?php echo e($order->url); ?>');"><span class="<?php echo e($order->seta); ?>" /> Solicitação</th>
                                                <th class="col-md-2 font-white orderby" onclick="orderby('data_cancelamento','<?php echo e($order->act); ?>','<?php echo e($order->url); ?>');"><span class="<?php echo e($order->seta); ?>" /> Cancelamento</th>
                                                <th class="col-md-1 font-white orderby"><span class="<?php echo e($order->seta); ?>" /> Contato </th>
                                                <th class="col-md-2 font-white orderby">Detalhes</th>
                                            </tr>
                                        </thead>
                                        <tbody> 
                                            <?php foreach($clientes as $cliente): ?>                                                
                                               <tr style="<?php if($cliente->dias_para_cancelamento > 5): ?>background-color:#ccffcc;<?php elseif($cliente->dias_para_cancelamento < 2): ?>background-color: #fbe1e3;<?php else: ?> background-color: #f9e491 <?php endif; ?>">
                                                    <td><?php echo $cliente->name; ?></td>
                                                    <td><?php echo $cliente->email; ?></td>
                                                    <td><?php echo $cliente->data_solicitacao; ?></td>
                                                    <td><?php echo $cliente->data_cancelamento; ?></td>
                                                    <td><?php echo $cliente->contato_pendente; ?></td>
                                                    <td>
                                                       <a class="btn blue-madison popovers fancybox fancybox.iframe" data-container="body" data-trigger="hover" data-placement="top" data-content="Ver detalhes do cliente" href="<?php echo e(route('admin.customers.details',['user_id' => $cliente->user_id])); ?>">
                                                        <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
                                                    </a>
                                                        <?php if(routeAcess('admin.sac.edit-cancelamentos')): ?> 
                                                            <a class="btn green-jungle popovers" data-container="body" data-trigger="hover" data-placement="top" data-content="Atender"  title="Editar Registro" href="<?php echo e(route('admin.sac.edit-cancelamentos',['id' => $cliente->id])); ?>">
                                                                <span class="fa fa-edit" aria-hidden="true"></span>
                                                            </a>
                                                        <?php endif; ?>
                                                    </td>
                                                </tr>
                                             <?php endforeach; ?>                                       
                                        </tbody>
                                        <tfoot>
                                            <tr>
                                                <td colspan="8" align="center">
                                                    <?php echo $paginacao; ?>

                                                </td>
                                            </tr>
                                        </tfoot>
                                    </table>                        
                                <?php endif; ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('js-admin-did'); ?>
    
    <script src="<?php echo e(asset('/assets/global/scripts/app.min.js')); ?>" type="text/javascript"></script>
    
    <script src="<?php echo e(asset('/assets/global/plugins/fancybox/source/jquery.fancybox.js?v=2.1.5')); ?>" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="../assets/global/plugins/fancybox/source/jquery.fancybox.css?v=2.1.5') }}" media="screen" />
    <script src="<?php echo e(asset('/assets/global/plugins/datatables/datatables.min.js')); ?>" type="text/javascript"></script>
    <script src="<?php echo e(asset('/assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.js')); ?>" type="text/javascript"></script>

    <script type="text/javascript">
        $(document).ready(function() {
            $('.fancybox').fancybox();
        });
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('template', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>