<?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">
					<?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 />";
								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>
								';
								echo "<hr>";
					 		}
					?>
				</div>
			</div>
			<div class="clearfix"> </div>
		</div>
	<!-- comment --> 
		

<?php
	include 'footer.php';
?>