<?php $__env->startSection('content'); ?>
         <div class="container">
               <h2>Leads</h2>

               <div class="lead-designar">
                <form action="scripts/update_leads.php" id="tick" method="POST">
                    <label for="exampleFormControlSelect1">Selecionar Consultor para designar a Lead:</label>
                    <div class="form-group" style="width: 300px;    display: flex;">

                        <select style="margin-right: 10px;" name="consultor" class="form-control" id="exampleFormControlSelect1">
                            <option value="">NENHUM</option>
                            <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option name="consultor" value="<?php echo e($user->name); ?>"><?php echo e($user->name); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                        <button class="btn btn-warning" type="submit" value="Designar">Designar</button>
                    </div>
                </form>
            </div>

            <table class="display" id="laravel_datatable">
               <thead>
                  <tr>
                     <th>Selecionar</th>
                     <th>Data</th>
                     <th>Nome</th>
                     <th>Telefone</th>
                     <th>Produto</th>
                     <th>Proposta</th>
                     <th>Consultor</th>
                     <th>Status</th>
                     <th>Editar</th>
                  </tr>
               </thead>
            </table>
         </div>
   <script>
   $(document).ready( function () {
    $('#laravel_datatable').DataTable({
           processing: true,
           serverSide: true,
           "order": [
                [1, "desc"]
            ],
           ajax: "<?php echo e(url('leads-list')); ?>",
           columns: [
                    { data: 'lead_id', name: 'lead_id', render:function(data, type, row){
                    return "<input name='lead_id[]' value="+ row.lead_id +" form='tick' type='checkbox'>"
                    }}
                    ,
                    { data: 'created_at', name: 'created_at' },
                    { data: 'nome', name: 'nome' },
                    { data: 'celular', name: 'celular' },
                    { data: 'produto', name: 'produto' },
                    { data: 'proposta', name: 'proposta' },
                    { data: 'consultor', name: 'consultor' },
                    { data: 'status', name: 'status' },
                    { data: 'lead_id', name: 'lead_id', render:function(data, type, row){
                        return "<a class='btn btn-outline-info' href='leads/"+ row.lead_id +"/edit'><i class='far fa-eye' aria-hidden='true'></i></a>"
                        }}

                 ]
        });
     });
  </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/volkswagenconsor/public_html/propostas/resources/views/leads.blade.php ENDPATH**/ ?>