<?php
session_start();
include 'dbcon.php';
if(isset($_POST['submit'])){
   $old_pass=$_POST['old_pass'];
   $new_pass=$_POST['new_pass'];
   $new_pass_again=$_POST['new_pass_again'];
   if($new_pass==$new_pass_again){
    $query=mysqli_query($con,"select * from admin where  pass='$old_pass'");
    if(mysqli_num_rows($query)>0){
        $query=mysqli_query($con,"select * from admin where  pass='$new_pass'");
    if(mysqli_num_rows($query)==0){
        $query=mysqli_query($con,"update  admin set pass='$new_pass'");
        if($query){
            echo"<script>alert('Your Password Change Successfully');window.location.href='password_change.php'</script>";
        }
    }
    else{
        echo"<script>alert('Do not enter same password');window.location.href='password_change.php'</script>";
    }
     }
     else{
        echo"<script>alert('Old Password is not correct');window.location.href='password_change.php'</script>";
  
     }
    }
    else{
        echo"<script>alert('New password is not same as Confirm password');window.location.href='password_change.php'</script>";
  
    }
}
?>
<!doctype html>
<html class="no-js" lang="">


<!-- Mirrored from www.radiustheme.com/demo/html/psdboss/global-abroadstudy/global-abroadstudy/login.html by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 06 Sep 2022 11:11:24 GMT -->
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>PPM | password change</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Favicon -->
    <link rel="shortcut icon" type="rel" href="https://perfectpostmedia.com/assets/img/ppm.png">
    <!-- Normalize CSS -->
    <link rel="stylesheet" href="css/normalize.css">
    <!-- Main CSS -->
    <link rel="stylesheet" href="css/main.css">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <!-- Fontawesome CSS -->
    <link rel="stylesheet" href="css/all.min.css">
    <!-- Flaticon CSS -->
    <link rel="stylesheet" href="fonts/flaticon.css">
    <!-- Animate CSS -->
    <link rel="stylesheet" href="css/animate.min.css">
    <!-- Custom CSS -->
    <link rel="stylesheet" href="style.css">
    <!-- Modernize js -->
    <script src="js/modernizr-3.6.0.min.js"></script>
</head>

<body>
    <!-- Preloader Start Here -->
    <div id="preloader"></div>
    <!-- Preloader End Here -->
    <!-- Login Page Start Here -->

    <div class="login-page-wrap" >
        <div class="login-page-content">
            <div class="login-box "  >
                <div class="item-logo" style="margin:0;padding:0">
                    <img src="https://perfectpostmedia.com/assets/img/ppm.png"  style="width:100px;" alt="logo">
                </div>
                <form  class="login-form" method="post">
                    <div class="form-group">
                        <label>Old Password</label>
                        <input type="text" placeholder="Enter Old Password" name="old_pass" class="form-control">
                        <i class="far fa-envelope"></i>
                    </div>
                    <div class="form-group">
                        <label>New Password</label>
                        <input type="text" placeholder="Enter New password" name="new_pass" class="form-control">
                        <i class="fas fa-lock"></i>
                    </div>
                    <div class="form-group">
                        <label>Confirm Password</label>
                        <input type="text" placeholder="Enter New password Again" name="new_pass_again" class="form-control">
                        <i class="fas fa-lock"></i>
                    </div>
                    <div class="form-group d-flex align-items-center justify-content-between">
                        <!-- <div class="form-check">
                            <input type="checkbox" class="form-check-input" id="remember-me">
                            <label for="remember-me" class="form-check-label">Remember Me</label>
                        </div> -->
                        <!-- <a href="#" class="forgot-btn">Forgot Password?</a> -->
                    </div>
                    <div class="form-group">
                        <button type="submit" name="submit" class="login-btn">Password Change</button>
                    </div>
                </form>
                <div class="login-social">
                    <p>Return to Dashboard</p>
                    <ul>
                        <li><a href="dashboard.php" class="bg-fb"><i class="fa fa-arrow-left"></i></a></li>
                        <!-- <li><a href="#" class="bg-twitter"><i class="fab fa-twitter"></i></a></li>
                        <li><a href="#" class="bg-gplus"><i class="fab fa-google-plus-g"></i></a></li>
                        <li><a href="#" class="bg-git"><i class="fab fa-github"></i></a></li> -->
                    </ul>
                </div>
            </div>
         
        </div>
    </div>
    <!-- Login Page End Here -->
    <!-- jquery-->
    <script src="js/jquery-3.3.1.min.js"></script>
    <!-- Plugins js -->
    <script src="js/plugins.js"></script>
    <!-- Popper js -->
    <script src="js/popper.min.js"></script>
    <!-- Bootstrap js -->
    <script src="js/bootstrap.min.js"></script>
    <!-- Scroll Up Js -->
    <script src="js/jquery.scrollUp.min.js"></script>
    <!-- Custom Js -->
    <script src="js/main.js"></script>

</body>


<!-- Mirrored from www.radiustheme.com/demo/html/psdboss/global-abroadstudy/global-abroadstudy/login.html by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 06 Sep 2022 11:11:25 GMT -->
</html>