<?php
echo "<h2 id='systemShutdownInfo'>" . __('SITE_SYSTEM_SHUTDOWN') . " <img src='/img/loading.gif'/></h2>";
?>

<script>
    getStatusOutput();

    function getStatusOutput() {
        $.ajax({
            url: "<?php echo url('site/shutdown'); ?>",
            type: "POST",
            dataType: "text",
            data: {},
            success: function () {
                setTimeout(function () {
                    getStatusOutput();
                }, 1000);
            },
            error: function () {
                $('#systemShutdownInfo').html('<?php echo __('SITE_SYSTEM_SHUTDOWN_DONE'); ?>');
            }
        });
    }
</script>