<!DOCTYPE html>
<html dir="ltr">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" href="<?= base_url(); ?>/assets/login/images/icons/dr.ico" />
    <title><?= $title; ?></title>
    <!-- Custom CSS -->
    <link href="<?= base_url(); ?>/assets/regis/dist/css/style.min.css" rel="stylesheet">
    <!--===============================================================================================-->
    <link rel='stylesheet' type="text/css" href='<?= base_url(); ?>/assets/login/alert/css.css'>
    <link rel='stylesheet' type="text/css" href='<?= base_url(); ?>/assets/login/alert/sweetalert2.min.css'>
    <!--===============================================================================================-->
    <style>
        .lds-spinner {
            color: official;
            display: inline-block;
            position: relative;
            width: 80px;
            height: 80px;
            margin-top: 25%;
        }

        .lds-spinner div {
            transform-origin: 40px 40px;
            animation: lds-spinner 1.2s linear infinite;
        }

        .lds-spinner div:after {
            content: " ";
            display: block;
            position: absolute;
            top: 3px;
            left: 37px;
            width: 6px;
            height: 18px;
            border-radius: 20%;
            background: blue;
        }

        .lds-spinner div:nth-child(1) {
            transform: rotate(0deg);
            animation-delay: -1.1s;
        }

        .lds-spinner div:nth-child(2) {
            transform: rotate(30deg);
            animation-delay: -1s;
        }

        .lds-spinner div:nth-child(3) {
            transform: rotate(60deg);
            animation-delay: -0.9s;
        }

        .lds-spinner div:nth-child(4) {
            transform: rotate(90deg);
            animation-delay: -0.8s;
        }

        .lds-spinner div:nth-child(5) {
            transform: rotate(120deg);
            animation-delay: -0.7s;
        }

        .lds-spinner div:nth-child(6) {
            transform: rotate(150deg);
            animation-delay: -0.6s;
        }

        .lds-spinner div:nth-child(7) {
            transform: rotate(180deg);
            animation-delay: -0.5s;
        }

        .lds-spinner div:nth-child(8) {
            transform: rotate(210deg);
            animation-delay: -0.4s;
        }

        .lds-spinner div:nth-child(9) {
            transform: rotate(240deg);
            animation-delay: -0.3s;
        }

        .lds-spinner div:nth-child(10) {
            transform: rotate(270deg);
            animation-delay: -0.2s;
        }

        .lds-spinner div:nth-child(11) {
            transform: rotate(300deg);
            animation-delay: -0.1s;
        }

        .lds-spinner div:nth-child(12) {
            transform: rotate(330deg);
            animation-delay: 0s;
        }

        @keyframes lds-spinner {
            0% {
                opacity: 1;
            }

            100% {
                opacity: 0;
            }
        }


        .overlay {
            z-index: 9999999;
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: rgba(255, 255, 255, 0.7);
            text-align: center;
        }
    </style>
</head>

