<?php 
  include('gc/common/header.php');
$user=$this->_page_data['user'];
 ?>
<div class="">
	<div class="col-xm-12">
		<div class="widget-box light-border">
			<!-- <div class="widget-header header-color-grey">
				<h4 class="smaller">
					State View 
				</h4>
			</div> -->
			<div class="widget-body">
										<div class="widget-main">
											<div class="space-6"></div>
												<form  name="myForm" action="<?php echo base_url();?>index.php/authentication/User_changing_password/<?php echo $user ?>"onsubmit="return validateForm()" method="post" accept-charset="utf-8">
													<span id="notmatch_password" class="text-danger font-weight-bold"></span>

												<fieldset>
													<label style="color: red;">											
														<div id="messages" style="color:red;"><h5><?php echo $this->session->flashdata('message'); ?></h5></div>												<label class="block clearfix">
														<span class="block input-icon input-icon-right">												
															<input type="password" class="form-control" id="old_password" size="30" maxlength="80" value="" name="old_password" onkeypress="return RestrictSpace()" placeholder="Old  Password" maxlength="40">												
															<i class="icon-user"></i>
														</span>
													<span id="old_password1" class="text-danger font-weight-bold"></span>
													</label>																																													
													<label class="block clearfix">
														<span class="block input-icon input-icon-right">												
															<input type="password" class="form-control" id="password" size="30" maxlength="80" value="" name="password"  onkeypress="return RestrictSpace()" placeholder="New Password" maxlength="40">												
															<i class="icon-user"></i>
														</span>
													<span id="password1" class="text-danger font-weight-bold"></span>
													</label>

													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
														<input type="password" size="30" id="confirm_password" class="form-control" value="" name="confirm_password" onkeypress="return RestrictSpace()" placeholder="Confirm Password" maxlength="40">
														<i class="icon-lock"></i>
														</span>
														<span id="confirm_password1" class="text-danger font-weight-bold"></span>
													</label>

													<div class="space"></div>

													<div class="clearfix">
														
														<!--		
														<button type="button" class="width-35 pull-right btn btn-sm btn-primary">
															<i class="icon-key"></i>
															<input type="submit" name="submit" value="Login	"  />														</button>-->
														
				<button class="pull-right btn btn-sm btn-warning" type="submit" name="submit">
															<i class="fa fa-key"></i> Submit
														</button>
													</div>

													<div class="space-4"></div>
												</fieldset>
								
												</form>									
										</div>
										<!-- /widget-main -->
									
									
									
										
									</div><!-- /widget-body -->
		</div>
	</div>
    <!-- /.col -->
</div>
<div class="space-4"></div>
	<!-- /.page-row -->
    <!-- /.page-content --> 
</div>
<!-- /.main-content -->  
</div>
<!-- /#ace-settings-container --> 
</div>
<!-- /.main-container-inner --> 
<?php
  include('gc/common/footer.php');
?>		
		
<!-- 	<script>
				$('document').ready(function(){
						 $('a').on("click", function (e) {
						 var rel = $(this).attr('rel');
						 //if(rel=='undefined'){
						 if($(this).attr('rel')){
							
							window.location.replace(rel);
						 }else{
						  e.preventDefault();
						 } 
						
						
						});
					});
	</script>  -->
	<script>
function RestrictSpace() {
    if (event.keyCode == 32) {
        return false;
    }
}
</script>
<script type="text/javascript">
		

		function validateForm(){

			// var old_password = document.getElementById('old_password').value;
			// var password = document.getElementById('password').value;
			// var confirm_password = document.getElementById('confirm_password').value;

			// if(old_password == ""){
			// 	document.getElementById('old_password1').innerHTML =" ** Please fill the Old Password field";
			// 	return false;
			// }else{
			// 	document.getElementById('old_password1').innerHTML ="";
			// }

			// if(password == ""){
			// 	document.getElementById('password1').innerHTML =" ** Please fill the password field";
			// 	return false;
			// }else{
			// 	document.getElementById('password1').innerHTML ="";
			// }
			// if(confirm_password == ""){
			// 	document.getElementById('confirm_password1').innerHTML =" ** Please fill the confirm password field";
			// 	return false;
			// }else{
			// 	document.getElementById('confirm_password1').innerHTML ="";
			// }

			// if(password!=confirm_password){
			// 	document.getElementById('notmatch_password').innerHTML =" ** Password does not match the confirm password";
			// 	return false;
			// }else{
			// 	document.getElementById('notmatch_password').innerHTML ="";
			// }



			var error=false;  
  var old_password=$("#old_password").val();  
  if(old_password=='')
  {
    $("#old_password1").html("Please Enter Old Password");
    error=true; 
  }
 else{
    $('#old_password1').html("");
  }
  
  var password=$("#password").val();  
  if(password=='')
  {
    $("#password1").html("Please Enter New Password");
    error=true; 
  }
  else
  {
    $('#password1').html("");
      
  }

  var confirm_password=$("#confirm_password").val();  
  if(confirm_password=='')
  {
    $("#confirm_password1").html("Please Enter Confirm Password");
    error=true; 
  }
  else
  {
    $('#confirm_password1').html("");
      
  }
  
  if(password!=confirm_password)
  {
    $("#notmatch_password").html("New and Confirm Password not matched");
    error=true; 
  }
  else
  {
    $('#notmatch_password').html("");
      
  }

  
  
  if(error==true)
  {
    return false;
  }
  else
  {
    return true;
  }



			

		}

	</script>