diff --git a/computingConsultaionService/nb-configuration.xml b/computingConsultaionService/nb-configuration.xml new file mode 100644 index 0000000..cd0068d --- /dev/null +++ b/computingConsultaionService/nb-configuration.xml @@ -0,0 +1,19 @@ + + + + + + 1.7-web + Tomcat + + diff --git a/computingConsultaionService/pom.xml b/computingConsultaionService/pom.xml new file mode 100644 index 0000000..6ef04ce --- /dev/null +++ b/computingConsultaionService/pom.xml @@ -0,0 +1,104 @@ + + + 4.0.0 + + com.computingConsultaionService + computingConsultaionService + 1.0-SNAPSHOT + war + + computingConsultaionService + + + ${project.build.directory}/endorsed + UTF-8 + + + + + javax + javaee-web-api + 7.0 + provided + + + mysql + mysql-connector-java + 8.0.30 + + + javax.servlet + servlet-api + 2.5 + provided + + + javax.servlet.jsp + jsp-api + 2.1 + provided + + + commons-io + commons-io + 2.6 + + + commons-fileupload + commons-fileupload + 1.3 + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + ${endorsed.dir} + + + + + org.apache.maven.plugins + maven-war-plugin + 3.3.2 + + false + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.6 + + + validate + + copy + + + ${endorsed.dir} + true + + + javax + javaee-endorsed-api + 7.0 + jar + + + + + + + + + + diff --git a/computingConsultaionService/src/main/java/com/admin/AddProduct.java b/computingConsultaionService/src/main/java/com/admin/AddProduct.java new file mode 100644 index 0000000..29afb7b --- /dev/null +++ b/computingConsultaionService/src/main/java/com/admin/AddProduct.java @@ -0,0 +1,90 @@ +package com.admin; + +import java.io.IOException; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import com.connection.DatabaseConnection; +import java.io.File; +import java.util.List; +import java.util.Random; +import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.FileItemFactory; +import org.apache.commons.fileupload.disk.DiskFileItemFactory; +import org.apache.commons.fileupload.servlet.ServletFileUpload; + + +/** + * + * @author Dayasagar + */ +@WebServlet(name = "AddProduct", urlPatterns = {"/AddProduct"}) +public class AddProduct extends HttpServlet { + private final String UPLOAD_DIRECTORY = "D:\\Web_API\\computingConsultaionService\\computingConsultaionService\\src\\main\\webapp\\uploads"; + + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + HttpSession session = request.getSession(); + if (ServletFileUpload.isMultipartContent(request)) { + try { + + FileItemFactory factory = new DiskFileItemFactory(); + + ServletFileUpload upload = new ServletFileUpload(factory); + + + List multiparts = upload.parseRequest(request); +System.out.println("QWERTYUI "+multiparts); + String imageName = null; + String itemName = null; + String itemQuantity = null; + String itemPrice = null; + String itemDescription = null; + + String SALTCHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; + StringBuilder salt = new StringBuilder(); + Random rnd = new Random(); + while (salt.length() < 3) { + int index = (int) (rnd.nextFloat() * SALTCHARS.length()); + salt.append(SALTCHARS.charAt(index)); + } + + for (FileItem item : multiparts) { + if (!item.isFormField()) { + imageName = new File(item.getName()).getName(); + item.write(new File(UPLOAD_DIRECTORY + File.separator + imageName)); + FileItem name = (FileItem) multiparts.get(0); + itemName = name.getString(); + FileItem quantity = (FileItem) multiparts.get(1); + itemQuantity = quantity.getString(); + FileItem price = (FileItem) multiparts.get(2); + itemPrice = price.getString(); + FileItem description = (FileItem) multiparts.get(3); + itemDescription = description.getString(); + } + } + try { + + int id = 0; + String imagePath = UPLOAD_DIRECTORY; + int i = DatabaseConnection.insertUpdateFromSqlQuery("insert into products(id,name,price,quantity,description,image,image_path) values('" + id + "','" + itemName + "','" + itemPrice + "','" + itemQuantity + "','" + itemDescription + "','" + imageName + "','" + imagePath + "')"); + if (i > 0) { + String success = "Product added successfully."; + session.setAttribute("message", success); + response.sendRedirect("pages/admin/postLogin/product/adminProductList.jsp"); + } + } catch (IOException e) { + } + } catch (Exception ex) { + request.setAttribute("message", "Add item Failed due to " + ex); + } + } else { + request.setAttribute("message", "Unable to complete requests"); + } + } +} diff --git a/computingConsultaionService/src/main/java/com/admin/AdminSignIn.java b/computingConsultaionService/src/main/java/com/admin/AdminSignIn.java new file mode 100644 index 0000000..ce3eaa9 --- /dev/null +++ b/computingConsultaionService/src/main/java/com/admin/AdminSignIn.java @@ -0,0 +1,58 @@ +package com.admin; + +import java.io.IOException; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.Statement; +import javax.servlet.http.HttpSession; + +import com.connection.DatabaseConnection; +import java.sql.SQLException; +/** + * + * @author Dayasagar + */ +@WebServlet(name = "AdminSignIn", urlPatterns= {"/AdminSignIn"}) +public class AdminSignIn extends HttpServlet { + + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + try { + //Getting all the parameters from the frontend (admin) + String email = request.getParameter("email"); + String pass = request.getParameter("upass"); + //Retriving our session + HttpSession hs = request.getSession(); + + //Calling Connection method + Connection con = DatabaseConnection.getConnection(); + + //Creating Statement + Statement st = con.createStatement(); + + //Querying inside the database + ResultSet resultset = st.executeQuery("select * from admin where email='" + email + "' AND password='" + pass + "'"); + //If all the details are correct + if (resultset.next()) { + hs.setAttribute("uname", resultset.getString("name")); + //Redirecting admin to dashboard page + response.sendRedirect("pages/admin/postLogin/adminDashboard.jsp"); + + } else { + //If details are wrong + String message = "You have enter wrong credentials"; + hs.setAttribute("credential", message); + //Redirecting admin to admin login page + response.sendRedirect("pages/admin/adminLogin.jsp"); + } + } catch (IOException | SQLException e) { + System.out.println(e); + } + } + +} diff --git a/computingConsultaionService/src/main/java/com/admin/EditProduct.java b/computingConsultaionService/src/main/java/com/admin/EditProduct.java new file mode 100644 index 0000000..0f4fa07 --- /dev/null +++ b/computingConsultaionService/src/main/java/com/admin/EditProduct.java @@ -0,0 +1,44 @@ +package com.admin; + +import com.connection.DatabaseConnection; +import java.io.IOException; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +/** + * + * @author Dayasagar + */ +@WebServlet(name = "EditProduct", urlPatterns = {"/EditProduct"}) +public class EditProduct extends HttpServlet { + + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + HttpSession session = request.getSession(); + try { + String itemId = request.getParameter("id"); + String itemName = request.getParameter("name"); + String itemQuantity = request.getParameter("quantity"); + String itemPrice = request.getParameter("price"); + String itemDescription = request.getParameter("description"); + + try { + int i = DatabaseConnection.insertUpdateFromSqlQuery("update products set name='" + itemName + "',price='" + itemPrice + "',quantity='" + itemQuantity + "',description='" + itemDescription + "' where id='" + itemId + "'"); + if (i > 0) { + String success = "Product editted successfully."; + session.setAttribute("message", success); + response.sendRedirect("pages/admin/postLogin/product/adminProductList.jsp"); + } + } catch (IOException e) { + } + } catch (Exception ex) { + request.setAttribute("message", "Edit item Failed due to " + ex); + } + } + +} diff --git a/computingConsultaionService/src/main/java/com/connection/DatabaseConnection.java b/computingConsultaionService/src/main/java/com/connection/DatabaseConnection.java new file mode 100644 index 0000000..2c3b7f3 --- /dev/null +++ b/computingConsultaionService/src/main/java/com/connection/DatabaseConnection.java @@ -0,0 +1,70 @@ +package com.connection; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; + +public class DatabaseConnection { + + //Creating database Connection in java online shopping system + public static Connection connection; + + //Creating universal method to open connect will mysql database + public static Connection getConnection() { + try { + //Registering with mysql Driver + Class.forName("com.mysql.jdbc.Driver"); + connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/computingconsltancyservices", "root", "7095"); + } catch (Exception e) { + e.printStackTrace(); + } + return (connection); + } + + //Creating universal method to close connect will mysql database + public static void CloseConnection() { + if (connection != null) { + try { + connection.close(); + connection = null; + } catch (SQLException ex) { + ex.printStackTrace(); + } + } + } + + //Creating universal method to query for retrieving information + public static ResultSet getResultFromSqlQuery(String SqlQueryString) { + //Creating Resultset object + ResultSet rs = null; + try { + //Checking whether the connection is null or null + if (connection == null) { + getConnection(); + } + //Querying the query + rs = connection.createStatement().executeQuery(SqlQueryString); + } catch (Exception ex) { + ex.printStackTrace(); + } + return rs; + } + + //Creating universal method to query for inserting or updating information in mysql database + public static int insertUpdateFromSqlQuery(String SqlQueryString) { + int i = 2; + try { + //Checking whether the connection is null or null + if (connection == null) { + getConnection(); + } + //Querying the query + i = connection.createStatement().executeUpdate(SqlQueryString); + + } catch (Exception ex) { + ex.printStackTrace(); + } + return i; + } +} \ No newline at end of file diff --git a/computingConsultaionService/src/main/java/com/user/UserLogin.java b/computingConsultaionService/src/main/java/com/user/UserLogin.java new file mode 100644 index 0000000..9e48e1d --- /dev/null +++ b/computingConsultaionService/src/main/java/com/user/UserLogin.java @@ -0,0 +1,50 @@ +package com.user; + +import com.connection.DatabaseConnection; +import java.io.IOException; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +/** + * + * @author Dayasagar + */ +@WebServlet(name = "UserLogin", urlPatterns = {"/UserLogin"}) +public class UserLogin extends HttpServlet { + + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + try { + String email = request.getParameter("email"); + String pass = request.getParameter("upass"); + HttpSession hs = request.getSession(); + + Connection con = DatabaseConnection.getConnection(); + + Statement st = con.createStatement(); + + ResultSet resultset = st.executeQuery("select * from users where email='" + email + "' AND password='" + pass + "'"); + if (resultset.next()) { + hs.setAttribute("uname", resultset.getString("name")); + hs.setAttribute("id", resultset.getString("id")); + response.sendRedirect("pages/user/postLogin/userDashboard.jsp"); + + } else { + String message = "You have enter wrong credentials"; + hs.setAttribute("credential", message); + response.sendRedirect("pages/user/userLogin.jsp"); + } + } catch (IOException | SQLException e) { + System.out.println(e); + } + } + +} diff --git a/computingConsultaionService/src/main/java/com/user/UserRegistration.java b/computingConsultaionService/src/main/java/com/user/UserRegistration.java new file mode 100644 index 0000000..973892a --- /dev/null +++ b/computingConsultaionService/src/main/java/com/user/UserRegistration.java @@ -0,0 +1,46 @@ +package com.user; + +import com.connection.DatabaseConnection; +import java.io.IOException; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +/** + * + * @author Dayasagar + */ +@WebServlet(name = "UserRegistration", urlPatterns = {"/UserRegistration"}) +public class UserRegistration extends HttpServlet { + + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + try { + String name = request.getParameter("name"); + String email = request.getParameter("email"); + String pass = request.getParameter("upass"); + String cpass = request.getParameter("cupass"); + HttpSession hs = request.getSession(); + + int id = 0; + + if (pass.equals(cpass)) { + DatabaseConnection.insertUpdateFromSqlQuery("insert into users(id,name,email,password) values('" + id + "','" + name + "','" + email + "', '" + pass + "')"); + response.sendRedirect("pages/user/userLogin.jsp"); + } else { + String message = "Password doesnt match"; + hs.setAttribute("credential", message); + response.sendRedirect("pages/user/userRegistration.jsp"); + } + } catch (IOException e) { + System.out.println(e); + } + } + +} diff --git a/computingConsultaionService/src/main/java/com/user/placeOrder.java b/computingConsultaionService/src/main/java/com/user/placeOrder.java new file mode 100644 index 0000000..1ffcfcc --- /dev/null +++ b/computingConsultaionService/src/main/java/com/user/placeOrder.java @@ -0,0 +1,57 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/Servlet.java to edit this template + */ +package com.user; + +import com.connection.DatabaseConnection; +import java.io.IOException; +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +/** + * + * @author Dayasagar + */ +@WebServlet(name = "placeOrder", urlPatterns = {"/placeOrder"}) +public class placeOrder extends HttpServlet { + + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + try { + String card_number = request.getParameter("card_number"); + String card_name = request.getParameter("card_name"); + String cvv = request.getParameter("cvv"); + String expiry = request.getParameter("expiry"); + String userid = request.getParameter("userid"); + HttpSession hs = request.getSession(); + + Connection con = DatabaseConnection.getConnection(); + + ResultSet res = DatabaseConnection.getResultFromSqlQuery("SELECT * FROM card_details WHERE card_number = '" + card_number + "' AND card_name = '" + card_name + "' AND cvv = '" + cvv + "' AND expiry = '" + expiry + "'"); + if (res != null) { + ResultSet res1 = DatabaseConnection.getResultFromSqlQuery("SELECT * FROM cart WHERE userid ='" + userid + "'"); + System.out.println("user id = "+userid); + while (res1.next()) { + int id = 0; + DatabaseConnection.insertUpdateFromSqlQuery("insert into orders(id,productid,userid,paid) values('" + id + "','" + res1.getString("productid") + "','" + res1.getString("userid") + "', 'true')"); + } + DatabaseConnection.insertUpdateFromSqlQuery("delete from cart where userid='" + userid + "' "); + response.sendRedirect("pages/user/postLogin/userDashboard.jsp"); + } else { + response.sendRedirect("checkout.jsp"); + } + } catch (IOException | SQLException e) { + System.out.println(e); + } + } +} diff --git a/computingConsultaionService/src/main/java/com/user/session.java b/computingConsultaionService/src/main/java/com/user/session.java new file mode 100644 index 0000000..813965e --- /dev/null +++ b/computingConsultaionService/src/main/java/com/user/session.java @@ -0,0 +1,13 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package com.user; + +/** + * + * @author Dayasagar + */ +class session { + +} diff --git a/computingConsultaionService/src/main/webapp/META-INF/context.xml b/computingConsultaionService/src/main/webapp/META-INF/context.xml new file mode 100644 index 0000000..976682b --- /dev/null +++ b/computingConsultaionService/src/main/webapp/META-INF/context.xml @@ -0,0 +1,2 @@ + + diff --git a/computingConsultaionService/src/main/webapp/assets/adminDashboard.css b/computingConsultaionService/src/main/webapp/assets/adminDashboard.css new file mode 100644 index 0000000..19ec7c4 --- /dev/null +++ b/computingConsultaionService/src/main/webapp/assets/adminDashboard.css @@ -0,0 +1,89 @@ +.accordion_one .panel-group { + margin-bottom: 0; + border: 1px solid #f1f1f1; + margin-left:1px; +} + +.accordion_one .panel { + background-color: transparent; + box-shadow: none; + border-bottom: 0px solid transparent; + border-radius: 0; + margin: 0; +} + +.accordion_one .panel-default { + border: 0; +} + +.accordion_one .panel-default>.panel-heading { + border-radius: 0px; +} + +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: 16px; + color: inherit; +} + +h4 { + font-size: 18px; + line-height: 24px; +} + +.accordion_one .panel .panel-heading a.collapsed { + color: #999999; + display: block; + padding: 12px 30px; + border-top: 0px; +} + +.accordion_one .panel .panel-heading a { + display: block; + padding: 12px 30px; + background: #fff; + color: #313131; + border-bottom: 1px solid #f1f1f1; +} + +.accordion-wrap .panel .panel-heading a { + font-size: 14px; +} + +.accordion_one .panel-group .panel-heading+.panel-collapse>.panel-body { + border-top: 0; + padding-top: 0; + padding: 25px 30px 30px 35px; + background: #fff; + color: #999999; +} + +.img-accordion { + width: 81px; + float: left; + margin-right: 15px; + display: block; +} + +.accordion_one .panel .panel-heading a:after { + content: "\2212"; +} + +.accordion_one .panel .panel-heading a:after, .accordion_one .panel .panel-heading a.collapsed:after { + font-family: 'FontAwesome'; + font-size: 15px; + width: 36px; + height: 48px; + line-height: 48px; + text-align: center; + background: #F1F1F1; + float: left; + margin-left: -31px; + margin-top: -12px; + margin-right: 15px; +} + +a:link { + text-decoration: none +} diff --git a/computingConsultaionService/src/main/webapp/assets/adminProductList.css b/computingConsultaionService/src/main/webapp/assets/adminProductList.css new file mode 100644 index 0000000..45af08e --- /dev/null +++ b/computingConsultaionService/src/main/webapp/assets/adminProductList.css @@ -0,0 +1,3 @@ +.mt-40 { + margin-top: 40px; +} \ No newline at end of file diff --git a/computingConsultaionService/src/main/webapp/assets/cart.css b/computingConsultaionService/src/main/webapp/assets/cart.css new file mode 100644 index 0000000..9d7ea8e --- /dev/null +++ b/computingConsultaionService/src/main/webapp/assets/cart.css @@ -0,0 +1,41 @@ +.param { + margin-bottom: 7px; + line-height: 1.4; +} +.param-inline dt { + display: inline-block; +} +.param dt { + margin: 0; + margin-right: 7px; + font-weight: 600; +} +.param-inline dd { + vertical-align: baseline; + display: inline-block; +} + +.param dd { + margin: 0; + vertical-align: baseline; +} + +.shopping-cart-wrap .price { + color: #007bff; + font-size: 18px; + font-weight: bold; + margin-right: 5px; + display: block; +} +var { + font-style: normal; +} + +.media img { + margin-right: 1rem; +} +.img-sm { + width: 90px; + max-height: 75px; + object-fit: cover; +} \ No newline at end of file diff --git a/computingConsultaionService/src/main/webapp/assets/checkout.css b/computingConsultaionService/src/main/webapp/assets/checkout.css new file mode 100644 index 0000000..ec02ea7 --- /dev/null +++ b/computingConsultaionService/src/main/webapp/assets/checkout.css @@ -0,0 +1,99 @@ + +.wrapper { + width: 350px; + height: 350px; + position: relative; + border-radius: 10px +} + +.outer-card { + width: 100%; + height: 100%; + background-color: #fff; + border-radius: 10px +} + +input, +input::-webkit-input-placeholder { + font-size: 16px; + line-height: 3 +} + +.wrapper .card::after { + position: absolute; + content: ""; + width: 200px; + height: 200px; + background-color: #3641d3; + right: -30px; + top: -30px; + border-radius: 50%; + opacity: 0.7 +} + +.wrapper .card::before { + position: absolute; + content: ""; + width: 300px; + height: 300px; + background-color: #3641d3; + left: -70px; + top: -70px; + border-radius: 50%; + opacity: 0.4 +} + +.wrapper .forms { + padding-top: 30px; + padding-left: 20px; + padding-right: 20px +} + +.wrapper .forms input { + height: 40px; + width: 100%; + font-size: 18px; + border: 2px solid #eee; + border-radius: 4px; + text-indent: 10px; + margin-top: 4px +} + +.wrapper .forms input:focus { + outline: none +} + +.input-items span { + font-size: 14px; + margin-left: 2px +} + +.input-items { + margin-bottom: 10px +} + +.one-line { + display: flex; + flex-direction: row +} + +.one-line .input-items:nth-child(1) { + margin-right: 10px +} + +.input-buttons { + width: 100%; + margin-top: 10px +} + +.input-buttons a { + width: 100%; + height: 45px; + border-radius: 5px; + color: #fff; + background-color: #000; + text-decoration: none; + display: flex; + justify-content: center; + align-items: center +} \ No newline at end of file diff --git a/computingConsultaionService/src/main/webapp/assets/style.css b/computingConsultaionService/src/main/webapp/assets/style.css new file mode 100644 index 0000000..45af08e --- /dev/null +++ b/computingConsultaionService/src/main/webapp/assets/style.css @@ -0,0 +1,3 @@ +.mt-40 { + margin-top: 40px; +} \ No newline at end of file diff --git a/computingConsultaionService/src/main/webapp/assets/userDashboard.css b/computingConsultaionService/src/main/webapp/assets/userDashboard.css new file mode 100644 index 0000000..e604d4a --- /dev/null +++ b/computingConsultaionService/src/main/webapp/assets/userDashboard.css @@ -0,0 +1,466 @@ +@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');*{ + padding: 0; + margin: 0; + box-sizing: border-box; + font-family: 'Poppins', sans-serif +} +body{ + background-color: #f4f4f4 +} +.container{ + margin: 40px auto +} +#header{ + width: 100%; + height: 60px; + box-shadow: 5px 5px 15px #e8e8e8 +} +.col-lg-4, .col-md-6{ + padding-right: 0 +} +button.btn.btn-hide{ + height: inherit; + background-color: #ff935d; + color: #fff; + font-size: 0.82rem; + padding-left: 40px; + padding-right: 40px; + border-top-right-radius: 0px; + border-bottom-right-radius: 0px +} +.btn:focus{ + box-shadow: none +} +.box-label .btn{ + background-color: #fff; + padding: 0; + font-size: 0.8rem +} +.btn-red{ + background-color: #e00000ce +} +.btn-orange{ + background-color: #ffa500 +} +.btn-pink{ + background-color: #e0009dce +} +.btn-green{ + background-color: #00811c +} +.btn-blue{ + background-color: #026bc2 +} +.btn-brown{ + background-color: #994a00 +} + +.pagination .page-item .page-link{ + color: #333; + border: none; + width: 40px; + text-align: center +} +.pagination .page-item.active .page-link{ + background-color: #fff; + border: 1px solid #333 +} +select{ + outline: none; + padding: 6px 12px; + margin: 0px 4px; + color: #999; + font-size: 0.85rem; + width: 140px +} +#select2{ + border: 1px solid #777; + color: #999 +} +#pro{ + border: none; + color: #333; + font-weight: 700; + padding-left: 0px; + width: initial +} +#filterbar{ + width: 30%; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 15px; + float: left +} +#filterbar input[type="radio"]{ + visibility: hidden +} +#filterbar input[type='radio']:checked{ + background-color: #16c79a; + border: none +} +#filterbar .btn.btn-success{ + background-color: #ddd; + color: #333; + border: none; + width: 115px +} +#filterbar .btn.btn-success:hover{ + background-color: #aff1e1; + color: #444 +} +#filterbar .btn-success:not(:disabled):not(.disabled).active, #filterbar .btn-success:not(:disabled):not(.disabled):active{ + background-color: #16c79a; + color: #fff +} +label{ + cursor: pointer +} +.tick{ + display: block; + position: relative; + padding-left: 23px; + cursor: pointer; + font-size: 0.9rem; + margin: 0 +} +.tick input{ + position: absolute; + opacity: 0; + cursor: pointer; + height: 0; + width: 0 +} +.check{ + position: absolute; + top: 1px; + left: 0; + height: 18px; + width: 18px; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 3px +} +.tick:hover input~.check{ + background-color: #f3f3f3 +} +.tick input:checked~.check{ + background-color: #ffffff +} +.check:after{ + content: ""; + position: absolute; + display: none +} +.tick input:checked~.check:after{ + display: block; + transform: rotate(45deg) scale(1) +} +.tick .check:after{ + left: 6px; + top: 2px; + width: 5px; + height: 10px; + border: solid rgb(0, 0, 0); + border-width: 0 3px 3px 0; + transform: rotate(45deg) scale(2) +} +.box{ + padding: 10px +} +.box-label{ + color: #11698e; + font-size: 0.9rem; + font-weight: 800 +} +#inner-box, #inner-box2{ + height: 150px; + overflow-y: scroll +} +#inner-box2{ + height: 132px +} +#inner-box::-webkit-scrollbar, #inner-box2::-webkit-scrollbar{ + width: 6px +} +#inner-box::-webkit-scrollbar-track, #inner-box2::-webkit-scrollbar-track{ + background-color: #ddd; + border-radius: 2px +} +#inner-box::-webkit-scrollbar-thumb, #inner-box2::-webkit-scrollbar-thumb{ + background-color: #333; + border-radius: 2px +} +#price{ + height: 45px +} +#size input[type="checkbox"]{ + visibility: hidden +} +#size input[type='checkbox']:checked{ + background-color: #16c79a; + border: none +} +#size .btn.btn-success{ + background-color: #ddd; + color: #333; + border: none; + width: 40px; + font-size: 0.8rem; + border-radius: 0 +} +#size .btn.btn-success:hover{ + background-color: #aff1e1; + color: #444 +} +#size .btn-success:not(:disabled):not(.disabled).active, #size .btn-success:not(:disabled):not(.disabled):active{ + background-color: #16c79a; + color: #fff +} +#size label{ + margin: 10px; + margin-left: 0px +} +.card{ + padding: 10px; + cursor: pointer; + transition: .3s all ease-in-out; + height: 350px +} +.card:hover{ + box-shadow: 2px 2px 15px #fd9a6ce5; + transform: scale(1.02) +} +.card .product-name{ + font-weight: 600 +} +.card-body{ + padding-bottom: 0 +} +.card .text-muted{ + font-size: 0.82rem +} +.card-img img{ + padding-top: 10px; + width: inherit; + height: 180px; + object-fit: contain; + display: block +} +.card-body .btn-group .btn{ + padding: 0; + width: 20px; + height: 20px; + margin-right: 5px; + border-radius: 50%; + position: relative +} +.card-body .btn-group>.btn-group:not(:last-child)>.btn, .card-body .btn-group>.btn:not(:last-child):not(.dropdown-toggle){ + border-radius: 50%; + transition: ease-in all .4s +} +.card-body input[type="radio"]{ + visibility: hidden +} +.card-body .btn:not(:disabled):not(.disabled).active::after, .card-body .btn:not(:disabled):not(.disabled):active::after{ + content: ""; + width: 10px; + height: 10px; + border-radius: 50%; + top: 4px; + left: 4.2px; + background-color: #fff; + position: absolute; + transition: ease-in all .4s +} +.card-body .btn.btn-light:not(:disabled):not(.disabled).active::after, .card-body .btn.btn-light:not(:disabled):not(.disabled):active::after{ + background-color: #000 +} +#avail-size input[type="checkbox"]{ + visibility: hidden +} +#avail-size input[type='checkbox']:checked{ + background-color: #16c79a; + border: none +} +#avail-size .btn.btn-success{ + background-color: #ddd; + color: #333; + border: none; + width: 20px; + font-size: 0.7rem; + border-radius: 0; + padding: 0 +} +#avail-size .btn.btn-success:hover{ + background-color: #aff1e1; + color: #444 +} +#avail-size .btn-success:not(:disabled):not(.disabled).active, #avail-size .btn-success:not(:disabled):not(.disabled):active{ + background-color: #16c79a; + color: #fff +} +#avail-size label{ + margin: 10px; + margin-left: 0px +} +#shirt{ + height: 170px +} +.middle{ + position: relative; + width: 100%; + margin-top: 25px +} +.slider{ + position: relative; + z-index: 1; + height: 5px; + margin: 0 15px +} +.slider>.track{ + position: absolute; + z-index: 1; + left: 0; + right: 0; + top: 0; + bottom: 0; + border-radius: 5px; + background-color: #ddd +} +.slider>.range{ + position: absolute; + z-index: 2; + left: 25%; + right: 25%; + top: 0; + bottom: 0; + border-radius: 5px; + background-color: #36a31b +} +.slider>.thumb{ + position: absolute; + top: 2px; + z-index: 3; + width: 20px; + height: 20px; + background-color: #36a31b; + border-radius: 50%; + box-shadow: 0 0 0 0 rgba(63, 204, 75, 0.705); + transition: box-shadow .3s ease-in-out +} +.slider>.thumb::after{ + position: absolute; + width: 8px; + height: 8px; + left: 28%; + top: 30%; + border-radius: 50%; + content: ''; + background-color: #fff +} +.slider>.thumb.left{ + left: 25%; + transform: translate(-15px, -10px) +} +.slider>.thumb.right{ + right: 25%; + transform: translate(15px, -10px) +} +.slider>.thumb.hover{ + box-shadow: 0 0 0 10px rgba(125, 230, 134, 0.507) +} +.slider>.thumb.active{ + box-shadow: 0 0 0 10px rgba(63, 204, 75, 0.623) +} +input[type=range]{ + position: absolute; + pointer-events: none; + -webkit-appearance: none; + z-index: 2; + height: 10px; + width: 100%; + opacity: 0 +} +input[type=range]::-webkit-slider-thumb{ + pointer-events: all; + width: 30px; + height: 30px; + border-radius: 0; + border: 0 none; + background-color: red; + -webkit-appearance: none +} +.del{ + text-decoration: line-through; + color: red +} +@media(min-width:1199.6px){ + #filterbar{ + width: 25% + } +} +@media(max-width:1199.5px){ + #filterbar{ + width: 28% + } + .card{ + height: 350px + } + .price{ + font-size: 0.9rem + } + .product-name{ + font-size: 0.8rem + } +} +@media(max-width: 991.5px){ + + #filterbar{ + width: 36% + } + #sort{ + background-color: inherit; + color: #fff; + margin: 0; + margin-bottom: 20px; + width: 100% + } + #sort option, #pro option{ + color: #000 + } + #pro, #select2, .result{ + background-color: inherit; + color: #fff + } + .card{ + height: 345px + } + .price{ + font-size: 0.85rem + } +} +@media(max-width: 767.5px){ + #filterbar{ + width: 50% + } +} +@media(max-width: 525.5px){ + #filterbar{ + float: none; + width: 100%; + margin-bottom: 20px; + border-radius: 5px + } + #content.my-5{ + margin-top: 20px !important; + margin-bottom: 20px !important + } + .col-lg-4, .col-md-6{ + padding-left: 0 + } +} +@media(max-width: 500.5px){ + .pagination{ + display: none + } +} \ No newline at end of file diff --git a/computingConsultaionService/src/main/webapp/common/footer.jsp b/computingConsultaionService/src/main/webapp/common/footer.jsp new file mode 100644 index 0000000..4a58128 --- /dev/null +++ b/computingConsultaionService/src/main/webapp/common/footer.jsp @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/computingConsultaionService/src/main/webapp/common/header.jsp b/computingConsultaionService/src/main/webapp/common/header.jsp new file mode 100644 index 0000000..654e2b6 --- /dev/null +++ b/computingConsultaionService/src/main/webapp/common/header.jsp @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/computingConsultaionService/src/main/webapp/common/logout.jsp b/computingConsultaionService/src/main/webapp/common/logout.jsp new file mode 100644 index 0000000..0997ebd --- /dev/null +++ b/computingConsultaionService/src/main/webapp/common/logout.jsp @@ -0,0 +1,5 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<% + session.invalidate(); + response.sendRedirect("../commonLogin.jsp"); +%> \ No newline at end of file diff --git a/computingConsultaionService/src/main/webapp/common/navigation.jsp b/computingConsultaionService/src/main/webapp/common/navigation.jsp new file mode 100644 index 0000000..cb8cc9e --- /dev/null +++ b/computingConsultaionService/src/main/webapp/common/navigation.jsp @@ -0,0 +1,34 @@ + diff --git a/computingConsultaionService/src/main/webapp/commonLogin.jsp b/computingConsultaionService/src/main/webapp/commonLogin.jsp new file mode 100644 index 0000000..d1954d3 --- /dev/null +++ b/computingConsultaionService/src/main/webapp/commonLogin.jsp @@ -0,0 +1,35 @@ +<%-- + Document : commonLogin + Created on : 31-Oct-2022, 3:36:46 am + Author : Dayasagar +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + Dashboard + <%@include file="common/header.jsp" %> + + + + + + + + diff --git a/computingConsultaionService/src/main/webapp/index.jsp b/computingConsultaionService/src/main/webapp/index.jsp new file mode 100644 index 0000000..8ed33c3 --- /dev/null +++ b/computingConsultaionService/src/main/webapp/index.jsp @@ -0,0 +1,4 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<% + response.sendRedirect("commonLogin.jsp"); +%> \ No newline at end of file diff --git a/computingConsultaionService/src/main/webapp/pages/admin/adminCommon/adminNav.jsp b/computingConsultaionService/src/main/webapp/pages/admin/adminCommon/adminNav.jsp new file mode 100644 index 0000000..eb480cd --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/admin/adminCommon/adminNav.jsp @@ -0,0 +1,41 @@ + diff --git a/computingConsultaionService/src/main/webapp/pages/admin/adminLogin.jsp b/computingConsultaionService/src/main/webapp/pages/admin/adminLogin.jsp new file mode 100644 index 0000000..705790b --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/admin/adminLogin.jsp @@ -0,0 +1,79 @@ +<%-- + Document : adminLogin + Created on : 31-Oct-2022, 3:11:10 am + Author : Dayasagar +--%> + +<%@page import="java.sql.Statement"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page import="java.sql.Connection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Admin Login + <%@include file="../../common/header.jsp" %> + + + +
+
+
+
+
+
Admin Login
+
+ <% + //Connecting to the database + Connection connection = DatabaseConnection.getConnection(); + Statement statement = connection.createStatement(); + String credential = (String) session.getAttribute("credential"); + //Checking creditionals whether there are null or not + if (credential != null) { + session.removeAttribute("credential"); + %> +
You have enter wrong credentials.
+ <% + } + %> +
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+
+
+
+
+ +
+ <%@include file="../../common/footer.jsp" %> + + diff --git a/computingConsultaionService/src/main/webapp/pages/admin/postLogin/adminDashboard.jsp b/computingConsultaionService/src/main/webapp/pages/admin/postLogin/adminDashboard.jsp new file mode 100644 index 0000000..7c99c4a --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/admin/postLogin/adminDashboard.jsp @@ -0,0 +1,4 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<% + response.sendRedirect("product/adminProductList.jsp"); +%> \ No newline at end of file diff --git a/computingConsultaionService/src/main/webapp/pages/admin/postLogin/orders/adminOrdersList.jsp b/computingConsultaionService/src/main/webapp/pages/admin/postLogin/orders/adminOrdersList.jsp new file mode 100644 index 0000000..0903db9 --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/admin/postLogin/orders/adminOrdersList.jsp @@ -0,0 +1,77 @@ +<%-- + Document : adminOrdersList + Created on : 06-Nov-2022, 1:40:14 pm + Author : Dayasagar +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Orders + <%@include file="../../../../common/header.jsp" %> + + + <% + //Checking whether admin in session or not + if (session.getAttribute("uname") != null && session.getAttribute("uname") != "") { + %> + +
+
+

Orders

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#Item NameUser NameQuantityAction
1MarkOtto@mdo + + +
2JacobThornton@fat + + +
3Larrythe Bird@twitter + + +
+
+ + <% + } else { + response.sendRedirect("../../../../commonLogin.jsp"); + } + %> + + diff --git a/computingConsultaionService/src/main/webapp/pages/admin/postLogin/product/addProduct.jsp b/computingConsultaionService/src/main/webapp/pages/admin/postLogin/product/addProduct.jsp new file mode 100644 index 0000000..42fd77e --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/admin/postLogin/product/addProduct.jsp @@ -0,0 +1,57 @@ +<%-- + Document : addProduct + Created on : 06-Nov-2022, 3:16:33 pm + Author : Dayasagar +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Add Product + <%@include file="../../../../../common/header.jsp" %> + + + + <% + //Checking whether admin in session or not + if (session.getAttribute("uname") != null && session.getAttribute("uname") != "") { + %> + +
+
+

