Skip to content

Commit

Permalink
Setting Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jave Lupango committed Dec 17, 2020
1 parent 532c927 commit dd3f15a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 18 deletions.
33 changes: 29 additions & 4 deletions view/body/form.body.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,42 @@
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" name="AddQ_password" id="exampleInputPassword1" value="" required placeholder="Password">
<input type="password" class="form-control" name="Update_password" id="exampleInputPassword1" value="" required placeholder="Password">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Confirm Password</label>
<input type="password" class="form-control" name="AddQ_passwordNew" id="exampleInputPassword1" value="" required placeholder="Confirm Password">
<input type="password" class="form-control" name="Update_passwordNew" id="exampleInputPassword1" value="" required placeholder="Confirm Password">
</div>
</div>
<div class="card-footer">
<button type="submit" name="btnupdate_2factAuth" class="btn btn-primary">Update</button>
<button type="submit" name="btnupdate_password" class="btn btn-primary">Update</button>
<?php
if(isset($_POST["btnupdate_password"]))
{
$usernameOR = $_POST["usernameOR"];
$Update_password = $_POST["Update_password"];
$Update_passwordNew = $_POST["Update_passwordNew"];
if($Update_password === $Update_passwordNew)
{
$hashUpdate_password= md5($Update_password);
$retUpdateusername = $c_Del->deleteRecord($conn, "UPDATE users SET password='$hashUpdate_password', passkey='$Update_password' WHERE username='$usernameOR'");
if($retUpdateusername === "success")
{
echo '<button type="button" name="" class="btn btn-success" style="float: right;" >Successfully Updated!</button>';
}
else
{
echo '<button type="button" name="" class="btn btn-danger" style="float: right;" >Unsuccessfully Updated!</button>';
}
}
else
{
echo '<button type="button" name="" class="btn btn-danger" style="float: right;" >Password not match!</button>';
}
}
?>
</div>
</form>
</form>
</div>
<!-- /.card -->
</div>
Expand Down
33 changes: 19 additions & 14 deletions view/body/viewuser.body.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
$SelectQuery = "";

if (strtoupper($data) == "VIEWALLUSER")
{
if ($c_Select->fn_SingleResponse($conn, "SELECT * FROM users WHERE username=?", "usertype", $_SESSION['username']) == "admin")
Expand Down Expand Up @@ -93,19 +92,25 @@
<td>'.$row['username'].'</td>
<td>'. $c_Func->_duration($row['duration']).'</td>
<td>'.$row['usertype'].'</td>
<td>
<button onclick="user_edit_function('.$row['id'].')" class="btn btn-success" title="Update Client Info"><i class="fa fa-edit"></i></button>
<button onclick="modalClientInformationView('.$row['id'].')" class="btn btn-info" title="View Client Info"><i class="fa fa-file"></i></button>
<button onclick="functionDeleteUsers('.$row['id'].')" class="btn btn-danger" title="Delete Client Info"><i class="fa fa-trash"></i></button>';
if ($row['usertype'] == "reseller")
{
echo'<button onclick="functionReloadVoucher('.$row['id'].')" class="btn btn-warning"><i class="fa fa-share" title="Reload Client Credit"></i></button>';
echo'<button onclick="functionReloadDuration('.$row['id'].')" class="btn btn-success"><i class="fa fa-barcode" title="Reload Client Duration"></i></button>';
}
else
{
echo'<button onclick="functionReloadDuration('.$row['id'].')" class="btn btn-success"><i class="fa fa-barcode" title="Reload Client Duration"></i></button>';
}
<td>';
if($aside_access === "client")
{
echo '<button type="button" name="" class="btn btn-danger">No Access</button>';
}
else{
echo '<button onclick="user_edit_function('.$row['id'].')" class="btn btn-success" title="Update Client Info"><i class="fa fa-edit"></i></button>
<button onclick="modalClientInformationView('.$row['id'].')" class="btn btn-info" title="View Client Info"><i class="fa fa-file"></i></button>
<button onclick="functionDeleteUsers('.$row['id'].')" class="btn btn-danger" title="Delete Client Info"><i class="fa fa-trash"></i></button>';
if ($row['usertype'] == "reseller")
{
echo'<button onclick="functionReloadVoucher('.$row['id'].')" class="btn btn-warning"><i class="fa fa-share" title="Reload Client Credit"></i></button>';
echo'<button onclick="functionReloadDuration('.$row['id'].')" class="btn btn-success"><i class="fa fa-barcode" title="Reload Client Duration"></i></button>';
}
else
{
echo'<button onclick="functionReloadDuration('.$row['id'].')" class="btn btn-success"><i class="fa fa-barcode" title="Reload Client Duration"></i></button>';
}
}
echo '</td> </tr>';
$countb++;
} //functionReloadVoucher
Expand Down

0 comments on commit dd3f15a

Please sign in to comment.