<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>Set Password</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta content="A fully featured admin theme which can be used to build CRM, CMS, etc." name="description" />
        <meta content="Coderthemes" name="author" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <!-- App favicon -->
        <link rel="shortcut icon" href="<?= base_url()."/public"; ?>/assets/images/favicon.ico">

		<!-- App css -->
		<link href="<?= base_url()."/public"; ?>/assets/css/bootstrap-corporate.min.css" rel="stylesheet" type="text/css" id="bs-default-stylesheet" />
		<link href="<?= base_url()."/public"; ?>/assets/css/app-corporate.min.css" rel="stylesheet" type="text/css" id="app-default-stylesheet" />

		<link href="<?= base_url()."/public"; ?>/assets/css/bootstrap-corporate-dark.min.css" rel="stylesheet" type="text/css" id="bs-dark-stylesheet" />
		<link href="<?= base_url()."/public"; ?>/assets/css/app-corporate-dark.min.css" rel="stylesheet" type="text/css" id="app-dark-stylesheet" />

		<!-- icons -->
		<link href="<?= base_url()."/public"; ?>/assets/css/icons.min.css" rel="stylesheet" type="text/css" />
<style>
.text-danger {
    color: red !important;
}
.parsley-errors-list>li {
    color: red !important;
}
.field-icon {
    float: right;
    margin-left: -35px;
    margin-top: 12px;
    margin-right: 12px;
    position: relative;
    z-index: 3;
}


</style>

    </head>

    <body class="loading">

        <div class="account-pages mt-5 mb-5">
            <div class="container">
                <div class="row justify-content-center">

                    <div class="col-lg-6">
                        <div class="card">
                            <div class="card-body">
                                <h3 class="header-title" style="text-align: center;">Set Password</h3>
                                <p class="sub-header">
                                </p>

                                <form method="post" action="<?= base_url()."update_password"; ?>" role="form" class="parsley-examples">
                                <input id="id" type="hidden" value="<?= session()->getTempdata('id'); ?>" name="id">
                                <input type="hidden" id="user" name="user" value="user">

                                <?php if(session()->getTempdata('mail_success')):?>
                                   <div class="alert alert-success" >
                                   <?= session()->getTempdata('mail_success'); ?>
                                   </div>
                                   <?php endif;?>
                                   
                                   
                                   <?php if(session()->getTempdata('error')):?>
                                   <div class="alert alert-danger" >
                                   <?= session()->getTempdata('error'); ?>
                                   </div>
                                   <?php endif;?>

                                   <div class="form-group row">
                                        <label for="hori-pass1" class="col-4 col-form-label">Email<span class="text-danger">*</span></label>
                                        <div class="col-7">
                                            <input type="text" class="form-control" value="<?= session()->getTempdata('email'); ?>" readonly>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="hori-pass1" class="col-4 col-form-label">Password<span class="text-danger">*</span></label>
                                        <div class="col-7">
                                            <input id="hori-pass1" type="password" placeholder="Password"  
                                            pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,}" 
                                            title="Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters" 
                                            required class="form-control" name="password">
                                        </div>
                                        <span toggle="#hori-pass1" id="toggle-password"  class="fa fa-fw fa-eye field-icon toggle-password"></span>
                                    </div>
                                    <div class="form-group row">
                                        <label for="hori-pass2" class="col-4 col-form-label">Confirm Password
                                            <span class="text-danger">*</span></label>
                                        <div class="col-7">
                                            <input data-parsley-equalto="#hori-pass1" type="password" required
                                                placeholder="Password" class="form-control" id="hori-pass2">
                                        </div>
                                    </div>
                                  

                                    
                                    <div class="form-group row">
                                        <div class="col-8 offset-4">
                                            <button type="submit" class="btn btn-primary waves-effect waves-light mr-1">
                                                Submit
                                            </button>
                                            <button type="reset" onclick="history.back()"
                                                    class="btn btn-secondary waves-effect">
                                                Cancel
                                            </button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div> <!-- end card-box -->

                    </div> <!-- end col -->
                </div>
                <!-- end row -->
            </div>
            <!-- end container -->
        </div>
        <!-- end page -->

 <!-- Right bar overlay-->
 <div class="rightbar-overlay"></div>
 <script>
    $("#toggle-password").click(function() {
    $(this).toggleClass("fa-eye fa-eye-slash");
    var input = $($(this).attr("toggle"));
    if (input.attr("type") == "password") {
        input.attr("type", "text");
    } 
    else {
        input.attr("type", "password");
    }
    });
</script>
 <!-- Vendor js -->
 <script src="<?= base_url()."/public"; ?>/assets/js/vendor.min.js"></script>

 <!-- Plugin js-->
 <script src="<?= base_url()."/public"; ?>/assets/libs/parsleyjs/parsley.min.js"></script>

 <!-- Validation init js-->
 <script src="<?= base_url()."/public"; ?>/assets/js/pages/form-validation.init.js"></script>

 <!-- App js -->
 <script src="<?= base_url()."/public"; ?>/assets/js/app.min.js"></script>
        
    </body>
</html>