-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
650 additions
and
303 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?php | ||
session_start(); | ||
//error_reporting(0); | ||
include('../../include/config.php'); | ||
include('../../include/checklogin.php'); | ||
// check_login(); | ||
|
||
date_default_timezone_set('Asia/Kolkata');// change according timezone | ||
|
||
$currentTime = date( 'd-m-Y h:i:s A', time () ); | ||
if(isset($_POST['submit'])) { | ||
$sql=mysqli_query($con,"SELECT password FROM users where password='".md5($_POST['cpass'])."' && id='".$_SESSION['id']."'"); | ||
$num=mysqli_fetch_array($sql); | ||
|
||
if($num>0) { | ||
$con=mysqli_query($con,"update users set password='".md5($_POST['npass'])."', updationDate='$currentTime' where id='".$_SESSION['id']."'"); | ||
$_SESSION['msg1']="Password Changed Successfully !!"; | ||
} else { | ||
$_SESSION['msg1']="Old Password not match !!"; | ||
} | ||
} | ||
?> | ||
|
||
<script type="text/javascript"> | ||
function valid() { | ||
if(document.chngpwd.cpass.value=="") { | ||
alert("Current Password Filed is Empty !!"); | ||
document.chngpwd.cpass.focus(); | ||
return false; | ||
} else if(document.chngpwd.npass.value=="") { | ||
alert("New Password Filed is Empty !!"); | ||
document.chngpwd.npass.focus(); | ||
return false; | ||
} else if(document.chngpwd.cfpass.value=="") { | ||
alert("Confirm Password Filed is Empty !!"); | ||
document.chngpwd.cfpass.focus(); | ||
return false; | ||
} else if(document.chngpwd.npass.value!= document.chngpwd.cfpass.value) { | ||
alert("Password and Confirm Password Field do not match !!"); | ||
document.chngpwd.cfpass.focus(); | ||
return false; | ||
} | ||
return true; | ||
} | ||
</script> | ||
|
||
|
||
<div class="wrap-content container" id="container"> | ||
<div class="container-fluid container-fullw bg-white"> | ||
|
||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div class="row margin-top-30"> | ||
<div class="col-lg-12 col-md-12"> | ||
<div class="panel panel-white"> | ||
<div class="panel-heading"><h5 class="panel-title">Change Password</h5></div> | ||
<div class="panel-body"> | ||
<p style="color:red;"> | ||
<?php echo htmlentities($_SESSION['msg1']);?> | ||
<?php echo htmlentities($_SESSION['msg1']="");?> | ||
</p> | ||
<form role="form" name="chngpwd" method="post" onSubmit="return valid();"> | ||
<div class="form-group"> | ||
<label for="exampleInputEmail1">Current Password</label> | ||
<input type="password" name="cpass" class="form-control" placeholder="Enter Current Password"> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="exampleInputPassword1">New Password</label> | ||
<input type="password" name="npass" class="form-control" placeholder="New Password"> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="exampleInputPassword1">Confirm Password</label> | ||
<input type="password" name="cfpass" class="form-control" placeholder="Confirm Password"> | ||
</div> | ||
|
||
<button type="submit" name="submit" class="btn btn-o btn-primary">Submit</button> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?php | ||
session_start(); | ||
//error_reporting(0); | ||
include('../../include/config.php'); | ||
include('../../include/checklogin.php'); | ||
// check_login(); | ||
|
||
if(isset($_POST['submit'])) { | ||
$fname=$_POST['fname']; | ||
$address=$_POST['address']; | ||
$city=$_POST['city']; | ||
$gender=$_POST['gender']; | ||
|
||
$sql=mysqli_query($con,"Update users set fullName='$fname',address='$address',city='$city',gender='$gender' where id='".$_SESSION['id']."'"); | ||
if($sql) { | ||
$msg="Your Profile updated Successfully"; | ||
} | ||
} | ||
?> | ||
|
||
<div class="wrap-content container" id="container"> | ||
<div class="container-fluid container-fullw bg-white"> | ||
|
||
<div class="row"> | ||
<div class="col-md-12"> | ||
<h5 style="color: green; font-size:18px;"> | ||
<?php if($msg) { echo htmlentities($msg);}?></h5> | ||
<div class="row margin-top-30"> | ||
<div class="col-lg-12 col-md-12"> | ||
<div class="panel panel-white"> | ||
<div class="panel-heading"> | ||
<h5 class="panel-title">Edit Profile</h5> | ||
</div> | ||
|
||
<div class="panel-body"> | ||
<?php | ||
$sql=mysqli_query($con,"select * from users where id='".$_SESSION['id']."'"); | ||
while($data=mysqli_fetch_array($sql)) { | ||
?> | ||
<h4><?php echo htmlentities($data['fullName']);?>'s Profile</h4> | ||
<p><b>Profile Reg. Date: </b><?php echo htmlentities($data['regDate']);?></p> | ||
<?php if($data['updationDate']){?> | ||
<p><b>Profile Last Updation Date: </b><?php echo htmlentities($data['updationDate']);?></p> | ||
<?php } ?> | ||
<hr /> | ||
<form role="form" name="edit" method="post"> | ||
<div class="form-group"> | ||
<label for="fname">User Name</label> | ||
<input type="text" name="fname" class="form-control" value="<?php echo htmlentities($data['fullName']);?>" > | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="address">Address</label> | ||
<textarea name="address" class="form-control"><?php echo htmlentities($data['address']);?></textarea> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="city">City</label> | ||
<input type="text" name="city" class="form-control" required="required" value="<?php echo htmlentities($data['city']);?>" > | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="gender">Gender</label> | ||
<select name="gender" class="form-control" required="required" > | ||
<option value="<?php echo htmlentities($data['gender']);?>"><?php echo htmlentities($data['gender']);?></option> | ||
<option value="male">Male</option> | ||
<option value="female">Female</option> | ||
<option value="other">Other</option> | ||
</select> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="fess">User Email</label> | ||
<input type="email" name="uemail" class="form-control" readonly="readonly" value="<?php echo htmlentities($data['email']);?>"> | ||
<a href="change-emaild.php">Update your email id</a></div> | ||
<button type="submit" name="submit" class="btn btn-o btn-primary">Update</button> | ||
</div> | ||
</form> | ||
<?php } ?> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
Binary file not shown.