Add Product

+
+
+
+
+ + +
+
+ + +
+
+ + +
+ + +
+
+ +
+ +
+
+
+ + <% + } else { + response.sendRedirect("../../../../commonLogin.jsp"); + } + %> + + diff --git a/computingConsultaionService/src/main/webapp/pages/admin/postLogin/product/adminProductList.jsp b/computingConsultaionService/src/main/webapp/pages/admin/postLogin/product/adminProductList.jsp new file mode 100644 index 0000000..af237a0 --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/admin/postLogin/product/adminProductList.jsp @@ -0,0 +1,74 @@ +<%-- + Document : adminPorductList + Created on : 06-Nov-2022, 1:40:25 pm + Author : Dayasagar +--%> + +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="java.sql.*"%> +<%@ page import="com.connection.*"%> + + + + + Product Listing + <%@include file="../../../../../common/header.jsp" %> + + + + <% + //Checking whether admin in session or not + if (session.getAttribute("uname") != null && session.getAttribute("uname") != "") { + %> + +
+
+

Product listing

+ Add Product +
+ + + + + + + + + + + + + + + <% + ResultSet res = DatabaseConnection.getResultFromSqlQuery("select * from products"); + while (res.next()) { + %> + + + + + + + + + + <% + } + %> + +
#Item NameDescriptionQuantityPriceImageAction
<%=res.getInt("id")%><%=res.getString("name")%><%=res.getString("description")%><%=res.getString("quantity")%><%=res.getString("price")%>" + width="100" height="70"> + ">View + ">Edit + ">Delete +
+
+ + <% + } else { + response.sendRedirect("../../../../commonLogin.jsp"); + } + %> + + diff --git a/computingConsultaionService/src/main/webapp/pages/admin/postLogin/product/deleteProduct.jsp b/computingConsultaionService/src/main/webapp/pages/admin/postLogin/product/deleteProduct.jsp new file mode 100644 index 0000000..2b8688d --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/admin/postLogin/product/deleteProduct.jsp @@ -0,0 +1,12 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="com.connection.*"%> +<%@ page import="java.sql.*"%> +<% + int id = Integer.parseInt(request.getParameter("id")); + int res = DatabaseConnection.insertUpdateFromSqlQuery("delete from products where id='" + id + "' "); + if (res > 0) { + response.sendRedirect("adminProductList.jsp"); + } else { + response.sendRedirect("adminProductList.jsp"); + } +%> \ No newline at end of file diff --git a/computingConsultaionService/src/main/webapp/pages/admin/postLogin/product/editProduct.jsp b/computingConsultaionService/src/main/webapp/pages/admin/postLogin/product/editProduct.jsp new file mode 100644 index 0000000..6a1aae5 --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/admin/postLogin/product/editProduct.jsp @@ -0,0 +1,69 @@ +<%-- + Document : addProduct + Created on : 06-Nov-2022, 3:16:33 pm + Author : Dayasagar +--%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Edit Product + <%@include file="../../../../../common/header.jsp" %> + + + + <% + //Checking whether admin in session or not + if (session.getAttribute("uname") != null && session.getAttribute("uname") != "") { + %> + +
+
+

