diff --git a/.gitignore b/.gitignore index 59dd348..e750817 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,6 @@ server/*.war # IntelliJ IDEA .idea/ -.history/ \ No newline at end of file +.history/ + +*.xlsx \ No newline at end of file diff --git a/get_version.sh b/get_version.sh index d634640..c3cf522 100644 --- a/get_version.sh +++ b/get_version.sh @@ -1,7 +1,7 @@ #!/bin/bash major_version=0 -minor_version=6 +minor_version=7 path_version=0 echo "$major_version.$minor_version.$path_version" diff --git a/pom.xml b/pom.xml index 48ddec9..3561a9f 100644 --- a/pom.xml +++ b/pom.xml @@ -1,10 +1,11 @@ - + 4.0.0 io.hardingadonis saledock - 0.6.0 + 0.7.0 war Sale Dock - v${project.version} @@ -16,7 +17,7 @@ UTF-8 10.0.0 - + jakarta.platform @@ -85,6 +86,16 @@ commons-fileupload 1.5 + + org.apache.poi + poi + 5.0.0 + + + org.apache.poi + poi-ooxml + 5.0.0 + diff --git a/src/main/java/io/hardingadonis/saledock/controller/error/ErrorPageServlet.java b/src/main/java/io/hardingadonis/saledock/controller/error/ErrorPageServlet.java new file mode 100644 index 0000000..e9e86cd --- /dev/null +++ b/src/main/java/io/hardingadonis/saledock/controller/error/ErrorPageServlet.java @@ -0,0 +1,23 @@ + +package io.hardingadonis.saledock.controller.error; + +import jakarta.servlet.*; +import jakarta.servlet.annotation.*; +import jakarta.servlet.http.*; +import java.io.*; + +@WebServlet(name = "ErrorPageServlet", urlPatterns = {"/error-404"}) +public class ErrorPageServlet extends HttpServlet { + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + request.getRequestDispatcher("/view/jsp/error/404.jsp").forward(request, response); + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + } +} diff --git a/src/main/java/io/hardingadonis/saledock/controller/management/customer/CustomerServlet.java b/src/main/java/io/hardingadonis/saledock/controller/management/customer/CustomerServlet.java index 993a339..c710879 100644 --- a/src/main/java/io/hardingadonis/saledock/controller/management/customer/CustomerServlet.java +++ b/src/main/java/io/hardingadonis/saledock/controller/management/customer/CustomerServlet.java @@ -17,14 +17,30 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) request.setCharacterEncoding("UTF-8"); response.setContentType("text/html; charset=UTF-8"); - List customers = Singleton.customerDAO.getAll(); - Integer customerCount = Singleton.customerDAO.count(); - request.setAttribute("customerCount", customerCount); + int pageNumber = 1; + int pageSize = 10; + + // Get the requested page number + String pageStr = request.getParameter("page"); + if (pageStr != null) { + pageNumber = Integer.parseInt(pageStr); + } + + List customers = Singleton.customerDAO.pagination((pageNumber - 1) * pageSize, pageSize); + + int totalPages = Singleton.customerDAO.totalPages(pageSize); + + request.setAttribute("pageSize", pageSize); + + request.setAttribute("customerCount", Singleton.customerDAO.count()); request.setAttribute("customers", customers); + request.setAttribute("currentPage", pageNumber); + request.setAttribute("totalPages", totalPages); + request.setAttribute("pageSize", pageSize); request.setAttribute("page", "customer"); + request.getRequestDispatcher("/view/jsp/management/customer/customer.jsp").forward(request, response); - } @Override diff --git a/src/main/java/io/hardingadonis/saledock/controller/management/customer/UpdateCustomerServlet.java b/src/main/java/io/hardingadonis/saledock/controller/management/customer/UpdateCustomerServlet.java index 6e5cb91..e1b4e9c 100644 --- a/src/main/java/io/hardingadonis/saledock/controller/management/customer/UpdateCustomerServlet.java +++ b/src/main/java/io/hardingadonis/saledock/controller/management/customer/UpdateCustomerServlet.java @@ -1,13 +1,17 @@ package io.hardingadonis.saledock.controller.management.customer; +import io.hardingadonis.saledock.model.Customer; +import io.hardingadonis.saledock.utils.Singleton; import jakarta.servlet.*; import jakarta.servlet.annotation.*; import jakarta.servlet.http.*; import java.io.*; +import java.util.Optional; @WebServlet(name = "UpdateCustomerServlet", urlPatterns = {"/update-customer"}) public class UpdateCustomerServlet extends HttpServlet { + @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { @@ -15,10 +19,52 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) response.setContentType("text/html; charset=UTF-8"); request.setAttribute("page", "customer"); + + String id = request.getParameter("id"); + if (id == null) { + response.sendError(404); + return; + } + + Integer id_customer = Integer.valueOf(id); + Optional customer = Singleton.customerDAO.getByID(id_customer); + + if (customer.isPresent()) { + var cus = customer.get(); + + request.setAttribute("cus", cus); + request.getRequestDispatcher("/view/jsp/management/customer/update-customer.jsp").forward(request, response); + } else { + response.sendRedirect(request.getContextPath() + "/customer"); + } } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + request.setCharacterEncoding("UTF-8"); + response.setContentType("text/html; charset=UTF-8"); + + System.out.println("hhhh"); + String name = request.getParameter("nameCus"); + String address = request.getParameter("addressCus"); + + String id = request.getParameter("id"); + if (id == null) { + response.sendError(404); + return; + } + + + Integer id_customer = Integer.valueOf(id); + Customer customer = Singleton.customerDAO.getByID(id_customer).get(); + if (!name.isEmpty()) { + customer.setName(name); + } + if (!address.isEmpty()) { + customer.setAddress(address); + } + Singleton.customerDAO.save(customer); + response.sendRedirect(request.getContextPath() + "/customer-detail?id="+id); } } diff --git a/src/main/java/io/hardingadonis/saledock/controller/management/order/AddOrderServlet.java b/src/main/java/io/hardingadonis/saledock/controller/management/order/AddOrderServlet.java index 0c4e463..51bccc9 100644 --- a/src/main/java/io/hardingadonis/saledock/controller/management/order/AddOrderServlet.java +++ b/src/main/java/io/hardingadonis/saledock/controller/management/order/AddOrderServlet.java @@ -1,11 +1,13 @@ package io.hardingadonis.saledock.controller.management.order; +import com.mysql.cj.util.StringUtils; import io.hardingadonis.saledock.model.*; import io.hardingadonis.saledock.utils.*; import jakarta.servlet.*; import jakarta.servlet.annotation.*; import jakarta.servlet.http.*; import java.io.*; +import java.util.*; @WebServlet(name = "AddOrderServlet", urlPatterns = {"/add-order"}) public class AddOrderServlet extends HttpServlet { @@ -16,50 +18,152 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) request.setCharacterEncoding("UTF-8"); response.setContentType("text/html; charset=UTF-8"); + List customers = Singleton.customerDAO.getAll(); + List products = Singleton.productDAO.getAll(); + + String action = request.getParameter("action"); + String customerIdParam = request.getParameter("customerId"); + + if (customerIdParam != null && !customerIdParam.isEmpty()) { + try { + Integer customerId = Integer.parseInt(customerIdParam); + request.setAttribute("customerId", customerId); + } catch (NumberFormatException e) { + e.printStackTrace(); + response.sendRedirect("./error-404"); + return; + } + } + + if (action != null) { + switch (action) { + case "delete": + deleteProductFromOrder(request, response); + break; + case "goBack": + SessionUtil.getInstance().removeValue(request, "productMap"); + response.sendRedirect("./order"); + return; + default: + response.sendRedirect("./add-order"); + } + } + + Map productMap = getProductMap(request); + + double totalCost = calculateTotalCost(productMap, Singleton.productDAO.getAll()); + + request.setAttribute("customers", customers); + request.setAttribute("products", products); + request.setAttribute("productMap", productMap); + request.setAttribute("totalCost", totalCost); + request.setAttribute("page", "order"); - RequestDispatcher requestDispatcher = request.getRequestDispatcher("/view/jsp/management/order/add-order.jsp"); - requestDispatcher.forward(request, response); + request.getRequestDispatcher("/view/jsp/management/order/add-order.jsp").forward(request, response); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - String customerID = request.getParameter("customerID"); - String productID = request.getParameter("productID"); - String quantity = request.getParameter("quantity"); - - if (customerID == null || productID == null || quantity == null) { - response.sendError(404, "Please provide Customer ID, Product ID and Quantity"); + String customerIdParam = request.getParameter("customerId"); + if (customerIdParam == null || customerIdParam.isEmpty()) { + response.sendRedirect("./add-order?message=customerNotExist"); return; } + try { + Integer customerId = Integer.parseInt(customerIdParam); + String note = request.getParameter("note"); + Employee employee = (Employee) SessionUtil.getInstance().getValue(request, "employee"); + + Optional customer = Singleton.customerDAO.getByID(customerId); + + if (customer.isPresent()) { + Order order = new Order(); - Integer id_customer = Integer.valueOf(customerID); - Integer id_product = Integer.valueOf(productID); + order.setCustomer(customer.get()); + order.setEmployee(employee); + order.setNote(note); - Customer customer = Singleton.customerDAO.getByID(id_customer).orElse(null); - Product product = Singleton.productDAO.getByID(id_product).orElse(null); - HttpSession session = request.getSession(); - Employee employee = (Employee) session.getAttribute("employee"); + Map productMap = getProductMap(request); - // Check if an employee is logged in - if (employee == null) { - response.sendRedirect(request.getContextPath() + "/login?message=notLoggedIn"); + if (productMap.isEmpty()) { + response.sendRedirect("./add-order?customerId=" + customerId + "&message=emptyProduct"); + return; + } else { + for (Integer productId : productMap.keySet()) { + Optional product = Singleton.productDAO.getByID(productId); + + if (product.isPresent()) { + order.addProduct(product.get(), productMap.get(productId)); + } else { + response.sendRedirect("./add-order?customerId=" + customerId + "&message=productNotExist"); + return; + } + } + } + Order saveOrder = Singleton.orderDAO.save(order); + SendEmailUtil.sendOrderMessage(customer.get().getEmail(), "Slae Dock - Đặt hàng thành công", saveOrder); + SessionUtil.getInstance().removeValue(request, "productMap"); + response.sendRedirect("./order?message=orderSuccess"); + } else { + response.sendRedirect("./add-order?message=customerNotExist"); + } + } catch (Exception e) { + e.printStackTrace(); + response.sendRedirect("./error-404"); return; } - if (customer == null || product == null) { - response.sendError(404, "Please provide correct Customer ID and Product ID"); - return; + } + + private void deleteProductFromOrder(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + String productIdParam = request.getParameter("productId"); + + if (productIdParam != null) { + try { + int productId = Integer.parseInt(productIdParam); + + Map productMap = getProductMap(request); + + productMap.remove(productId); + + double totalCost = calculateTotalCost(productMap, Singleton.productDAO.getAll()); + request.setAttribute("totalCost", totalCost); + + SessionUtil.getInstance().putValue(request, "productMap", productMap); + + } catch (NumberFormatException e) { + e.printStackTrace(); + } } + } - Order order = new Order(); - order.setCustomer(customer); - order.setEmployee(employee); + private Map getProductMap(HttpServletRequest request) { + Map productMap = (Map) SessionUtil.getInstance().getValue(request, "productMap"); + if (productMap == null) { + productMap = new HashMap<>(); + SessionUtil.getInstance().putValue(request, "productMap", productMap); + } + return productMap; + } - order.addProduct(product, Integer.valueOf(quantity)); + private double calculateTotalCost(Map productMap, List allProducts) { + double totalCost = 0; + + for (Map.Entry entry : productMap.entrySet()) { + int productId = entry.getKey(); + int quantity = entry.getValue(); + + for (Product product : allProducts) { + if (product.getID() == productId) { + totalCost += product.getPrice() * quantity; + break; + } + } + } - Singleton.orderDAO.save(order); - response.sendRedirect(request.getContextPath() + "/order"); + return totalCost; } } diff --git a/src/main/java/io/hardingadonis/saledock/controller/management/order/AddProductIntoOrder.java b/src/main/java/io/hardingadonis/saledock/controller/management/order/AddProductIntoOrder.java new file mode 100644 index 0000000..48066b2 --- /dev/null +++ b/src/main/java/io/hardingadonis/saledock/controller/management/order/AddProductIntoOrder.java @@ -0,0 +1,99 @@ +package io.hardingadonis.saledock.controller.management.order; + +import io.hardingadonis.saledock.model.*; +import io.hardingadonis.saledock.utils.*; +import jakarta.servlet.*; +import jakarta.servlet.annotation.*; +import jakarta.servlet.http.*; +import java.io.*; +import java.util.*; + +@WebServlet(name = "AddProductIntoOrder", urlPatterns = {"/add-product-into-order"}) +public class AddProductIntoOrder extends HttpServlet { + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + List products = Singleton.productDAO.getAll(); + request.setAttribute("products", products); + String customerIdParam = request.getParameter("customerId"); + + if (!checkCusIdParam(customerIdParam)) { + response.sendRedirect("./error-404"); + return; + } + + request.getRequestDispatcher("/view/jsp/management/order/add-product-into-order.jsp").forward(request, response); + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + String customerIdParam = request.getParameter("customerId"); + + if (!checkCusIdParam(customerIdParam)) { + response.sendRedirect("./error-404"); + return; + } + + String productIdParam = request.getParameter("productId"); + + if (productIdParam == null || productIdParam.isEmpty()) { + request.setAttribute("message", "productNotExist"); + this.doGet(request, response); + return; + } + + Integer productId = Integer.parseInt(productIdParam); + Integer productQuantity = Integer.parseInt(request.getParameter("productQuantity")); + + if (productId == null) { + request.setAttribute("message", "notInputProduct"); + this.doGet(request, response); + } + + if (productQuantity == null) { + request.setAttribute("message", "notInputProduct"); + this.doGet(request, response); + } + + Optional product = Singleton.productDAO.getByID(productId); + + if (product.isPresent()) { + Map productMap = (Map) SessionUtil.getInstance().getValue(request, "productMap"); + + if (productMap == null) { + productMap = new HashMap<>(); + SessionUtil.getInstance().putValue(request, "productMap", productMap); + } + + if (productMap.containsKey(productId)) { + Integer currentQuantity = productMap.get(productId); + productMap.put(productId, currentQuantity + productQuantity); + } else { + productMap.put(productId, productQuantity); + } + + SessionUtil.getInstance().putValue(request, "productMap", productMap); + response.sendRedirect("./add-order?customerId=" + customerIdParam + "&message=addSuccess"); + } else { + request.setAttribute("message", "productNotExist"); + this.doGet(request, response); + } + + } + + private boolean checkCusIdParam(String customerIdParam) { + if (customerIdParam == null || customerIdParam.isEmpty()) { + return true; + } + + try { + Integer customerId = Integer.parseInt(customerIdParam); + } catch (Exception e) { + e.printStackTrace(); + return false; + } + return true; + } +} diff --git a/src/main/java/io/hardingadonis/saledock/controller/management/order/OrderServlet.java b/src/main/java/io/hardingadonis/saledock/controller/management/order/OrderServlet.java index 5ed284f..30d45de 100644 --- a/src/main/java/io/hardingadonis/saledock/controller/management/order/OrderServlet.java +++ b/src/main/java/io/hardingadonis/saledock/controller/management/order/OrderServlet.java @@ -7,9 +7,12 @@ import jakarta.servlet.http.*; import java.io.*; import java.util.*; +import java.util.stream.*; @WebServlet(name = "OrderServlet", urlPatterns = {"/order"}) public class OrderServlet extends HttpServlet { + + final static int LIMIT = 10; @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) @@ -18,7 +21,26 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) response.setContentType("text/html; charset=UTF-8"); List orders = Singleton.orderDAO.getAll(); - request.setAttribute("orders", orders); + int count = Singleton.orderDAO.count(); + + int pageNum = getInteger(request.getParameter("page")); + int offset = pageNum; + + if (offset == -1){ + offset = 0; + pageNum = 1; + } else { + offset = (offset - 1)*LIMIT; + } + + List orderPaging = Singleton.orderDAO.pagination(offset, LIMIT); + int total = Singleton.orderDAO.totalPages(LIMIT); + + request.setAttribute("numOfOrder", count); + request.setAttribute("currentPage", pageNum); + request.setAttribute("totalPage", total); + request.setAttribute("limit", LIMIT); + request.setAttribute("orders", orderPaging); request.setAttribute("page", "order"); request.getRequestDispatcher("/view/jsp/management/order/order.jsp").forward(request, response); @@ -28,4 +50,15 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } + + private static int getInteger(String parameter){ + if (parameter == null) { + return -1; + } + try { + return Integer.parseInt(parameter); + } catch (NumberFormatException e) { + return -1; + } + } } diff --git a/src/main/java/io/hardingadonis/saledock/controller/management/product/ProductServlet.java b/src/main/java/io/hardingadonis/saledock/controller/management/product/ProductServlet.java index 3cfff48..476a328 100644 --- a/src/main/java/io/hardingadonis/saledock/controller/management/product/ProductServlet.java +++ b/src/main/java/io/hardingadonis/saledock/controller/management/product/ProductServlet.java @@ -10,6 +10,7 @@ @WebServlet(name = "ProductServlet", urlPatterns = {"/product"}) public class ProductServlet extends HttpServlet { + final static int LIMIT = 10; @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) @@ -17,10 +18,26 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) request.setCharacterEncoding("UTF-8"); response.setContentType("text/html; charset=UTF-8"); - List products = Singleton.productDAO.getAll(); - Integer productCount = Singleton.productDAO.count(); - request.setAttribute("productCount", productCount); - request.setAttribute("products", products); + int page = 1; + if (request.getParameter("page") != null) { + try { + page = Integer.parseInt(request.getParameter("page")); + } catch (Exception e) { + response.sendRedirect("./error-404"); + return; + } + } + + List list = Singleton.productDAO.pagination((page - 1) * LIMIT, LIMIT); + Integer count = Singleton.productDAO.count(); + int totalPage = Singleton.productDAO.totalPages(LIMIT); + + request.setAttribute("productList", list); + request.setAttribute("currentPage", page); + request.setAttribute("totalPage", totalPage); + request.setAttribute("numOfPro", count); + request.setAttribute("limit", LIMIT); + request.setAttribute("page", "product"); request.getRequestDispatcher("/view/jsp/management/product/product.jsp").forward(request, response); diff --git a/src/main/java/io/hardingadonis/saledock/controller/others/download/DownloadServlet.java b/src/main/java/io/hardingadonis/saledock/controller/others/download/DownloadServlet.java new file mode 100644 index 0000000..7496ad2 --- /dev/null +++ b/src/main/java/io/hardingadonis/saledock/controller/others/download/DownloadServlet.java @@ -0,0 +1,58 @@ +package io.hardingadonis.saledock.controller.others.download; + +import io.hardingadonis.saledock.utils.*; +import jakarta.servlet.*; +import jakarta.servlet.annotation.*; +import jakarta.servlet.http.*; + +import java.io.*; + +@WebServlet(name = "DownloadServlet", urlPatterns = {"/download"}) +public class DownloadServlet extends HttpServlet { + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html"); + + var type = request.getParameter("type"); + + var path = ""; + + switch (type) { + case "customer": { + path = ExcelUtil.generateCustomersExcel(getServletContext().getRealPath("/")); + break; + } + + case "product": { + path = ExcelUtil.generateProductsExcel(getServletContext().getRealPath("/")); + break; + } + + default: { + response.sendError(404); + return; + } + } + + var file = new File(path); + + response.setContentType("application/octet-stream"); + response.setContentLength((int) file.length()); + response.setHeader("Content-Disposition", "attachment; filename=" + file.getName()); + + try (var fileInputStream = new FileInputStream(file)) { + var out = response.getOutputStream(); + var buffer = new byte[4096]; + int bytesRead; + + while ((bytesRead = fileInputStream.read(buffer)) != -1) { + out.write(buffer, 0, bytesRead); + } + } catch (Exception ex) { + response.sendError(404); + return; + } + } +} diff --git a/src/main/java/io/hardingadonis/saledock/dao/ICustomerDAO.java b/src/main/java/io/hardingadonis/saledock/dao/ICustomerDAO.java index 0f82e9c..90a315a 100644 --- a/src/main/java/io/hardingadonis/saledock/dao/ICustomerDAO.java +++ b/src/main/java/io/hardingadonis/saledock/dao/ICustomerDAO.java @@ -4,5 +4,5 @@ public interface ICustomerDAO extends IDAO, IPagination { - public String getTop10(Integer duration); + public String getTop10(Integer duration); } diff --git a/src/main/java/io/hardingadonis/saledock/dao/IEmployeeDAO.java b/src/main/java/io/hardingadonis/saledock/dao/IEmployeeDAO.java index 1691623..c76a9ca 100644 --- a/src/main/java/io/hardingadonis/saledock/dao/IEmployeeDAO.java +++ b/src/main/java/io/hardingadonis/saledock/dao/IEmployeeDAO.java @@ -7,5 +7,5 @@ public interface IEmployeeDAO extends IDAO { public Optional getByCode(String code); - public Optional getByEmail(String email); + public Optional getByEmail(String email); } diff --git a/src/main/java/io/hardingadonis/saledock/dao/impl/OrderDAOImpl.java b/src/main/java/io/hardingadonis/saledock/dao/impl/OrderDAOImpl.java index 46ded41..aaa51ea 100644 --- a/src/main/java/io/hardingadonis/saledock/dao/impl/OrderDAOImpl.java +++ b/src/main/java/io/hardingadonis/saledock/dao/impl/OrderDAOImpl.java @@ -159,7 +159,7 @@ public String statisticByStatus(Integer duration) { @Override public List pagination(Integer offset, Integer limit) { try (Session session = sessionFactory.openSession()) { - Query query = session.createQuery("FROM Order", Order.class); + Query query = session.createQuery("FROM Order ORDER BY ID DESC", Order.class); query.setFirstResult(offset); query.setMaxResults(limit); diff --git a/src/main/java/io/hardingadonis/saledock/utils/ExcelUtil.java b/src/main/java/io/hardingadonis/saledock/utils/ExcelUtil.java new file mode 100644 index 0000000..c20d217 --- /dev/null +++ b/src/main/java/io/hardingadonis/saledock/utils/ExcelUtil.java @@ -0,0 +1,76 @@ +package io.hardingadonis.saledock.utils; + +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.xssf.usermodel.*; + +import java.io.*; + +public class ExcelUtil { + + public static String generateCustomersExcel(String path) { + String[] header = {"ID", "Mã khách hàng", "Tên khách hàng", "Email", "Địa chỉ"}; + + final String pathSave = path + "customers.xlsx"; + + try (XSSFWorkbook workbook = new XSSFWorkbook()) { + XSSFSheet sheet = workbook.createSheet("Khách hàng"); + + Row headerRow = sheet.createRow(0); + for (int i = 0; i < header.length; i++) { + Cell cell = headerRow.createCell(i); + cell.setCellValue(header[i]); + } + + var list = Singleton.customerDAO.getAll(); + + for (int i = 0; i < list.size(); i++) { + Row row = sheet.createRow(i + 1); + row.createCell(0).setCellValue(list.get(i).getID()); + row.createCell(1).setCellValue(list.get(i).getCode()); + row.createCell(2).setCellValue(list.get(i).getName()); + row.createCell(3).setCellValue(list.get(i).getEmail()); + row.createCell(4).setCellValue(list.get(i).getAddress()); + } + + workbook.write(new FileOutputStream(pathSave)); + } catch (Exception ex) { + System.err.println(ex.getMessage()); + } + + return pathSave; + } + + public static String generateProductsExcel(String path) { + String[] header = {"ID", "Code", "Tên sản phẩm", "Mô tả", "Giá", "Phân loại"}; + + final String pathSave = path + "products.xlsx"; + + try (XSSFWorkbook workbook = new XSSFWorkbook()) { + XSSFSheet sheet = workbook.createSheet("Sản phẩm"); + + Row headerRow = sheet.createRow(0); + for (int i = 0; i < header.length; i++) { + Cell cell = headerRow.createCell(i); + cell.setCellValue(header[i]); + } + + var list = Singleton.productDAO.getAll(); + + for (int i = 0; i < list.size(); i++) { + Row row = sheet.createRow(i + 1); + row.createCell(0).setCellValue(list.get(i).getID()); + row.createCell(1).setCellValue(list.get(i).getCode()); + row.createCell(2).setCellValue(list.get(i).getName()); + row.createCell(3).setCellValue(list.get(i).getDescription()); + row.createCell(4).setCellValue(list.get(i).getPrice()); + row.createCell(5).setCellValue(list.get(i).getCategory().getName()); + } + + workbook.write(new FileOutputStream(pathSave)); + } catch (Exception ex) { + System.err.println(ex.getMessage()); + } + + return pathSave; + } +} diff --git a/src/main/java/io/hardingadonis/saledock/utils/FormatValue.java b/src/main/java/io/hardingadonis/saledock/utils/FormatValue.java new file mode 100644 index 0000000..f90b52f --- /dev/null +++ b/src/main/java/io/hardingadonis/saledock/utils/FormatValue.java @@ -0,0 +1,29 @@ +package io.hardingadonis.saledock.utils; + +import java.text.*; +import java.time.*; +import java.time.format.*; +import java.util.*; + +public class FormatValue { + public static String formatCurrency(double amount, String monetaryUnit) { + NumberFormat currencyFormatter = null; + switch (monetaryUnit) { + case "VND": + currencyFormatter = NumberFormat.getCurrencyInstance(new Locale("vi", "VN")); + break; + default: + System.out.println("Can't find valid moneytary unit!"); + } + + String formattedAmount = currencyFormatter.format(amount); + + return formattedAmount; + } + + public static String formatDateTime(LocalDateTime dateTime) { + String formattedTime = dateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + + return formattedTime; + } +} diff --git a/src/main/java/io/hardingadonis/saledock/utils/SendEmailUtil.java b/src/main/java/io/hardingadonis/saledock/utils/SendEmailUtil.java index bbbfaa6..195f7ed 100644 --- a/src/main/java/io/hardingadonis/saledock/utils/SendEmailUtil.java +++ b/src/main/java/io/hardingadonis/saledock/utils/SendEmailUtil.java @@ -1,7 +1,11 @@ package io.hardingadonis.saledock.utils; +import io.hardingadonis.saledock.model.*; import jakarta.mail.*; import jakarta.mail.internet.*; +import java.io.*; +import java.time.LocalDateTime; +import java.time.format.*; import java.util.*; import java.util.logging.*; @@ -38,11 +42,13 @@ protected PasswordAuthentication getPasswordAuthentication() { } catch (MessagingException ex) { System.out.println("Send email fail!"); Logger.getLogger(SendEmailUtil.class.getName()).log(Level.SEVERE, null, ex); + } catch (UnsupportedEncodingException ex) { + Logger.getLogger(SendEmailUtil.class.getName()).log(Level.SEVERE, null, ex); } }).start(); } - public static Message prepareMessage(Session session, String from, String recipient, String title, String textMessage) { + public static Message prepareMessage(Session session, String from, String recipient, String title, String textMessage) throws UnsupportedEncodingException { try { Message message = new MimeMessage(session); @@ -50,7 +56,7 @@ public static Message prepareMessage(Session session, String from, String recipi message.setFrom(new InternetAddress(from)); message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(recipient, false)); message.setReplyTo(InternetAddress.parse(from, false)); - message.setSubject(title); + message.setSubject(MimeUtility.encodeText(title, "UTF-8", "B")); message.setSentDate(new Date()); message.setContent(textMessage, "text/html; charset=UTF-8"); return message; @@ -78,4 +84,81 @@ public static void sendGetOTPMessage(String to, String title, String otp) { + ""; sendEmail(to, title, message); } + + public static void sendOrderMessage(String to, String title, Order order) { + + String message = "\n" + + "\n" + + "\n" + + " \n" + + " \n" + + " Đặt hàng thành công\n" + + " \n" + + "\n" + + "\n" + + "

Cảm ơn khách hàng " + order.getCustomer().getName() + " .

\n" + + "

Bạn đã đặt hàng thành công.

\n" + + "

Đây là chi tiết đơn hàng của bạn:

\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " "; + for (OrderDetail orderDetail : order.getOrderDetails()) { + message += "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " "; + } + message += "\n" + + "
\n" + + "
Tên sản phẩm
\n" + + "
\n" + + "
Đơn giá
\n" + + "
\n" + + "
Số lượng
\n" + + "
\n" + + "
Thành tiền
\n" + + "
\n" + + "

" + orderDetail.getProduct().getName()+ "

\n" + + "
\n" + + "

" + FormatValue.formatCurrency(orderDetail.getProduct().getPrice(), "VND") + "

\n" + + "
\n" + + "

" + orderDetail.getQuantity()+ "

\n" + + "
\n" + + "

" + FormatValue.formatCurrency(orderDetail.getProduct().getPrice()*orderDetail.getQuantity(), "VND") + "

\n" + + "
\n" + + "

Tổng số tiền cần thanh toán cho đơn hàng là: " + FormatValue.formatCurrency(order.getTotal(), "VND") + "

\n" + + "

Địa chỉ giao hàng là: " + order.getCustomer().getAddress() + "

\n" + + "

Thời gian đặt hàng: " + FormatValue.formatDateTime(order.getCreatedAt()) + "

\n" + + "

Ghi chú đơn hàng: " + order.getNote() + "

\n" + + "

Vui lòng giữ liên lạc để nhận hàng trong thời gian tới.

\n" + + "

Cảm ơn bạn đã tin tưởng Sale Dock!

\n" + + "\n" + + ""; + sendEmail(to, title, message); + } } diff --git a/src/main/webapp/view/assets/css/others/login/form-login.css b/src/main/webapp/view/assets/css/others/login/form-login.css new file mode 100644 index 0000000..f40e38f --- /dev/null +++ b/src/main/webapp/view/assets/css/others/login/form-login.css @@ -0,0 +1,13 @@ +body { + display: flex; + justify-content: center; + align-items: center; + min-height: 100vh; + margin: 0; +} + +.container { + position: relative; + border-radius: 10px; +} + diff --git a/src/main/webapp/view/assets/css/sweetalert2.min.css b/src/main/webapp/view/assets/css/sweetalert2.min.css new file mode 100644 index 0000000..7d533ed --- /dev/null +++ b/src/main/webapp/view/assets/css/sweetalert2.min.css @@ -0,0 +1 @@ +.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:0.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static !important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto} diff --git a/src/main/webapp/view/assets/js/alert-timeout.js b/src/main/webapp/view/assets/js/alert-timeout.js new file mode 100644 index 0000000..9830741 --- /dev/null +++ b/src/main/webapp/view/assets/js/alert-timeout.js @@ -0,0 +1,7 @@ +$(document).ready(function() { + setTimeout(function() { + $(".alert").fadeOut('slow'); + }, 3000); +}); + + diff --git a/src/main/webapp/view/assets/js/management/order/add-order/confirm-popup.js b/src/main/webapp/view/assets/js/management/order/add-order/confirm-popup.js new file mode 100644 index 0000000..0fbfbd0 --- /dev/null +++ b/src/main/webapp/view/assets/js/management/order/add-order/confirm-popup.js @@ -0,0 +1,56 @@ +/* global Swal */ + +function confirmDelete(productId, customerId) { + Swal.fire({ + title: "Bạn có chắc chắn muốn xoá sản phẩm ra khỏi đơn hàng?", + text: "Bạn không thể khôi phục lại được!", + icon: "warning", + showCancelButton: true, + confirmButtonColor: "#3085d6", + cancelButtonColor: "#d33", + confirmButtonText: "Vâng, Xoá nó!" + }).then((result) => { + if (result.isConfirmed) { + $.ajax({ + type: "GET", + url: "./add-order?action=delete&productId=" + productId, + data: { productId: productId }, + success: function (response) { + Swal.fire({ + title: "Xoá thành công!", + text: "Sản phẩm đã được xoá.", + icon: "success" + }).then(() => { + var newUrl; + if (customerId == null) { + newUrl = "./add-order?message=deleteSuccess"; + + } else { + newUrl = "./add-order?customerId=" + customerId + "&message=deleteSuccess"; + } + window.location.href = newUrl; + }); + }, + error: function (error) { + console.error("Lỗi xoá sản phẩm:", error); + } + }); + } + }); +} + +function confirmAddOrder(customerId) { + Swal.fire({ + title: "Bạn có chắc chắn muốn thêm đơn hàng này?", + text: "Bạn có thể sẽ phải chịu trách nhiệm khi thêm nhầm đơn hàng!", + icon: "warning", + showCancelButton: true, + confirmButtonColor: "#3085d6", + cancelButtonColor: "#d33", + confirmButtonText: "Vâng, Thêm đơn hàng!" + }).then((result) => { + if (result.isConfirmed) { + $('#form-add-order').submit(); + } + }); +} diff --git a/src/main/webapp/view/assets/js/sweetalert2.all.min.js b/src/main/webapp/view/assets/js/sweetalert2.all.min.js new file mode 100644 index 0000000..bd41e7e --- /dev/null +++ b/src/main/webapp/view/assets/js/sweetalert2.all.min.js @@ -0,0 +1,6 @@ +/*! +* sweetalert2 v11.10.5 +* Released under the MIT License. +*/ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Sweetalert2=e()}(this,(function(){"use strict";function t(t,n,o){return n=c(n),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,e()?Reflect.construct(n,o||[],c(t).constructor):n.apply(t,o))}function e(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(e=function(){return!!t})()}function n(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var o=0;ot.length)&&(e=t.length);for(var n=0,o=new Array(e);no?1:n .").concat(C[e]));case"checkbox":return t.querySelector(".".concat(C.popup," > .").concat(C.checkbox," input"));case"radio":return t.querySelector(".".concat(C.popup," > .").concat(C.radio," input:checked"))||t.querySelector(".".concat(C.popup," > .").concat(C.radio," input:first-child"));case"range":return t.querySelector(".".concat(C.popup," > .").concat(C.range," input"));default:return t.querySelector(".".concat(C.popup," > .").concat(C.input))}},it=function(t){if(t.focus(),"file"!==t.type){var e=t.value;t.value="",t.value=e}},rt=function(t,e,n){t&&e&&("string"==typeof e&&(e=e.split(/\s+/).filter(Boolean)),e.forEach((function(e){Array.isArray(t)?t.forEach((function(t){n?t.classList.add(e):t.classList.remove(e)})):n?t.classList.add(e):t.classList.remove(e)})))},at=function(t,e){rt(t,e,!0)},ct=function(t,e){rt(t,e,!1)},ut=function(t,e){for(var n=Array.from(t.children),o=0;o1&&void 0!==arguments[1]?arguments[1]:"flex";t&&(t.style.display=e)},dt=function(t){t&&(t.style.display="none")},ft=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";t&&new MutationObserver((function(){mt(t,t.innerHTML,e)})).observe(t,{childList:!0,subtree:!0})},pt=function(t,e,n,o){var i=t.querySelector(e);i&&i.style.setProperty(n,o)},mt=function(t,e){e?lt(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):dt(t)},ht=function(t){return!(!t||!(t.offsetWidth||t.offsetHeight||t.getClientRects().length))},vt=function(t){return!!(t.scrollHeight>t.clientHeight)},gt=function(t){var e=window.getComputedStyle(t),n=parseFloat(e.getPropertyValue("animation-duration")||"0"),o=parseFloat(e.getPropertyValue("transition-duration")||"0");return n>0||o>0},bt=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=$();n&&ht(n)&&(e&&(n.style.transition="none",n.style.width="100%"),setTimeout((function(){n.style.transition="width ".concat(t/1e3,"s linear"),n.style.width="0%"}),10))},yt=function(){return"undefined"==typeof window||"undefined"==typeof document},wt='\n
\n \n
    \n
    \n \n

    \n
    \n \n \n
    \n \n \n
    \n \n
    \n \n \n
    \n
    \n
    \n \n \n \n
    \n
    \n
    \n
    \n
    \n
    \n').replace(/(^|\n)\s*/g,""),Ct=function(){b.currentInstance.resetValidationMessage()},At=function(t){var e,n=!!(e=M())&&(e.remove(),ct([document.documentElement,document.body],[C["no-backdrop"],C["toast-shown"],C["has-column"]]),!0);if(yt())P("SweetAlert2 requires document to initialize");else{var o=document.createElement("div");o.className=C.container,n&&at(o,C["no-transition"]),tt(o,wt);var i,r,a,c,u,s,l,d,f,p="string"==typeof(i=t.target)?document.querySelector(i):i;p.appendChild(o),function(t){var e=D();e.setAttribute("role",t.toast?"alert":"dialog"),e.setAttribute("aria-live",t.toast?"polite":"assertive"),t.toast||e.setAttribute("aria-modal","true")}(t),function(t){"rtl"===window.getComputedStyle(t).direction&&at(M(),C.rtl)}(p),r=D(),a=ut(r,C.input),c=ut(r,C.file),u=r.querySelector(".".concat(C.range," input")),s=r.querySelector(".".concat(C.range," output")),l=ut(r,C.select),d=r.querySelector(".".concat(C.checkbox," input")),f=ut(r,C.textarea),a.oninput=Ct,c.onchange=Ct,l.onchange=Ct,d.onchange=Ct,f.oninput=Ct,u.oninput=function(){Ct(),s.value=u.value},u.onchange=function(){Ct(),s.value=u.value}}},kt=function(t,e){t instanceof HTMLElement?e.appendChild(t):"object"===o(t)?Et(t,e):t&&tt(e,t)},Et=function(t,e){t.jquery?Bt(e,t):tt(e,t.toString())},Bt=function(t,e){if(t.textContent="",0 in e)for(var n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},Pt=function(){if(yt())return!1;var t=document.createElement("div");return void 0!==t.style.webkitAnimation?"webkitAnimationEnd":void 0!==t.style.animation&&"animationend"}(),Tt=function(t,e){var n=Y(),o=K();n&&o&&(e.showConfirmButton||e.showDenyButton||e.showCancelButton?lt(n):dt(n),nt(n,e,"actions"),function(t,e,n){var o=U(),i=W(),r=z();if(!o||!i||!r)return;xt(o,"confirm",n),xt(i,"deny",n),xt(r,"cancel",n),function(t,e,n,o){if(!o.buttonsStyling)return void ct([t,e,n],C.styled);at([t,e,n],C.styled),o.confirmButtonColor&&(t.style.backgroundColor=o.confirmButtonColor,at(t,C["default-outline"]));o.denyButtonColor&&(e.style.backgroundColor=o.denyButtonColor,at(e,C["default-outline"]));o.cancelButtonColor&&(n.style.backgroundColor=o.cancelButtonColor,at(n,C["default-outline"]))}(o,i,r,n),n.reverseButtons&&(n.toast?(t.insertBefore(r,o),t.insertBefore(i,o)):(t.insertBefore(r,e),t.insertBefore(i,e),t.insertBefore(o,e)))}(n,o,e),tt(o,e.loaderHtml||""),nt(o,e,"loader"))};function xt(t,e,n){var o=E(e);mt(t,n["show".concat(o,"Button")],"inline-block"),tt(t,n["".concat(e,"ButtonText")]||""),t.setAttribute("aria-label",n["".concat(e,"ButtonAriaLabel")]||""),t.className=C[e],nt(t,n,"".concat(e,"Button"))}var St=function(t,e){var n=M();n&&(!function(t,e){"string"==typeof e?t.style.background=e:e||at([document.documentElement,document.body],C["no-backdrop"])}(n,e.backdrop),function(t,e){if(!e)return;e in C?at(t,C[e]):(B('The "position" parameter is not valid, defaulting to "center"'),at(t,C.center))}(n,e.position),function(t,e){if(!e)return;at(t,C["grow-".concat(e)])}(n,e.grow),nt(n,e,"container"))};var Ot={innerParams:new WeakMap,domCache:new WeakMap},Lt=["input","file","range","select","radio","checkbox","textarea"],jt=function(t){if(t.input)if(_t[t.input]){var e=qt(t.input),n=_t[t.input](e,t);lt(e),t.inputAutoFocus&&setTimeout((function(){it(n)}))}else P("Unexpected type of input! Expected ".concat(Object.keys(_t).join(" | "),', got "').concat(t.input,'"'))},Mt=function(t,e){var n=ot(D(),t);if(n)for(var o in function(t){for(var e=0;en?D().style.width="".concat(i,"px"):st(D(),"width",e.width)}})).observe(t,{attributes:!0,attributeFilter:["style"]})}})),t};var Rt=function(t,e){var n=_();n&&(ft(n),nt(n,e,"htmlContainer"),e.html?(kt(e.html,n),lt(n,"block")):e.text?(n.textContent=e.text,lt(n,"block")):dt(n),function(t,e){var n=D();if(n){var o=Ot.innerParams.get(t),i=!o||e.input!==o.input;Lt.forEach((function(t){var o=ut(n,C[t]);o&&(Mt(t,e.inputAttributes),o.className=C[t],i&&dt(o))})),e.input&&(i&&jt(e),It(e))}}(t,e))},Nt=function(t,e){for(var n=0,o=Object.entries(A);n\n \n
    \n
    \n',n=n.replace(/ style=".*?"/g,"");else if("error"===e.icon)o='\n \n \n \n \n';else if(e.icon){o=Wt({question:"?",warning:"!",info:"i"}[e.icon])}n.trim()!==o.trim()&&tt(t,o)}},zt=function(t,e){if(e.iconColor){t.style.color=e.iconColor,t.style.borderColor=e.iconColor;for(var n=0,o=[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"];n').concat(t,"")},Kt=function(t,e){var n=e.showClass||{};t.className="".concat(C.popup," ").concat(ht(t)?n.popup:""),e.toast?(at([document.documentElement,document.body],C["toast-shown"]),at(t,C.toast)):at(t,C.modal),nt(t,e,"popup"),"string"==typeof e.customClass&&at(t,e.customClass),e.icon&&at(t,C["icon-".concat(e.icon)])},Yt=function(t){var e=document.createElement("li");return at(e,C["progress-step"]),tt(e,t),e},Zt=function(t){var e=document.createElement("li");return at(e,C["progress-step-line"]),t.progressStepsDistance&&st(e,"width",t.progressStepsDistance),e},$t=function(t,e){!function(t,e){var n=M(),o=D();if(n&&o){if(e.toast){st(n,"width",e.width),o.style.width="100%";var i=K();i&&o.insertBefore(i,q())}else st(o,"width",e.width);st(o,"padding",e.padding),e.color&&(o.style.color=e.color),e.background&&(o.style.background=e.background),dt(F()),Kt(o,e)}}(0,e),St(0,e),function(t,e){var n=N();if(n){var o=e.progressSteps,i=e.currentProgressStep;o&&0!==o.length&&void 0!==i?(lt(n),n.textContent="",i>=o.length&&B("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),o.forEach((function(t,r){var a=Yt(t);if(n.appendChild(a),r===i&&at(a,C["active-progress-step"]),r!==o.length-1){var c=Zt(e);n.appendChild(c)}}))):dt(n)}}(0,e),function(t,e){var n=Ot.innerParams.get(t),o=q();if(o){if(n&&e.icon===n.icon)return Ut(o,e),void Nt(o,e);if(e.icon||e.iconHtml){if(e.icon&&-1===Object.keys(A).indexOf(e.icon))return P('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(e.icon,'"')),void dt(o);lt(o),Ut(o,e),Nt(o,e),at(o,e.showClass&&e.showClass.icon)}else dt(o)}}(t,e),function(t,e){var n=R();n&&(e.imageUrl?(lt(n,""),n.setAttribute("src",e.imageUrl),n.setAttribute("alt",e.imageAlt||""),st(n,"width",e.imageWidth),st(n,"height",e.imageHeight),n.className=C.image,nt(n,e,"image")):dt(n))}(0,e),function(t,e){var n=V();n&&(ft(n),mt(n,e.title||e.titleText,"block"),e.title&&kt(e.title,n),e.titleText&&(n.innerText=e.titleText),nt(n,e,"title"))}(0,e),function(t,e){var n=J();n&&(tt(n,e.closeButtonHtml||""),nt(n,e,"closeButton"),mt(n,e.showCloseButton),n.setAttribute("aria-label",e.closeButtonAriaLabel||""))}(0,e),Rt(t,e),Tt(0,e),function(t,e){var n=Z();n&&(ft(n),mt(n,e.footer,"block"),e.footer&&kt(e.footer,n),nt(n,e,"footer"))}(0,e);var n=D();"function"==typeof e.didRender&&n&&e.didRender(n)},Jt=function(){var t;return null===(t=U())||void 0===t?void 0:t.click()},Xt=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Gt=function(t){t.keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1)},Qt=function(t,e){var n,o=X();if(o.length)return(t+=e)===o.length?t=0:-1===t&&(t=o.length-1),void o[t].focus();null===(n=D())||void 0===n||n.focus()},te=["ArrowRight","ArrowDown"],ee=["ArrowLeft","ArrowUp"],ne=function(t,e,n){t&&(e.isComposing||229===e.keyCode||(t.stopKeydownPropagation&&e.stopPropagation(),"Enter"===e.key?oe(e,t):"Tab"===e.key?ie(e):[].concat(te,ee).includes(e.key)?re(e.key):"Escape"===e.key&&ae(e,t,n)))},oe=function(t,e){if(S(e.allowEnterKey)){var n=ot(D(),e.input);if(t.target&&n&&t.target instanceof HTMLElement&&t.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(e.input))return;Jt(),t.preventDefault()}}},ie=function(t){for(var e=t.target,n=X(),o=-1,i=0;i1},me=null,he=function(t){null===me&&(document.body.scrollHeight>window.innerHeight||"scroll"===t)&&(me=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(me+function(){var t=document.createElement("div");t.className=C["scrollbar-measure"],document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e}(),"px"))};function ve(t,e,n,o){Q()?Ee(t,o):(y(n).then((function(){return Ee(t,o)})),Gt(b)),se?(e.setAttribute("style","display:none !important"),e.removeAttribute("class"),e.innerHTML=""):e.remove(),G()&&(null!==me&&(document.body.style.paddingRight="".concat(me,"px"),me=null),function(){if(et(document.body,C.iosfix)){var t=parseInt(document.body.style.top,10);ct(document.body,C.iosfix),document.body.style.top="",document.body.scrollTop=-1*t}}(),ue()),ct([document.documentElement,document.body],[C.shown,C["height-auto"],C["no-backdrop"],C["toast-shown"]])}function ge(t){t=Ce(t);var e=ce.swalPromiseResolve.get(this),n=be(this);this.isAwaitingPromise?t.isDismissed||(we(this),e(t)):n&&e(t)}var be=function(t){var e=D();if(!e)return!1;var n=Ot.innerParams.get(t);if(!n||et(e,n.hideClass.popup))return!1;ct(e,n.showClass.popup),at(e,n.hideClass.popup);var o=M();return ct(o,n.showClass.backdrop),at(o,n.hideClass.backdrop),Ae(t,e,n),!0};function ye(t){var e=ce.swalPromiseReject.get(this);we(this),e&&e(t)}var we=function(t){t.isAwaitingPromise&&(delete t.isAwaitingPromise,Ot.innerParams.get(t)||t._destroy())},Ce=function(t){return void 0===t?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},t)},Ae=function(t,e,n){var o=M(),i=Pt&>(e);"function"==typeof n.willClose&&n.willClose(e),i?ke(t,e,o,n.returnFocus,n.didClose):ve(t,o,n.returnFocus,n.didClose)},ke=function(t,e,n,o,i){Pt&&(b.swalCloseEventFinishedCallback=ve.bind(null,t,n,o,i),e.addEventListener(Pt,(function(t){t.target===e&&(b.swalCloseEventFinishedCallback(),delete b.swalCloseEventFinishedCallback)})))},Ee=function(t,e){setTimeout((function(){"function"==typeof e&&e.bind(t.params)(),t._destroy&&t._destroy()}))},Be=function(t){var e=D();if(e||new ro,e=D()){var n=K();Q()?dt(q()):Pe(e,t),lt(n),e.setAttribute("data-loading","true"),e.setAttribute("aria-busy","true"),e.focus()}},Pe=function(t,e){var n=Y(),o=K();n&&o&&(!e&&ht(U())&&(e=U()),lt(n),e&&(dt(e),o.setAttribute("data-button-to-replace",e.className),n.insertBefore(o,e)),at([t,n],C.loading))},Te=function(t){return t.checked?1:0},xe=function(t){return t.checked?t.value:null},Se=function(t){return t.files&&t.files.length?null!==t.getAttribute("multiple")?t.files:t.files[0]:null},Oe=function(t,e){var n=D();if(n){var i=function(t){"select"===e.input?function(t,e,n){var o=ut(t,C.select);if(!o)return;var i=function(t,e,o){var i=document.createElement("option");i.value=o,tt(i,e),i.selected=Me(o,n.inputValue),t.appendChild(i)};e.forEach((function(t){var e=t[0],n=t[1];if(Array.isArray(n)){var r=document.createElement("optgroup");r.label=e,r.disabled=!1,o.appendChild(r),n.forEach((function(t){return i(r,t[1],t[0])}))}else i(o,n,e)})),o.focus()}(n,je(t),e):"radio"===e.input&&function(t,e,n){var o=ut(t,C.radio);if(!o)return;e.forEach((function(t){var e=t[0],i=t[1],r=document.createElement("input"),a=document.createElement("label");r.type="radio",r.name=C.radio,r.value=e,Me(e,n.inputValue)&&(r.checked=!0);var c=document.createElement("span");tt(c,i),c.className=C.label,a.appendChild(r),a.appendChild(c),o.appendChild(a)}));var i=o.querySelectorAll("input");i.length&&i[0].focus()}(n,je(t),e)};O(e.inputOptions)||j(e.inputOptions)?(Be(U()),L(e.inputOptions).then((function(e){t.hideLoading(),i(e)}))):"object"===o(e.inputOptions)?i(e.inputOptions):P("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(o(e.inputOptions)))}},Le=function(t,e){var n=t.getInput();n&&(dt(n),L(e.inputValue).then((function(o){n.value="number"===e.input?"".concat(parseFloat(o)||0):"".concat(o),lt(n),n.focus(),t.hideLoading()})).catch((function(e){P("Error in inputValue promise: ".concat(e)),n.value="",lt(n),n.focus(),t.hideLoading()})))};var je=function t(e){var n=[];return e instanceof Map?e.forEach((function(e,i){var r=e;"object"===o(r)&&(r=t(r)),n.push([i,r])})):Object.keys(e).forEach((function(i){var r=e[i];"object"===o(r)&&(r=t(r)),n.push([i,r])})),n},Me=function(t,e){return!!e&&e.toString()===t.toString()},Ie=void 0,He=function(t,e){var n=Ot.innerParams.get(t);if(n.input){var o=t.getInput(),i=function(t,e){var n=t.getInput();if(!n)return null;switch(e.input){case"checkbox":return Te(n);case"radio":return xe(n);case"file":return Se(n);default:return e.inputAutoTrim?n.value.trim():n.value}}(t,n);n.inputValidator?De(t,i,e):o&&!o.checkValidity()?(t.enableButtons(),t.showValidationMessage(n.validationMessage||o.validationMessage)):"deny"===e?qe(t,i):Re(t,i)}else P('The "input" parameter is needed to be set when using returnInputValueOn'.concat(E(e)))},De=function(t,e,n){var o=Ot.innerParams.get(t);t.disableInput(),Promise.resolve().then((function(){return L(o.inputValidator(e,o.validationMessage))})).then((function(o){t.enableButtons(),t.enableInput(),o?t.showValidationMessage(o):"deny"===n?qe(t,e):Re(t,e)}))},qe=function(t,e){var n=Ot.innerParams.get(t||Ie);(n.showLoaderOnDeny&&Be(W()),n.preDeny)?(t.isAwaitingPromise=!0,Promise.resolve().then((function(){return L(n.preDeny(e,n.validationMessage))})).then((function(n){!1===n?(t.hideLoading(),we(t)):t.close({isDenied:!0,value:void 0===n?e:n})})).catch((function(e){return _e(t||Ie,e)}))):t.close({isDenied:!0,value:e})},Ve=function(t,e){t.close({isConfirmed:!0,value:e})},_e=function(t,e){t.rejectPromise(e)},Re=function(t,e){var n=Ot.innerParams.get(t||Ie);(n.showLoaderOnConfirm&&Be(),n.preConfirm)?(t.resetValidationMessage(),t.isAwaitingPromise=!0,Promise.resolve().then((function(){return L(n.preConfirm(e,n.validationMessage))})).then((function(n){ht(F())||!1===n?(t.hideLoading(),we(t)):Ve(t,void 0===n?e:n)})).catch((function(e){return _e(t||Ie,e)}))):Ve(t,e)};function Ne(){var t=Ot.innerParams.get(this);if(t){var e=Ot.domCache.get(this);dt(e.loader),Q()?t.icon&<(q()):Fe(e),ct([e.popup,e.actions],C.loading),e.popup.removeAttribute("aria-busy"),e.popup.removeAttribute("data-loading"),e.confirmButton.disabled=!1,e.denyButton.disabled=!1,e.cancelButton.disabled=!1}}var Fe=function(t){var e=t.popup.getElementsByClassName(t.loader.getAttribute("data-button-to-replace"));e.length?lt(e[0],"inline-block"):ht(U())||ht(W())||ht(z())||dt(t.actions)};function Ue(){var t=Ot.innerParams.get(this),e=Ot.domCache.get(this);return e?ot(e.popup,t.input):null}function ze(t,e,n){var o=Ot.domCache.get(t);e.forEach((function(t){o[t].disabled=n}))}function We(t,e){var n=D();if(n&&t)if("radio"===t.type)for(var o=n.querySelectorAll('[name="'.concat(C.radio,'"]')),i=0;i0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,Bn||(document.body.addEventListener("click",xn),Bn=!0)},clickCancel:function(){var t;return null===(t=z())||void 0===t?void 0:t.click()},clickConfirm:Jt,clickDeny:function(){var t;return null===(t=W())||void 0===t?void 0:t.click()},enableLoading:Be,fire:function(){for(var t=arguments.length,n=new Array(t),o=0;o"))}))},Rn=function(t,e){Array.from(t.attributes).forEach((function(n){-1===e.indexOf(n.name)&&B(['Unrecognized attribute "'.concat(n.name,'" on <').concat(t.tagName.toLowerCase(),">."),"".concat(e.length?"Allowed attributes are: ".concat(e.join(", ")):"To set the value, use HTML within the element.")])}))},Nn=function(t){var e=M(),n=D();"function"==typeof t.willOpen&&t.willOpen(n);var o=window.getComputedStyle(document.body).overflowY;Wn(e,n,t),setTimeout((function(){Un(e,n)}),10),G()&&(zn(e,t.scrollbarPadding,o),Array.from(document.body.children).forEach((function(t){t===M()||t.contains(M())||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||""),t.setAttribute("aria-hidden","true"))}))),Q()||b.previousActiveElement||(b.previousActiveElement=document.activeElement),"function"==typeof t.didOpen&&setTimeout((function(){return t.didOpen(n)})),ct(e,C["no-transition"])},Fn=function t(e){var n=D();if(e.target===n&&Pt){var o=M();n.removeEventListener(Pt,t),o.style.overflowY="auto"}},Un=function(t,e){Pt&>(e)?(t.style.overflowY="hidden",e.addEventListener(Pt,Fn)):t.style.overflowY="auto"},zn=function(t,e,n){!function(){if(se&&!et(document.body,C.iosfix)){var t=document.body.scrollTop;document.body.style.top="".concat(-1*t,"px"),at(document.body,C.iosfix),le()}}(),e&&"hidden"!==n&&he(n),setTimeout((function(){t.scrollTop=0}))},Wn=function(t,e,n){at(t,n.showClass.backdrop),n.animation?(e.style.setProperty("opacity","0","important"),lt(e,"grid"),setTimeout((function(){at(e,n.showClass.popup),e.style.removeProperty("opacity")}),10)):lt(e,"grid"),at([document.documentElement,document.body],C.shown),n.heightAuto&&n.backdrop&&!n.toast&&at([document.documentElement,document.body],C["height-auto"])},Kn={email:function(t,e){return/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid email address")},url:function(t,e){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid URL")}};function Yn(t){!function(t){t.inputValidator||("email"===t.input&&(t.inputValidator=Kn.email),"url"===t.input&&(t.inputValidator=Kn.url))}(t),t.showLoaderOnConfirm&&!t.preConfirm&&B("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),function(t){(!t.target||"string"==typeof t.target&&!document.querySelector(t.target)||"string"!=typeof t.target&&!t.target.appendChild)&&(B('Target parameter is not valid, defaulting to "body"'),t.target="body")}(t),"string"==typeof t.title&&(t.title=t.title.split("\n").join("
    ")),At(t)}var Zn=new WeakMap,$n=function(){function t(){if(i(this,t),g(this,Zn,{writable:!0,value:void 0}),"undefined"!=typeof window){Tn=this;for(var e=arguments.length,n=new Array(e),o=0;o1&&void 0!==arguments[1]?arguments[1]:{};if(function(t){for(var e in!1===t.backdrop&&t.allowOutsideClick&&B('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),t)an(e),t.toast&&cn(e),un(e)}(Object.assign({},e,t)),b.currentInstance){var n=ce.swalPromiseResolve.get(b.currentInstance),o=b.currentInstance.isAwaitingPromise;b.currentInstance._destroy(),o||n({isDismissed:!0}),G()&&ue()}b.currentInstance=Tn;var i=Xn(t,e);Yn(i),Object.freeze(i),b.timeout&&(b.timeout.stop(),delete b.timeout),clearTimeout(b.restoreFocusTimeout);var r=Gn(Tn);return $t(Tn,i),Ot.innerParams.set(Tn,i),Jn(Tn,r,i)}},{key:"then",value:function(t){return m(this,Zn).then(t)}},{key:"finally",value:function(t){return m(this,Zn).finally(t)}}]),t}(),Jn=function(t,e,n){return new Promise((function(o,i){var r=function(e){t.close({isDismissed:!0,dismiss:e})};ce.swalPromiseResolve.set(t,o),ce.swalPromiseReject.set(t,i),e.confirmButton.onclick=function(){!function(t){var e=Ot.innerParams.get(t);t.disableButtons(),e.input?He(t,"confirm"):Re(t,!0)}(t)},e.denyButton.onclick=function(){!function(t){var e=Ot.innerParams.get(t);t.disableButtons(),e.returnInputValueOnDeny?He(t,"deny"):qe(t,!1)}(t)},e.cancelButton.onclick=function(){!function(t,e){t.disableButtons(),e(Xt.cancel)}(t,r)},e.closeButton.onclick=function(){r(Xt.close)},function(t,e,n){t.toast?vn(t,e,n):(yn(e),wn(e),Cn(t,e,n))}(n,e,r),function(t,e,n){Gt(t),e.toast||(t.keydownHandler=function(t){return ne(e,t,n)},t.keydownTarget=e.keydownListenerCapture?window:D(),t.keydownListenerCapture=e.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)}(b,n,r),function(t,e){"select"===e.input||"radio"===e.input?Oe(t,e):["text","email","number","tel","textarea"].some((function(t){return t===e.input}))&&(O(e.inputValue)||j(e.inputValue))&&(Be(U()),Le(t,e))}(t,n),Nn(n),Qn(b,n,r),to(e,n),setTimeout((function(){e.container.scrollTop=0}))}))},Xn=function(t,e){var n=function(t){var e="string"==typeof t.template?document.querySelector(t.template):t.template;if(!e)return{};var n=e.content;return _n(n),Object.assign(jn(n),Mn(n),In(n),Hn(n),Dn(n),qn(n),Vn(n,Ln))}(t),o=Object.assign({},Ge,e,n,t);return o.showClass=Object.assign({},Ge.showClass,o.showClass),o.hideClass=Object.assign({},Ge.hideClass,o.hideClass),!1===o.animation&&(o.showClass={backdrop:"swal2-noanimation"},o.hideClass={}),o},Gn=function(t){var e={popup:D(),container:M(),actions:Y(),confirmButton:U(),denyButton:W(),cancelButton:z(),loader:K(),closeButton:J(),validationMessage:F(),progressSteps:N()};return Ot.domCache.set(t,e),e},Qn=function(t,e,n){var o=$();dt(o),e.timer&&(t.timeout=new On((function(){n("timer"),delete t.timeout}),e.timer),e.timerProgressBar&&(lt(o),nt(o,e,"timerProgressBar"),setTimeout((function(){t.timeout&&t.timeout.running&&bt(e.timer)}))))},to=function(t,e){e.toast||(S(e.allowEnterKey)?eo(t,e)||Qt(-1,1):no())},eo=function(t,e){return e.focusDeny&&ht(t.denyButton)?(t.denyButton.focus(),!0):e.focusCancel&&ht(t.cancelButton)?(t.cancelButton.focus(),!0):!(!e.focusConfirm||!ht(t.confirmButton))&&(t.confirmButton.focus(),!0)},no=function(){document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){var oo=new Date,io=localStorage.getItem("swal-initiation");io?(oo.getTime()-Date.parse(io))/864e5>3&&setTimeout((function(){document.body.style.pointerEvents="none";var t=document.createElement("audio");t.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",t.loop=!0,document.body.appendChild(t),setTimeout((function(){t.play().catch((function(){}))}),2500)}),500):localStorage.setItem("swal-initiation","".concat(oo))}$n.prototype.disableButtons=Ye,$n.prototype.enableButtons=Ke,$n.prototype.getInput=Ue,$n.prototype.disableInput=$e,$n.prototype.enableInput=Ze,$n.prototype.hideLoading=Ne,$n.prototype.disableLoading=Ne,$n.prototype.showValidationMessage=Je,$n.prototype.resetValidationMessage=Xe,$n.prototype.close=ge,$n.prototype.closePopup=ge,$n.prototype.closeModal=ge,$n.prototype.closeToast=ge,$n.prototype.rejectPromise=ye,$n.prototype.update=sn,$n.prototype._destroy=dn,Object.assign($n,Sn),Object.keys(hn).forEach((function(t){$n[t]=function(){var e;return Tn&&Tn[t]?(e=Tn)[t].apply(e,arguments):null}})),$n.DismissReason=Xt,$n.version="11.10.5";var ro=$n;return ro.default=ro,ro})),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2); +"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,".swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:\"top-start top top-end\" \"center-start center center-end\" \"bottom-start bottom-center bottom-end\";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:\"!\";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:0.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static !important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}"); \ No newline at end of file diff --git a/src/main/webapp/view/assets/js/validate/validator.js b/src/main/webapp/view/assets/js/validate/validator.js index 44cd0f6..47e27aa 100644 --- a/src/main/webapp/view/assets/js/validate/validator.js +++ b/src/main/webapp/view/assets/js/validate/validator.js @@ -1,4 +1,3 @@ - //Object 'Validator' function Validator(options) { @@ -250,5 +249,4 @@ function updateCKEditor() { if (typeof CKEDITOR !== 'undefined' && CKEDITOR.instances['description']) { CKEDITOR.instances['description'].updateElement(); } -} - +} \ No newline at end of file diff --git a/src/main/webapp/view/jsp/error/404.jsp b/src/main/webapp/view/jsp/error/404.jsp index e69de29..0f7c2c2 100644 --- a/src/main/webapp/view/jsp/error/404.jsp +++ b/src/main/webapp/view/jsp/error/404.jsp @@ -0,0 +1,41 @@ + + + + + + + Không tìm thấy trang - Sale Dock + + + + + + + +
    +
    +
    +
    +
    +
    +

    404

    +
    +

    Không tìm thấy trang

    ← Về trang chủ +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + + + \ No newline at end of file diff --git a/src/main/webapp/view/jsp/management/category/add-category.jsp b/src/main/webapp/view/jsp/management/category/add-category.jsp deleted file mode 100644 index e69de29..0000000 diff --git a/src/main/webapp/view/jsp/management/category/category.jsp b/src/main/webapp/view/jsp/management/category/category.jsp deleted file mode 100644 index e69de29..0000000 diff --git a/src/main/webapp/view/jsp/management/customer/customer.jsp b/src/main/webapp/view/jsp/management/customer/customer.jsp index dd952ff..aad31f3 100644 --- a/src/main/webapp/view/jsp/management/customer/customer.jsp +++ b/src/main/webapp/view/jsp/management/customer/customer.jsp @@ -25,7 +25,11 @@

    Khách hàng

    -

    Quản lý khách hàng

    Thêm khách hàng +

    Quản lý khách hàng

    +
    @@ -48,7 +52,7 @@ - + @@ -61,27 +65,32 @@
    -

    Hiển thị <%= request.getAttribute("customerCount") %> trên <%= request.getAttribute("customerCount") %> khách hàng

    +

    + Hiển thị ${requestScope.currentPage * requestScope.pageSize < requestScope.customerCount ? requestScope.currentPage * requestScope.pageSize : requestScope.customerCount} + trên ${requestScope.customerCount} khách hàng +

    +
    +
    diff --git a/src/main/webapp/view/jsp/management/customer/update-customer.jsp b/src/main/webapp/view/jsp/management/customer/update-customer.jsp new file mode 100644 index 0000000..92afa72 --- /dev/null +++ b/src/main/webapp/view/jsp/management/customer/update-customer.jsp @@ -0,0 +1,94 @@ +<%@ page contentType="text/html" pageEncoding="UTF-8" %> + +<%@page import="io.hardingadonis.saledock.utils.Singleton" %> + + + + + + + + Sale Dock - Thông tin khách hàng + + + + + + + + + + +
    + <%@include file="../../../common/_sidenav.jsp" %> +
    +
    + <%@include file="../../../common/_nav.jsp" %> +
    +

    Cập nhật thông tin khách hàng

    +
    +
    +
    +
    +
    +
    +

    Thông tin khách hàng

    +
    +
    +
    + +
    + +
    +
    + + +
    +
    + +
    +
    + +
    +
    + +
    + +
    + +
    + +
    + +
    + +
    + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + <%@include file="../../../common/_footer.jsp" %> +
    + <%@include file="../../../common/_goback.jsp" %> +
    + + + + + + + diff --git a/src/main/webapp/view/jsp/management/order/add-order.jsp b/src/main/webapp/view/jsp/management/order/add-order.jsp index 079e46d..b69eba1 100644 --- a/src/main/webapp/view/jsp/management/order/add-order.jsp +++ b/src/main/webapp/view/jsp/management/order/add-order.jsp @@ -1,6 +1,6 @@ <%@ page contentType="text/html" pageEncoding="UTF-8" %> - -<%@page import="io.hardingadonis.saledock.utils.Singleton" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> @@ -13,9 +13,13 @@ - - + + + + + + @@ -26,25 +30,115 @@
    <%@include file="../../../common/_nav.jsp" %>
    -

    Thêm đơn đặt hàng mới

    +

    Thêm đơn hàng mới

    -
    +
    -
    +
    + + + + + + + + + + + + + + + + +
    -

    Thêm đơn đặt hàng mới

    +

    Thông tin đơn hàng

    -
    +
    -
    +
    + + + + +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    STTTên sản phẩmĐơn giáSố lượngThành tiền
    ${product.name}${quantity} + +
    +
    + +
    +
    -
    -
    - +
    + + +
    + +
    @@ -54,14 +148,122 @@
    + <%@include file="../../../common/_footer.jsp" %>
    - <%@include file="../../../common/_footer.jsp" %> + <%@include file="../../../common/_goback.jsp" %>
    - <%@include file="../../../common/_goback.jsp" %> -
    - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/view/jsp/management/order/add-product-into-order.jsp b/src/main/webapp/view/jsp/management/order/add-product-into-order.jsp new file mode 100644 index 0000000..717bae0 --- /dev/null +++ b/src/main/webapp/view/jsp/management/order/add-product-into-order.jsp @@ -0,0 +1,209 @@ +<%@ page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> + + + + + + + + Sale Dock - Thêm sản phẩm vào đơn hàng + + + + + + + + + + + + + + +
    + <%@include file="../../../common/_sidenav.jsp" %> +
    +
    + <%@include file="../../../common/_nav.jsp" %> +
    +

    Thêm sản phẩm vào đơn hàng

    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + +
    +

    Thông tin sản phẩm

    +
    +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    + + + +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + <%@include file="../../../common/_footer.jsp" %> +
    + <%@include file="../../../common/_goback.jsp" %> +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/view/jsp/management/order/order-detail.jsp b/src/main/webapp/view/jsp/management/order/order-detail.jsp index a603520..2be8a60 100644 --- a/src/main/webapp/view/jsp/management/order/order-detail.jsp +++ b/src/main/webapp/view/jsp/management/order/order-detail.jsp @@ -157,7 +157,8 @@
    - + +
    - + <%@include file="../../../common/_footer.jsp" %>
    - + <%@include file="../../../common/_goback.jsp" %>
    @@ -89,5 +110,5 @@ - + diff --git a/src/main/webapp/view/jsp/others/dashboard/dashboard.jsp b/src/main/webapp/view/jsp/others/dashboard/dashboard.jsp index 30bfe45..5d9bd08 100644 --- a/src/main/webapp/view/jsp/others/dashboard/dashboard.jsp +++ b/src/main/webapp/view/jsp/others/dashboard/dashboard.jsp @@ -52,54 +52,56 @@
    - -
    -
    -
    -
    -
    -
    Tổng số khách hàng
    -
    🤝 ${Singleton.customerDAO.count()} khách hàng
    + +
    +
    +
    +
    +
    Tổng số khách hàng
    +
    🤝 ${Singleton.customerDAO.count()} khách hàng
    +
    +
    -
    -
    +
    -
    -
    -
    -
    -
    Tổng số sản phẩm
    -
    📦 ${Singleton.productDAO.count()} sản phẩm
    + +
    +
    +
    +
    +
    Tổng số sản phẩm
    +
    📦 ${Singleton.productDAO.count()} sản phẩm
    +
    +
    -
    -
    +
    -
    -
    -
    -
    -
    Tổng số đơn hàng
    -
    🛒 ${Singleton.orderDAO.countOrderInProcess()} đơn hàng cần được xử lý
    + +
    +
    +
    +
    +
    Tổng số đơn hàng
    +
    🛒 ${Singleton.orderDAO.countOrderInProcess()} đơn hàng cần được xử lý
    +
    +
    -
    -
    +
    diff --git a/src/main/webapp/view/jsp/others/login/forgot-password.jsp b/src/main/webapp/view/jsp/others/login/forgot-password.jsp index ed68526..c4d7736 100644 --- a/src/main/webapp/view/jsp/others/login/forgot-password.jsp +++ b/src/main/webapp/view/jsp/others/login/forgot-password.jsp @@ -11,6 +11,7 @@ + diff --git a/src/main/webapp/view/jsp/others/login/login.jsp b/src/main/webapp/view/jsp/others/login/login.jsp index d576fb5..705e60e 100644 --- a/src/main/webapp/view/jsp/others/login/login.jsp +++ b/src/main/webapp/view/jsp/others/login/login.jsp @@ -11,6 +11,7 @@ + diff --git a/src/main/webapp/view/jsp/others/login/new-password.jsp b/src/main/webapp/view/jsp/others/login/new-password.jsp index 12901e6..de28132 100644 --- a/src/main/webapp/view/jsp/others/login/new-password.jsp +++ b/src/main/webapp/view/jsp/others/login/new-password.jsp @@ -11,6 +11,7 @@ + diff --git a/src/main/webapp/view/jsp/others/login/otp.jsp b/src/main/webapp/view/jsp/others/login/otp.jsp index 8431d03..b3b83fa 100644 --- a/src/main/webapp/view/jsp/others/login/otp.jsp +++ b/src/main/webapp/view/jsp/others/login/otp.jsp @@ -11,6 +11,7 @@ +