From a7f86c6851f457f999e43330ca6a7bab906ff03d Mon Sep 17 00:00:00 2001
From: Oviya Balamurugan <cb.en.u4cse19341@cb.students.amrita.edu>
Date: Thu, 11 Mar 2021 08:40:29 +0000
Subject: [PATCH] home page of admin

---
 ahome.php | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 ahome.php

diff --git a/ahome.php b/ahome.php
new file mode 100644
index 0000000..66242e3
--- /dev/null
+++ b/ahome.php
@@ -0,0 +1,50 @@
+<?php
+session_start();
+include "database.php";
+function countRecord($sql,$mysqli)
+{
+$res=$mysqli->query($sql);
+return $res->num_rows;
+}
+
+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">Welcome Admin</h3>
+<div id="center"> 
+<ul class="record">
+<li>Total students: <?php echo countRecord("select * from student",$mysqli); ?></li>
+<li>Total Books   : <?php echo countRecord("select * from book",$mysqli); ?></li>
+<li>Total Request : <?php echo countRecord("select * from request",$mysqli); ?></li>
+<li>Total Comments: <?php echo countRecord("select * from comment",$mysqli); ?></li>
+</ul>
+
+    </div>
+</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