<?php $__env->startSection('content'); ?>
    <div class="container mt-3" style="max-width:100%;min-height:100%;">
        <div class="table-wrapper ">
            <div class="table-title">
                <div class="row mb-3">
                    <div class="col d-flex justify-content-center">
                        <h2>Cota <b>Premiada</b></h2>
                    </div>
                </div>
            </div>
        </div>

        <select class="form-control block" onchange="selecionarRifa(this)">
            <option value="0">Selecione a rifa desejada</option>
            <?php $__currentLoopData = $rifas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rifa): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <option value="<?php echo e($rifa->id); ?>"><?php echo e($rifa->name); ?></option>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </select>

        <span id="conteudo"></span>
    </div>

    <script>
        function selecionarRifa(el) {
            $('#conteudo').html('')

            if(el.value == 0) return;
            
            loading();
            $.ajax({
                url: "<?php echo e(route('selecionarRifa')); ?>",
                type: 'POST',
                dataType: 'json',
                data: {
                    "id": el.value
                },
                success: function(response) {
                    loading()
                    if (response.html) {
                        $('#conteudo').html(response.html)
                        $('#cota-busca').focus();
                    }
                },
                error: function(error) {
                    loading()
                }
            })
        }
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home2/sited512/premiumtop.sitederifas.net/resources/views/rifaPremiada/index.blade.php ENDPATH**/ ?>