<!DOCTYPE html>
<html lang="en">
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$ng = false;
?>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>System Requirements</title>
    <link rel="stylesheet" href="/vendors/fontawesome-free-5.15.4-web/css/all.min.css">
    <link rel="shortcut icon" href="/assets/img/logo.png" type="image/x-icon">
    <link rel="stylesheet" href="/vendors/plainadmin/assets/css/bootstrap.min.css">
</head>

<body>
    <div class="container py-2">
        <div class="text-center">
            <img src="/assets/img/logo.png" style="max-width: 100px;" alt="logo.png">
            <header>
                <stong class="font-md">Persyaratan sistem</strong>
            </header>
            <hr>
            <fieldset>
                <dl>
                    <dt>PHP Version</dt>
                    <dd>
                        <?php if (version_compare(PHP_VERSION, '7.4', '>=')) : ?>
                            <i class='fas fa-check text-success'></i>
                        <?php else : ?>
                            <?php $ng = true; ?>
                            <i class='fas fa-times text-danger'></i>
                        <?php endif; ?>
                        <?= PHP_VERSION ?>
                    </dd>
                    <dt>PHP Extensions</dt>
                    <dd>
                        <?php if (in_array("iconv", get_loaded_extensions())) : ?>
                            <i class='fas fa-check text-success'></i>
                        <?php else : ?>
                            <?php $ng = true; ?>
                            <i class='fas fa-times text-danger'></i>
                        <?php endif; ?>
                        iconv
                    </dd>
                    <dd>
                        <?php if (in_array("intl", get_loaded_extensions())) : ?>
                            <i class='fas fa-check text-success'></i>
                        <?php else : ?>
                            <?php $ng = true; ?>
                            <i class='fas fa-times text-danger'></i>
                        <?php endif; ?>
                        intl
                    </dd>
                    <dd>
                        <?php if (in_array("json", get_loaded_extensions())) : ?>
                            <i class='fas fa-check text-success'></i>
                        <?php else : ?>
                            <?php $ng = true; ?>
                            <i class='fas fa-times text-danger'></i>
                        <?php endif; ?>
                        json
                    </dd>
                    <dd>
                        <?php if (in_array("date", get_loaded_extensions())) : ?>
                            <i class='fas fa-check text-success'></i>
                        <?php else : ?>
                            <?php $ng = true; ?>
                            <i class='fas fa-times text-danger'></i>
                        <?php endif; ?>
                        date
                    </dd>
                    <dd>
                        <?php if (in_array("gd", get_loaded_extensions())) : ?>
                            <i class='fas fa-check text-success'></i>
                        <?php else : ?>
                            <?php $ng = true; ?>
                            <i class='fas fa-times text-danger'></i>
                        <?php endif; ?>
                        gd
                    </dd>
                    <dd>
                        <?php if (in_array("zip", get_loaded_extensions())) : ?>
                            <i class='fas fa-check text-success'></i>
                        <?php else : ?>
                            <?php $ng = true; ?>
                            <i class='fas fa-times text-danger'></i>
                        <?php endif; ?>
                        zip
                    </dd>
                    <dd>
                        <?php if (in_array("mysqli", get_loaded_extensions())) : ?>
                            <i class='fas fa-check text-success'></i>
                        <?php else : ?>
                            <?php $ng = true; ?>
                            <i class='fas fa-times text-danger'></i>
                        <?php endif; ?>
                        mysqli
                    </dd>
                    <dd>
                        <?php if (in_array("session", get_loaded_extensions())) : ?>
                            <i class='fas fa-check text-success'></i>
                        <?php else : ?>
                            <?php $ng = true; ?>
                            <i class='fas fa-times text-danger'></i>
                        <?php endif; ?>
                        session
                    </dd>
                    <dd>
                        <?php if (in_array("mbstring", get_loaded_extensions())) : ?>
                            <i class='fas fa-check text-success'></i>
                        <?php else : ?>
                            <?php $ng = true; ?>
                            <i class='fas fa-times text-danger'></i>
                        <?php endif; ?>
                        mbstring
                    </dd>
                    <dt>PHP Class</dt>
                    <dd>
                        <?php if (class_exists('ZipArchive')) : ?>
                            <i class='fas fa-check text-success'></i>
                        <?php else : ?>
                            <?php $ng = true; ?>
                            <i class='fas fa-times text-danger'></i>
                        <?php endif; ?>
                        ZipArchive
                    </dd>
                </dl>
            </fieldset>
            <?php if ($ng) : ?>
                <div class="alert alert-danger" role="alert">
                    <strong>Persyaratan sistem</strong>
                    <p>
                        <strong>Harap perbaiki masalah di atas dan coba lagi.</strong>
                    </p>
                </div>
            <?php else : ?>
                <div class="alert alert-success" role="alert">
                    <strong>Persyaratan sistem</strong>
                    <p>
                        <strong>Anda telah memenuhi persyaratan sistem.</strong>
                    </p>
                </div>
                <a href="/pnli" class="btn btn-primary">Install</a>
            <?php endif; ?>
        </div>
    </div>
    <!-- END MAIN PANEL -->
    <!-- ==========================CONTENT ENDS HERE ========================== -->
    <script src="/vendors/plainadmin/assets/js/bootstrap.bundle.min.js"></script>

</body>

</html>