From f51e61f1c8f79a14b728e6520202a3966d8f9af2 Mon Sep 17 00:00:00 2001
From: Oviya Balamurugan <cb.en.u4cse19341@cb.students.amrita.edu>
Date: Thu, 11 Mar 2021 08:49:48 +0000
Subject: [PATCH] view comments

---
 view_comm.php | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 view_comm.php

diff --git a/view_comm.php b/view_comm.php
new file mode 100644
index 0000000..53f10fc
--- /dev/null
+++ b/view_comm.php
@@ -0,0 +1,69 @@
+<?php
+session_start();
+include "database.php";
+
+if(!isset( $_SESSION["AID"]))
+{
+ header("location:alogin.php");
+}
+?>
+
+
+<!DOTYPE HTML>
+<html>
+<head>
+<title>BOOK MANAGEMENT SYSTEM</title>
+<link rel="stylesheet" type ="text/css" href="css/style.css">
+</head>
+<body>
+<div id="container">
+<div id="header">
+<h1>BOOK MANAGEMENT SYSTEM</h1>
+</div>
+<div id="wrapper">
+    <h3 id="heading">View Comment details</h3>
+<?php
+$sql="SELECT book .BTITLE,student.NAME,comment.COMM,comment.LOGS from comment inner join book on book.BID = comment.BID inner join student on comment.SID=student.ID";
+
+
+$res = $mysqli->query($sql);
+if($res->num_rows>0)
+{
+ echo "<table>
+ <tr>
+ <th>SNO</th>
+ <th>BOOK</th>
+ <th>NAME</th>
+ <th>COMMENT</th>
+ <th>LOGS</th>
+ </tr>
+ ";
+ while($row=$res->fetch_assoc())
+ {
+     $i++;
+     echo "<tr>";
+     echo "<td>{$i}</td>";
+     echo "<td>{$row["BTITLE"]}</td>";
+     echo "<td>{$row["NAME"]}</td>";
+     echo "<td>{$row["COMM"]}</td>";
+     echo "<td>{$row["LOGS"]}</td>";
+     echo "</tr>";
+ }
+ echo "</table>";
+}
+else{
+    echo "<p class='error'> No comments found </p>";
+}
+?>
+</div>
+<div id="navi">
+    <?php
+    include "adminsidebar.php"
+    ?>
+</div>
+<div id="footer">
+<p>Copyright &copy; book management 2020</p>
+<div>
+</div>
+</body>
+</html>
\ No newline at end of file
-- 
GitLab