<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="Start your development with a Dashboard for Bootstrap 4.">
    <meta name="author" content="Creative Tim">
    <title>SPK. Pemilihan Jenis Makanan Balita Metode SAW</title>
    <!-- Favicon -->
    <link rel="icon" href="<?=base_url()?>assets/argon/img/brand/favicon.png" type="image/png">
    <!-- Fonts -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700">
    <!-- Icons -->
    <link rel="stylesheet" href="<?=base_url()?>assets/argon/vendor/nucleo/css/nucleo.css" type="text/css">
    <link rel="stylesheet" href="<?=base_url()?>assets/argon/vendor/@fortawesome/fontawesome-free/css/all.min.css"
        type="text/css">
    <!-- Argon CSS -->
    <link rel="stylesheet" href="<?=base_url()?>assets/argon/css/argon.css?v=1.1.0" type="text/css">
    <style>
    body {
        background-color: #0B3C1E;
        overflow: hidden;
        /* Menghilangkan scrollbar */
        margin: 0;
        /* Menghilangkan margin default */
        padding: 0;
        /* Menghilangkan padding default */
    }

    .imgg {
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
    }

    .col-md-6 {
        padding: 0;
    }

    .btn-success {
        background-color: #00B207;
    }

    @media (max-width: 992px) {
        .col-md-6 .imgg {
            display: none;
        }
    }
    </style>
</head>

<body style="background-color:#0B3C1E;">

    <!-- Main content -->
    <div class="main-content">
        <div class="row">
            <div class="col-md-6">
                <img src="<?=base_url()?>assets/img/img.png" class="imgg" width="100%" alt="Responsive image">
            </div>
            <div class="col-md-6">

                <!-- Page content -->
                <div class="container mt-6">
                    <div class="row justify-content-center mr-2 ml-2">
                        <div class="col-md-8">
                            <div class="text-center text-muted mb-4">
                                <?= $this->session->flashdata('msg') ?>
                            </div>
                            <div class="text-center text-muted mb-5">
                                <h1 class="text-white">Ubah Password</h1>
                            </div>
                            <form action="<?= base_url('lupapassword/proresreset')?>" method="Post" id="formadd3">
                                <input type="hidden" name="email" value="<?=$email?>">
                                <div class="help-info" id="pesan2_pgw"> </div>

                                <div class="input-group mb-3">
                                    <input type="password" class="form-control" name="password" id="pass1_pgw"
                                        placeholder="Masukkan Password Baru" required>
                                    <div class="input-group-append">
                                        <div class="input-group-text">
                                            <span class="fas fa-lock"></span>
                                        </div>
                                    </div>
                                </div>

                                <div class="help-info" id="pesan3_pgw"> </div>
                                <div class="input-group mb-3">
                                    <input type="password" class="form-control" name="password2" id="pass2_pgw"
                                        placeholder="Konfirmasi Password Baru" required>
                                    <div class="input-group-append">
                                        <div class="input-group-text">
                                            <span class="fas fa-lock"></span>
                                        </div>
                                    </div>
                                </div>

                                <div class="text-right">
                                    <input type="submit" class="btn btn-success waves-effect" value="Submit"
                                        name="proses">
                                    <a class="btn btn-danger border-0 text-white"
                                        href="<?=base_url('login');?>">Batal</a>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
    <!-- Footer -->

    <!-- jQuery -->
    <script src="<?=base_url();?>/assets/plugins/jquery/jquery.min.js"></script>
    <!-- Bootstrap 4 -->
    <script src="<?=base_url();?>/assets/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
    <!-- AdminLTE App -->
    <script src="<?=base_url();?>/assets/js/adminlte.min.js"></script>

    <script>
    $(document).ready(function() {
        $("#formadd3").change(function() {
            var email = $("#email").val();
            var pass1 = $("#pass1_pgw").val();
            var pass2 = $("#pass2_pgw").val();
            var cek2 = 1;
            var cek3 = 1;
            $.ajax({
                url: "<?php echo base_url(); ?>daftar/cekpass",
                method: "post",
                data: {
                    pass1: pass1
                },
                success: function(data) {
                    if (data != "") {
                        cek2 = 0;
                        $('#pesan2_pgw').html(data);
                    } else {
                        $('#pesan2_pgw').html(data);
                        cek2 = 1;
                    }
                    if (cek2 == 0 || cek3 == 0) {
                        $(':input[type="submit"]').prop('disabled', true);
                    } else {
                        $(':input[type="submit"]').prop('disabled', false);
                    }
                }
            });

            $.ajax({
                url: "<?php echo base_url(); ?>daftar/cekpass2",
                method: "post",
                data: {
                    pass1: pass1,
                    pass2: pass2
                },
                success: function(data) {
                    if (data != "") {
                        cek3 = 0;
                        $('#pesan3_pgw').html(data);
                    } else {
                        $('#pesan3_pgw').html(data);
                        cek3 = 1;
                    }
                    if (cek2 == 0 || cek3 == 0) {
                        $(':input[type="submit"]').prop('disabled', true);
                    } else {
                        $(':input[type="submit"]').prop('disabled', false);
                    }

                }
            });
        });
    });
    </script>
</body>

</html>