Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

Commit

Permalink
Admin Page UI
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldStarPro committed Dec 7, 2023
1 parent 58cafbf commit 47ae94d
Show file tree
Hide file tree
Showing 8 changed files with 197 additions and 100 deletions.
Original file line number Diff line number Diff line change
@@ -1,79 +1,33 @@

package admin;
package io.hardingadonis.miu.controller.admin;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


@WebServlet(name = "AdminServlet", urlPatterns = {"/admin"})
public class AdminServlet extends HttpServlet {

/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample code. */
out.println("<!DOCTYPE html>");
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet AdminServlet</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Servlet AdminServlet at " + request.getContextPath() + "</h1>");
out.println("</body>");
out.println("</html>");
}
}

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=UTF-8");

request.getRequestDispatcher("/view/admin/admin.jsp").forward(request, response);
}

/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}

/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/

@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package admin;
package io.hardingadonis.miu.controller.admin;

import java.io.IOException;
import javax.servlet.ServletException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package admin;
package io.hardingadonis.miu.controller.admin;

import java.io.IOException;
import javax.servlet.ServletException;
Expand Down
14 changes: 7 additions & 7 deletions src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
<filter-name>DefaultFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>AdminServlet</servlet-name>
<servlet-class>admin.AdminServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ListUserServlet</servlet-name>
<servlet-class>admin.ListUserServlet</servlet-class>
Expand All @@ -20,10 +16,10 @@
<servlet-name>ListOrderServlet</servlet-name>
<servlet-class>admin.ListOrderServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet>
<servlet-name>AdminServlet</servlet-name>
<url-pattern>/admin</url-pattern>
</servlet-mapping>
<servlet-class>io.hardingadonis.miu.controller.admin.AdminServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ListUserServlet</servlet-name>
<url-pattern>/listUser</url-pattern>
Expand All @@ -32,6 +28,10 @@
<servlet-name>ListOrderServlet</servlet-name>
<url-pattern>/listOrder</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>AdminServlet</servlet-name>
<url-pattern>/admin</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
15
Expand Down
183 changes: 175 additions & 8 deletions src/main/webapp/view/admin/admin.jsp
Original file line number Diff line number Diff line change
@@ -1,13 +1,180 @@


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page contentType="text/html" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
<link rel="icon" href="<%=request.getContextPath()%>/assets/images/favicon/favicon.png" type="image/ico"/>
<title>Admin Page</title>
<link href="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/style.min.css" rel="stylesheet" />
<link href="<%=request.getContextPath()%>/assets/css/admin/styles.css" rel="stylesheet" />
<script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css">
</head>
<body>
<h1>Hello World!</h1>

<body class="sb-nav-fixed">
<nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark">
<!-- Navbar Brand-->
<a class="navbar-brand ps-3" href="index.html">Welcome Admin</a>
<!-- Sidebar Toggle-->
<button class="btn btn-link btn-sm order-1 order-lg-0 me-4 me-lg-0" id="sidebarToggle" href="#!"><i class="fas fa-bars"></i></button>

<!-- Navbar-->
<ul class="navbar-nav d-none d-md-inline-block form-inline ms-auto me-0 me-md-3 my-2 my-md-0">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"><i class="fas fa-user fa-fw"></i></a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="#!">Logout</a></li>
</ul>
</li>
</ul>
</nav>
<div id="layoutSidenav">
<div id="layoutSidenav_nav">
<nav class="sb-sidenav accordion sb-sidenav-dark" id="sidenavAccordion">
<div class="sb-sidenav-menu">
<div class="nav">
<div class="sb-sidenav-menu-heading">Core</div>
<a class="nav-link" href="admin">
<div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
Dashboard
</a>
<a class="nav-link" href="listUser">
<div class="sb-nav-link-icon"><i class="fas fa-table"></i></div>
User Management
</a>
<a class="nav-link" href="listOrder">
<div class="sb-nav-link-icon"><i class="fas fa-table"></i></div>
Order Management
</a>
<a class="nav-link" href="listCategory">
<div class="sb-nav-link-icon"><i class="fas fa-table"></i></div>
Category Management
</a>
<a class="nav-link" href="listProduct">
<div class="sb-nav-link-icon"><i class="fas fa-table"></i></div>
Product Management
</a>
</div>
</div>
<div class="sb-sidenav-footer">
<div class="small">Logged in as:</div>
Admin
</div>
</nav>
</div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid px-4">
<h1 class="mt-4">Dashboard</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item active">Admin Role</li>
</ol>
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
<a class="box-link" href="list_user.html">
<div class="info-box">
<div class="icon bg-indigo">
<i class="material-icons">face</i>
</div>
<div class="content">
<div class="text">TỔNG KHÁCH HÀNG</div>
<span class="number count-to" data-from="0" data-to="10000" data-speed="1000" data-fresh-interval="20">15</span>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
<a class="box-link" href="list_product.html">
<div class="info-box">
<div class="icon bg-purple">
<i class="material-icons">bookmark</i>
</div>
<div class="content">
<div class="text">TỔNG SẢN PHẨM</div>
<span class="number count-to" data-from="0" data-to="1000" data-speed="1000" data-fresh-interval="20">50</span>
</div>
</div>
</a>
</div>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
<a class="box-link" href="list_order.html">
<div class="info-box">
<div class="icon bg-red">
<i class="material-icons">shopping_cart</i>
</div>
<div class="content">
<div class="text">TỔNG ĐƠN HÀNG</div>
<span class="number count-to" data-from="0" data-to="10000" data-speed="1000" data-fresh-interval="20">30</span>
</div>
</div>
</a>
</div>
</div>
<div class="row">
<div class="col-xl-12">
<div class="card mb-4">
<div class="card-header">
<i class="fas fa-chart-area me-1"></i>
Area Chart Example
</div>
<div class="card-body"><canvas id="myAreaChart" width="100%" height="40"></canvas></div>
<div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div>
</div>
</div>
</div>

