⚝
One Hat Cyber Team
⚝
Your IP:
216.73.217.37
Server IP:
15.235.14.176
Server:
Linux server2.ihostph.com 4.18.0-553.30.1.el8_10.x86_64 #1 SMP Tue Nov 26 02:30:26 EST 2024 x86_64
Server Software:
Apache
PHP Version:
8.1.34
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
gracious
/
verification.graciousphils.com
/
Edit File: myStaff.php
<!doctype html> <?php include 'connection.php'; if(isset($_SESSION['user']) && ($_SESSION['user'] == "Pia Vera" || $_SESSION['user'] == "Nesh Lastra")){ if(isset($_POST['btnChangePosition'])){ $query = "UPDATE `tblusers` SET `position` = ?, `isActive` = ? WHERE `tblusers`.`user_id` = ?;"; $st = $pdo->prepare($query); $st->bindParam(1,$_POST['position']); $st->bindParam(2,$_POST['isActive']); $st->bindParam(3,$_POST['userId']); $st->execute(); echo "<script>alert('Change Position Successful!');</script>"; } ?> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Bootstrap CSS --> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous"> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.0.1/css/bootstrap.min.css"/> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css"/> <link rel="stylesheet" type="text/css" href="styles.css"> <title>VERIFICATION+</title> <style type="text/css"> .dataTables_length { margin-bottom: 5px; } </style> </head> <body> <?php include 'navBar.php'; ?> <?php $st = $pdo->prepare("select tblusers.user_id, tblusers.name, tblusers.isLogin, tblpositions.positionName, tblusers.isActive from tblusers INNER JOIN tblpositions ON tblusers.position = tblpositions.position_id"); $st->execute(); ?> <br> <div class="container"> <div class="row"> <h2 class="col-lg-8 offset-lg-2 text-center">My Staff</h2> </div> <div class="row"> <div class="col-lg-8 offset-lg-2"> <table id="example" class="table table-bordered display compact" style="width: 100%;"> <thead> <tr class="text-center table-dark"> <th>#</th> <th>Name</th> <th>Position</th> <th>Active</th> <th>Status</th> <th>Action</th> </tr> </thead> <tbody> <?php $count = 0; while ($data = $st->fetch()) { $count++; ?> <tr class="text-center"> <form method="POST" action="myStaff.php"> <input type="hidden" value="<?php echo $data['user_id'];?>" name="userId"> <td><?php echo $count;?></td> <td><?php echo $data['name'];?></td> <td> <select name="position" id="floatingAgentName" class="form-select form-select-sm" required> <?php $modalPositionName = $data['positionName']; $stmt = $pdo->prepare("select * from tblpositions where position_id != 1"); $stmt->execute(); while ($selectData = $stmt->fetch()) { if($modalPositionName==$selectData['positionName']){ ?> <option value="<?php echo $selectData['position_id']; ?>" selected><?php echo $selectData['positionName']; ?></option> <?php } else{ ?> <option value="<?php echo $selectData['position_id']; ?>"><?php echo $selectData['positionName']?></option> ?> <?php } } ?> </select> </td> <td> <select name="isActive" id="floatingAgentName" class="form-select form-select-sm" required> <?php $modalisActive = $data['isActive']; echo $modalisActive; if($modalisActive != "1"){ ?> <option value="0" selected>Inactive</option> <option value="1">Active</option> <?php } else if($modalisActive == "1"){ ?> <option value="0">Inactive</option> <option value="1" selected>Active</option> ?> <?php } ?> </select> </td> <?php if($data['isLogin']== 1){ ?> <td><span class="badge badge-pill bg-success">Online</span></td> <?php } else{ ?> <td><span class="badge badge-pill bg-secondary">Offline</span></td> <?php } ?> <td><button type="submit" class="btn btn-sm btn-success" name="btnChangePosition">Update Staff</button></td> </form> </tr> <?php } ?> </tbody> </table> </div> </div> </div> <!-- Optional JavaScript; choose one of the two! --> <!-- Option 1: Bootstrap Bundle with Popper --> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous"></script> <script src="https://code.jquery.com/jquery-3.5.1.js"></script> <script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script> <script> $(document).ready(function() { $('#example').DataTable({autoWidth: false}); } ); </script> <!-- Option 2: Separate Popper and Bootstrap JS --> <!-- <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.min.js" integrity="sha384-Atwg2Pkwv9vp0ygtn1JAojH0nYbwNJLPhwyoVbhoPwBhjQPR5VtM2+xf0Uwh9KtT" crossorigin="anonymous"></script> --> </body> </html> <?php } else{ session_destroy(); header("location:index.php"); } ?>
Simpan