Edit Product

+
+
+ <% + int id = Integer.parseInt(request.getParameter("id")); + //Querying to database + ResultSet res = DatabaseConnection.getResultFromSqlQuery("select * from products where id='" + id + "' "); + while (res.next()) { + %> +
+
+ + " placeholder="Product" readonly="true"> +
+
+ + " placeholder="Enter Product Name"> +
+
+ + " placeholder="Quantity"> +
+
+ + " placeholder="Price"> +
+ + +
+ +
+ <% + } + %> +
+
+ + <% + } else { + response.sendRedirect("../../../../commonLogin.jsp"); + } + %> + + diff --git a/computingConsultaionService/src/main/webapp/pages/admin/postLogin/product/viewProduct.jsp b/computingConsultaionService/src/main/webapp/pages/admin/postLogin/product/viewProduct.jsp new file mode 100644 index 0000000..e66f3a6 --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/admin/postLogin/product/viewProduct.jsp @@ -0,0 +1,128 @@ +<%-- + Document : viewProduct + Created on : 06-Nov-2022, 3:16:54 pm + Author : Dayasagar +--%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Product Details + <%@include file="../../../../../common/header.jsp" %> + + + <% + //Checking whether admin in session or not + if (session.getAttribute("uname") != null && session.getAttribute("uname") != "") { + %> + +
+

