diff --git a/src/main/java/io/hardingadonis/miu/controller/admin/AdminServlet.java b/src/main/java/io/hardingadonis/miu/controller/admin/AdminServlet.java deleted file mode 100644 index af8dc972..00000000 --- a/src/main/java/io/hardingadonis/miu/controller/admin/AdminServlet.java +++ /dev/null @@ -1,33 +0,0 @@ -package io.hardingadonis.miu.controller.admin; - -import java.io.IOException; -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 { - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - request.setCharacterEncoding("UTF-8"); - response.setContentType("text/html; charset=UTF-8"); - - request.getRequestDispatcher("/view/admin/admin.jsp").forward(request, response); - } - - @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - } - - - @Override - public String getServletInfo() { - return "Short description"; - }// - -} \ No newline at end of file diff --git a/src/main/java/io/hardingadonis/miu/controller/admin/CategoryManagement.java b/src/main/java/io/hardingadonis/miu/controller/admin/CategoryAdmin.java similarity index 56% rename from src/main/java/io/hardingadonis/miu/controller/admin/CategoryManagement.java rename to src/main/java/io/hardingadonis/miu/controller/admin/CategoryAdmin.java index ae963965..750d3d8f 100644 --- a/src/main/java/io/hardingadonis/miu/controller/admin/CategoryManagement.java +++ b/src/main/java/io/hardingadonis/miu/controller/admin/CategoryAdmin.java @@ -1,26 +1,32 @@ package io.hardingadonis.miu.controller.admin; -import io.hardingadonis.miu.dao.impl.mysql.CategoryDAOMySQLImpl; -import io.hardingadonis.miu.model.Category; -import io.hardingadonis.miu.services.Singleton; +import io.hardingadonis.miu.model.*; +import io.hardingadonis.miu.services.*; import java.io.*; import java.util.*; import javax.servlet.*; -import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; import javax.servlet.http.*; -@WebServlet(name = "CategoryManagement", urlPatterns = {"/categorymanagement"}) -@MultipartConfig -public class CategoryManagement extends HttpServlet { +@WebServlet(name = "CategoryAdmin", urlPatterns = {"/admin/category"}) +public class CategoryAdmin extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); response.setContentType("text/html; charset=UTF-8"); + + HttpSession session = request.getSession(); - request.getRequestDispatcher("/view/admin/category-management.jsp").forward(request, response); + Admin admin = (Admin) session.getAttribute("admin"); + + if (admin == null) { + response.sendRedirect(request.getContextPath() + "/admin/login"); + return; + } + + request.getRequestDispatcher("/view/admin/category-admin.jsp").forward(request, response); } @@ -29,7 +35,5 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); response.setContentType("text/html; charset=UTF-8"); - } - } diff --git a/src/main/java/io/hardingadonis/miu/controller/admin/DashboardAdmin.java b/src/main/java/io/hardingadonis/miu/controller/admin/DashboardAdmin.java new file mode 100644 index 00000000..f087e8d5 --- /dev/null +++ b/src/main/java/io/hardingadonis/miu/controller/admin/DashboardAdmin.java @@ -0,0 +1,34 @@ +package io.hardingadonis.miu.controller.admin; + +import io.hardingadonis.miu.model.*; +import java.io.*; +import javax.servlet.*; +import javax.servlet.annotation.*; +import javax.servlet.http.*; + +@WebServlet(name = "DashboardAdmin", urlPatterns = {"/admin"}) +public class DashboardAdmin extends HttpServlet { + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + request.setCharacterEncoding("UTF-8"); + response.setContentType("text/html; charset=UTF-8"); + + HttpSession session = request.getSession(); + + Admin admin = (Admin) session.getAttribute("admin"); + + if (admin == null) { + response.sendRedirect(request.getContextPath() + "/admin/login"); + return; + } + + request.getRequestDispatcher("/view/admin/dashboard-admin.jsp").forward(request, response); + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + } +} diff --git a/src/main/java/io/hardingadonis/miu/controller/admin/ListCategoryServlet.java b/src/main/java/io/hardingadonis/miu/controller/admin/ListCategoryServlet.java deleted file mode 100644 index c49955e8..00000000 --- a/src/main/java/io/hardingadonis/miu/controller/admin/ListCategoryServlet.java +++ /dev/null @@ -1,35 +0,0 @@ -package io.hardingadonis.miu.controller.admin; - -import io.hardingadonis.miu.dao.impl.mysql.CategoryDAOMySQLImpl; -import io.hardingadonis.miu.model.Category; -import io.hardingadonis.miu.services.Singleton; -import java.io.*; -import java.util.*; -import javax.servlet.*; -import javax.servlet.annotation.MultipartConfig; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.*; - -@WebServlet(name = "ListCategoryServlet", urlPatterns = {"/listCategory"}) -@MultipartConfig -public class ListCategoryServlet extends HttpServlet { - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - request.setCharacterEncoding("UTF-8"); - response.setContentType("text/html; charset=UTF-8"); - - request.getRequestDispatcher("/view/admin/list_category.jsp").forward(request, response); - - } - - @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - request.setCharacterEncoding("UTF-8"); - response.setContentType("text/html; charset=UTF-8"); - - } - -} diff --git a/src/main/java/io/hardingadonis/miu/controller/admin/ListOrderServlet.java b/src/main/java/io/hardingadonis/miu/controller/admin/ListOrderServlet.java deleted file mode 100644 index 9f5bfe43..00000000 --- a/src/main/java/io/hardingadonis/miu/controller/admin/ListOrderServlet.java +++ /dev/null @@ -1,35 +0,0 @@ - -package io.hardingadonis.miu.controller.admin; - -import java.io.IOException; -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 = "ListOrderServlet", urlPatterns = {"/listOrder"}) -public class ListOrderServlet extends HttpServlet { - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - request.setCharacterEncoding("UTF-8"); - response.setContentType("text/html; charset=UTF-8"); - - request.getRequestDispatcher("/view/admin/list_order.jsp").forward(request, response); - } - - - @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - } - - - @Override - public String getServletInfo() { - return "Short description"; - }// - -} diff --git a/src/main/java/io/hardingadonis/miu/controller/admin/LoginAdmin.java b/src/main/java/io/hardingadonis/miu/controller/admin/LoginAdmin.java index f64ec583..55850a04 100644 --- a/src/main/java/io/hardingadonis/miu/controller/admin/LoginAdmin.java +++ b/src/main/java/io/hardingadonis/miu/controller/admin/LoginAdmin.java @@ -1,11 +1,10 @@ package io.hardingadonis.miu.controller.admin; -import io.hardingadonis.miu.model.Admin; -import io.hardingadonis.miu.services.Hash; -import io.hardingadonis.miu.services.Singleton; +import io.hardingadonis.miu.model.*; +import io.hardingadonis.miu.services.*; import java.io.*; import javax.servlet.*; -import javax.servlet.annotation.WebServlet; +import javax.servlet.annotation.*; import javax.servlet.http.*; @WebServlet(name = "LoginAdmin", urlPatterns = {"/admin/login"}) diff --git a/src/main/java/io/hardingadonis/miu/controller/admin/LogoutAdmin.java b/src/main/java/io/hardingadonis/miu/controller/admin/LogoutAdmin.java new file mode 100644 index 00000000..dbcb38f7 --- /dev/null +++ b/src/main/java/io/hardingadonis/miu/controller/admin/LogoutAdmin.java @@ -0,0 +1,25 @@ +package io.hardingadonis.miu.controller.admin; + +import java.io.*; +import javax.servlet.*; +import javax.servlet.annotation.*; +import javax.servlet.http.*; + +@WebServlet(name = "LogoutAdmin", urlPatterns = {"/admin/logout"}) +public class LogoutAdmin extends HttpServlet { + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + request.setCharacterEncoding("UTF-8"); + response.setContentType("text/html; charset=UTF-8"); + + HttpSession session = request.getSession(false); + + if (session != null) { + session.invalidate(); + } + + response.sendRedirect(request.getContextPath() + "/admin"); + } +} diff --git a/src/main/java/io/hardingadonis/miu/controller/admin/OrderAdmin.java b/src/main/java/io/hardingadonis/miu/controller/admin/OrderAdmin.java new file mode 100644 index 00000000..009d1197 --- /dev/null +++ b/src/main/java/io/hardingadonis/miu/controller/admin/OrderAdmin.java @@ -0,0 +1,35 @@ +package io.hardingadonis.miu.controller.admin; + +import io.hardingadonis.miu.model.*; +import java.io.IOException; +import javax.servlet.*; +import javax.servlet.annotation.*; +import javax.servlet.http.*; + +@WebServlet(name = "OrderAdmin", urlPatterns = {"/admin/order"}) +public class OrderAdmin extends HttpServlet { + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + request.setCharacterEncoding("UTF-8"); + response.setContentType("text/html; charset=UTF-8"); + + HttpSession session = request.getSession(); + + Admin admin = (Admin) session.getAttribute("admin"); + + if (admin == null) { + response.sendRedirect(request.getContextPath() + "/admin/login"); + return; + } + + request.getRequestDispatcher("/view/admin/order-admin.jsp").forward(request, response); + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + } + +} diff --git a/src/main/java/io/hardingadonis/miu/controller/admin/ProductManagement.java b/src/main/java/io/hardingadonis/miu/controller/admin/ProductAdmin.java similarity index 68% rename from src/main/java/io/hardingadonis/miu/controller/admin/ProductManagement.java rename to src/main/java/io/hardingadonis/miu/controller/admin/ProductAdmin.java index 011dc0a7..f638ee95 100644 --- a/src/main/java/io/hardingadonis/miu/controller/admin/ProductManagement.java +++ b/src/main/java/io/hardingadonis/miu/controller/admin/ProductAdmin.java @@ -1,22 +1,32 @@ package io.hardingadonis.miu.controller.admin; -import io.hardingadonis.miu.services.Singleton; +import io.hardingadonis.miu.model.*; +import io.hardingadonis.miu.services.*; import java.io.*; import javax.servlet.*; -import javax.servlet.annotation.WebServlet; +import javax.servlet.annotation.*; import javax.servlet.http.*; -import org.json.simple.JSONObject; +import org.json.simple.*; -@WebServlet(name = "ProductManagement", urlPatterns = {"/productmanagement"}) -public class ProductManagement extends HttpServlet { +@WebServlet(name = "ProductAdmin", urlPatterns = {"/admin/product"}) +public class ProductAdmin extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); response.setContentType("text/html; charset=UTF-8"); + + HttpSession session = request.getSession(); - request.getRequestDispatcher("/view/admin/product-management.jsp").forward(request, response); + Admin admin = (Admin) session.getAttribute("admin"); + + if (admin == null) { + response.sendRedirect(request.getContextPath() + "/admin/login"); + return; + } + + request.getRequestDispatcher("/view/admin/product-admin.jsp").forward(request, response); } @Override @@ -46,5 +56,4 @@ protected void doDelete(HttpServletRequest request, HttpServletResponse response System.err.println(ex.getMessage()); } } - } diff --git a/src/main/java/io/hardingadonis/miu/controller/admin/ListUserServlet.java b/src/main/java/io/hardingadonis/miu/controller/admin/UserAdmin.java similarity index 61% rename from src/main/java/io/hardingadonis/miu/controller/admin/ListUserServlet.java rename to src/main/java/io/hardingadonis/miu/controller/admin/UserAdmin.java index ae0bf101..cbb51c7d 100644 --- a/src/main/java/io/hardingadonis/miu/controller/admin/ListUserServlet.java +++ b/src/main/java/io/hardingadonis/miu/controller/admin/UserAdmin.java @@ -1,24 +1,32 @@ package io.hardingadonis.miu.controller.admin; -import io.hardingadonis.miu.services.Singleton; -import java.io.IOException; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.json.simple.JSONObject; - -@WebServlet(name = "ListUserServlet", urlPatterns = {"/listUser"}) -public class ListUserServlet extends HttpServlet { +import io.hardingadonis.miu.model.*; +import io.hardingadonis.miu.services.*; +import java.io.*; +import javax.servlet.*; +import javax.servlet.annotation.*; +import javax.servlet.http.*; +import org.json.simple.*; + +@WebServlet(name = "UserAdmin", urlPatterns = {"/admin/user"}) +public class UserAdmin extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); response.setContentType("text/html; charset=UTF-8"); + + HttpSession session = request.getSession(); + + Admin admin = (Admin) session.getAttribute("admin"); + + if (admin == null) { + response.sendRedirect(request.getContextPath() + "/admin/login"); + return; + } - request.getRequestDispatcher("/view/admin/list_user.jsp").forward(request, response); + request.getRequestDispatcher("/view/admin/user-admin.jsp").forward(request, response); } @Override diff --git a/src/main/java/io/hardingadonis/miu/dao/impl/mysql/OrderDAOMySQLImpl.java b/src/main/java/io/hardingadonis/miu/dao/impl/mysql/OrderDAOMySQLImpl.java index 3e216819..95823acc 100644 --- a/src/main/java/io/hardingadonis/miu/dao/impl/mysql/OrderDAOMySQLImpl.java +++ b/src/main/java/io/hardingadonis/miu/dao/impl/mysql/OrderDAOMySQLImpl.java @@ -30,7 +30,7 @@ public List getAll() { try { Connection conn = Singleton.dbContext.getConnection(); - PreparedStatement smt = conn.prepareStatement("SELECT * FROM order"); + PreparedStatement smt = conn.prepareStatement("SELECT * FROM `order`"); ResultSet rs = smt.executeQuery(); @@ -53,7 +53,7 @@ public List getAllByUserID(int userID) { try { Connection conn = Singleton.dbContext.getConnection(); - PreparedStatement smt = conn.prepareStatement("SELECT * FROM order WHERE user_id = ?"); + PreparedStatement smt = conn.prepareStatement("SELECT * FROM `order` WHERE user_id = ?"); smt.setInt(1, userID); ResultSet rs = smt.executeQuery(); @@ -77,7 +77,7 @@ public List getAllByPayment(Payment payment) { try { Connection conn = Singleton.dbContext.getConnection(); - PreparedStatement smt = conn.prepareStatement("SELECT * FROM order WHERE payment = ?"); + PreparedStatement smt = conn.prepareStatement("SELECT * FROM `order` WHERE payment = ?"); smt.setString(1, payment.toString()); ResultSet rs = smt.executeQuery(); @@ -101,7 +101,7 @@ public List getAllByOrderStatus(OrderStatus status) { try { Connection conn = Singleton.dbContext.getConnection(); - PreparedStatement smt = conn.prepareStatement("SELECT * FROM order WHERE status = ?"); + PreparedStatement smt = conn.prepareStatement("SELECT * FROM `order` WHERE status = ?"); smt.setString(1, status.toString()); ResultSet rs = smt.executeQuery(); @@ -125,7 +125,7 @@ public Order get(int ID) { try { Connection conn = Singleton.dbContext.getConnection(); - PreparedStatement smt = conn.prepareStatement("SELECT * FROM order WHERE id = ?"); + PreparedStatement smt = conn.prepareStatement("SELECT * FROM `order` WHERE id = ?"); smt.setInt(1, ID); ResultSet rs = smt.executeQuery(); @@ -202,7 +202,7 @@ public int count() { try { Connection conn = Singleton.dbContext.getConnection(); - PreparedStatement smt = conn.prepareStatement("SELECT COUNT(*) FROM order"); + PreparedStatement smt = conn.prepareStatement("SELECT COUNT(*) FROM `order`"); ResultSet rs = smt.executeQuery(); @@ -225,7 +225,7 @@ public int countByUserID(int userID) { try { Connection conn = Singleton.dbContext.getConnection(); - PreparedStatement smt = conn.prepareStatement("SELECT COUNT(*) FROM order WHERE user_id = ?"); + PreparedStatement smt = conn.prepareStatement("SELECT COUNT(*) FROM `order` WHERE user_id = ?"); smt.setInt(1, userID); ResultSet rs = smt.executeQuery(); @@ -249,7 +249,7 @@ public int countByPayment(Payment payment) { try { Connection conn = Singleton.dbContext.getConnection(); - PreparedStatement smt = conn.prepareStatement("SELECT COUNT(*) FROM order WHERE payment = ?"); + PreparedStatement smt = conn.prepareStatement("SELECT COUNT(*) FROM `order` WHERE payment = ?"); smt.setString(1, payment.toString()); ResultSet rs = smt.executeQuery(); @@ -273,7 +273,7 @@ public int countByOrderStatus(OrderStatus status) { try { Connection conn = Singleton.dbContext.getConnection(); - PreparedStatement smt = conn.prepareStatement("SELECT COUNT(*) FROM order WHERE status = ?"); + PreparedStatement smt = conn.prepareStatement("SELECT COUNT(*) FROM `order` WHERE status = ?"); smt.setString(1, status.toString()); ResultSet rs = smt.executeQuery(); diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 3671f4b4..533e7520 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -8,51 +8,19 @@ DefaultFilter /* - - ListUserServlet - io.hardingadonis.miu.controller.admin.ListUserServlet - - - ListOrderServlet - io.hardingadonis.miu.controller.admin.ListOrderServlet - - - ListCategoryServlet - io.hardingadonis.miu.controller.admin.ListCategoryServlet - - - AdminServlet - io.hardingadonis.miu.controller.admin.AdminServlet - - - ListUserServlet - /listUser - - - ListOrderServlet - /listOrder - - - AdminServlet - /admin - - - ListCategoryServlet - /listCategory - 15 - + + *.jsp diff --git a/src/main/webapp/assets/js/admin/demo/datatables-simple-demo.js b/src/main/webapp/assets/js/admin/datatables-simple-demo.js similarity index 100% rename from src/main/webapp/assets/js/admin/demo/datatables-simple-demo.js rename to src/main/webapp/assets/js/admin/datatables-simple-demo.js diff --git a/src/main/webapp/assets/js/admin/demo/chart-area-demo.js b/src/main/webapp/assets/js/admin/demo/chart-area-demo.js deleted file mode 100644 index f63ff916..00000000 --- a/src/main/webapp/assets/js/admin/demo/chart-area-demo.js +++ /dev/null @@ -1,54 +0,0 @@ -// Set new default font family and font color to mimic Bootstrap's default styling -Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif'; -Chart.defaults.global.defaultFontColor = '#292b2c'; - -// Area Chart Example -var ctx = document.getElementById("myAreaChart"); -var myLineChart = new Chart(ctx, { - type: 'line', - data: { - labels: ["Mar 1", "Mar 2", "Mar 3", "Mar 4", "Mar 5", "Mar 6", "Mar 7", "Mar 8", "Mar 9", "Mar 10", "Mar 11", "Mar 12", "Mar 13"], - datasets: [{ - label: "Sessions", - lineTension: 0.3, - backgroundColor: "rgba(2,117,216,0.2)", - borderColor: "rgba(2,117,216,1)", - pointRadius: 5, - pointBackgroundColor: "rgba(2,117,216,1)", - pointBorderColor: "rgba(255,255,255,0.8)", - pointHoverRadius: 5, - pointHoverBackgroundColor: "rgba(2,117,216,1)", - pointHitRadius: 50, - pointBorderWidth: 2, - data: [10000, 30162, 26263, 18394, 18287, 28682, 31274, 33259, 25849, 24159, 32651, 31984, 38451], - }], - }, - options: { - scales: { - xAxes: [{ - time: { - unit: 'date' - }, - gridLines: { - display: false - }, - ticks: { - maxTicksLimit: 7 - } - }], - yAxes: [{ - ticks: { - min: 0, - max: 40000, - maxTicksLimit: 5 - }, - gridLines: { - color: "rgba(0, 0, 0, .125)", - } - }], - }, - legend: { - display: false - } - } -}); diff --git a/src/main/webapp/assets/js/admin/demo/chart-bar-demo.js b/src/main/webapp/assets/js/admin/demo/chart-bar-demo.js deleted file mode 100644 index 049ad204..00000000 --- a/src/main/webapp/assets/js/admin/demo/chart-bar-demo.js +++ /dev/null @@ -1,46 +0,0 @@ -// Set new default font family and font color to mimic Bootstrap's default styling -Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif'; -Chart.defaults.global.defaultFontColor = '#292b2c'; - -// Bar Chart Example -var ctx = document.getElementById("myBarChart"); -var myLineChart = new Chart(ctx, { - type: 'bar', - data: { - labels: ["January", "February", "March", "April", "May", "June"], - datasets: [{ - label: "Revenue", - backgroundColor: "rgba(2,117,216,1)", - borderColor: "rgba(2,117,216,1)", - data: [4215, 5312, 6251, 7841, 9821, 14984], - }], - }, - options: { - scales: { - xAxes: [{ - time: { - unit: 'month' - }, - gridLines: { - display: false - }, - ticks: { - maxTicksLimit: 6 - } - }], - yAxes: [{ - ticks: { - min: 0, - max: 15000, - maxTicksLimit: 5 - }, - gridLines: { - display: true - } - }], - }, - legend: { - display: false - } - } -}); diff --git a/src/main/webapp/assets/js/admin/demo/chart-pie-demo.js b/src/main/webapp/assets/js/admin/demo/chart-pie-demo.js deleted file mode 100644 index 4e16c415..00000000 --- a/src/main/webapp/assets/js/admin/demo/chart-pie-demo.js +++ /dev/null @@ -1,16 +0,0 @@ -// Set new default font family and font color to mimic Bootstrap's default styling -Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif'; -Chart.defaults.global.defaultFontColor = '#292b2c'; - -// Pie Chart Example -var ctx = document.getElementById("myPieChart"); -var myPieChart = new Chart(ctx, { - type: 'pie', - data: { - labels: ["Blue", "Red", "Yellow", "Green"], - datasets: [{ - data: [12.21, 15.58, 11.25, 8.32], - backgroundColor: ['#007bff', '#dc3545', '#ffc107', '#28a745'], - }], - }, -}); diff --git a/src/main/webapp/assets/js/admin/demo/datatables-demo.js b/src/main/webapp/assets/js/admin/demo/datatables-demo.js deleted file mode 100644 index f2eecbfe..00000000 --- a/src/main/webapp/assets/js/admin/demo/datatables-demo.js +++ /dev/null @@ -1,4 +0,0 @@ -// Call the dataTables jQuery plugin -$(document).ready(function() { - $('#dataTable').DataTable(); -}); diff --git a/src/main/webapp/view/admin/list_catgory.jsp b/src/main/webapp/view/admin/category-admin.jsp similarity index 88% rename from src/main/webapp/view/admin/list_catgory.jsp rename to src/main/webapp/view/admin/category-admin.jsp index 3566da13..e19c54a9 100644 --- a/src/main/webapp/view/admin/list_catgory.jsp +++ b/src/main/webapp/view/admin/category-admin.jsp @@ -1,11 +1,8 @@ -<%-- - Document : category-management - Created on : Dec 7, 2023, 12:53:12 PM - Author : Admin ---%> <%@page import="io.hardingadonis.miu.services.Singleton"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> + <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + @@ -18,7 +15,7 @@ Category Management - + @@ -38,7 +35,7 @@ @@ -49,23 +46,23 @@
@@ -99,9 +101,9 @@ ID Name - Create_at - Update_at - Delete_at + Create At + Update At + Delete At Actions @@ -205,19 +207,17 @@ - + - - - - - - + + + + + + diff --git a/src/main/webapp/view/admin/category-management.jsp b/src/main/webapp/view/admin/category-management.jsp deleted file mode 100644 index a469ede5..00000000 --- a/src/main/webapp/view/admin/category-management.jsp +++ /dev/null @@ -1,223 +0,0 @@ -<%-- - Document : category-management - Created on : Dec 7, 2023, 12:53:12 PM - Author : Admin ---%> -<%@page import="io.hardingadonis.miu.services.Singleton"%> -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> - - - - - - - - - - Category Management - - - - - - - - -
- -
-
-
-

