<?php $__env->startSection('header-script'); ?>
<?php echo $__env->make('admin.layouts.datatable-header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('content'); ?>
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.20/js/dataTables.bootstrap.min.js"></script>


<!-- Page-Title -->
<div class="col-md-12">
    <div class="col-md-12 pd-0">
        <div class="u-shadow-v21 nbr g-bg-white rounded notice-board  mg-0 wow slideInUp" data-wow-duration="3s">
            <div class="media g-mb-15">
                <div>
                    <div class="bar-title" style="text-align:center">
                        <h1><a href=""><span> প্রশ্ন ব্যাংক
                                </span></a></h1>
                    </div>
                    <h1><a href="<?php echo e(url('admin/quistionsprint')); ?>"><span> Question Print</span></a></h1>
                    <table id="example" class="table table-dark">
                        <thead>
                            <tr>
                                <th scope="col">SL</th>
                                <th scope="col"> Round</th>
                                <th scope="col"> Question Type</th>
                                <th scope="col"> Episode Name</th>
                                <th scope="col"> Question Name</th>
                                <th scope="col"> Link</th>
                                <th scope="col"> Time</th>
                                <th scope="col"> Right Answer</th>
                                <th scope="col"> Points</th>
                                <th scope="col">Image</th>
                                <th scope="col">Edit</th>
                                <th scope="col">Delete</th>
                                <th scope="col">Available</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $i = 0; ?>
                            <?php if(count($quistions) > 0): ?>

                            <?php $__currentLoopData = $quistions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $quistion): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <?php $i+=1; ?>
                                <th scope="row"><?php echo e($i); ?></th>
                                <td><?php echo e($quistion->round_id); ?></td>
                                <td> <?php if($quistion->question_type == 1): ?>
                                    ট্রেক্সট
                                    <?php elseif($quistion->question_type == 2): ?>
                                    ছবি
                                    <?php elseif($quistion->question_type == 3): ?>
                                    অডিও
                                    <?php else: ?>
                                    ভিডিও
                                    <?php endif; ?>

                                </td>
                                <td><?php echo e($quistion->episode_name); ?></td>
                                <td><?php echo e($quistion->question_name); ?></td>
                                <td>
                                    <?php if($quistion->link == ''): ?>
                                    No Media File in this Question
                                    <?php else: ?>
                                    <iframe width="100" height="60" src="<?php echo e($quistion->link); ?>}" frameborder="0"
                                        allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
                                        allowfullscreen></iframe>

                                    <?php endif; ?>

                                </td>
                                <td><?php echo e($quistion->time); ?> Sec</td>
                                <td>
                                    <?php
                                         if($quistion->option_num==0){
                                             echo $quistion->na_answer;
                                         }else{
                                         
                                         ?>
                                         
                                         <?php if($quistion->right_answer == 'op_1'): ?> <?php echo e($quistion->op_1); ?>

                                         <?php elseif($quistion->right_answer == 'op_2'): ?> <?php echo e($quistion->op_2); ?>

                                         <?php elseif($quistion->right_answer == 'op_3'): ?> <?php echo e($quistion->op_3); ?>

                                         <?php else: ?> <?php echo e($quistion->op_4); ?>

                                         <?php endif; ?>
                                         <?php } ?>
                                </td>
                                <td><?php echo e($quistion->points); ?></td>
                                <td>
                                    <div>
                                        <img src="<?php echo e(URL::to('public/images/' . $quistion->qus_media)); ?>" width="100"
                                            height="60" alt="image not found" />
                                        </a>

                                    </div>
                                </td>
                                <td>
                                    <a href="<?php echo e(url('admin/quistion')); ?>/<?php echo e($quistion->id); ?>/edit"
                                        class="btn btn-danger btn-sm">
                                        <span class="glyphicon glyphicon-edit"> </span> Edit
                                    </a>
                                </td>
                                <td>
                                    <form class="form-horizontal" enctype="multipart/form-data" method="POST"
                                        action="<?php echo e(action('AdminController@quistiondelete', $quistion->id)); ?>">
                                        <?php echo e(csrf_field()); ?>

                                        <a href="<?php echo e(url('admin/quistion')); ?>/<?php echo e($quistion->id); ?>/delete"
                                            class="btn btn-danger btn-sm">
                                            <span class="glyphicon glyphicon-trash"> </span>
                                        </a>
                                    </form>
                                </td>
                                <td>

                                    <?php echo Form::open(['action' => ['AdminController@statusupdate',
                                    $quistion->id],
                                    'method'=> 'POST']); ?>

                                    <?php echo Form::hidden('status', 1); ?>



                                    <?php echo Form::hidden('_method', 'POST'); ?>

                                    <?php if($quistion->status == 0): ?>
                                    <button class="btn btn-danger" type="submit"> unavailble
                                    </button>

                                    <?php else: ?><button class="btn btn-success" type="submit">available
                                    </button>
                                    <?php endif; ?>

                                    <?php echo Form::close(); ?>


                                </td>


                            </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php else: ?>
                            <tr>
                                <td> No Data Found</td>
                            </tr>
                            <?php endif; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

    </div>
</div>
</div>
<script>
    $(document).ready(function() {
    $('#example').DataTable();
} );
    </script>

<!-- end row -->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('footer-script'); ?>
<?php echo $__env->make('admin.layouts.datatable-footer-script', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>