<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="<?php echo base_url();?>assets/js/jquery.validate.min.js"></script>
<div class="main-panel">
    <div class="content-wrapper">
		<div class="col-md-12 grid-margin stretch-card">
			<div class="card">
				<div class="card-body">
				<h4 class="card-title">Change Password</h4>
					<form id="user_form" name="user_form" class="valid" method="post" action="<?php echo base_url();?>user/passwordChange" >
						<input type="hidden" name="id" value="<?php echo $users['id'];?>">
						<div class="form-group row">
							<label class="col-sm-2 col-form-label">Full Name</label>
							<div class="col-sm-10">
								<label class="col-sm-2 col-form-label"><?php echo $users['first_name'].' '.$users['last_name'];?></label>
							</div>
						</div>
						<div class="form-group row">
							<label class="col-sm-2 col-form-label">New Password</label>
							<div class="col-sm-10">
								<input type="text" name="password" placeholder="Please Enter New Password" class="form-control">
							</div>
						</div>
						<div class="form-group row">
							<div class="col-sm-10">
								<input type="submit" class="btn btn-primary btn-outline-primary" value="Change Password">
								<a href="<?php echo base_url();?>user/users" class="btn btn-info btn-outline-primary">Back to Users</a>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
		var $j = jQuery.noConflict();
        $j(document).ready(function () {
            // Initialize the validation
            $j('#user_form').validate({
				errorClass: 'error-label', 
                rules: {
                    
					password: {
						required:true
					}
                },
                messages: {
                    password: {
                        required: "Please provide a password.",
                        minlength: "Your password must be at least 6 characters long.",
                    },
                },
                submitHandler: function (form) {
                    form.submit(); // Submit the form
                },
            });
        });
    </script>
