<?php
error_reporting(1);
//Cek User
$format = new format;
$time = new time;
$clslistTanggungan = new listTanggungan();
$hariini = $time->tanggalIni();

if ((int)substr($time->getDate(), 5, 2) > 6) {
    $blnNow = (int)substr($time->getDate(), 5, 2) - 6;
} else {
    $blnNow = (int)substr($time->getDate(), 5, 2) + 6;
}

$id = $_GET['i4'];
?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">

    <!-- Main content -->
    <section class="content">
        <div class="container">
            <!-- Info boxes -->
            <!-- /.row -->
            <div class="row mt-5">
                <div class="col-md-12  mt-5">
                    <div class="timeline-header bg-secondary pt-0 pb-1 mb-5">
                        <b class="text-light judul my-2 ml-2" style="font-family:consolas;font-size:14px"><span class="bi bi-arrow-repeat"></span> RESET PASSWORD</b>
                        <a class="btn bg-transparent btn-xs  mx-1 text-light float-right" href="../../" style="font-family: consolas;" title="KELUAR"><span class="bi bi-arrow-left-circle-fill">

                        </a>
                    </div>

                    <div class='row mt-3'>
                        <div class='col-12 col-sm-12 col-md-12'>
                            <div class='info-box  bg-transparent mt-2'>

                                <div class='info-box-content small'>
                                    <div class="row col-md-12 mt-2 text-center">
                                        <div class="col-sm-12">
                                            <label class="text-danger">Isikan Password Baru untuk melakukan Reset</label>
                                        </div><!-- /.col -->

                                        <div class="col-md-8 text-left">
                                            <form action="" method="post">
                                                <div class="card-body mt-4 px-2 mx-3">
                                                    <div class="row my-1">
                                                        <label class="col-lg-3 col-md-4 col-sm-12 ">Password</label>
                                                        <div class="col-lg-9 col-md-8 col-sm-12">
                                                            <input type="text" class="form-control form-control-sm fontInput" name="passwordNew" value="" placeholder="Password" required>
                                                        </div>
                                                    </div>



                                                    <div class="row mt-4">
                                                        <div class="col-md-7">
                                                            <button type="submit" class="btn btn-secondary btn-xs float-right" name="submitResetNew"><i class="bi-save"></i> Proses Reset </button>
                                                        </div>

                                                    </div>

                                                </div>

                                            </form>
                                        </div>

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </section>

    <div class="clearfix hidden-md-up"></div>
</div>


<?php
if (isset($_POST['submitResetNew'])) {

    $crud = new crudData();
    $user = new user();

    $user->resetPassProses($id);
};