List Category

- -
- -
-
-
- - Category Table -
-
- - - - - - - - - - - - - - - - - - - - - - - -
IDNameCreate_atUpdate_atDelete_atActions
${c.ID}${c.name}${c.createAt}${c.updateAt}${c.deleteAt} - - - - -
-
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/webapp/view/admin/admin.jsp b/src/main/webapp/view/admin/dashboard-admin.jsp similarity index 89% rename from src/main/webapp/view/admin/admin.jsp rename to src/main/webapp/view/admin/dashboard-admin.jsp index 0548ecbf..4889340c 100644 --- a/src/main/webapp/view/admin/admin.jsp +++ b/src/main/webapp/view/admin/dashboard-admin.jsp @@ -11,20 +11,20 @@ - + @@ -164,17 +169,17 @@ - - - + + + - - - + + + - - + + \ No newline at end of file diff --git a/src/main/webapp/view/admin/list_order.jsp b/src/main/webapp/view/admin/order-admin.jsp similarity index 90% rename from src/main/webapp/view/admin/list_order.jsp rename to src/main/webapp/view/admin/order-admin.jsp index 626d39db..86eea716 100644 --- a/src/main/webapp/view/admin/list_order.jsp +++ b/src/main/webapp/view/admin/order-admin.jsp @@ -1,7 +1,7 @@ - <%@page import="io.hardingadonis.miu.services.Singleton"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + @@ -30,7 +30,7 @@ @@ -45,19 +45,19 @@ Dashboard - + User Management - + Order Management - + Category Management - + Product Management @@ -65,7 +65,12 @@ @@ -87,7 +92,7 @@ ID - User Name + User ID Total Price Payment Status @@ -171,11 +176,11 @@ - - - + + + - + diff --git a/src/main/webapp/view/admin/list_product.jsp b/src/main/webapp/view/admin/product-admin.jsp similarity index 92% rename from src/main/webapp/view/admin/list_product.jsp rename to src/main/webapp/view/admin/product-admin.jsp index 3dd1f9aa..e875866d 100644 --- a/src/main/webapp/view/admin/list_product.jsp +++ b/src/main/webapp/view/admin/product-admin.jsp @@ -34,7 +34,7 @@ @@ -45,23 +45,23 @@
@@ -240,12 +245,12 @@ - - - + + + - + diff --git a/src/main/webapp/view/admin/product-management.jsp b/src/main/webapp/view/admin/product-management.jsp deleted file mode 100644 index 148c58bc..00000000 --- a/src/main/webapp/view/admin/product-management.jsp +++ /dev/null @@ -1,257 +0,0 @@ -<%-- - Document : product-management - Created on : Dec 7, 2023, 3:27:52 PM - Author : Admin ---%> -<%@page import="io.hardingadonis.miu.services.Singleton"%> -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> - - - - - - - - - - Product Management - - - - - - - - -
- -
-
-
-

List Product

- -
- -
-
-
- - Product Table -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IDNameCategoryPriceAmountThumbnailActions
${p.ID}${p.name} - ${Singleton.categoryDAO.getNameCategory(p.categoryID)} - ${p.price}${p.amount} - - - - - - - - - - - -
-
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/webapp/view/admin/list_user.jsp b/src/main/webapp/view/admin/user-admin.jsp similarity index 87% rename from src/main/webapp/view/admin/list_user.jsp rename to src/main/webapp/view/admin/user-admin.jsp index 68e37bbe..f753bf6c 100644 --- a/src/main/webapp/view/admin/list_user.jsp +++ b/src/main/webapp/view/admin/user-admin.jsp @@ -30,7 +30,7 @@ @@ -41,23 +41,23 @@
@@ -139,11 +144,11 @@ - - - + + + - +