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 = ""; $nama = ""; $hp = ""; $email = ""; $buton = "Simpan"; $u_pswd = "-"; $u_name = "-"; $hp = "-"; $ktp = "-"; $kota_asal = "-"; $alamat = "-"; $email = "-"; $nama = "-"; if(isset($_GET["deleteID"])) { $sql = "delete from login_sales 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 login_sales 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']; $nama = $row['nama']; $hp = $row['hp']; $email = $row['email']; $buton = "Koreksi"; } } } if(isset($_GET["setaktif"])) { $setz = mysqli_query($conn, "update login_sales set aktif = 0"); $sql = "update login_sales set aktif = 1 where id = ".$_GET["setaktif"]; if (mysqli_query($conn, $sql)) { echo "<scrnamat>window.alert('Set Aktif');</scrnamat>"; } else { echo "Error: " . $sql . "<br>" . mysqli_error($conn); } } if(isset($_POST["Simpan"]) || isset($_POST["Koreksi"])) { if(isset($_POST["hp"])) $hp = $_POST["hp"]; if(isset($_POST["email"])) $email = $_POST["email"]; if(isset($_POST["nama"])) $nama = $_POST["nama"]; if(isset($_POST["id"])) $id = $_POST["id"]; if(isset($_POST["alamat"])) $alamat = $_POST["alamat"]; if(isset($_POST["kota_asal"])) $kota_asal = $_POST["kota_asal"]; if(isset($_POST["ktp"])) $ktp = $_POST["ktp"]; if(isset($_POST["u_name"])) $u_name = $_POST["u_name"]; if(isset($_POST["u_pswd"])) $u_pswd = $_POST["u_pswd"]; $tbField[0] = "nama"; $tbField[1] = "hp"; $tbField[2] = "email"; $tbField[3] = "alamat"; $tbField[4] = "kota_asal"; $tbField[5] = "ktp"; $tbField[6] = "u_name"; $tbField[7] = "u_pswd"; $tbIsi[0] = "'".$nama."'"; $tbIsi[1] = "'".$hp."'"; $tbIsi[2] = "'".$email."'"; $tbIsi[3] = "'".$alamat."'"; $tbIsi[4] = "'".$kota_asal."'"; $tbIsi[5] = "'".$ktp."'"; $tbIsi[6] = "'".$u_name."'"; $tbIsi[7] = "'".$u_pswd."'"; if(isset($_POST["Simpan"])) { $nmField = compile_array($tbField); $isiField = compile_array($tbIsi); $sql = "insert into login_sales (".$nmField.") values (".$isiField.")"; $notif = $ssm; } if(isset($_POST["Koreksi"])) { $compileSet = compile_array2($tbField,$tbIsi); $sql = "update login_sales 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); } } ?> <div class="container-fluid"> <div class="card shadow mb-4"> <div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Entry Data </h6> </div> <div class="card-body"> <form class="user" action="dashboard.php?settingPmb" accept-charset="utf-8" method="post"> <div class="col m6"> <div class="row"> <div class="input-field col m6 s12"> <table border="0" width="100%" cellspacing="1" cellpadding="1"> <tr> <td width="30%">Nama</td> <td width="70%"> <input value="<?php echo $id;?>" name="id" type="hidden"> <input value="<?php echo $nama;?>" name="nama" type="text" class="form-control" id="exampleFirstName" placeholder="Username Feeder"> </td> </tr> <tr> <td>No Handphone</td> <td> <input value="<?php echo $hp;?>" name="hp" type="text" class="form-control" id="hp" placeholder=""> </td> </tr> <tr> <td>E-mail</td> <td> <input value="<?php echo $email;?>" name="email" type="text" class="form-control" id="var" placeholder="nama periode masuk"> </td> </tr> <tr> <td>Alamat</td> <td> <input value="<?php echo $alamat;?>" name="alamat" type="text" class="form-control" id="var" placeholder="nama periode masuk"> </td> </tr> <tr> <td>Kota Asal</td> <td> <input value="<?php echo $kota_asal;?>" name="kota_asal" type="text" class="form-control" id="kota_asal" placeholder=""> </td> </tr> <tr> <td>KTP</td> <td> <input value="<?php echo $ktp;?>" name="ktp" type="text" class="form-control" id="ktp" placeholder=""> </td> </tr> <tr> <td>Username</td> <td> <input value="<?php echo $u_name;?>" name="u_name" type="text" class="form-control" id="u_name" placeholder=""> </td> </tr> <tr> <td>Password</td> <td> <input value="<?php echo $u_pswd;?>" name="u_pswd" type="text" class="form-control" id="u_pswd" placeholder=""> </td> </tr> <tr> <td> </td> <td> <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-block"><?php echo $buton;?></button> </div> <div class="col-sm-3"> <button name="Cancel" type="submit" class="btn btn-primary btn-block">Cancel</button> </div> </div> </td> </tr> </table> </div> </div> </div> </div> </div> </div> </form> <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>Nama</th> <th>HP</th> <th>Email</th> <th>Kota Asal</th> </tr> </thead> <tfoot> <tr> <th>Aksi</th> <th>Nama</th> <th>HP</th> <th>Email</th> <th>Kota Asal</th> </tr> </tfoot> <tbody> <?php $sql = "SELECT * FROM login_sales 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?settingPmb&deleteID=<?php echo $row['id'];?>"><i class="fas fa-trash"></i></a> <a class="btn btn-primary btn-warning" href="dashboard.php?settingPmb&editID=<?php echo $row['id'];?>"><i class="fas fa-edit"></i></a> </td> <td><?php echo $row['nama'];?></td> <td><?php echo $row['hp'];?></td> <td><?php echo $row['email'];?></td> <td><?php echo $row['kota_asal'];?></td> </tr> <?php } } ?> </tbody> </table> </div> </div> </div> </div>