perbaikan

parent e905def1
......@@ -20,7 +20,7 @@
<div class="login-form-grids">
<h5>Data Artikel</h5>
<?php
$id_article = mysqli_real_escape_string($_GET['id']);
$id_article = mysqli_real_escape_string($koneksi, $_GET['id']);
$cari = mysqli_query($koneksi, "SELECT * FROM t_artikel WHERE id_artikel='$id_article'")or die(mysqli_error());
while($data = mysqli_fetch_array($cari)){
?>
......
......@@ -20,7 +20,7 @@
<div class="login-form-grids">
<h5>Data Buku</h5>
<?php
$id_buku = mysqli_real_escape_string($_GET['id']);
$id_buku = mysqli_real_escape_string($koneksi, $_GET['id']);
$cari = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE isbn='$id_buku'")or die(mysqli_error());
while($data = mysqli_fetch_array($cari)) {
?>
......
......@@ -26,7 +26,7 @@
<!-- comment -->
<div class="about">
<div class="w3_agileits_contact_grids">
<div class="col-md-12 w3_agileits_contact_grid_right">
<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);
......@@ -36,11 +36,16 @@
while($row = mysqli_fetch_array($query))
{
echo "<b>" . $row['nama_pengirim'] . "</b>" . " " . " | " . " " . "<i>" .
$row['tanggal'] . "</i>" . "<br />" . $row['komentar'] . "<br />";
$row['tanggal'] . "</i>" . "<br />" . $row['komentar'] . "<br />". $row['tanggapan'] . "<br />";
echo '
<form action="contact_process.php" method="POST"">
<textarea name="balas_komentar" placeholder="Tanggapan Anda..." required=""></textarea>
<input type="submit" name="balsan" value="kirim">
<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>";
......
<?php
include 'koneksi.php';
$balasan = $_POST['balasan'];
$tanggal_balsan = $_POST['tanggal_balsan'];
$tanggapan = $_POST['tanggapan'];
$tanggal_tanggapan = $_POST['tanggal_tanggapan'];
$query = mysqli_query($koneksi, "INSERT INTO t_komentar VALUES('', '', '', '', '$balasan', NOW())");
$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{
......
......@@ -20,7 +20,7 @@
<div class="login-form-grids">
<h5>Informasi Data Diri</h5>
<?php
$id_nama = mysqli_real_escape_string($_GET['id']);
$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)) {
?>
......
......@@ -44,6 +44,8 @@
<th>Pengirim</th>
<th>Komentar</th>
<th>Tanggal</th>
<th>Tanggapan</th>
<th>Tanggal Ditanggapi</th>
<th>Opsi</th>
</tr>
</thead>
......@@ -56,9 +58,14 @@
<td class="invert"><?php echo $data['nama_pengirim']; ?></td>
<td class="invert"><?php echo $data['komentar']; ?></td>
<td class="invert"><?php echo $data['tanggal']; ?></td>
<td class="invert"><?php echo $data['tanggapan']; ?></td>
<td class="invert"><?php echo $data['tanggal_tanggapan']; ?></td>
<td class="invert">
<div class="rem">
<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']; ?>' }">
<img src="images/close_1.png" />
</a>
......@@ -75,7 +82,7 @@
}
else {
echo '
<tr><td colspan="5" align="center" style="background-color:#ffffff"> Data komentar kosong ! </td></tr></table>
<tr><td colspan="7" align="center" style="background-color:#ffffff"> Data komentar kosong ! </td></tr></table>
';
}
?>
......
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