Product Details

+
+ + <% + int id = Integer.parseInt(request.getParameter("id")); + ResultSet res = DatabaseConnection.getResultFromSqlQuery("select * from products where id='" + id + "' "); + while (res.next()) { + %> +
+
+ + +
+
+ <% + } + %> + +
+ + + <% + } else { + response.sendRedirect("../../../../commonLogin.jsp"); + } + %> + + diff --git a/computingConsultaionService/src/main/webapp/pages/user/postLogin/addToCart.jsp b/computingConsultaionService/src/main/webapp/pages/user/postLogin/addToCart.jsp new file mode 100644 index 0000000..cd44359 --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/user/postLogin/addToCart.jsp @@ -0,0 +1,14 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="com.connection.*"%> +<%@ page import="java.sql.*"%> +<% + int productId = Integer.parseInt(request.getParameter("id")); + int id=0; + String userid = (String)session.getAttribute("id"); + int res = DatabaseConnection.insertUpdateFromSqlQuery("insert into cart(id,productId,userid) values('" + id + "','" + productId + "','" + userid + "')"); + if (res > 0) { + response.sendRedirect("userDashboard.jsp"); + } else { + response.sendRedirect("viewProduct.jsp?id="+productId); + } +%> \ No newline at end of file diff --git a/computingConsultaionService/src/main/webapp/pages/user/postLogin/cart.jsp b/computingConsultaionService/src/main/webapp/pages/user/postLogin/cart.jsp new file mode 100644 index 0000000..da75ca9 --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/user/postLogin/cart.jsp @@ -0,0 +1,82 @@ +<%-- + Document : cart + Created on : 09-Nov-2022, 1:08:12 am + Author : Dayasagar +--%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Cart + <%@include file="../../../common/header.jsp" %> + + + + +
+ +
+

Cart

+ Proceed to checkout +
+ + +
+ + + + + + + + + + <% + String id = (String)session.getAttribute("id"); + ResultSet res = DatabaseConnection.getResultFromSqlQuery("SELECT * FROM cart c LEFT JOIN products p ON c.productId = p.id WHERE c.userid='" + id + "' "); + while (res.next()) { + %> + + + + + + <% + } + if(res == null) + { + %> + + + + <% } %> + +
ServicePriceAction
+
+
" class="img-thumbnail img-sm">
+
+
<%=res.getString("name")%>
+
+
+
+
+ GBP <%=res.getString("price")%> +
+
+ " class="btn btn-outline-danger"> × Remove +
+ No items in the cart +
+
+ +
+ + + + + + diff --git a/computingConsultaionService/src/main/webapp/pages/user/postLogin/checkout.jsp b/computingConsultaionService/src/main/webapp/pages/user/postLogin/checkout.jsp new file mode 100644 index 0000000..ef057df --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/user/postLogin/checkout.jsp @@ -0,0 +1,58 @@ +<%-- + Document : checkout + Created on : 09-Nov-2022, 1:29:44 am + Author : Dayasagar +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Payment + <%@include file="../../../common/header.jsp" %> + + + + +
+ +
+
+

Payment

+
+
+
+
+
+ Card Number + +
+
+ Name on card +
+
+
+ Expiry Date + +
+
+ CVV + +
+
+ " hidden=""> +
+
+
+
+
+
+ + + + diff --git a/computingConsultaionService/src/main/webapp/pages/user/postLogin/myOrders.jsp b/computingConsultaionService/src/main/webapp/pages/user/postLogin/myOrders.jsp new file mode 100644 index 0000000..6819c2f --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/user/postLogin/myOrders.jsp @@ -0,0 +1,81 @@ +<%-- + Document : cart + Created on : 09-Nov-2022, 1:08:12 am + Author : Dayasagar +--%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Orders + <%@include file="../../../common/header.jsp" %> + + + + +
+ +
+

My Orders

