<?php if(Session::has('information_popup')): ?>
<?php
$information = \App\Models\WebsiteInformation::where('is_popup', '1')->orderBy('id', 'desc')->limit('5')->get();
?>
<?php if($information->count() > 0): ?>
<div class="modal fade" id="modal-info" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" style="display: none;">
    <div class="modal-dialog modal-dialog-centered modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title mt-0"><i class="fa fa-info-circle fa-fw"></i> Informasi Terbaru</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            </div>
            <div class="modal-body" style="overflow-y: scroll; max-height: 500px;">
                <?php $__currentLoopData = $information; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="alert alert-custom text-white">
                    <div class="d-flex mb-3">
                        <div class="">
                            <button type="button" class="btn btn-light btn-icon btn-sm icon-left">
                                <i class="far fa-lightbulb"></i> <?php echo $value->category; ?> - <?php echo e(\Carbon\Carbon::parse($value->created_at)->translatedFormat('d F Y - H:i')); ?>

                            </button>
                        </div>
                        <div class="ml-auto">
                        </div>
                    </div>
                    <hr>
                    <?php echo ($value->content); ?>

                </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
            <div class="modal-footer bg-whitesmoke br">
                <button type="button" class="btn btn-light" data-dismiss="modal">Tutup</button>
                <button type="button" class="btn btn-custom" onclick="read_popup()"><i class="fa fa-thumbs-up"></i> Saya Sudah Membaca</button>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $('#modal-info').modal('show');
    function read_popup() {
        $.ajax({
            type: "GET",
            data: "true",
            url: "<?php echo e(url('ajax/read_popup')); ?>",
            success: function() {
                $('#modal-info').modal('hide');
            },
            error: function() {
                alert('Terjadi kesalahan.');
            }
        });
    }
</script>
<?php endif; ?>
<?php endif; ?><?php /**PATH /home/buzb2196/public_html/panel.buzzerinaja.com/resources/views/user/layouts/info.blade.php ENDPATH**/ ?>