
<div class="page-content" >
    
    
<div class="row">
    <div class="col-sm-12">
        <div class="widget-box">
            <div class="widget-header" style="height:70px;">
                <h4  style="text-align:center; color:green;"><b>Change Password</b> </h4>
            </div>

            <div class="widget-body">
            
                 <?php
                                $message = $this->session->userdata('message');
                                if (!empty($message)) {
                                    ?>
                                    <div class="alert alert-block alert-success">
                                        <h6 class="lighter arial green" style="text-align:center;"><b>
                                                <?php echo $message;
                                                $this->session->unset_userdata('message');
                                                ?>
                                            </b></h6>
                                    </div>  
                                    <?php
                                }
                                $errormessage = $this->session->userdata('errormessage');
                                if (!empty($errormessage)) {
                                    ?>
                                    <div class="alert alert-block alert-danger">
                                        <h6 class="lighter arial red" style="text-align:center;"><b>
                                                <?php echo $errormessage;
                                                $this->session->unset_userdata('errormessage');
                                                ?>
                                            </b></h6>
                                    </div> 
                                    <?php
                                }
                                ?>
                <div class="widget-main no-padding">
                    <form action="<?php echo admin_url()?>/newpasswordsetup/change_password " method="post">
                       
                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-2 col-sm-2"> Courrent Password </label>
                            <?php echo form_error('data[courrentPassword]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <input type="password" name="data[courrentPassword]" autocomplete="off" value="<?php echo set_value('data[courrentPassword]',false); ?>" placeholder="Courrent Password" class="col-xs-4 col-sm-4" />
                         </fieldset>

                        
                        
                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-2 col-sm-2"> New Password </label>
                            <?php echo form_error('data[newPassword]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <input type="password" name="data[newPassword]" autocomplete="off" value="<?php echo set_value('data[newPassword]',false); ?>" id="password" placeholder="New Password" class="col-xs-4 col-sm-4" />
                           
                        </fieldset>
                       
                        <fieldset class="col-xs-12 col-sm-12">
                               <label class="col-xs-2 col-sm-2"> Confrime New Password </label>
                            <?php echo form_error('data[confirmPassword]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <input type="password" name="data[confirmPassword]" autocomplete="off" value="<?php echo set_value('data[confirmPassword]',false); ?>" id="varefied_password" onkeyup="Verify_password();" placeholder="Confirm Password" class="col-xs-4 col-sm-4" />
                            &nbsp;&nbsp;&nbsp;&nbsp;<label style="color:red" id="pmessage"> </label><label style="color:red" id="pmessage"></label>
                        </fieldset>




                        <div class="clearfix"></div>

                        <div class="form-actions center">
                            <button type="submit"  name="btnSave" id="mySubmit" class="btn btn-sm btn-success">
                                 <i class="ace-icon fa fa-check bigger-110"></i>
                                Change Password
                                
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div></div></div> 

<script type="text/javascript"> 
function Verify_password(){
       var password=document.getElementById('password').value;
       var varefied_password=document.getElementById('varefied_password').value;
       if(password !== varefied_password){
           document.getElementById('pmessage').innerHTML="Password  Missmatch";
            document.getElementById("mySubmit").disabled = true;
       }
       else{
           document.getElementById('pmessage').innerHTML=" ";
           document.getElementById("mySubmit").disabled = false;
       }
   }

</script>