en
Feedback
SCA Projects

SCA Projects

Open in Telegram
385
Subscribers
No data24 hours
-17 days
+130 days
Posts Archive
\");\n request.setAttribute(\"message\",status);\n rd.forward(request, response);\n\n } else if (avQty < pQty) {\n String status = null;\n if (avQty == 0) {\n status = \"Product out of stock!\";\n } else {\n cartDao.updateProductInCart(new CartPojo(userId, prodId, avQty));\n status = \"Only \" + avQty + \" no of \" + productPojo.getProdName() + \" are available, so we are adding only \" + avQty + \" products in your cart\";\n }\n DemandImpl demand = new DemandImpl();\n DemandPojo demandPojo = new DemandPojo(userId, prodId, pQty - avQty);\n boolean flag = demand.addProduct(demandPojo);\n if (flag) {\n status += \"
Later we will mail you when \" + productPojo.getProdName() + \" will be available\";\n }\n RequestDispatcher rd = request.getRequestDispatcher(\"./CartDetailsServlet\");\n //pw.println(\"\");\n //rd.include(request, response);\n request.setAttribute(\"message\",status);\n rd.forward(request, response);\n } else {\n String status = cartDao.updateProductInCart(new CartPojo(userId, prodId, pQty));\n RequestDispatcher rd = request.getRequestDispatcher(\"userHome.jsp\");\n //pw.println(\"\");\n //rd.include(request, response);\n request.setAttribute(\"message\",status);\n rd.forward(request, response);\n }\n\n }","datePublished":"2025-01-03T16:07:23Z","dateModified":"2025-01-03T16:07:23Z","author":{"@type":"Organization","name":"SCA Projects","url":"https://telemetr.io/en/channels/1829492395-scaprojects","image":"https://img.tlmtr.io/c/1ZOmxR/6334803859834255158?ty=x"},"publisher":{"@type":"Organization","name":"SCA Projects","url":"https://telemetr.io/en/channels/1829492395-scaprojects","image":"https://img.tlmtr.io/c/1ZOmxR/6334803859834255158?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":109}]}},{"@type":"ListItem","position":19,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/en/channels/1829492395-scaprojects/posts/228","url":"https://telemetr.io/en/channels/1829492395-scaprojects/posts/228","mainEntityOfPage":"https://telemetr.io/en/channels/1829492395-scaprojects/posts/228","headline":"<%@ page language=\"java\" contentType=\"text/html; charset=ISO-8859-1\" pageEncoding=\"ISO-8859-1\"%> <%@ page imp…","articleBody":"<%@ page language=\"java\" contentType=\"text/html; charset=ISO-8859-1\"\n pageEncoding=\"ISO-8859-1\"%>\n<%@ page import=\"in.gadgethub.dao.impl.*,in.gadgethub.dao.*,in.gadgethub.pojo.*,javax.servlet.ServletOutputStream,java.io.*,java.util.*\" %>\n\n\n\n\n Order Details\n \n \n \n \n\n\n\n <%\n Listorders=(List)request.getAttribute(\"orders\");\n String paymentStatus=(String)request.getAttribute(\"paymentStatus\");\n %>\n\n \n\n
Order Details
\n\n \n <%\n if(paymentStatus!=null){\n %>\n
\n <%=paymentStatus %>\n
\n <%\n }\n %>\n\n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n <%\n if(orders!=null && !orders.isEmpty()){\n for(OrderDetailsPojo order:orders){\n \n %>\n \n \n \n \n \n \n \n \n \n <%\n }\n }else{\n %>\n \n \n \n <%\n }\n %>\n \n
PictureProduct NameOrder IDQuantityPriceTimeStatus
\" style=\"width: 50px; height: 50px;\"><%=order.getProdName()%><%=order.getOrderId()%><%=order.getQuantity()%><%=order.getAmount() %><%=order.getTime()%><%=order.getShipped()==0?\"ORDER_PLACED\":\"ORDER_SHIPPED\" %>
No orders found.
\n
\n
\n \n\n <%@ include file=\"footer.jsp\" %>\n\n","datePublished":"2025-01-03T16:07:20Z","dateModified":"2025-01-03T16:07:20Z","author":{"@type":"Organization","name":"SCA Projects","url":"https://telemetr.io/en/channels/1829492395-scaprojects","image":"https://img.tlmtr.io/c/1ZOmxR/6334803859834255158?ty=x"},"publisher":{"@type":"Organization","name":"SCA Projects","url":"https://telemetr.io/en/channels/1829492395-scaprojects","image":"https://img.tlmtr.io/c/1ZOmxR/6334803859834255158?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":101}]}},{"@type":"ListItem","position":20,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/en/channels/1829492395-scaprojects/posts/227","url":"https://telemetr.io/en/channels/1829492395-scaprojects/posts/227","mainEntityOfPage":"https://telemetr.io/en/channels/1829492395-scaprojects/posts/227","headline":"orderDetails.jsp =============","articleBody":"orderDetails.jsp\n=============","datePublished":"2025-01-03T16:06:47Z","dateModified":"2025-01-03T16:06:47Z","author":{"@type":"Organization","name":"SCA Projects","url":"https://telemetr.io/en/channels/1829492395-scaprojects","image":"https://img.tlmtr.io/c/1ZOmxR/6334803859834255158?ty=x"},"publisher":{"@type":"Organization","name":"SCA Projects","url":"https://telemetr.io/en/channels/1829492395-scaprojects","image":"https://img.tlmtr.io/c/1ZOmxR/6334803859834255158?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":104}]}}]}
+1
activation-1.1.1.jar0.68 KB

UserProfileServlet.java0.03 KB

header.jsp0.09 KB

+1
AdminStockServlet.java0.03 KB

public class MailMessage { public static void registrationSuccess(String recipientMailId, String name) throws MessagingException { String subject = "Registration Successfull"; String htmlTextMessage = "" + "" + "" + "

Welcome to " + AppInfo.appName + "

" + "" + "Hi " + name + "," + "

Thanks for singing up with " + AppInfo.appName + ".
" + "We are glad that you choose us. We invite you to check out our latest collection of new electonics appliances." + "
We are providing upto 60% OFF on most of the electronic gadgets. So please visit our site and explore the collections." + "

Our Online electronics is growing in a larger amount these days and we are in high demand so we thanks all of you for " + "making us up to that level. We Deliver Product to your house with no extra delivery charges and we also have collection of most of the" + "branded items.

As a Welcome gift for our New Customers we are providing additional 10% OFF Upto 500 Rs for the first product purchase. " + "
To avail this offer you only have " + "to enter the promo code given below.


PROMO CODE: " + "" + AppInfo.appName.toUpperCase() + "500


" + "Have a good day!
" + "" + "" + ""; JavaMailUtil.sendMail(recipientMailId, subject, htmlTextMessage); } }

JavaMailUtil.java0.02 KB

+1
unshippedItems.jsp0.04 KB

AddToCartServlet.java0.07 KB

+1
adminStock.jsp0.03 KB

photo content

UI
UI

photo content

photo content

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import="in.gadgethub.dao.impl.*,in.gadgethub.dao.*,in.gadgethub.pojo.*,javax.servlet.ServletOutputStream,java.io.*,java.util.*" %> <!DOCTYPE html> <html> <head> <title>Product Stocks</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> <link rel="stylesheet" href="mycss.css"> </head> <body style="background-color: #E6F9E6;"> <jsp:include page="header.jsp" /> <div class="text-center text-primary h3 m-3">Stock Products</div> <div class="container-fluid"> <div class="table-responsive "> <table class="table table-hover table-sm"> <thead> <tr> <th>Image</th> <th>ProductId</th> <th>Name</th> <th>Type</th> <th>Price</th> <th>Sold Qty</th> <th>Stock Qty</th> <th colspan="2" class="text-center">Actions</th> </tr> </thead> <tbody > <% /* Java Code */ { %> <tr> <td><img src="./ShowImageServlet?pid=<%=/* Java Code */%>" style="width: 50px; height: 50px;"></td> <td><a href="./updateProduct.jsp?prodid=<%=/* Java Code */%>"><%=/* Java Code */%></a></td> <% /* Java Code */ %> <td><%=/* Java Code */%></td> <td><%=/* Java Code */%></td> <td><%=/* Java Code */%></td> <td><%=/* Java Code */%></td> <td><%=/* Java Code */%></td> <td> <form method="post"> <button type="submit" formaction="updateProduct.jsp?prodid=<%=/* Java Code */%>" class="btn btn-primary">Update</button> </form> </td> <td> <form method="post"> <button type="submit" formaction="./RemoveProductServlet?prodid=<%=/* Java Code */%>" class="btn btn-danger">Remove</button> </form> </td> </tr> <% } %> <% /* Java Code */ { %> <tr style="background-color: grey; color: white;"> <td colspan="7" style="text-align: center;">No Items Available</td> </tr> <% } %> </tbody> </table> </div> </div> <%@ include file="footer.jsp"%> </body> </html>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import="in.gadgethub.dao.impl.*,in.gadgethub.dao.*,in.gadgethub.pojo.*,javax.servlet.ServletOutputStream,java.io.*,java.util.*" %> <!DOCTYPE html> <html> <head> <title>Profile Details</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> <link rel="stylesheet" href="mycss.css"> </head> <body style="background-color: #E6F9E6;"> <% UserPojo userPojo=(UserPojo)request.getAttribute("user"); %> <jsp:include page="header.jsp" /> <div class="container mt-5 user-profile"> <div class="row"> <div class="col mt-3"> <nav aria-label="breadcrumb" class="bg-warning rounded-3 p-3 mb-4"> <ol class="breadcrumb mb-0"> <li class="breadcrumb-item"><a href="index.jsp">Home</a></li> <li class="breadcrumb-item"><a href="userProfile.jsp">User Profile</a></li> </ol> </nav> </div> </div> <div class="row"> <div class="col-lg-4"> <div class="card mb-4"> <div class="card-body text-center"> <img src="images/profile.jpg" class="rounded-circle img-fluid w-25" > <h5 class="my-3"> Hello <%=userPojo.getUsername()%> here!! </h5> </div> </div> <div class="card mb-4 mb-4"> <div class="card-body p-0"> <ul class="list-group list-group-flush rounded-3"> <li class="text-center list-group-item d-flex justify-content-between align-items-center p-3"> <h3>My Profile</h3> </li> </ul> </div> </div> </div> <div class="col-lg-8"> <div class="card mb-4"> <div class="card-body"> <div class="row"> <div class="col-sm-3"> <p class="mb-0">Full Name</p> </div> <div class="col-sm-9"> <p class="text-muted mb-0"><%=userPojo.getUsername()%></p> </div> </div> <hr> <div class="row"> <div class="col-sm-3"> <p class="mb-0">Email</p> </div> <div class="col-sm-9"> <p class="text-muted mb-0"><%=userPojo.getUseremail()%> </p> </div> </div> <hr> <div class="row"> <div class="col-sm-3"> <p class="mb-0">Phone</p> </div> <div class="col-sm-9"> <p class="text-muted mb-0"><%=userPojo.getMobile()%> </p> </div> </div> <hr> <div class="row"> <div class="col-sm-3"> <p class="mb-0">Address</p> </div> <div class="col-sm-9"> <p class="text-muted mb-0"><%=userPojo.getAddress()%> </p> </div> </div> <hr> <div class="row"> <div class="col-sm-3"> <p class="mb-0">PinCode</p> </div> <div class="col-sm-9"> <p class="text-muted mb-0"><%=userPojo.getPincode()%> </p> </div> </div> </div> </div> </div> </div> </div> <br> <br> <br> <%@ include file="footer.jsp"%> </body> </html>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html> <html> <head> <title>Profile Details</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> <link rel="stylesheet" href="mycss.css"> </head> <body style="background-color: #E6F9E6;"> <% /* Java Code */ %> <jsp:include page="header.jsp" /> <div class="container mt-5 user-profile"> <div class="row"> <div class="col mt-3"> <nav aria-label="breadcrumb" class="bg-warning rounded-3 p-3 mb-4"> <ol class="breadcrumb mb-0"> <li class="breadcrumb-item"><a href="index.jsp">Home</a></li> <li class="breadcrumb-item"><a href="profile.jsp">User Profile</a></li> </ol> </nav> </div> </div> <div class="row"> <div class="col-lg-4"> <div class="card mb-4"> <div class="card-body text-center"> <img src="images/profile.jpg" class="rounded-circle img-fluid w-25" > <h5 class="my-3"> Hello <%=/* Java Code */%> here!! </h5> </div> </div> <div class="card mb-4 mb-4"> <div class="card-body p-0"> <ul class="list-group list-group-flush rounded-3"> <li class="text-center list-group-item d-flex justify-content-between align-items-center p-3"> <h3>My Profile</h3> </li> </ul> </div> </div> </div> <div class="col-lg-8"> <div class="card mb-4"> <div class="card-body"> <div class="row"> <div class="col-sm-3"> <p class="mb-0">Full Name</p> </div> <div class="col-sm-9"> <p class="text-muted mb-0"><%=/* Java Code */%></p> </div> </div> <hr> <div class="row"> <div class="col-sm-3"> <p class="mb-0">Email</p> </div> <div class="col-sm-9"> <p class="text-muted mb-0"><%=/* Java Code */%> </p> </div> </div> <hr> <div class="row"> <div class="col-sm-3"> <p class="mb-0">Phone</p> </div> <div class="col-sm-9"> <p class="text-muted mb-0"><%=/* Java Code */%> </p> </div> </div> <hr> <div class="row"> <div class="col-sm-3"> <p class="mb-0">Address</p> </div> <div class="col-sm-9"> <p class="text-muted mb-0"><%=/* Java Code */%> </p> </div> </div> <hr> <div class="row"> <div class="col-sm-3"> <p class="mb-0">PinCode</p> </div> <div class="col-sm-9"> <p class="text-muted mb-0"><%=/* Java Code */%> </p> </div> </div> </div> </div> </div> </div> </div> <br> <br> <br> <%@ include file="footer.jsp"%> </body> </html>

Repost from SCALive
πŸš€ Exciting Announcement! 🌟 We are thrilled to launch our new AJAX Bootcamp this weekend! πŸ“… Date: 4th-Jan-25-Saturday (Today) ⏰ Time: 6:00 PM 🌐 Dive into the world of asynchronous web development and master AJAX to create dynamic and interactive web applications. πŸ“‹ To join this exclusive bootcamp, kindly fill out the form below: πŸ”— https://us02web.zoom.us/meeting/register/vS22DeCZS8KJaC4QuXjoKg Don’t miss this opportunity to enhance your skills! Best Regards, Team SCA πŸ’»βœ¨

package in.gadgethub.servlet; import in.gadgethub.dao.impl.CartDAOImpl; import in.gadgethub.dao.impl.DemandImpl; import in.gadgethub.dao.impl.ProductDaoImpl; import in.gadgethub.pojo.CartPojo; import in.gadgethub.pojo.DemandPojo; import in.gadgethub.pojo.ProductPojo; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; /** * * @author SCALive */ public class AddToCartServlet extends HttpServlet { protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter pw = response.getWriter(); HttpSession session = request.getSession(); String userName = (String) session.getAttribute("userName"); String password = (String) session.getAttribute("password"); String userType = (String) session.getAttribute("userType"); if (userType == null password == null userName == null || !userType.equalsIgnoreCase("customer")) { response.sendRedirect("login.jsp?message=Access denied ! Please login first"); return; } String userId = userName; String prodId = request.getParameter("pid"); int pQty = Integer.parseInt(request.getParameter("pqty")); String action = request.getParameter("action"); CartDAOImpl cartDao = new CartDAOImpl(); ProductDaoImpl productDao = new ProductDaoImpl(); ProductPojo productPojo = productDao.getProductDetails(prodId); int avQty = productDao.getProductQuantity(prodId); int cartQty = cartDao.getCartItemCount(userId, prodId); pQty += cartQty; if (action != null) { cartDao.updateProductInCart(new CartPojo(userId, prodId, pQty)); RequestDispatcher rd = request.getRequestDispatcher("./CartDetailsServlet"); rd.forward(request, response); } else if (pQty == cartQty) { String status = cartDao.removeProductFromCart(userId, prodId); RequestDispatcher rd = request.getRequestDispatcher("userHome.jsp"); //pw.println("<script>document.getElementById('message').innerHTML='" + status + "'</script>"); request.setAttribute("message",status); rd.forward(request, response); } else if (avQty < pQty) { String status = null; if (avQty == 0) { status = "Product out of stock!"; } else { cartDao.updateProductInCart(new CartPojo(userId, prodId, avQty)); status = "Only " + avQty + " no of " + productPojo.getProdName() + " are available, so we are adding only " + avQty + " products in your cart"; } DemandImpl demand = new DemandImpl(); DemandPojo demandPojo = new DemandPojo(userId, prodId, pQty - avQty); boolean flag = demand.addProduct(demandPojo); if (flag) { status += "<br/>Later we will mail you when " + productPojo.getProdName() + " will be available"; } RequestDispatcher rd = request.getRequestDispatcher("./CartDetailsServlet"); //pw.println("<script>document.getElementById('message').innerHTML='" + status + "'</script>"); //rd.include(request, response); request.setAttribute("message",status); rd.forward(request, response); } else { String status = cartDao.updateProductInCart(new CartPojo(userId, prodId, pQty)); RequestDispatcher rd = request.getRequestDispatcher("userHome.jsp"); //pw.println("<script>document.getElementById('message').innerHTML='" + status + "'</script>"); //rd.include(request, response); request.setAttribute("message",status); rd.forward(request, response); } }

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import="in.gadgethub.dao.impl.*,in.gadgethub.dao.*,in.gadgethub.pojo.*,javax.servlet.ServletOutputStream,java.io.*,java.util.*" %> <!DOCTYPE html> <html> <head> <title>Order Details</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> <link rel="stylesheet" href="mycss.css"> </head> <body style="background-color: #E6F9E6;"> <% List<OrderDetailsPojo>orders=(List<OrderDetailsPojo>)request.getAttribute("orders"); String paymentStatus=(String)request.getAttribute("paymentStatus"); %> <jsp:include page="header.jsp" /> <div class="text-center text-primary h3 m-3">Order Details</div> <!-- Display Payment Status --> <% if(paymentStatus!=null){ %> <div id="message" class="alert alert-info text-center"> <%=paymentStatus %> </div> <% } %> <!-- Start of Product Items List --> <div class="container"> <div class="table-responsive "> <table class="table table-hover table-sm"> <thead style="background-color: black; color: white; font-size: 14px; font-weight: bold;"> <tr> <th>Picture</th> <th>Product Name</th> <th>Order ID</th> <th>Quantity</th> <th>Price</th> <th>Time</th> <th>Status</th> </tr> </thead> <tbody> <% if(orders!=null && !orders.isEmpty()){ for(OrderDetailsPojo order:orders){ %> <tr> <td><img src="./ShowImageServlet?pid=<%=order.getProdId()%>" style="width: 50px; height: 50px;"></td> <td><%=order.getProdName()%></td> <td><%=order.getOrderId()%></td> <td><%=order.getQuantity()%></td> <td><%=order.getAmount() %></td> <td><%=order.getTime()%></td> <td class="text-success"><%=order.getShipped()==0?"ORDER_PLACED":"ORDER_SHIPPED" %></td> </tr> <% } }else{ %> <tr> <td colspan="7" class="text-center">No orders found.</td> </tr> <% } %> </tbody> </table> </div> </div> <!-- End of Product Items List --> <%@ include file="footer.jsp" %> </body> </html>

orderDetails.jsp =============