+
+ + +
+ + + + + + + + + + <% + String id = (String)session.getAttribute("id"); + ResultSet res = DatabaseConnection.getResultFromSqlQuery("SELECT * FROM orders c LEFT JOIN products p ON c.productid = p.id WHERE c.userid='" + id + "' "); + while (res.next()) { + %> + + + + + + <% + } + if(res == null) + { + %> + + + + <% } %> + +
ServicePriceAction
+
+
" class="img-thumbnail img-sm">
+
+
<%=res.getString("name")%>
+
+
+
+
+ GBP <%=res.getString("price")%> +
+
+ " class="btn btn-outline-danger"> × Cancel Order +
+ No orders placed yet +
+
+ +
+ + + + + + diff --git a/computingConsultaionService/src/main/webapp/pages/user/postLogin/placeOrder.jsp b/computingConsultaionService/src/main/webapp/pages/user/postLogin/placeOrder.jsp new file mode 100644 index 0000000..4faee56 --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/user/postLogin/placeOrder.jsp @@ -0,0 +1,24 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="com.connection.*"%> +<%@ page import="java.sql.*"%> +<%@page import="java.sql.ResultSet"%> +<% + String card_number = request.getParameter("card_number"); + String card_name = request.getParameter("card_name"); + String cvv = request.getParameter("cvv"); + String expiry = request.getParameter("expiry"); + String userid = (String)session.getAttribute("id"); + ResultSet res = DatabaseConnection.getResultFromSqlQuery("SELECT * FROM card_details WHERE card_number = '" + card_number + "' AND card_name = '" + card_name + "' AND cvv = '" + cvv + "' AND expiry = '" + expiry + "')"); + if (res.getRow() > 0) { + ResultSet res1 = DatabaseConnection.getResultFromSqlQuery("SELECT * FROM cart WHERE userid ='" + userid + "'"); + + while(res1.next()) { + int id = 0; + DatabaseConnection.insertUpdateFromSqlQuery("insert into orders(id,productid,userid,paid) values('" + id + "','" + res1.getString("productid") + "','" + res1.getString("userid") + "', 'true')"); + } + DatabaseConnection.insertUpdateFromSqlQuery("delete from cart where userid='" + userid + "' "); + response.sendRedirect("userDashboard.jsp"); + } else { + response.sendRedirect("checkout.jsp"); + } +%> \ No newline at end of file diff --git a/computingConsultaionService/src/main/webapp/pages/user/postLogin/removeCart.jsp b/computingConsultaionService/src/main/webapp/pages/user/postLogin/removeCart.jsp new file mode 100644 index 0000000..b7bdf17 --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/user/postLogin/removeCart.jsp @@ -0,0 +1,12 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="com.connection.*"%> +<%@ page import="java.sql.*"%> +<% + int id = Integer.parseInt(request.getParameter("id")); + int res = DatabaseConnection.insertUpdateFromSqlQuery("delete from cart where id='" + id + "' "); + if (res > 0) { + response.sendRedirect("cart.jsp"); + } else { + response.sendRedirect("cart.jsp"); + } +%> \ No newline at end of file diff --git a/computingConsultaionService/src/main/webapp/pages/user/postLogin/userDashboard.jsp b/computingConsultaionService/src/main/webapp/pages/user/postLogin/userDashboard.jsp new file mode 100644 index 0000000..03552ae --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/user/postLogin/userDashboard.jsp @@ -0,0 +1,79 @@ +<%-- + Document : userDashboard + Created on : 06-Nov-2022, 10:20:09 pm + Author : Dayasagar +--%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + User Dashboard + <%@include file="../../../common/header.jsp" %> + + + + +
+ +
+
+
+ + +
+
+ <% + ResultSet res = DatabaseConnection.getResultFromSqlQuery("SELECT *,IF(userid = 1, true, false) as inCart FROM products p LEFT JOIN cart c ON p.id = c.productId"); + while (res.next()) { + %> +
+
+
<%=res.getString("name")%>
+
+ " + alt="" + /> +
+
+
+
<%=res.getString("price")%>
+
+
+ " style="margin-right: 10px">View + <% + //Checking whether admin in session or not + if (!res.getBoolean("inCart")) { + %> + ">Add to Cart + <% + } + %> + +
+ <% + if (res.getBoolean("inCart")) { + %> +

Item already in cart

+ <% + } + %> + +
+
+
+ <% + } + %> + +
+
+
+
+ + + diff --git a/computingConsultaionService/src/main/webapp/pages/user/postLogin/viewProduct.jsp b/computingConsultaionService/src/main/webapp/pages/user/postLogin/viewProduct.jsp new file mode 100644 index 0000000..b10b4df --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/user/postLogin/viewProduct.jsp @@ -0,0 +1,138 @@ +<%-- + Document : viewProduct + Created on : 06-Nov-2022, 3:16:54 pm + Author : Dayasagar +--%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Product Details + <%@include file="../../../../../common/header.jsp" %> + + + <% + //Checking whether admin in session or not + if (session.getAttribute("uname") != null && session.getAttribute("uname") != "") { + %> + +
+

Product Details

+
+ + <% + int id = Integer.parseInt(request.getParameter("id")); + ResultSet res = DatabaseConnection.getResultFromSqlQuery("SELECT *,IF(userid = 1, true, false) as inCart FROM products p LEFT JOIN cart c ON p.id = c.productId WHERE p.id='" + id + "' "); + while (res.next()) { + %> +
+
+ + +
+
+ <% + } + %> + +
+ + + <% + } else { + response.sendRedirect("../../../commonLogin.jsp"); + } + %> + + diff --git a/computingConsultaionService/src/main/webapp/pages/user/userLogin.jsp b/computingConsultaionService/src/main/webapp/pages/user/userLogin.jsp new file mode 100644 index 0000000..b70339f --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/user/userLogin.jsp @@ -0,0 +1,81 @@ +<%-- + Document : userLogin + Created on : 06-Nov-2022, 10:09:01 pm + Author : Dayasagar +--%> +<%@page import="java.sql.Statement"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page import="java.sql.Connection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + User Login + <%@include file="../../common/header.jsp" %> + + + +
+
+
+
+
+
User Login
+
+ <% + //Connecting to the database + Connection connection = DatabaseConnection.getConnection(); + Statement statement = connection.createStatement(); + String credential = (String) session.getAttribute("credential"); + //Checking creditionals whether there are null or not + if (credential != null) { + session.removeAttribute("credential"); + %> +
You have enter wrong credentials.
+ <% + } + %> +
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+

Dont have an account?

Click Here +

