Current File : /home/inlingua/www/sensoriumpsychologists.com/student/change_password.php |
<?php
include_once('common/session.php');
include_once('../classes/config.php');?>
<?php
$session_id=$_SESSION['email'];
extract($_REQUEST);
if(isset($change_pass))
{
if(!empty($op) && !empty($np) && !empty($cp))
{
$select="SELECT * FROM shristi_student where email='$session_id'";
$change_result = $conn->query($select);
$arr = $change_result->fetch_assoc();
// print_r($arr);die;
$op=$op;
$np=$np;
$cp=$cp;
if($op==$arr['password']){
if($np==$cp){
$np1=$np;
$update="update shristi_student SET password ='$np1' where email='$session_id'";
$update_result = $conn->query($update);
$msg1='<div class="alert alert-success">
<a class="close" data-dismiss="alert" href="#">×</a>
<strong>Successfully!</strong>Password Change.</div>';
//$msg1="Password changed";
}else{
$msg= ' <div class="alert alert-danger">
<a class="close" data-dismiss="alert" href="#">×</a>
<strong>Warning!</strong>New password and conform password is not match.
</div>';
;
//$msg="New password and conform password is not match";
}
}else{
$msg= ' <div class="alert alert-danger">
<a class="close" data-dismiss="alert" href="#">×</a>
<strong>Warning!</strong>Old password is not correct.
</div>';
;
//$msg="Old password is not correct";
}
}else{
$msg= ' <div class="alert alert-danger">
<a class="close" data-dismiss="alert" href="#">×</a>
<strong>Warning!</strong>Please fill the blank fields.
</div>';
;
// $msg="Please fill the blank fields";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Shristi</title>
<?php require("common/head_links.php");?>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<?php require("common/header.php");?>
<?php require("common/left_side_bar.php");?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1> Change Password </h1>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-body" style="padding:50px 15px;">
<?php
if(isset($msg)){
echo "<span style='color:red'><strong>$msg</strong></span>";
}
if(isset($msg1)){
echo "<span style='color:green'><strong>$msg1</strong></span>";
}
?>
<form class="form-horizontal" name="frmChange" role="form" method="post">
<div class="col-md-2"></div>
<div class="col-md-8">
<div class="form-group">
<label class="control-label col-md-4" for="pwd">Current Password:</label>
<div class="col-md-6">
<input type="password" class="form-control" name="op" ><span id="currentPassword" class="required"></span>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-4" for="pwd">New Password:</label>
<div class="col-md-6">
<input type="password" class="form-control" name="np"><span id="newPassword" class="required"></span>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-4" for="pwd">Confirm New Password:</label>
<div class="col-md-6">
<input type="password" class="form-control" name="cp"><span id="confirmPassword" class="required">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-5 col-sm-10">
<button type="submit" class="btn btn-success" name="change_pass">Change Password</button>
</div>
</div>
</form>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php require("common/footer.php");?>
</div><!-- ./wrapper -->
<?php require("common/footer_links.php");?>
</body>
</html>