<?php

/*
 * *************************************************
 * Copyright (C) 2021 Earworks.                    *
 * Codeigniter Project Template Modification       *
 * Please contact our email for more information : *
 * contact@earworks.co.id                          *
 * *************************************************
 */

defined('BASEPATH') OR exit('No direct script access allowed');
//Ci::set_reload();
?>

<style type="text/css">
    .title1 {
        font-size:4em;
        text-align: center;
        display:block;
        margin-bottom:30px;
        line-height:1em;
    }
    .title2 {
        font-size:6em;
        font-weight:bold;
        display:block;
        text-align:center;
        margin-bottom:30px;
        line-height:1.2em;
    }
    .title2.small {
        font-size:4.5em;
        font-weight:normal;
        font-family: Museo;
        margin-bottom:30px;
    }
</style>
<style type="text/css">
    .title-all-page {
        margin-top:80px;
    }
</style>
<div class="row">
    <div class="col-xs-12"  style="background:transparent !important;">
        <div class="title-all-page" id="display">
            <span class="title2 text-center">
                Thank you for your participation <br /> in this event.
            </span>
        </div>
    </div>
</div>
<script type="text/javascript">
</script>
<?php

$display_url = base_url('home/ajax-screen/'.$absen->slug);
Ci::set_script(<<<EOD
    
    var page_script = function () {
        var the;
        var display_url = '{$display_url}';
        var temp = null;
        return {
            init: function () {
                the = this;
                setInterval(the.show_display, 5000);
            },
            show_display: function () {
                $.ajax({
                    url: display_url, type: 'GET', dataType: 'JSON',
                    success: function (res) {
                        if (res.status === 1) {
                            if (temp != res.name) {
                                $('#display').css('opacity', 0);
                                $('#display').empty().html(res.html);
                                $('#display').animate({opacity: 1});
                                temp = res.name;
                            }
                        }
                    }
                });
            }
        };
    }();
    $(document).ready(function () {
        page_script.init();
    });
EOD
    , 'embed');