+
+
+
+
+
+ +
+ <%@include file="../../common/footer.jsp" %> + + diff --git a/computingConsultaionService/src/main/webapp/pages/user/userRegistration.jsp b/computingConsultaionService/src/main/webapp/pages/user/userRegistration.jsp new file mode 100644 index 0000000..a2e60dd --- /dev/null +++ b/computingConsultaionService/src/main/webapp/pages/user/userRegistration.jsp @@ -0,0 +1,91 @@ +<%-- + Document : userLogin + Created on : 06-Nov-2022, 10:09:01 pm + Author : Dayasagar +--%> +<%@page import="java.sql.Statement"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page import="java.sql.Connection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + User Login + <%@include file="../../common/header.jsp" %> + + + +
+
+
+
+
+
User Registration
+
+ <% + //Connecting to the database + Connection connection = DatabaseConnection.getConnection(); + Statement statement = connection.createStatement(); + String credential = (String) session.getAttribute("credential"); + //Checking creditionals whether there are null or not + if (credential != null) { + session.removeAttribute("credential"); + %> +
<%=credential%>
+ <% + } + %> +
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+
+
+
+
+ +
+ <%@include file="../../common/footer.jsp" %> + + diff --git a/computingConsultaionService/target/classes/.netbeans_automatic_build b/computingConsultaionService/target/classes/.netbeans_automatic_build new file mode 100644 index 0000000..e69de29 diff --git a/computingConsultaionService/target/classes/com/admin/AddProduct.class b/computingConsultaionService/target/classes/com/admin/AddProduct.class new file mode 100644 index 0000000..e7b1876 Binary files /dev/null and b/computingConsultaionService/target/classes/com/admin/AddProduct.class differ diff --git a/computingConsultaionService/target/classes/com/admin/AdminSignIn.class b/computingConsultaionService/target/classes/com/admin/AdminSignIn.class new file mode 100644 index 0000000..de0a2a4 Binary files /dev/null and b/computingConsultaionService/target/classes/com/admin/AdminSignIn.class differ diff --git a/computingConsultaionService/target/classes/com/admin/EditProduct.class b/computingConsultaionService/target/classes/com/admin/EditProduct.class new file mode 100644 index 0000000..035610e Binary files /dev/null and b/computingConsultaionService/target/classes/com/admin/EditProduct.class differ diff --git a/computingConsultaionService/target/classes/com/connection/DatabaseConnection.class b/computingConsultaionService/target/classes/com/connection/DatabaseConnection.class new file mode 100644 index 0000000..91b5aa6 Binary files /dev/null and b/computingConsultaionService/target/classes/com/connection/DatabaseConnection.class differ diff --git a/computingConsultaionService/target/classes/com/user/UserLogin.class b/computingConsultaionService/target/classes/com/user/UserLogin.class new file mode 100644 index 0000000..d496e48 Binary files /dev/null and b/computingConsultaionService/target/classes/com/user/UserLogin.class differ diff --git a/computingConsultaionService/target/classes/com/user/UserRegistration.class b/computingConsultaionService/target/classes/com/user/UserRegistration.class new file mode 100644 index 0000000..9f18613 Binary files /dev/null and b/computingConsultaionService/target/classes/com/user/UserRegistration.class differ diff --git a/computingConsultaionService/target/classes/com/user/placeOrder.class b/computingConsultaionService/target/classes/com/user/placeOrder.class new file mode 100644 index 0000000..ce4daa0 Binary files /dev/null and b/computingConsultaionService/target/classes/com/user/placeOrder.class differ diff --git a/computingConsultaionService/target/classes/com/user/session.class b/computingConsultaionService/target/classes/com/user/session.class new file mode 100644 index 0000000..48e13c6 Binary files /dev/null and b/computingConsultaionService/target/classes/com/user/session.class differ diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT.war b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT.war new file mode 100644 index 0000000..560bf35 Binary files /dev/null and b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT.war differ diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/META-INF/context.xml b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/META-INF/context.xml new file mode 100644 index 0000000..976682b --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/META-INF/context.xml @@ -0,0 +1,2 @@ + + diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/Tomcat.dpf b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/Tomcat.dpf new file mode 100644 index 0000000..976682b --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/Tomcat.dpf @@ -0,0 +1,2 @@ + + diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/admin/AddProduct.class b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/admin/AddProduct.class new file mode 100644 index 0000000..e7b1876 Binary files /dev/null and b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/admin/AddProduct.class differ diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/admin/AdminSignIn.class b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/admin/AdminSignIn.class new file mode 100644 index 0000000..de0a2a4 Binary files /dev/null and b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/admin/AdminSignIn.class differ diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/admin/EditProduct.class b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/admin/EditProduct.class new file mode 100644 index 0000000..035610e Binary files /dev/null and b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/admin/EditProduct.class differ diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/connection/DatabaseConnection.class b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/connection/DatabaseConnection.class new file mode 100644 index 0000000..91b5aa6 Binary files /dev/null and b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/connection/DatabaseConnection.class differ diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/user/UserLogin.class b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/user/UserLogin.class new file mode 100644 index 0000000..d496e48 Binary files /dev/null and b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/user/UserLogin.class differ diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/user/UserRegistration.class b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/user/UserRegistration.class new file mode 100644 index 0000000..9f18613 Binary files /dev/null and b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/user/UserRegistration.class differ diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/user/placeOrder.class b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/user/placeOrder.class new file mode 100644 index 0000000..ce4daa0 Binary files /dev/null and b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/user/placeOrder.class differ diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/user/session.class b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/user/session.class new file mode 100644 index 0000000..48e13c6 Binary files /dev/null and b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/classes/com/user/session.class differ diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/lib/commons-fileupload-1.3.jar b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/lib/commons-fileupload-1.3.jar new file mode 100644 index 0000000..32f2360 Binary files /dev/null and b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/lib/commons-fileupload-1.3.jar differ diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/lib/commons-io-2.6.jar b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/lib/commons-io-2.6.jar new file mode 100644 index 0000000..00556b1 Binary files /dev/null and b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/lib/commons-io-2.6.jar differ diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/lib/mysql-connector-java-8.0.30.jar b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/lib/mysql-connector-java-8.0.30.jar new file mode 100644 index 0000000..92ebe1b Binary files /dev/null and b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/lib/mysql-connector-java-8.0.30.jar differ diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/lib/protobuf-java-3.19.4.jar b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/lib/protobuf-java-3.19.4.jar new file mode 100644 index 0000000..a545ea0 Binary files /dev/null and b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/WEB-INF/lib/protobuf-java-3.19.4.jar differ diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/adminDashboard.css b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/adminDashboard.css new file mode 100644 index 0000000..19ec7c4 --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/adminDashboard.css @@ -0,0 +1,89 @@ +.accordion_one .panel-group { + margin-bottom: 0; + border: 1px solid #f1f1f1; + margin-left:1px; +} + +.accordion_one .panel { + background-color: transparent; + box-shadow: none; + border-bottom: 0px solid transparent; + border-radius: 0; + margin: 0; +} + +.accordion_one .panel-default { + border: 0; +} + +.accordion_one .panel-default>.panel-heading { + border-radius: 0px; +} + +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: 16px; + color: inherit; +} + +h4 { + font-size: 18px; + line-height: 24px; +} + +.accordion_one .panel .panel-heading a.collapsed { + color: #999999; + display: block; + padding: 12px 30px; + border-top: 0px; +} + +.accordion_one .panel .panel-heading a { + display: block; + padding: 12px 30px; + background: #fff; + color: #313131; + border-bottom: 1px solid #f1f1f1; +} + +.accordion-wrap .panel .panel-heading a { + font-size: 14px; +} + +.accordion_one .panel-group .panel-heading+.panel-collapse>.panel-body { + border-top: 0; + padding-top: 0; + padding: 25px 30px 30px 35px; + background: #fff; + color: #999999; +} + +.img-accordion { + width: 81px; + float: left; + margin-right: 15px; + display: block; +} + +.accordion_one .panel .panel-heading a:after { + content: "\2212"; +} + +.accordion_one .panel .panel-heading a:after, .accordion_one .panel .panel-heading a.collapsed:after { + font-family: 'FontAwesome'; + font-size: 15px; + width: 36px; + height: 48px; + line-height: 48px; + text-align: center; + background: #F1F1F1; + float: left; + margin-left: -31px; + margin-top: -12px; + margin-right: 15px; +} + +a:link { + text-decoration: none +} diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/adminProductList.css b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/adminProductList.css new file mode 100644 index 0000000..45af08e --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/adminProductList.css @@ -0,0 +1,3 @@ +.mt-40 { + margin-top: 40px; +} \ No newline at end of file diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/cart.css b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/cart.css new file mode 100644 index 0000000..9d7ea8e --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/cart.css @@ -0,0 +1,41 @@ +.param { + margin-bottom: 7px; + line-height: 1.4; +} +.param-inline dt { + display: inline-block; +} +.param dt { + margin: 0; + margin-right: 7px; + font-weight: 600; +} +.param-inline dd { + vertical-align: baseline; + display: inline-block; +} + +.param dd { + margin: 0; + vertical-align: baseline; +} + +.shopping-cart-wrap .price { + color: #007bff; + font-size: 18px; + font-weight: bold; + margin-right: 5px; + display: block; +} +var { + font-style: normal; +} + +.media img { + margin-right: 1rem; +} +.img-sm { + width: 90px; + max-height: 75px; + object-fit: cover; +} \ No newline at end of file diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/checkout.css b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/checkout.css new file mode 100644 index 0000000..ec02ea7 --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/checkout.css @@ -0,0 +1,99 @@ + +.wrapper { + width: 350px; + height: 350px; + position: relative; + border-radius: 10px +} + +.outer-card { + width: 100%; + height: 100%; + background-color: #fff; + border-radius: 10px +} + +input, +input::-webkit-input-placeholder { + font-size: 16px; + line-height: 3 +} + +.wrapper .card::after { + position: absolute; + content: ""; + width: 200px; + height: 200px; + background-color: #3641d3; + right: -30px; + top: -30px; + border-radius: 50%; + opacity: 0.7 +} + +.wrapper .card::before { + position: absolute; + content: ""; + width: 300px; + height: 300px; + background-color: #3641d3; + left: -70px; + top: -70px; + border-radius: 50%; + opacity: 0.4 +} + +.wrapper .forms { + padding-top: 30px; + padding-left: 20px; + padding-right: 20px +} + +.wrapper .forms input { + height: 40px; + width: 100%; + font-size: 18px; + border: 2px solid #eee; + border-radius: 4px; + text-indent: 10px; + margin-top: 4px +} + +.wrapper .forms input:focus { + outline: none +} + +.input-items span { + font-size: 14px; + margin-left: 2px +} + +.input-items { + margin-bottom: 10px +} + +.one-line { + display: flex; + flex-direction: row +} + +.one-line .input-items:nth-child(1) { + margin-right: 10px +} + +.input-buttons { + width: 100%; + margin-top: 10px +} + +.input-buttons a { + width: 100%; + height: 45px; + border-radius: 5px; + color: #fff; + background-color: #000; + text-decoration: none; + display: flex; + justify-content: center; + align-items: center +} \ No newline at end of file diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/style.css b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/style.css new file mode 100644 index 0000000..45af08e --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/style.css @@ -0,0 +1,3 @@ +.mt-40 { + margin-top: 40px; +} \ No newline at end of file diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/userDashboard.css b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/userDashboard.css new file mode 100644 index 0000000..e604d4a --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/assets/userDashboard.css @@ -0,0 +1,466 @@ +@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');*{ + padding: 0; + margin: 0; + box-sizing: border-box; + font-family: 'Poppins', sans-serif +} +body{ + background-color: #f4f4f4 +} +.container{ + margin: 40px auto +} +#header{ + width: 100%; + height: 60px; + box-shadow: 5px 5px 15px #e8e8e8 +} +.col-lg-4, .col-md-6{ + padding-right: 0 +} +button.btn.btn-hide{ + height: inherit; + background-color: #ff935d; + color: #fff; + font-size: 0.82rem; + padding-left: 40px; + padding-right: 40px; + border-top-right-radius: 0px; + border-bottom-right-radius: 0px +} +.btn:focus{ + box-shadow: none +} +.box-label .btn{ + background-color: #fff; + padding: 0; + font-size: 0.8rem +} +.btn-red{ + background-color: #e00000ce +} +.btn-orange{ + background-color: #ffa500 +} +.btn-pink{ + background-color: #e0009dce +} +.btn-green{ + background-color: #00811c +} +.btn-blue{ + background-color: #026bc2 +} +.btn-brown{ + background-color: #994a00 +} + +.pagination .page-item .page-link{ + color: #333; + border: none; + width: 40px; + text-align: center +} +.pagination .page-item.active .page-link{ + background-color: #fff; + border: 1px solid #333 +} +select{ + outline: none; + padding: 6px 12px; + margin: 0px 4px; + color: #999; + font-size: 0.85rem; + width: 140px +} +#select2{ + border: 1px solid #777; + color: #999 +} +#pro{ + border: none; + color: #333; + font-weight: 700; + padding-left: 0px; + width: initial +} +#filterbar{ + width: 30%; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 15px; + float: left +} +#filterbar input[type="radio"]{ + visibility: hidden +} +#filterbar input[type='radio']:checked{ + background-color: #16c79a; + border: none +} +#filterbar .btn.btn-success{ + background-color: #ddd; + color: #333; + border: none; + width: 115px +} +#filterbar .btn.btn-success:hover{ + background-color: #aff1e1; + color: #444 +} +#filterbar .btn-success:not(:disabled):not(.disabled).active, #filterbar .btn-success:not(:disabled):not(.disabled):active{ + background-color: #16c79a; + color: #fff +} +label{ + cursor: pointer +} +.tick{ + display: block; + position: relative; + padding-left: 23px; + cursor: pointer; + font-size: 0.9rem; + margin: 0 +} +.tick input{ + position: absolute; + opacity: 0; + cursor: pointer; + height: 0; + width: 0 +} +.check{ + position: absolute; + top: 1px; + left: 0; + height: 18px; + width: 18px; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 3px +} +.tick:hover input~.check{ + background-color: #f3f3f3 +} +.tick input:checked~.check{ + background-color: #ffffff +} +.check:after{ + content: ""; + position: absolute; + display: none +} +.tick input:checked~.check:after{ + display: block; + transform: rotate(45deg) scale(1) +} +.tick .check:after{ + left: 6px; + top: 2px; + width: 5px; + height: 10px; + border: solid rgb(0, 0, 0); + border-width: 0 3px 3px 0; + transform: rotate(45deg) scale(2) +} +.box{ + padding: 10px +} +.box-label{ + color: #11698e; + font-size: 0.9rem; + font-weight: 800 +} +#inner-box, #inner-box2{ + height: 150px; + overflow-y: scroll +} +#inner-box2{ + height: 132px +} +#inner-box::-webkit-scrollbar, #inner-box2::-webkit-scrollbar{ + width: 6px +} +#inner-box::-webkit-scrollbar-track, #inner-box2::-webkit-scrollbar-track{ + background-color: #ddd; + border-radius: 2px +} +#inner-box::-webkit-scrollbar-thumb, #inner-box2::-webkit-scrollbar-thumb{ + background-color: #333; + border-radius: 2px +} +#price{ + height: 45px +} +#size input[type="checkbox"]{ + visibility: hidden +} +#size input[type='checkbox']:checked{ + background-color: #16c79a; + border: none +} +#size .btn.btn-success{ + background-color: #ddd; + color: #333; + border: none; + width: 40px; + font-size: 0.8rem; + border-radius: 0 +} +#size .btn.btn-success:hover{ + background-color: #aff1e1; + color: #444 +} +#size .btn-success:not(:disabled):not(.disabled).active, #size .btn-success:not(:disabled):not(.disabled):active{ + background-color: #16c79a; + color: #fff +} +#size label{ + margin: 10px; + margin-left: 0px +} +.card{ + padding: 10px; + cursor: pointer; + transition: .3s all ease-in-out; + height: 350px +} +.card:hover{ + box-shadow: 2px 2px 15px #fd9a6ce5; + transform: scale(1.02) +} +.card .product-name{ + font-weight: 600 +} +.card-body{ + padding-bottom: 0 +} +.card .text-muted{ + font-size: 0.82rem +} +.card-img img{ + padding-top: 10px; + width: inherit; + height: 180px; + object-fit: contain; + display: block +} +.card-body .btn-group .btn{ + padding: 0; + width: 20px; + height: 20px; + margin-right: 5px; + border-radius: 50%; + position: relative +} +.card-body .btn-group>.btn-group:not(:last-child)>.btn, .card-body .btn-group>.btn:not(:last-child):not(.dropdown-toggle){ + border-radius: 50%; + transition: ease-in all .4s +} +.card-body input[type="radio"]{ + visibility: hidden +} +.card-body .btn:not(:disabled):not(.disabled).active::after, .card-body .btn:not(:disabled):not(.disabled):active::after{ + content: ""; + width: 10px; + height: 10px; + border-radius: 50%; + top: 4px; + left: 4.2px; + background-color: #fff; + position: absolute; + transition: ease-in all .4s +} +.card-body .btn.btn-light:not(:disabled):not(.disabled).active::after, .card-body .btn.btn-light:not(:disabled):not(.disabled):active::after{ + background-color: #000 +} +#avail-size input[type="checkbox"]{ + visibility: hidden +} +#avail-size input[type='checkbox']:checked{ + background-color: #16c79a; + border: none +} +#avail-size .btn.btn-success{ + background-color: #ddd; + color: #333; + border: none; + width: 20px; + font-size: 0.7rem; + border-radius: 0; + padding: 0 +} +#avail-size .btn.btn-success:hover{ + background-color: #aff1e1; + color: #444 +} +#avail-size .btn-success:not(:disabled):not(.disabled).active, #avail-size .btn-success:not(:disabled):not(.disabled):active{ + background-color: #16c79a; + color: #fff +} +#avail-size label{ + margin: 10px; + margin-left: 0px +} +#shirt{ + height: 170px +} +.middle{ + position: relative; + width: 100%; + margin-top: 25px +} +.slider{ + position: relative; + z-index: 1; + height: 5px; + margin: 0 15px +} +.slider>.track{ + position: absolute; + z-index: 1; + left: 0; + right: 0; + top: 0; + bottom: 0; + border-radius: 5px; + background-color: #ddd +} +.slider>.range{ + position: absolute; + z-index: 2; + left: 25%; + right: 25%; + top: 0; + bottom: 0; + border-radius: 5px; + background-color: #36a31b +} +.slider>.thumb{ + position: absolute; + top: 2px; + z-index: 3; + width: 20px; + height: 20px; + background-color: #36a31b; + border-radius: 50%; + box-shadow: 0 0 0 0 rgba(63, 204, 75, 0.705); + transition: box-shadow .3s ease-in-out +} +.slider>.thumb::after{ + position: absolute; + width: 8px; + height: 8px; + left: 28%; + top: 30%; + border-radius: 50%; + content: ''; + background-color: #fff +} +.slider>.thumb.left{ + left: 25%; + transform: translate(-15px, -10px) +} +.slider>.thumb.right{ + right: 25%; + transform: translate(15px, -10px) +} +.slider>.thumb.hover{ + box-shadow: 0 0 0 10px rgba(125, 230, 134, 0.507) +} +.slider>.thumb.active{ + box-shadow: 0 0 0 10px rgba(63, 204, 75, 0.623) +} +input[type=range]{ + position: absolute; + pointer-events: none; + -webkit-appearance: none; + z-index: 2; + height: 10px; + width: 100%; + opacity: 0 +} +input[type=range]::-webkit-slider-thumb{ + pointer-events: all; + width: 30px; + height: 30px; + border-radius: 0; + border: 0 none; + background-color: red; + -webkit-appearance: none +} +.del{ + text-decoration: line-through; + color: red +} +@media(min-width:1199.6px){ + #filterbar{ + width: 25% + } +} +@media(max-width:1199.5px){ + #filterbar{ + width: 28% + } + .card{ + height: 350px + } + .price{ + font-size: 0.9rem + } + .product-name{ + font-size: 0.8rem + } +} +@media(max-width: 991.5px){ + + #filterbar{ + width: 36% + } + #sort{ + background-color: inherit; + color: #fff; + margin: 0; + margin-bottom: 20px; + width: 100% + } + #sort option, #pro option{ + color: #000 + } + #pro, #select2, .result{ + background-color: inherit; + color: #fff + } + .card{ + height: 345px + } + .price{ + font-size: 0.85rem + } +} +@media(max-width: 767.5px){ + #filterbar{ + width: 50% + } +} +@media(max-width: 525.5px){ + #filterbar{ + float: none; + width: 100%; + margin-bottom: 20px; + border-radius: 5px + } + #content.my-5{ + margin-top: 20px !important; + margin-bottom: 20px !important + } + .col-lg-4, .col-md-6{ + padding-left: 0 + } +} +@media(max-width: 500.5px){ + .pagination{ + display: none + } +} \ No newline at end of file diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/common/footer.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/common/footer.jsp new file mode 100644 index 0000000..4a58128 --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/common/footer.jsp @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/common/header.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/common/header.jsp new file mode 100644 index 0000000..654e2b6 --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/common/header.jsp @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/common/logout.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/common/logout.jsp new file mode 100644 index 0000000..0997ebd --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/common/logout.jsp @@ -0,0 +1,5 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<% + session.invalidate(); + response.sendRedirect("../commonLogin.jsp"); +%> \ No newline at end of file diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/common/navigation.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/common/navigation.jsp new file mode 100644 index 0000000..cb8cc9e --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/common/navigation.jsp @@ -0,0 +1,34 @@ + diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/commonLogin.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/commonLogin.jsp new file mode 100644 index 0000000..d1954d3 --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/commonLogin.jsp @@ -0,0 +1,35 @@ +<%-- + Document : commonLogin + Created on : 31-Oct-2022, 3:36:46 am + Author : Dayasagar +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + Dashboard + <%@include file="common/header.jsp" %> + + + + + + + + diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/index.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/index.jsp new file mode 100644 index 0000000..8ed33c3 --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/index.jsp @@ -0,0 +1,4 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<% + response.sendRedirect("commonLogin.jsp"); +%> \ No newline at end of file diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/adminCommon/adminNav.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/adminCommon/adminNav.jsp new file mode 100644 index 0000000..eb480cd --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/adminCommon/adminNav.jsp @@ -0,0 +1,41 @@ + diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/adminLogin.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/adminLogin.jsp new file mode 100644 index 0000000..705790b --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/adminLogin.jsp @@ -0,0 +1,79 @@ +<%-- + Document : adminLogin + Created on : 31-Oct-2022, 3:11:10 am + Author : Dayasagar +--%> + +<%@page import="java.sql.Statement"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page import="java.sql.Connection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Admin Login + <%@include file="../../common/header.jsp" %> + + + +
+
+
+
+
+
Admin Login
+
+ <% + //Connecting to the database + Connection connection = DatabaseConnection.getConnection(); + Statement statement = connection.createStatement(); + String credential = (String) session.getAttribute("credential"); + //Checking creditionals whether there are null or not + if (credential != null) { + session.removeAttribute("credential"); + %> +
You have enter wrong credentials.
+ <% + } + %> +
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+
+
+
+
+ +
+ <%@include file="../../common/footer.jsp" %> + + diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/adminDashboard.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/adminDashboard.jsp new file mode 100644 index 0000000..7c99c4a --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/adminDashboard.jsp @@ -0,0 +1,4 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<% + response.sendRedirect("product/adminProductList.jsp"); +%> \ No newline at end of file diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/orders/adminOrdersList.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/orders/adminOrdersList.jsp new file mode 100644 index 0000000..0903db9 --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/orders/adminOrdersList.jsp @@ -0,0 +1,77 @@ +<%-- + Document : adminOrdersList + Created on : 06-Nov-2022, 1:40:14 pm + Author : Dayasagar +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Orders + <%@include file="../../../../common/header.jsp" %> + + + <% + //Checking whether admin in session or not + if (session.getAttribute("uname") != null && session.getAttribute("uname") != "") { + %> + +
+
+

