ESH/techsyn_shortcut_popup.php

177 lines
8.0 KiB
PHP
Raw Permalink Normal View History

2024-10-23 18:28:06 +05:30
<a href="home.php"> BACK</a>
<?php
/* error_reporting(E_ERROR | E_PARSE);
include ('includes/config/config.php');
echo $_SESSION['user_id'];
// echo dhfdhdhg;
$userInfo = "select u.*, ur.*, r.* from tbl_users u left join user_roles ur on u.user_id = ur.user_id left join role_master r on ur.role_id=r.role_id where u.user_id =" . $_SESSION['user_id'];
$userInfoResult = mysqli_query($conn,$userInfo);
$userInfoData = @mysqli_fetch_array($userInfoResult);
?>
<?php
if (isset($hid) && $hid == '1') {
$msg = "";
if ($frmacn == "Update") {
$userid = $_SESSION['user_id'];
$sql = "SELECT user_password FROM tbl_users WHERE user_id='" . $userid . "'";
$res = @mysqli_query($conn,$sql);
$row = @mysqli_fetch_array($res);
@extract($row);
if ($old_pass == $row['user_password']) {
$new_pass ==$_POST['new_password'];
$conf_pass ==$_POST['confirm_password'];
$cont = strlen($new_pass);
if (($new_pass == $conf_pass) && ($cont > 4)) {
$result = mysqli_query($conn,"UPDATE tbl_users SET user_password = '" . $new_pass . "' WHERE user_id='" . $userid . "'") or die(mysqli_error($conn));
$msg = "Password Changed Successfully";
if (!$result) {
$msg = 'Error';
}
echo "<script>alert('Password Change Successfull. Please Login Again.')</script>";
echo "<script>location.replace('index.php')</script>";
} else {
$msg = "New Password/Confirm Password mismatch OR Password length should be more than 5 alphabets";
}
} else {
$msg = "Incorrect Old Password";
}
}
}*/
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2 style="align:center">Change Password</h2>
<form class="form-horizontal" action="techsyn_chpass.php" method="post" id="changepass_form" style="align:center">
<div class="form-group">
<label class="control-label col-sm-2" for="form_name">Old Password:</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="old_password" placeholder="Enter email" name="old_password" required="required" data-error="Firstname is required.">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="new_password"> New Password :</label>
<div class="col-sm-6">
<input type="password" class="form-control" id="new_password" placeholder="Enter New Password" name="new_password" required="required" data-error="Confirm Password is required.">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="confirm_password"> Confirm Password:</label>
<div class="col-sm-6">
<input type="password" class="form-control" id="confirm_password" placeholder="Enter Confirm Password" name="confirm_password" required="required" data-error="Confirm Password is required.">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default" name="frmacn" value="Update" onclick="document.forms[0].hid.value = 1">Submit</button>
</div>
</div>
</form>
</div>
</body>
</html>
<!--
<div id="dashboard" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content for Broadcast messages-->
<!-- <div class="modal-content border-radius-4">
<div class="modal-body">
<table class="table">
<tbody>
<tr class="info">
<td ><?php echo $userInfoData['user_name'] ?></td>
<td ><?php echo $userInfoData['role_name'] ?></td>
<td ><?php echo $userInfoData['email'] ?></td>
</tr>
</tbody>
</table>
<div>
<br><br><h5 align="center"><b>Change Password</b><h5>
<form id="changepass_form" action="techsyn_chpass.php" style="align:center" method="post" role="form">
<div class="controls">
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="form_name">Old Password </label>
<input id="form_firstname" type="text" name="firstName" class="form-control" required="required" data-error="Firstname is required.">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="new_password">New Password </label>
<input id="new_password" type="text" name="new_password" class="form-control" required="required" data-error="New Password is required.">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="confirm_password">Confirm Password </label>
<input id="confirm_password" type="text" name="confirm_password" class="form-control" required="required" data-error="Confirm Password is required.">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<input type="submit" name="frmacn" value="Update" onclick="document.forms[0].hid.value = 1">
</div>
</div>
</div>
</div></form></div>
</div>
</div>
</div>
</div>
-->