EVOLUTION-NINJA
Edit File: forgot_password_user.php
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>AMCAD</title> <!-- user css --> <link href="<?php echo base_url('public/assets/css/avinash.css') ?>" rel="stylesheet"> <!-- Bootstrap Core CSS --> <link href="<?php echo base_url('public/assets/css/bootstrap.min.css') ?>" rel="stylesheet"> <!-- MetisMenu CSS --> <link href="<?php echo base_url('public/assets/css/metisMenu.min.css') ?>" rel="stylesheet"> <!-- Timeline CSS --> <link href="<?php echo base_url('public/assets/css/timeline.css') ?>" rel="stylesheet"> <!-- Custom CSS --> <link href="<?php echo base_url('public/assets/css/sb-admin-2.css') ?>" rel="stylesheet"> <!-- Morris Charts CSS --> <link href="<?php echo base_url('public/assets/css/morris.css') ?>" rel="stylesheet"> <!-- Custom Fonts --> <link href="<?php echo base_url('public/assets/css/font-awesome.min.css') ?>" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="<?php echo base_url('public/assets/toastr/toastr.min.css'); ?>"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-GE6Zef6XX5v8rOR3z2XTMyMVEPkdHE56f3ecV0uFn1BdAv1Zv7tju8DFmlz3I9x9y3uWAlG6M7IAj4I1fxq01w==" crossorigin="anonymous" /> <style> body { background: url("public/assets/website_assets/images/banner.png") no-repeat center center/cover; height: 100vh; margin: 0; display: flex; justify-content: center; align-items: center; } .form-container { background-color: transparent; padding: 20px; border-radius: 5px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); width: 100%; max-width: 400px; text-align: center; /* margin-left: 318px; */ } .form-group { margin-bottom: 20px; } .input-group-addon i { color: #555; } .btn-login { background-color: #007bff; color: #fff; border: none; } .btn-login:hover { background-color: #0056b3; } #form-reset{ margin-left: 24%; } </style> </head> <body> <div class="container"> <div class="form-container" id="form-reset"> <div class="col-lg-12"> <h3 style="padding-bottom:30px;border-bottom:1px solid #ccc;margin-bottom:20px;">Reset Password</h3> </div> <form method="post" id="forgot_password_form"> <div class="form-group"> <input type="hidden" name="encrypted_id" value="<?php echo $token; ?>" required> </div> <div class="form-group"> <label for="password1" class="control-label">Enter New Password</label> <div class="input-group"> <div class="input-group-addon"><i class="fa fa-lock"></i></div> <input type="password" class="form-control" id="password1" name="password1" title="Minimum 6, Maximum 8 characters, one uppercase, one lowercase, one number and one special character:" required> <div class="input-group-addon eye-toggle" onclick="togglePasswordVisibility('password1')" data-input="password1"> <i class="fa fa-eye"></i> </div> </div> </div> <div class="form-group"> <label for="password2" class="control-label">Retype Password</label> <div class="input-group"> <div class="input-group-addon"><i class="fa fa-lock"></i></div> <input type="password" class="form-control" id="password2" name="password2" title="Minimum 6, Maximum 8 characters, one uppercase, one lowercase, one number and one special character:" required> <div class="input-group-addon eye-toggle" onclick="togglePasswordVisibility('password2')" data-input="password2"> <i class="fa fa-eye"></i> </div> </div> </div> <button type="submit" class="btn btn-block btn-login" data-loading-text="Please wait....">Submit </button> </form> </div> </div> <!-- jQuery --> <script src="<?php echo base_url('public/assets/js/jquery.min.js') ?>"></script> <!-- Bootstrap Core JavaScript --> <script src="<?php echo base_url('public/assets/js/bootstrap.min.js') ?>"></script> <script type="text/javascript" src="<?php echo base_url('public/assets/toastr/toastr.min.js'); ?>"></script> <script type="text/javascript"> $(document).ready(function() { $('#forgot_password_form').submit(function(e) { e.preventDefault(); var formdata = new FormData($(this)[0]); $(".btn-login").attr('disabled', 'disabled'); $(".btn-login").text("Submitting..."); $.ajax({ type: 'post', url: '<?php echo site_url("reset_forgot_pswrd_user") ?>', data: formdata, contentType: false, processData: false, success: function(response) { response = jQuery.parseJSON(response); console.log(response); if (response.result == 1) { toastr["success"](response.message); // Redirect to the faculty page window.location.href = '<?php echo site_url("/") ?>'; } else if (response.result == 2) { toastr["error"](response.message); } else { toastr["error"](response.message); } $(".btn-login").text("Submit"); $(".btn-login").removeAttr('disabled'); } }); }); }); </script> <script> function togglePasswordVisibility(inputId) { var passwordInput = document.getElementById(inputId); var eyeIcon = document.querySelector('[data-input="' + inputId + '"] i'); if (passwordInput.type === 'password') { passwordInput.type = 'text'; eyeIcon.classList.remove('fa-eye'); eyeIcon.classList.add('fa-eye-slash'); } else { passwordInput.type = 'password'; eyeIcon.classList.remove('fa-eye-slash'); eyeIcon.classList.add('fa-eye'); } } </script> </body> </html>