Skip to content
Permalink
Browse files
admin and user seperation
  • Loading branch information
Roshan Koshy Thomas committed Aug 25, 2022
1 parent 47b06bc commit a588e688634e7671739b8e3ae5245ee361c76bf5
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
@@ -23,9 +23,13 @@ List<Product> prod = (List<Product>) request.getAttribute("product");

<!-- custom css file link -->
<link rel="stylesheet" href="./css/admin.css">
<%@include file="/includes/head.jsp"%>


</head>
<body>
<%@include file="/includes/navbar.jsp"%>




@@ -93,6 +97,7 @@ List<Product> prod = (List<Product>) request.getAttribute("product");
</div>

</div>



</body>
@@ -134,7 +134,6 @@ html{




@media (max-width:991px){

html{
@@ -1,9 +1,9 @@


<%-- <%@page import="cfy.model.User"%>
<%@page import="cfy.model.User"%>
<%
User auth = (User) request.getSession().getAttribute("auth");
%> --%>
User usr = (User) request.getSession().getAttribute("auth");
%>


<nav class="navbar navbar-expand-lg navbar-light bg-light">
@@ -19,14 +19,30 @@ User auth = (User) request.getSession().getAttribute("auth");
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item"><a class="nav-link" href="index.jsp">Home</a></li>

<%
if (usr!=null && usr.getType().equals("user")) {
%>
<li class="nav-item"><a class="nav-link" href="cart.jsp">Cart
<span class="badge badge-danger">${cart_list.size()}</span>
</a></li>


<%
if (auth != null) {
}
if (usr != null) {
if (usr.getType().equals("user")) {
%>


<li class="nav-item"><a class="nav-link" href="orders.jsp">Orders</a></li>
<%
}
%>


<li class="nav-item"><a class="nav-link" href="log-out">Logout</a></li>

<%
} else {
%>
@@ -12,6 +12,11 @@ if (auth != null) {
request.setAttribute("person", auth);
}
if(auth.getType().equals("admin")){
response.sendRedirect("admin");
}
ProductDao pd = new ProductDao(DbCon.getConnection());
List<Product> products = pd.getAllProducts();

0 comments on commit a588e68

Please sign in to comment.