<div>
<div class="row">
<div class="col-lg-6">
<div class="card mb-4">
<div class="card-header">
<i class="fas fa-chart-bar me-1"></i>
Bar Chart Example
</div>
<div class="card-body"><canvas id="myBarChart" width="100%" height="50"></canvas></div>
<div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div>
</div>
</div>
<div class="col-lg-6">
<div class="card mb-4">
<div class="card-header">
<i class="fas fa-chart-pie me-1"></i>
Pie Chart Example
</div>
<div class="card-body"><canvas id="myPieChart" width="100%" height="50"></canvas></div>
<div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div>
</div>
</div>
</div>
</div>
</div>
</main>
<footer class="py-4 bg-light mt-auto">
<div class="container-fluid px-4">
<div class="d-flex align-items-center justify-content-between small">
<div class="text-muted">Copyright &copy; Group1's Website 2023</div>
<div>
<a href="#">Privacy Policy</a>
&middot;
<a href="#">Terms &amp; Conditions</a>
</div>
</div>
</div>
</footer>
</div>
</div>



<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="<%=request.getContextPath()%>/assets/js/admin/scripts.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js"></script>
<script src="<%=request.getContextPath()%>/assets/js/admin/demo/chart-area-demo.js"></script>
<script src="<%=request.getContextPath()%>/assets/js/admin/demo/chart-bar-demo.js"></script>
<script src="<%=request.getContextPath()%>/assets/js/admin/demo/chart-pie-demo.js"></script>
<script src="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/umd/simple-datatables.min.js"></script>
<script src="<%=request.getContextPath()%>/assets/js/admin/demo/datatables-simple-demo.js"></script>

</body>
</html>
</html>
4 changes: 2 additions & 2 deletions src/main/webapp/view/admin/list_order.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<div class="sb-sidenav-menu">
<div class="nav">
<div class="sb-sidenav-menu-heading">Core</div>
<a class="nav-link" href="index.html">
<a class="nav-link" href="admin">
<div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
Dashboard
</a>
Expand Down Expand Up @@ -192,7 +192,7 @@
<script src="<%=request.getContextPath()%>/assets/js/admin/demo/chart-bar-demo.js"></script>
<script src="<%=request.getContextPath()%>/assets/js/admin/demo/chart-pie-demo.js"></script>
<script src="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/umd/simple-datatables.min.js"></script>
<script src="<%=request.getContextPath()%>/assets/js/admin/demo/databases-simple-demo.js"></script>
<script src="<%=request.getContextPath()%>/assets/js/admin/demo/datatables-simple-demo.js"></script>
</body>
</html>

28 changes: 2 additions & 26 deletions src/main/webapp/view/admin/list_user.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<div class="sb-sidenav-menu">
<div class="nav">
<div class="sb-sidenav-menu-heading">Core</div>
<a class="nav-link" href="index.html">
<a class="nav-link" href="admin">
<div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
Dashboard
</a>
Expand Down Expand Up @@ -103,30 +103,6 @@
<a href="#" class="btn btn-danger btn-tiny" title="Delete"><i class="fa fa-trash"></i></a>
</td>
</tr>
<tr>
<td>2</td>
<td>Lê Minh Vương</td>
<td>2003</td>
<td>Male</td>
<td>HoangTHQE170116@fpt.edu.vn</td>
<td>Quy Nhon</td>
<td>Active</td>
<td>
<a href="#" class="btn btn-danger btn-tiny" title="Delete"><i class="fa fa-trash"></i></a>
</td>
</tr>
<tr>
<td>3</td>
<td>Nguyễn Thị Thúy</td>
<td>2003</td>
<td>Male</td>
<td>HoangTHQE170116@fpt.edu.vn</td>
<td>Quy Nhon</td>
<td>Active</td>
<td>
<a href="#" class="btn btn-danger btn-tiny" title="Delete"><i class="fa fa-trash"></i></a>
</td>
</tr>
</tbody>
</table>
</div>
Expand Down Expand Up @@ -180,7 +156,7 @@
<script src="<%=request.getContextPath()%>/assets/js/admin/demo/chart-bar-demo.js"></script>
<script src="<%=request.getContextPath()%>/assets/js/admin/demo/chart-pie-demo.js"></script>
<script src="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/umd/simple-datatables.min.js"></script>
<script src="<%=request.getContextPath()%>/assets/js/admin/demo/databases-simple-demo.js"></script>
<script src="<%=request.getContextPath()%>/assets/js/admin/demo/datatables-simple-demo.js"></script>

</body>
</html>
Expand Down

0 comments on commit 47ae94d

Please sign in to comment.