<?php include_once('header.php'); 
if(!empty($_POST['newpassword']))
$pass=change_password();
?>
<main class="admin-content form-page">
        <section class="form-shell">
           <form method="post" action="<?php $_SERVER['PHP_SELF']; ?>" id="change_password" class="needs-validation" novalidate>
              <div id="formFeedback" class="alert d-none mb-3" role="alert"></div>
             <?php
                if(!empty($_GET['fail']))
                {
              ?>
                <div class="alert alert-danger" align="center"><strong style="color:black"> <centrer> Invalid Old Password </centrer> </strong></div>
            <?php
                }
                if(!empty($_GET['succ']))
                {
            ?>
                <div class="alert alert-success" align="center"><strong style="color:black"> <centrer> Password Changed Successfully </centrer> </strong></div>
            <?php
                }
            ?>
              <div class="row g-3 g-lg-4 form-grid">
                <div class="col-12 col-md-12">
                  <label class="form-label" for="courseTitle">Old Password</label>
                  <input type="password" class="form-control" name="oldpassword" id="oldpassword" required>
                  <div class="invalid-feedback">Old Password required.</div>
                </div>
                
                 <div class="row g-3 g-lg-4 form-grid">
                <div class="col-12 col-md-12">
                  <label class="form-label" for="courseTitle">New Password</label>
                  <input type="password" class="form-control" id="newpassword" name="newpassword" required>
                  <div class="invalid-feedback">New Password required.</div>
                </div>
                
                 <div class="row g-3 g-lg-4 form-grid">
                <div class="col-12 col-md-12">
                  <label class="form-label" for="courseTitle">Conform Password</label>
                  <input type="password" class="form-control" id="cnfpassword" name="cnfpassword" required>
                  <div class="invalid-feedback">Confirm Password required.</div>
                </div>
                
                <div class="col-12 form-actions">
                  <button type="submit" class="btn btn-primary rounded-pill px-3">Submit</button>
                </div>
              </div>
            </form>
        </section>
      </main>

      
<?php include_once('footer.php'); ?>