-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdmindashboard.jsp
More file actions
99 lines (96 loc) · 3.97 KB
/
Admindashboard.jsp
File metadata and controls
99 lines (96 loc) · 3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" type="image/x-icon" href="images/logo2.png">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard</title>
<link rel="stylesheet" href="adDashCss.css">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
<header>
<a href="" class="heading"><h1>Admin Dashboard</h1></a>
</header>
<nav>
<ul>
<li><a href="Admindashboard.jsp">Dashboard</a></li>
<li><a href="engagement.jsp">Engagements</a></li>
<li><a href="orders.jsp">Orders</a></li>
<li><a href="Product.jsp">Products</a></li>
<li><a href="Ledger.jsp">Orders Ledger</a></li>
<li><a href="feedback.jsp">Feedback/Support</a></li>
<li><a href="logoutadmin.html">Logout</a></li>
</ul>
</nav>
<main>
<%
try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/system_station", "root", "9353");
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery("SELECT COUNT(*) FROM register");
// Retrieving count from the result set
if (resultSet.next()) {
int numberOfUsers = resultSet.getInt(1);
%>
<section id="dashboard">
<h2>Dashboard</h2>
<div class="stats">
<div class="stat">
<h3>User Engaged with Website</h3>
<p> <%= numberOfUsers %></p>
</div>
<%
}}catch(Exception e){
out.println(e);
}
try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/system_station", "root", "9353");
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery("SELECT COUNT(*) FROM orders");
// Retrieving count from the result set
if (resultSet.next()) {
int numberOfOrders = resultSet.getInt(1);
%>
<div class="stat">
<h3>Number of Orders</h3>
<p><%= numberOfOrders %></p>
</div><%
}}catch(Exception e){
out.println(e);
}
try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/system_station", "root", "9353");
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery("SELECT COUNT(*) FROM ledgers");
// Retrieving count from the result set
if (resultSet.next()) {
int numberOfSales = resultSet.getInt(1);
%>
<div class="stat">
<h3>Product Sales</h3>
<p><%= numberOfSales %></p>
</div>
</div><%
}}catch(Exception e){
out.println(e);
}%>
<div class="graph">
<!-- Placeholder for graph -->
<!-- <p>Graphical representation of data will go here.</p> -->
<canvas id="myChart" width="400" height="400"></canvas>
</div>
</section>
</main>
<footer>
<p>System Station</p>
</footer>
</body>
</html>