File: /home/nyiet8349bzl/iecbm.sbsc.in/bsadmin/change-password.php
<?php
require_once("../classes/site_class.php");
$obj = new Site();
if($_SESSION['admin']['user_id']=='')
{
echo "<script>window.location.href='index.php'</script>";
}
if(isset($_REQUEST['Submit']) and !empty($_REQUEST['Submit']) and ($_REQUEST['Submit']=='Submit'))
{
$resp = $obj->updatePassword();
if($resp==0)
{
echo "<script>alert('Old password not match')</script>";
}
if($resp==5)
{
echo "<script>alert('Your password update Successfully')</script>";
//echo "<script>window.location.href='change-password.php'</script>";
}
if($resp==1 )
{
echo "<script>alert('Your password is not save, Please try later')</script>";
echo "<script>window.location.href='change-password.php'</script>";
}
}
?>
<!doctype html>
<html class="fixed">
<head>
<title>Admin</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<?php include("inc-head.php"); ?>
</head>
<body>
<section class="body">
<?php include("inc-header.php"); ?>
<div class="inner-wrapper">
<?php include("inc-navigation.php"); ?>
<section role="main" class="content-body">
<header class="page-header">
<h2>Change Password</h2>
<div class="right-wrapper pull-right">
<ol class="breadcrumbs">
<li>
<a href="dashboard.php">
<i class="fa fa-home"></i>
</a>
</li>
<li><span>Change Password</span></li>
</ol>
<a class="sidebar-right-toggle"></a>
</div>
</header>
<div class="row">
<div class="col-lg-12">
<section class="panel">
<header class="panel-heading">
<div class="panel-actions">
<a href="#" class="panel-action panel-action-toggle" data-panel-toggle></a>
<a href="#" class="panel-action panel-action-dismiss" data-panel-dismiss></a>
</div>
<h2 class="panel-title">Change Password</h2>
</header>
<div class="panel-body">
<form class="form-horizontal form-bordered" name="password_form" method ="Post" action="" onsubmit="return Validate_password();" enctype="multipart/form-data">
<div class="form-group">
<label class="col-md-3 control-label" for="inputDefault">Enter Old Password*</label>
<div class="col-md-9">
<input type="password" class="form-control" name="oldpassword" maxlength="25" />
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="inputDefault">Enter New Password*</label>
<div class="col-md-9">
<input type="password" class="form-control" name="newpassword" id="password" maxlength="25" />
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="inputDefault">Enter Conform Password*</label>
<div class="col-md-9">
<input type="password" class="form-control" name="conformpassword" id="confirm_password" maxlength="25" />
<span id='message'></span>
</div>
</div>
<div class="row">
<div class="col-sm-1"></div>
<div class="col-sm-9 text-center">
<input type="submit" class="btn btn-primary" name="Submit" value="Submit" onclick="return Validate_Passwords();"/>
</div>
</div>
</form>
</div>
</section>
</div>
</div>
</section>
</div>
</section>
<script>
$('#password, #confirm_password').on('keyup', function ()
{
if ($('#password').val() == $('#confirm_password').val())
{
$('#message').html('Matching').css('color', 'green');
} else
$('#message').html('Not Matching').css('color', 'red');
});
</script>
<?php include("inc-footer.php"); ?>
</body>
</html>