perbaikan dan penghapusan data yang tidak sesuai dengan use case

parent 3e8dac30
<?php
require_once("koneksi.php");
include 'header.php';
?>
<!-- breadcrumbs -->
<div class="breadcrumbs">
<div class="container">
<ol class="breadcrumb breadcrumb1 animated wow slideInLeft" data-wow-delay=".5s">
<?php
if (isset($_SESSION['administrator'])) {
echo '
<li><span><i class="fa fa-sign-in" aria-hidden="true"></i><a href="login.php"> Masuk</a></span></li>
<li class="active">Tanggapi Komentar</li> ';
}
else {
echo '
<li><a href="index.php"><span class="glyphicon glyphicon-home" aria-hidden="true"></span>Beranda</a></li>
<li class="active">Tanggapi Komentar</li> ';
}
?>
</ol>
</div>
</div>
<!-- //breadcrumbs -->
<!-- comment -->
<div class="about">
<div class="w3_agileits_contact_grids">
<div class="col-md-12 w3_agileits_contact_grid_right"><br>
<?php
$query = mysqli_query($koneksi, "SELECT * FROM t_komentar ORDER BY tanggal DESC") or die(mysqli_error());
$masukan = mysqli_num_rows($query);
echo "<h4>" . "Jumlah komentar saat ini $masukan buah." . "</h4>";
echo "<b>" . "Berikan kritik & saran Anda agar kami <br> dapat meingkatkan pelayanan kami." . "</b>";
echo "<hr>";
while($row = mysqli_fetch_array($query))
{
echo "<b>" . $row['nama_pengirim'] . "</b>" . " " . " | " . " " . "<i>" .
$row['tanggal'] . "</i>" . "<br />" . $row['komentar'] . "<br />". $row['tanggapan'] . "<br />";
echo '
<form class="col-md-" action="editcomment_process.php" method="POST"">
<span class="input input--ichiro">
<input class="input__field input__field--ichiro" type="text" id="input-25" name="tanggapan" placeholder="Tanggapan Anda..." required="" />
<label class="input__label input__label--ichiro" for="input-25">
<span class="input__label-content input__label-content--ichiro">Tanggapan Komentar</span>
</label>
</span>
<input type="submit" name="kirim" value="kirim">
</form>
';
echo "<hr>";
}
?>
</div>
</div>
<div class="clearfix"> </div>
</div>
<!-- comment -->
<?php
include 'footer.php';
?>
\ No newline at end of file
<?php
include 'koneksi.php';
$tanggapan = $_POST['tanggapan'];
$tanggal_tanggapan = $_POST['tanggal_tanggapan'];
$query = mysqli_query($koneksi, "INSERT INTO t_komentar VALUES('', '', '', '', '$tanggapan', NOW())");
if ($query) {
echo "<script>alert('Terimakasih $username telah menanggapi masukan !'); window.location = 'processcomment.php'</script>";
}else{
echo "<script>alert('$username gagal menanggapi masukan !'); window.location = 'editcomment.php'</script>";
}
<?php
require_once("koneksi.php");
include 'header.php';
?>
<!-- breadcrumbs -->
<div class="breadcrumbs">
<div class="container">
<ol class="breadcrumb breadcrumb1">
<li><span><i class="fa fa-sign-in" aria-hidden="true"></i><a href="login.php"> Masuk</a></span></li>
<li class="active">Form Kelola Buku</li>
</ol>
</div>
</div>
<!-- //breadcrumbs -->
<!-- register -->
<div class="register">
<div class="container">
<h2>Form Ubah Informasi Data Diri</h2>
<div class="login-form-grids">
<h5>Informasi Data Diri</h5>
<?php
$id_nama = mysqli_real_escape_string($koneksi, $_GET['id']);
$cari = mysqli_query($koneksi, "SELECT * FROM t_user WHERE id_user='$id_nama'")or die(mysqli_error());
while($data = mysqli_fetch_array($cari)) {
?>
<form action="editprofile_process.php" method="POST">
<input type="hidden" name="id" placeholder="ID User" value="<?php echo $data['id_user'] ?>" >
Nama Lengkap :
<input type="text" name="nama_lengkap" placeholder="Nama Lengkap" value="<?php echo $data['nama_lengkap'] ?>" >
Alamat :
<input type="text" name="alamat" placeholder="Alamat" value="<?php echo $data['alamat'] ?>" ><br>
Nomor Ponsel :
<input type="text" name="nomor_ponsel" placeholder="Nomor Ponsel" value="<?php echo $data['nomor_ponsel'] ?>" >
Email :
<input type="email" name="email" placeholder="Email" value="<?php echo $data['email'] ?>" >
<div class="register-check-box">
<div class="check">
<label class="checkbox"><input type="checkbox" name="checkbox" required=" " ><i> </i>Saya telah mengetahui dan setuju</label>
</div>
</div>
<input type="submit" name="simpan" value="simpan">
</form>
<?php
}
?>
</div>
<div class="register-home">
<a href="editprofile.php">Batal</a>
</div>
</div>
</div>
<!-- //register -->
<?php
include 'footer.php';
?>
\ No newline at end of file
<?php
session_start();
include 'koneksi.php';
$username = $_SESSION['username'];
$id = $_POST['id'];
$nama_lengkap = $_POST['nama_lengkap'];
$alamat = $_POST['alamat'];
$nomor_ponsel = $_POST['nomor_ponsel'];
$email = $_POST['email'];
$edit = mysqli_query($koneksi, "UPDATE t_user SET nama_lengkap='$nama_lengkap', email='$email', alamat='$alamat', nomor_ponsel='$nomor_ponsel' WHERE id_user='$id'") or die(mysqli_error());
if($edit) {
echo "sukses";
}
else {
echo "<script>alert('Gagal menyimpan data diri !'); window.location = 'editprofile.php'</script>";
}
?>
\ No newline at end of file
<?php <?php
global $koneksi; global $koneksi;
//$koneksi = mysqli_connect("localhost", "root", ""); $koneksi = mysqli_connect("localhost", "root", "");
$koneksi = mysqli_connect("localhost", "p1d3ti07", "p1d3ti07"); //$koneksi = mysqli_connect("localhost", "p1d3ti07", "p1d3ti07");
if (!$koneksi) { if (!$koneksi) {
die("Database connection problem"); die("Database connection problem");
} }
//$db_use = mysqli_select_db($koneksi, "toko_buku_cemerlang") or die("Select database problem !!"); $db_use = mysqli_select_db($koneksi, "toko_buku_cemerlang") or die("Select database problem !!");
$db_use = mysqli_select_db($koneksi, "p1d3ti07_d3ti07") or die("Select database problem !!"); //$db_use = mysqli_select_db($koneksi, "p1d3ti07_d3ti07") or die("Select database problem !!");
?> ?>
\ No newline at end of file
...@@ -62,10 +62,7 @@ ...@@ -62,10 +62,7 @@
<td class="invert"><?php echo $data['tanggal_tanggapan']; ?></td> <td class="invert"><?php echo $data['tanggal_tanggapan']; ?></td>
<td class="invert"> <td class="invert">
<div class="rem"> <div class="rem">
<div> <div>
<a href="editcomment.php?id=<?php echo $data['id_komentar']; ?>">
<img src="images/edit.png" />
</a>
<a href='deletecomment_process.php?id=<?php echo $data['id_komentar']; ?>' }"> <a href='deletecomment_process.php?id=<?php echo $data['id_komentar']; ?>' }">
<img src="images/close_1.png" /> <img src="images/close_1.png" />
</a> </a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment