<?php include('../config/setup.php');?>
<?php include('../session.php');?>


 <?php
 if(isset($_POST['change_Admin']))
 { 

 $chang_old_Password = md5($_POST['Admin_old_password']); 
 
$trimmed_str = trim($chang_old_Password);
 
if($trimmed_str == $session__password )
{
  $new_EncryptPassword = trim(md5($_POST['Admin_new_password']));
$passcustediton=date('Y-m-d');
$update_customer=mysqli_query($config,"update master_login set Master_Password='".trim($new_EncryptPassword)."' where Master_id='$session_id'");
unset($_COOKIE['$session__password']);




header('location:../logout.php?action=session_Expired');
}else{
	echo "<script>alert('Old Password Mis-Matched') </script>";
	
}
 }

?>

<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<title> </title>
	<meta content='width=device-width, initial-scale=1.0, shrink-to-fit=no' name='viewport' />
	<link rel="icon" href="../assets/img/icon.ico" type="image/x-icon"/>
	
	<!-- Fonts and icons -->
	<script src="../assets/js/plugin/webfont/webfont.min.js"></script>
	<script>
		WebFont.load({
			google: {"families":["Lato:300,400,700,900"]},
			custom: {"families":["Flaticon", "Font Awesome 5 Solid", "Font Awesome 5 Regular", "Font Awesome 5 Brands", "simple-line-icons"], urls: ['../assets/css/fonts.min.css']},
			active: function() {
				sessionStorage.fonts = true;
			}
		});
	</script>

	<!-- CSS Files -->
	<link rel="stylesheet" href="../assets/css/bootstrap.min.css">
	<link rel="stylesheet" href="../assets/css/atlantis.min.css">
	<!-- CSS Just for demo purpose, don't include it in your project -->
	<link rel="stylesheet" href="../assets/css/demo.css">
</head>
<body>
	<div class="wrapper">
		<div class="main-header">
			<!-- Logo Header -->
			 <?php include('logo.php');?>
			<!-- End Logo Header -->

			<!-- Navbar Header -->
			<?php include('topbar.php');?>
			 <!-- End Navbar -->
		</div>
		<!-- Sidebar -->
		<?php include('sidebar.php');?>
		
		
		<div class="main-panel">
		
			
			<!-- Modal -->
  <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Add New Location</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <form action="change_password.php" method="post" enctype="multipart/form-data">
     
			<div class="form-group">
			<label for="email2">Enter Old Password</label>
			<input type="password" class="form-control" id="email2" name="Admin_old_password" placeholder="Enter Old Password"  >
			</div>  <div class="form-group">
			<label for="email2">Enter New Password</label>
			<input type="password" class="form-control" id="email2" name="Admin_new_password" placeholder="Enter  New Password"  >
			</div>  
			 
		
 		
		     <div class="form-group">
									<button class="btn btn-success" type="submit" name="change_Admin">Add New</button>
 								</div>
			
			
			</form>
	
      </div>
    
    </div>
 
			
			
			
			
			
			
			
			
			
			
			
			
			
			 <?php include('footer.php');?>
		</div>
		
		 
		<!-- End Custom template -->
	</div>
	<!--   Core JS Files   -->
	<script src="../assets/js/core/jquery.3.2.1.min.js"></script>
	<script src="../assets/js/core/popper.min.js"></script>
	<script src="../assets/js/core/bootstrap.min.js"></script>
	<!-- jQuery UI -->
	<script src="../assets/js/plugin/jquery-ui-1.12.1.custom/jquery-ui.min.js"></script>
	<script src="../assets/js/plugin/jquery-ui-touch-punch/jquery.ui.touch-punch.min.js"></script>
	
	<!-- jQuery Scrollbar -->
	<script src="../assets/js/plugin/jquery-scrollbar/jquery.scrollbar.min.js"></script>
	<!-- Datatables -->
	<script src="../assets/js/plugin/datatables/datatables.min.js"></script>
	<!-- Atlantis JS -->
	<script src="../assets/js/atlantis.min.js"></script>
	<!-- Atlantis DEMO methods, don't include it in your project! -->
	<script src="../assets/js/setting-demo2.js"></script>
	<script >
		$(document).ready(function() {
			$('#basic-datatables').DataTable({
			});

		 
 
			 
		});
	</script>
</body>
</html>