<body onload="hide_loading();">
    <div class="main-wrapper">
        <div class="loading overlay">
            <div class="lds-spinner">
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
            </div>
        </div>
        <div class="auth-wrapper d-flex no-block justify-content-center align-items-center bg-dark">
            <div class="auth-box bg-dark border-top border-secondary">
                <div>
                    <div id="flashsucces" data-flash="<?= $this->session->flashdata('messageSuccess'); ?>"></div>
                    <div id="flashwarning" data-flash="<?= $this->session->flashdata('messageWarning'); ?>"></div>
                    <div id="flashupdate" data-flash="<?= $this->session->flashdata('messageUpdate'); ?>"></div>
                    <div id="flasherror" data-flash="<?= $this->session->flashdata('messageError'); ?>"></div>
                    <div id="flashsave" data-flash="<?= $this->session->flashdata('messageSave'); ?>"></div>
                    <div id="flashinfo" data-flash="<?= $this->session->flashdata('messageInfo'); ?>"></div>
                    <div id="flashinfo2" data-flash="<?= $this->session->flashdata('messageInfo2'); ?>"></div>

                    <div class="text-center p-t-20 p-b-20">
                        <span class="db"><img src="<?= base_url(); ?>/assets/login/images/d-rapor1.png" width="200px" alt="logo" /></span>
                    </div>

                    <div class="text-center">
                        <h4>Apakah anda lupa password ?</h4>
                    </div>

                    <?= $this->session->flashdata('messageDaftar'); ?>
                    <!-- Form -->
                    <form class="form-horizontal m-t-20" action="<?= base_url('login/lupa_password'); ?>" method="post">
                        <div class="row p-b-30">
                            <div class="col-12">

                                <?= form_error('email_user', '<small class="text-white bg-danger"><b>', '</b></small>'); ?>
                                <div class="input-group mb-3">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text bg-success text-white" id="basic-addon1"><i class="ti-email"></i></span>
                                    </div>
                                    <input type="email" class="form-control form-control-lg" placeholder="Email Admin" name="email_user" id="email_user" aria-describedby="basic-addon1" value="<?= set_value('email_user'); ?>">
                                </div>

                            </div>
                        </div>
                        <div class="row border-top border-secondary">
                            <div class="col-12">
                                <div class="form-group">
                                    <div class="p-t-20">
                                        <button class="btn btn-block btn-lg btn-warning" type="submit"> Reset Password</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!-- ============================================================== -->
        <!-- Login box.scss -->
        <!-- ============================================================== -->
        <!-- ============================================================== -->
        <!-- Page wrapper scss in scafholding.scss -->
        <!-- ============================================================== -->
        <!-- ============================================================== -->
        <!-- Page wrapper scss in scafholding.scss -->
        <!-- ============================================================== -->
        <!-- ============================================================== -->
        <!-- Right Sidebar -->
        <!-- ============================================================== -->
        <!-- ============================================================== -->
        <!-- Right Sidebar -->
        <!-- ============================================================== -->
    </div>
    <!-- ============================================================== -->
    <!-- All Required js -->
    <!-- ============================================================== -->
    <script src="<?= base_url(); ?>/assets/regis/assets/libs/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap tether Core JavaScript -->
    <script src="<?= base_url(); ?>/assets/regis/assets/libs/popper.js/dist/umd/popper.min.js"></script>
    <script src="<?= base_url(); ?>/assets/regis/assets/libs/bootstrap/dist/js/bootstrap.min.js"></script>
    <!--===============================================================================================-->
    <script src="<?= base_url(); ?>/assets/login/alert/sweetalert2.all.min.js"></script>
    <script src="<?= base_url(); ?>/assets/login/alert/jquery.min.js"></script>
    <!--===============================================================================================-->

    <!-- ============================================================== -->
    <!-- This page plugin js -->
    <!-- ============================================================== -->
    <script>
        let fadeTarget = document.querySelector(".loading")

        function show_loading() {
            fadeTarget.style.display = "block";
            fadeTarget.style.opacity = 1;
        }

        function hide_loading() {
            // fadeTarget.style.display = "none";
            let fadeEffect = setInterval(() => {
                if (!fadeTarget.style.opacity) {
                    fadeTarget.style.opacity = 1;
                }
                if (fadeTarget.style.opacity > 0) {
                    fadeTarget.style.opacity -= 0.1;
                } else {
                    clearInterval(fadeEffect)
                    fadeTarget.style.display = "none"
                }
            }, 150)
        }
    </script>
    <script>
        var flash = $('#flashsucces').data('flash');
        if (flash) {
            Swal.fire({
                icon: 'success',
                title: 'Berhasil',
                text: flash,
            })
        }

        $(document).on('click', '#btn-hapus', function(e) {
            e.preventDefault();
            var link = $(this).attr('href');

            Swal.fire({
                title: 'Apakah anda yakin ?',
                text: "Anda akan menghapus data !",
                icon: 'question',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: 'Ya, Hapus !'
            }).then((result) => {
                if (result.isConfirmed) {
                    window.location = link;
                }
            })

        })

        $(document).on('click', '#btn-proses', function(e) {
            e.preventDefault();
            var link = $(this).attr('href');

            Swal.fire({
                title: 'Apakah anda yakin ?',
                text: "Anda akan memproses data nilai akhir !",
                icon: 'question',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: 'Ya, proses !'
            }).then((result) => {
                if (result.isConfirmed) {
                    window.location = link;
                }
            })

        })

        var flash = $('#flasherror').data('flash');
        if (flash) {
            Swal.fire({
                icon: 'error',
                title: 'Gagal',
                text: flash,
            })
        }

        var flash = $('#flashwarning').data('flash');
        if (flash) {
            Swal.fire({
                icon: 'warning',
                title: 'Cek lagi',
                text: flash,
            })
        }

        var flash = $('#flashinfo').data('flash');
        if (flash) {
            Swal.fire({
                icon: 'info',
                title: 'Mohon menunggu',
                text: flash,
            })
        }

        var flash = $('#flashinfo2').data('flash');
        if (flash) {
            Swal.fire({
                icon: 'info',
                title: 'Mohon hubungi admin',
                text: flash,
            })
        }

        var flash = $('#flashsave').data('flash');
        if (flash) {
            Swal.fire({
                position: 'bottom-end',
                icon: 'success',
                text: flash,
                showConfirmButton: false,
                timer: 2000
            })
        }

        var flash = $('#flashupdate').data('flash');
        if (flash) {
            Swal.fire({
                position: 'bottom-end',
                icon: 'success',
                text: flash,
                showConfirmButton: false,
                timer: 2000
            })
        }
    </script>
</body>

</html>