<?php $__env->startPush("head"); ?>
    <title><?php echo e($anketDetay->question); ?> - Anketler - <?php echo e(config('ayarlar.baslik')); ?></title>
    <meta name="description" content="<?php echo e($anketDetay->question); ?> başlıklı ankete oy kullanmak için sitemizi ziyaret ediniz." />
<?php $__env->stopPush(); ?>
<?php $__env->startSection("content"); ?>
    <section>
        <div class="archive-header text-center mb-30">
            <h1><span class="font-weight-ultra"><?php echo e($anketDetay->question); ?></span></h1>
            <div class="breadcrumb">
                <a href="<?php echo e(url('/')); ?>">Ana Sayfa</a>
                <span></span>
                <a href="<?php echo e(url('/anketler')); ?>">
                    Anketler
                </a>
                <span></span>
                <?php echo e($anketDetay->question); ?>

            </div>
        </div>
    </section>
    <section class="pt-30 bg-white box-shadow mt-15 mb-30">
        <div class="container">
            <div class="row">
                <div class="col-md-8">
                    <div class="anket_detay_message"></div>
                    <div class="vote_widget anket_detay_secenekler">
                        <form id="anketForm">
                            <?php echo csrf_field(); ?>

                            <input type="hidden" id="pollId" name="pollId" value="<?php echo e($anketDetay->id); ?>">
                            <input type="hidden" id="newsId" name="newsId" value="<?php echo e($anketDetay->haber_id); ?>">
                            <?php if($options): ?>
                                <ul class="list-unstyled pl-0">
                                    <?php $__currentLoopData = $options; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $option): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <li class="py-1">
                                            <input type="radio" id="secenek<?php echo e($option->id); ?>" name="data" value="<?php echo e($option->id); ?>">
                                            <label class="ml-1" for="secenek<?php echo e($option->id); ?>"><?php echo e($option->name); ?></label>
                                        </li>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </ul>
                            <?php endif; ?>
                            <div class="vote_buttons">
                                <button type="submit" class="btn btn-danger font-medium font-weight-bold">Anketi Oyla</button>
                            </div>
                        </form>
                    </div>
                    <div class="bt-1 border-color-1 mt-4 mb-3"></div>
                    <?php if($anketDetay->isHide == 0): ?>
                        <div class="row mt-4">
                            <div class="col-md-12">
                                <h3>Anket Sonuçları</h3>
                            </div>
                            <div class="col-md-12">
                                <table class="table table-striped">
                                    <tbody>
                                    <tr>
                                        <th width="40%">Seçenekler</th>
                                        <th width="40%"></th>
                                        <th width="10%">Oy</th>
                                        <th width="10%">Yüzde</th>
                                    </tr>
                                    <?php if($options): ?>
                                        <?php $__currentLoopData = $options; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $option): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr>
                                                <?php ($anketSecenekSayi = isset($anketSonuclarToplam[$option->id]) ? $anketSonuclarToplam[$option->id] : 0); ?>
                                                <?php ($progress = ($anketSecenekSayi != 0) ? round(($anketSecenekSayi / $anketGenelToplam) * 100 , 1) : 0); ?>
                                                <td><?php echo e($option->name); ?></td>
                                                <td>
                                                    <progress value="<?php echo e($progress); ?>" max="100"></progress>
                                                </td>
                                                <td><?php echo e($anketSecenekSayi); ?></td>
                                                <td><?php echo e($progress); ?></td>
                                            </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php endif; ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    <?php endif; ?>
                </div>
                <div class="col-md-4">
                    <?php echo $__env->make('frontend.'.$temaadi.'.blocks.sidebar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                </div>
            </div>
        </div>
    </section>
<?php $__env->stopSection(); ?>
<?php $__env->startPush("customJs"); ?>
    <script>
        $('#anketForm').submit(function () {
            let form = $(this);
            $.ajax({
                type: "POST",
                url: "<?php echo e(url('/')); ?>/anketler/oy-ver",
                data: form.serialize(),
                success : function (response) {
                    $('.anket_detay_message').empty().append(response.message);
                    setTimeout(function () {
                        window.location.reload();
                    },2000)
                },
                error: function (request, status, error) {
                    var responseData = JSON.parse(request);
                    var content = '';

                    console.log(responseData);
                }
            });

            return false;
        });
    </script>
<?php $__env->stopPush(); ?>
<?php $__env->startPush("customCss"); ?>

<?php $__env->stopPush(); ?>

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