Server IP : 101.255.104.117 / Your IP : 101.255.104.117 Web Server : Apache/2.4.34 (Win32) OpenSSL/1.0.2o PHP/5.6.38 System : Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586 User : user ( 0) PHP Version : 5.6.38 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/xampp182/htdocs/wablast/ |
Upload File : |
<?php $id = ""; $ip = ""; $userf = ""; $pwdf = ""; $buton = "Simpan"; if(isset($_GET["deleteID"])) { $sql = "delete from set_feeder where id = ".$_GET["deleteID"]; if (mysqli_query($conn, $sql)) { echo "<script>window.alert('Data Sudah Terhapus');</script>"; } else { echo "Error: " . $sql . "<br>" . mysqli_error($conn); } } if(isset($_GET["editID"])) { $sql = "SELECT * FROM set_feeder where id = ".$_GET["editID"]." order by id desc"; $result = mysqli_query($conn, $sql); if(mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_assoc($result)) { $id = $row['id']; $ip = $row['ip']; $userf = $row['userf']; $pwdf = $row['pwdf']; $buton = "Koreksi"; } } } if(isset($_GET["setaktif"])) { $setz = mysqli_query($conn, "update set_feeder set aktif = 0"); $sql = "update set_feeder set aktif = 1 where id = ".$_GET["setaktif"]; if (mysqli_query($conn, $sql)) { echo "<script>window.alert('Set Aktif');</script>"; } else { echo "Error: " . $sql . "<br>" . mysqli_error($conn); } } if(isset($_POST["Simpan"]) || isset($_POST["Koreksi"])) { if(isset($_POST["userf"])) $userf = $_POST["userf"]; if(isset($_POST["pwdf"])) $pwdf = $_POST["pwdf"]; if(isset($_POST["ip"])) $ip = $_POST["ip"]; if(isset($_POST["id"])) $id = $_POST["id"]; $tbField[0] = "pwdf"; $tbField[1] = "userf"; $tbIsi[0] = "'".$pwdf."'"; $tbIsi[1] = "'".$userf."'"; if(isset($_POST["Simpan"])) { $nmField = compile_array($tbField); $isiField = compile_array($tbIsi); $sql = "insert into set_feeder (".$nmField.") values (".$isiField.")"; $notif = $ssm; } if(isset($_POST["Koreksi"])) { $compileSet = compile_array2($tbField,$tbIsi); $sql = "update set_feeder set ".$compileSet." where id = ".$id; $notif = $sum; } if (mysqli_query($conn, $sql)) { echo "<script>window.alert('".$notif."');</script>"; } else { echo "Error: " . $sql . "<br>" . mysqli_error($conn); } } ?> <h1 class="h3 mb-4 text-gray-800">Setting Akun Perguruan Tinggi</h1> <div class="row"> <div class="col-lg-12"> <div class="p-5"> <form class="user" action="dashboard.php?settingPT" accept-charset="utf-8" method="post"> <div class="form-group row"> <div class="col-sm-6 mb-3 mb-sm-0"> <input value="<?php echo $id;?>" name="id" type="hidden"> <input value="<?php echo $userf;?>" name="userf" type="text" class="form-control form-control-user" id="exampleFirstName" placeholder="API Key"> </div> <div class="col-sm-6"> <input value="<?php echo $pwdf;?>" name="pwdf" type="text" class="form-control form-control-user" id="exampleLastName" placeholder="Number Key"> </div> </div> <div class="form-group row"> <div class="col-sm-3 mb-3 mb-sm-0"> <button name="<?php echo $buton;?>" type="submit" class="btn btn-primary btn-user btn-block"><?php echo $buton;?></button> </div> <div class="col-sm-3"> <button name="Cancel" type="submit" class="btn btn-primary btn-user btn-block">Cancel</button> </div> </div> </form> </div> </div> </div> <div class="container-fluid"> <!-- Page Heading --> <!-- DataTales Example --> <div class="card shadow mb-4"> <div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">DataTables</h6> </div> <div class="card-body"> <div class="table-responsive"> <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> <thead> <tr> <th>Aksi</th> <th>API Key</th> <th>Number Key</th> <th>Waktu</th> <th>Aktif</th> </tr> </thead> <tfoot> <tr> <th>Aksi</th> <th>API Key</th> <th>Number Key</th> <th>Waktu</th> <th>Aktif</th> </tr> </tfoot> <tbody> <?php $sql = "SELECT * FROM set_feeder order by id desc"; $result = mysqli_query($conn, $sql); if(mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_assoc($result)) { ?> <tr> <td> <a class="btn btn-primary btn-danger" href="dashboard.php?settingPT&deleteID=<?php echo $row['id'];?>"><i class="fas fa-trash"></i></a> <a class="btn btn-primary btn-warning" href="dashboard.php?settingPT&editID=<?php echo $row['id'];?>"><i class="fas fa-edit"></i></a> </td> <td><?php echo $row['userf'];?></td> <td><?php echo $row['pwdf'];?></td> <td><?php echo $row['tgl'];?></td> <td> <?php if($row['aktif'] == 1) echo "Aktif"; else { ?> <a class="btn btn-primary btn-info" href="dashboard.php?settingPT&setaktif=<?php echo $row['id'];?>"><i class="fas fa-sign-in-alt"></i></a> <?php } ?> </td> </tr> <?php } } ?> </tbody> </table> </div> </div> </div> </div>