Untitled
unknown
plain_text
2 years ago
6.0 kB
7
Indexable
<%@page import="DAOs.BrandDAO"%>
<%@page import="DAOs.CategoryDAO"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="DAOs.ProductDAO"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Product</title>
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<link href='https://unpkg.com/boxicons@2.0.9/css/boxicons.min.css' rel='stylesheet'>
<link rel="stylesheet" href="<%= request.getContextPath()%>/CSS/StyleAdminPanel.css">
<link rel="stylesheet" href="<%= request.getContextPath()%>/CSS/button5.css">
</head>
<body>
<body>
<!-- SIDEBAR -->
<%
int usID = (int) session.getAttribute("AdminstratorID");
%>
<div class="order_list_container">
<jsp:include page="/Admin_navigation.jsp">
<jsp:param name="ID" value="<%=usID%>"/>
</jsp:include>
<section id="content">
<!-- MAIN -->
<jsp:include page="Admin_anlyzes.jsp"></jsp:include>
<main>
<% ProductDAO pDao = new ProductDAO();
int totalProducts = pDao.getTotalProductCount();
%>
<div class="table-data">
<div class="order">
<div class="Header">
<div class="pHeader"><%= totalProducts%> product</div>
<label class="addNewBrand" onclick="location.href = '/addNewBrand'">Add new Brands</label>
<label class="addNewCategory" onclick="location.href = '/addNewCategory'">Add new categories</label>
<label class="addNewProduct">Add new products</label>
</div>
<div class="table_example">
<table id="example">
<thead>
<tr>
<th style="">Product Name</th>
<th>Brand</th>
<th>Category</th>
<th>Price</th>
<th>Inventory</th>
<th>Sold</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<%
ResultSet rs = pDao.getAllProduct();
while (rs.next()) {
%>
<tr>
<td style="text-align: center">
<img class="pImg" src="<%= rs.getString("ProductImageURL")%>" alt="alt"/>
<%=rs.getString("ProductName")%>
</td>
<%
int BrandID = rs.getInt("BrandID");
BrandDAO bDao = new BrandDAO();
ResultSet rs2 = bDao.getNameBrandByBrandID(BrandID);
while (rs2.next()) {
%>
<td style="text-align: center"><%=rs2.getString("BrandName")%></td>
<%}%>
<%
int CategoryID = rs.getInt("CategoryID");
CategoryDAO cDao = new CategoryDAO();
ResultSet rs3 = cDao.getCategoryNameByCategoryID(CategoryID);
while (rs3.next()) {
%>
<td style="text-align: center"><%=rs3.getString("CatName")%></td>
<%}%>
<td style="text-align: center"> <%=rs.getInt("Price")%></td>
<td style="text-align: center"> <%=rs.getInt("Quantity")%></td>
<td style="text-align: center"> <%=rs.getByte("Active")%></td>
<td style="text-align: center"> <a class="info" href="/Product/View/<%=rs.getInt("CategoryID")%>"><b>Info ></b></a></td>
</tr>
<%
}
%>
</tbody>
</table>
</div>
</div>
</div>
</main>
<!-- MAIN -->
</section>
</div>
<!-- CONTENT -->
<script src="<%= request.getContextPath()%>/JavaScript/script.js"></script>
<script src="https://kit.fontawesome.com/53d8d93477.js" crossorigin="anonymous"></script>
</body>
</html>
Editor is loading...