Orders

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#Item NameUser NameQuantityAction
1MarkOtto@mdo + + +
2JacobThornton@fat + + +
3Larrythe Bird@twitter + + +
+
+ + <% + } else { + response.sendRedirect("../../../../commonLogin.jsp"); + } + %> + + diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/product/addProduct.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/product/addProduct.jsp new file mode 100644 index 0000000..42fd77e --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/product/addProduct.jsp @@ -0,0 +1,57 @@ +<%-- + Document : addProduct + Created on : 06-Nov-2022, 3:16:33 pm + Author : Dayasagar +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Add Product + <%@include file="../../../../../common/header.jsp" %> + + + + <% + //Checking whether admin in session or not + if (session.getAttribute("uname") != null && session.getAttribute("uname") != "") { + %> + +
+
+

Add Product

+
+
+
+
+ + +
+
+ + +
+
+ + +
+ + +
+
+ +
+ +
+
+
+ + <% + } else { + response.sendRedirect("../../../../commonLogin.jsp"); + } + %> + + diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/product/adminProductList.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/product/adminProductList.jsp new file mode 100644 index 0000000..af237a0 --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/product/adminProductList.jsp @@ -0,0 +1,74 @@ +<%-- + Document : adminPorductList + Created on : 06-Nov-2022, 1:40:25 pm + Author : Dayasagar +--%> + +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="java.sql.*"%> +<%@ page import="com.connection.*"%> + + + + + Product Listing + <%@include file="../../../../../common/header.jsp" %> + + + + <% + //Checking whether admin in session or not + if (session.getAttribute("uname") != null && session.getAttribute("uname") != "") { + %> + +
+
+

Product listing

+ Add Product +
+ + + + + + + + + + + + + + + <% + ResultSet res = DatabaseConnection.getResultFromSqlQuery("select * from products"); + while (res.next()) { + %> + + + + + + + + + + <% + } + %> + +
#Item NameDescriptionQuantityPriceImageAction
<%=res.getInt("id")%><%=res.getString("name")%><%=res.getString("description")%><%=res.getString("quantity")%><%=res.getString("price")%>" + width="100" height="70"> + ">View + ">Edit + ">Delete +
+
+ + <% + } else { + response.sendRedirect("../../../../commonLogin.jsp"); + } + %> + + diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/product/deleteProduct.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/product/deleteProduct.jsp new file mode 100644 index 0000000..2b8688d --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/product/deleteProduct.jsp @@ -0,0 +1,12 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="com.connection.*"%> +<%@ page import="java.sql.*"%> +<% + int id = Integer.parseInt(request.getParameter("id")); + int res = DatabaseConnection.insertUpdateFromSqlQuery("delete from products where id='" + id + "' "); + if (res > 0) { + response.sendRedirect("adminProductList.jsp"); + } else { + response.sendRedirect("adminProductList.jsp"); + } +%> \ No newline at end of file diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/product/editProduct.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/product/editProduct.jsp new file mode 100644 index 0000000..6a1aae5 --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/product/editProduct.jsp @@ -0,0 +1,69 @@ +<%-- + Document : addProduct + Created on : 06-Nov-2022, 3:16:33 pm + Author : Dayasagar +--%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Edit Product + <%@include file="../../../../../common/header.jsp" %> + + + + <% + //Checking whether admin in session or not + if (session.getAttribute("uname") != null && session.getAttribute("uname") != "") { + %> + +
+
+

Edit Product

+
+
+ <% + int id = Integer.parseInt(request.getParameter("id")); + //Querying to database + ResultSet res = DatabaseConnection.getResultFromSqlQuery("select * from products where id='" + id + "' "); + while (res.next()) { + %> +
+
+ + " placeholder="Product" readonly="true"> +
+
+ + " placeholder="Enter Product Name"> +
+
+ + " placeholder="Quantity"> +
+
+ + " placeholder="Price"> +
+ + +
+ +
+ <% + } + %> +
+
+ + <% + } else { + response.sendRedirect("../../../../commonLogin.jsp"); + } + %> + + diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/product/viewProduct.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/product/viewProduct.jsp new file mode 100644 index 0000000..e66f3a6 --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/admin/postLogin/product/viewProduct.jsp @@ -0,0 +1,128 @@ +<%-- + Document : viewProduct + Created on : 06-Nov-2022, 3:16:54 pm + Author : Dayasagar +--%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Product Details + <%@include file="../../../../../common/header.jsp" %> + + + <% + //Checking whether admin in session or not + if (session.getAttribute("uname") != null && session.getAttribute("uname") != "") { + %> + +
+

Product Details

+
+ + <% + int id = Integer.parseInt(request.getParameter("id")); + ResultSet res = DatabaseConnection.getResultFromSqlQuery("select * from products where id='" + id + "' "); + while (res.next()) { + %> +
+
+ + +
+
+ <% + } + %> + +
+ + + <% + } else { + response.sendRedirect("../../../../commonLogin.jsp"); + } + %> + + diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/addToCart.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/addToCart.jsp new file mode 100644 index 0000000..cd44359 --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/addToCart.jsp @@ -0,0 +1,14 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="com.connection.*"%> +<%@ page import="java.sql.*"%> +<% + int productId = Integer.parseInt(request.getParameter("id")); + int id=0; + String userid = (String)session.getAttribute("id"); + int res = DatabaseConnection.insertUpdateFromSqlQuery("insert into cart(id,productId,userid) values('" + id + "','" + productId + "','" + userid + "')"); + if (res > 0) { + response.sendRedirect("userDashboard.jsp"); + } else { + response.sendRedirect("viewProduct.jsp?id="+productId); + } +%> \ No newline at end of file diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/cart.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/cart.jsp new file mode 100644 index 0000000..da75ca9 --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/cart.jsp @@ -0,0 +1,82 @@ +<%-- + Document : cart + Created on : 09-Nov-2022, 1:08:12 am + Author : Dayasagar +--%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Cart + <%@include file="../../../common/header.jsp" %> + + + + +
+ +
+

