<?php
include'connection.php';
include'time.php';
    // Change Profile Programme// 
    
    $usrid = $_GET['usrid'];
    $OldPwd = $_GET['OldPwd'];
    $NewPwd = $_GET['NewPwd'];
    $ReNewPwd = $_GET['ReNewPwd'];
    
    $quGetPwd="select * from retailer where Userid='$usrid'";
    $reGetPwd=mysqli_query($con,$quGetPwd);
    $dataGetPwd=mysqli_fetch_array($reGetPwd);
    $Pwd=$dataGetPwd['Password'];
    if($OldPwd==$Pwd)
    {
        if($NewPwd==$ReNewPwd)
        {
            $qu="update retailer set Password='$ReNewPwd' where Userid='$usrid'";
            if(mysqli_query($con,$qu))
            {
                echo "<div class='msg-div'>
                        <form method='post'>
                        <h3>Password Changed Successfully !</h3><br>
                        <i class='fa fa-check-circle' aria-hidden='true' id='okIcon'></i><br><br>
                        <button type='submit' class='btnPopup'>OK</button><br><br>
                        </form>
                    </div>";
            }
        }
        else
        {
            echo "<div class='msg-div'>
                <form method='post'>
                <h3>Password And Confirm Password Not Matched !</h3><br>
                <i class='fa fa-ban' aria-hidden='true' id='NotokIcon'></i><br><br>
                <button type='submit' class='btnPopup'>OK</button><br><br>
                </form>
            </div>";
        }
    }
    else
    {
        echo "<div class='msg-div'>
                <form method='post'>
                <h3>You Have Entered Invalid Password !</h3><br>
                <i class='fa fa-ban' aria-hidden='true' id='NotokIcon'></i><br><br>
                <button type='submit' class='btnPopup'>OK</button><br><br>
                </form>
            </div>";
    }
?>