This repository has been archived by the owner on Dec 31, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58cafbf
commit 47ae94d
Showing
8 changed files
with
197 additions
and
100 deletions.
There are no files selected for viewing
64 changes: 9 additions & 55 deletions
64
src/main/java/io/hardingadonis/miu/controller/admin/AdminServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/main/java/io/hardingadonis/miu/controller/admin/ListOrderServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/io/hardingadonis/miu/controller/admin/ListUserServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected]/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 © Group1's Website 2023</div> | ||
<div> | ||
<a href="#">Privacy Policy</a> | ||
· | ||
<a href="#">Terms & Conditions</a> | ||
</div> | ||
</div> | ||
</div> | ||
</footer> | ||
</div> | ||
</div> | ||
|
||
|
||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/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/[email protected]/dist/umd/simple-datatables.min.js"></script> | ||
<script src="<%=request.getContextPath()%>/assets/js/admin/demo/datatables-simple-demo.js"></script> | ||
|
||
</body> | ||
</html> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
@@ -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/[email protected]/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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
@@ -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>[email protected]</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>[email protected]</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> | ||
|
@@ -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/[email protected]/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> | ||
|