<?php if($article['status'] == true): ?>
<?php ($num = 0); ?>
<div class="row">
    <div class="table-responsive">
        <table class="table" style="width: 100%">
            <tbody>
                <?php $__currentLoopData = $article['data']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $info): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php ($num = $num + 1); ?>
                <?php if($num % 5 == 1): ?>
                <tr class="td-hover">
                    <td style="width: 20%; text-align: center; border-bottom-width: 0px">
                        <a class="p-hover" href="<?php echo e(route($codePage, $info['article']['short_url'])); ?>">
                            <div class="box" data-value="<?php echo e($info['article']['id']); ?>">
                                <div class="box-body">
                                    <img src="<?php echo e(asset('../storage/km/articles/'.$info['name'])); ?>"
                                        class="margin content-cover" width="140px" height="210px" />
                                </div>
                                <div class="box-footer" style="text-align: center" width="140px">
                                    <p class="margin-clear kitem-1"><?php echo e($info['article']['name']); ?></p>
                                    <small class="text-muted"><?php echo e($info['article']['author']); ?></small>
                                </div>
                            </div>
                        </a>
                    </td>
                    <?php elseif($num % 5 == 0): ?>
                    <td style="width: 20%; text-align: center; border-bottom-width: 0px">
                        <a class="p-hover" href="<?php echo e(route($codePage, $info['article']['short_url'])); ?>">
                            <div class="box" data-value="<?php echo e($info['article']['id']); ?>">
                                <div class="box-body">
                                    <img src="<?php echo e(asset('../storage/km/articles/'.$info['name'])); ?>"
                                        class="margin content-cover" width="140px" height="210px" />
                                </div>
                                <div class="box-footer" style="text-align: center" width="140px">
                                    <p class="margin-clear kitem-1"><?php echo e($info['article']['name']); ?></p>
                                    <small class="text-muted"><?php echo e($info['article']['author']); ?></small>
                                </div>
                            </div>
                        </a>
                    </td>
                </tr>
                <?php else: ?>
                <td style="width: 20%; text-align: center; border-bottom-width: 0px">
                    <a class="p-hover" href="<?php echo e(route($codePage, $info['article']['short_url'])); ?>">
                        <div class="box" data-value="<?php echo e($info['article']['id']); ?>">
                            <div class="box-body">
                                <img src="<?php echo e(asset('../storage/km/articles/'.$info['name'])); ?>"
                                    class="margin content-cover" width="140px" height="210px" />
                            </div>
                            <div class="box-footer" style="text-align: center" width="140px">
                                <p class="margin-clear kitem-1"><?php echo e($info['article']['name']); ?></p>
                                <small class="text-muted"><?php echo e($info['article']['author']); ?></small>
                            </div>
                        </div>
                    </a>
                </td>
                <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                <?php if((count($article['data']) % 5) < 5): ?> <?php for($i=count($article['data']) % 5; $i < 5; $i++): ?> <td
                    style="width: 20%; text-align: center; border-bottom-width: 0px">
                    </td>
                    <?php if($i == 5): ?>
                    </tr>
                    <?php endif; ?>
                    <?php endfor; ?>
                    <?php endif; ?>
            </tbody>
        </table>
    </div>
    <div class="d-flex justify-content-center">
        <?php echo $article['data']->links(); ?>

    </div>
</div>
<?php else: ?>
<?php if(session()->has('user')): ?>
<p>ไม่พบข้อมูล</p>
<?php else: ?>
<p>ขออภัยไม่พบข้อมูล/แสดงข้อมูลเฉพาะสมาชิกเท่านั้น</p>
<?php endif; ?>
<?php endif; ?>

<script>
var selector = '.pageid a';
$(selector).on('click', function() {
    $(selector).removeClass('active');
    $(this).addClass('txtorange-5 active');
    urlApi = $(this).attr("data-index");
    listPage(urlApi);
});

function listPage(urlApi) {
    var form_data = new FormData();
    form_data.append('type', 1);
    form_data.append('url', urlApi);
    form_data.append('size', 20);

    $.ajax({
        type: "post",
        url: 'page/tableListInfo',
        data: form_data,
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        },
        processData: false,
        contentType: false,
        cache: false,
        success: function(html) {
            window.scrollTo({
                top: 0,
                behavior: 'smooth'
            });
            $('#blade').html(html);
        }
    });
}
</script><?php /**PATH /var/www/html/km-web/resources/views/subpage/tableInfographic.blade.php ENDPATH**/ ?>