Cart

+ Proceed to checkout +
+ + +
+ + + + + + + + + + <% + String id = (String)session.getAttribute("id"); + ResultSet res = DatabaseConnection.getResultFromSqlQuery("SELECT * FROM cart c LEFT JOIN products p ON c.productId = p.id WHERE c.userid='" + id + "' "); + while (res.next()) { + %> + + + + + + <% + } + if(res == null) + { + %> + + + + <% } %> + +
ServicePriceAction
+
+
" class="img-thumbnail img-sm">
+
+
<%=res.getString("name")%>
+
+
+
+
+ GBP <%=res.getString("price")%> +
+
+ " class="btn btn-outline-danger"> × Remove +
+ No items in the cart +
+
+ +
+ + + + + + diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/checkout.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/checkout.jsp new file mode 100644 index 0000000..ef057df --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/checkout.jsp @@ -0,0 +1,58 @@ +<%-- + Document : checkout + Created on : 09-Nov-2022, 1:29:44 am + Author : Dayasagar +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Payment + <%@include file="../../../common/header.jsp" %> + + + + +
+ +
+
+

Payment

+
+
+
+
+
+ Card Number + +
+
+ Name on card +
+
+
+ Expiry Date + +
+
+ CVV + +
+
+ " hidden=""> +
+
+
+
+
+
+ + + + diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/myOrders.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/myOrders.jsp new file mode 100644 index 0000000..6819c2f --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/myOrders.jsp @@ -0,0 +1,81 @@ +<%-- + Document : cart + Created on : 09-Nov-2022, 1:08:12 am + Author : Dayasagar +--%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Orders + <%@include file="../../../common/header.jsp" %> + + + + +
+ +
+

My Orders

+
+ + +
+ + + + + + + + + + <% + String id = (String)session.getAttribute("id"); + ResultSet res = DatabaseConnection.getResultFromSqlQuery("SELECT * FROM orders c LEFT JOIN products p ON c.productid = p.id WHERE c.userid='" + id + "' "); + while (res.next()) { + %> + + + + + + <% + } + if(res == null) + { + %> + + + + <% } %> + +
ServicePriceAction
+
+
" class="img-thumbnail img-sm">
+
+
<%=res.getString("name")%>
+
+
+
+
+ GBP <%=res.getString("price")%> +
+
+ " class="btn btn-outline-danger"> × Cancel Order +
+ No orders placed yet +
+
+ +
+ + + + + + diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/placeOrder.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/placeOrder.jsp new file mode 100644 index 0000000..4faee56 --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/placeOrder.jsp @@ -0,0 +1,24 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="com.connection.*"%> +<%@ page import="java.sql.*"%> +<%@page import="java.sql.ResultSet"%> +<% + String card_number = request.getParameter("card_number"); + String card_name = request.getParameter("card_name"); + String cvv = request.getParameter("cvv"); + String expiry = request.getParameter("expiry"); + String userid = (String)session.getAttribute("id"); + ResultSet res = DatabaseConnection.getResultFromSqlQuery("SELECT * FROM card_details WHERE card_number = '" + card_number + "' AND card_name = '" + card_name + "' AND cvv = '" + cvv + "' AND expiry = '" + expiry + "')"); + if (res.getRow() > 0) { + ResultSet res1 = DatabaseConnection.getResultFromSqlQuery("SELECT * FROM cart WHERE userid ='" + userid + "'"); + + while(res1.next()) { + int id = 0; + DatabaseConnection.insertUpdateFromSqlQuery("insert into orders(id,productid,userid,paid) values('" + id + "','" + res1.getString("productid") + "','" + res1.getString("userid") + "', 'true')"); + } + DatabaseConnection.insertUpdateFromSqlQuery("delete from cart where userid='" + userid + "' "); + response.sendRedirect("userDashboard.jsp"); + } else { + response.sendRedirect("checkout.jsp"); + } +%> \ No newline at end of file diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/removeCart.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/removeCart.jsp new file mode 100644 index 0000000..b7bdf17 --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/removeCart.jsp @@ -0,0 +1,12 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page import="com.connection.*"%> +<%@ page import="java.sql.*"%> +<% + int id = Integer.parseInt(request.getParameter("id")); + int res = DatabaseConnection.insertUpdateFromSqlQuery("delete from cart where id='" + id + "' "); + if (res > 0) { + response.sendRedirect("cart.jsp"); + } else { + response.sendRedirect("cart.jsp"); + } +%> \ No newline at end of file diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/userDashboard.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/userDashboard.jsp new file mode 100644 index 0000000..03552ae --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/userDashboard.jsp @@ -0,0 +1,79 @@ +<%-- + Document : userDashboard + Created on : 06-Nov-2022, 10:20:09 pm + Author : Dayasagar +--%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + User Dashboard + <%@include file="../../../common/header.jsp" %> + + + + +
+ +
+
+
+ + +
+
+ <% + ResultSet res = DatabaseConnection.getResultFromSqlQuery("SELECT *,IF(userid = 1, true, false) as inCart FROM products p LEFT JOIN cart c ON p.id = c.productId"); + while (res.next()) { + %> +
+
+
<%=res.getString("name")%>
+
+ " + alt="" + /> +
+
+
+
<%=res.getString("price")%>
+
+
+ " style="margin-right: 10px">View + <% + //Checking whether admin in session or not + if (!res.getBoolean("inCart")) { + %> + ">Add to Cart + <% + } + %> + +
+ <% + if (res.getBoolean("inCart")) { + %> +

Item already in cart

+ <% + } + %> + +
+
+
+ <% + } + %> + +
+
+
+
+ + + diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/viewProduct.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/viewProduct.jsp new file mode 100644 index 0000000..b10b4df --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/postLogin/viewProduct.jsp @@ -0,0 +1,138 @@ +<%-- + Document : viewProduct + Created on : 06-Nov-2022, 3:16:54 pm + Author : Dayasagar +--%> + +<%@page import="java.sql.ResultSet"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + Product Details + <%@include file="../../../../../common/header.jsp" %> + + + <% + //Checking whether admin in session or not + if (session.getAttribute("uname") != null && session.getAttribute("uname") != "") { + %> + +
+

Product Details

+
+ + <% + int id = Integer.parseInt(request.getParameter("id")); + ResultSet res = DatabaseConnection.getResultFromSqlQuery("SELECT *,IF(userid = 1, true, false) as inCart FROM products p LEFT JOIN cart c ON p.id = c.productId WHERE p.id='" + id + "' "); + while (res.next()) { + %> +
+
+ + +
+
+ <% + } + %> + +
+ + + <% + } else { + response.sendRedirect("../../../commonLogin.jsp"); + } + %> + + diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/userLogin.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/userLogin.jsp new file mode 100644 index 0000000..b70339f --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/userLogin.jsp @@ -0,0 +1,81 @@ +<%-- + Document : userLogin + Created on : 06-Nov-2022, 10:09:01 pm + Author : Dayasagar +--%> +<%@page import="java.sql.Statement"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page import="java.sql.Connection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + User Login + <%@include file="../../common/header.jsp" %> + + + +
+
+
+
+
+
User Login
+
+ <% + //Connecting to the database + Connection connection = DatabaseConnection.getConnection(); + Statement statement = connection.createStatement(); + String credential = (String) session.getAttribute("credential"); + //Checking creditionals whether there are null or not + if (credential != null) { + session.removeAttribute("credential"); + %> +
You have enter wrong credentials.
+ <% + } + %> +
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+

Dont have an account?

Click Here +

+
+
+
+
+
+ +
+ <%@include file="../../common/footer.jsp" %> + + diff --git a/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/userRegistration.jsp b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/userRegistration.jsp new file mode 100644 index 0000000..a2e60dd --- /dev/null +++ b/computingConsultaionService/target/computingConsultaionService-1.0-SNAPSHOT/pages/user/userRegistration.jsp @@ -0,0 +1,91 @@ +<%-- + Document : userLogin + Created on : 06-Nov-2022, 10:09:01 pm + Author : Dayasagar +--%> +<%@page import="java.sql.Statement"%> +<%@page import="com.connection.DatabaseConnection"%> +<%@page import="java.sql.Connection"%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + User Login + <%@include file="../../common/header.jsp" %> + + + +
+
+
+
+
+
User Registration
+
+ <% + //Connecting to the database + Connection connection = DatabaseConnection.getConnection(); + Statement statement = connection.createStatement(); + String credential = (String) session.getAttribute("credential"); + //Checking creditionals whether there are null or not + if (credential != null) { + session.removeAttribute("credential"); + %> +
<%=credential%>
+ <% + } + %> +
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+
+
+
+
+ +
+ <%@include file="../../common/footer.jsp" %> + + diff --git a/computingConsultaionService/target/endorsed/javaee-endorsed-api-7.0.jar b/computingConsultaionService/target/endorsed/javaee-endorsed-api-7.0.jar new file mode 100644 index 0000000..7f2e96d Binary files /dev/null and b/computingConsultaionService/target/endorsed/javaee-endorsed-api-7.0.jar differ diff --git a/computingConsultaionService/target/maven-archiver/pom.properties b/computingConsultaionService/target/maven-archiver/pom.properties new file mode 100644 index 0000000..4cf1fa0 --- /dev/null +++ b/computingConsultaionService/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=computingConsultaionService +groupId=com.computingConsultaionService +version=1.0-SNAPSHOT diff --git a/computingConsultaionService/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/computingConsultaionService/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..ea3178d --- /dev/null +++ b/computingConsultaionService/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,8 @@ +com\connection\DatabaseConnection.class +com\user\UserLogin.class +com\admin\AdminSignIn.class +com\admin\AddProduct.class +com\user\placeOrder.class +com\user\UserRegistration.class +com\user\session.class +com\admin\EditProduct.class diff --git a/computingConsultaionService/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/computingConsultaionService/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..43adaac --- /dev/null +++ b/computingConsultaionService/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,8 @@ +D:\Web_API\computingConsultaionService\computingConsultaionService\src\main\java\com\user\session.java +D:\Web_API\computingConsultaionService\computingConsultaionService\src\main\java\com\user\UserLogin.java +D:\Web_API\computingConsultaionService\computingConsultaionService\src\main\java\com\admin\AdminSignIn.java +D:\Web_API\computingConsultaionService\computingConsultaionService\src\main\java\com\admin\AddProduct.java +D:\Web_API\computingConsultaionService\computingConsultaionService\src\main\java\com\connection\DatabaseConnection.java +D:\Web_API\computingConsultaionService\computingConsultaionService\src\main\java\com\user\placeOrder.java +D:\Web_API\computingConsultaionService\computingConsultaionService\src\main\java\com\user\UserRegistration.java +D:\Web_API\computingConsultaionService\computingConsultaionService\src\main\java\com\admin\EditProduct.java diff --git a/computingConsultaionService/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/computingConsultaionService/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..e69de29 diff --git a/computingConsultaionService/target/test-classes/.netbeans_automatic_build b/computingConsultaionService/target/test-classes/.netbeans_automatic_build new file mode 100644 index 0000000..e69de29