Skip to content

Commit 603281f

Browse files
committed
First Commit
0 parents  commit 603281f

File tree

120 files changed

+7352
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+7352
-0
lines changed

build.xml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- You may freely edit this file. See commented blocks below for -->
3+
<!-- some examples of how to customize the build. -->
4+
<!-- (If you delete it and reopen the project it will be recreated.) -->
5+
<!-- By default, only the Clean and Build commands use this build script. -->
6+
<!-- Commands such as Run, Debug, and Test only use this build script if -->
7+
<!-- the Compile on Save feature is turned off for the project. -->
8+
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
9+
<!-- in the project's Project Properties dialog box.-->
10+
<project name="OnlineStore" default="default" basedir=".">
11+
<description>Builds, tests, and runs the project OnlineStore.</description>
12+
<import file="nbproject/build-impl.xml"/>
13+
<!--
14+
15+
There exist several targets which are by default empty and which can be
16+
used for execution of your tasks. These targets are usually executed
17+
before and after some main targets. They are:
18+
19+
-pre-init: called before initialization of project properties
20+
-post-init: called after initialization of project properties
21+
-pre-compile: called before javac compilation
22+
-post-compile: called after javac compilation
23+
-pre-compile-single: called before javac compilation of single file
24+
-post-compile-single: called after javac compilation of single file
25+
-pre-compile-test: called before javac compilation of JUnit tests
26+
-post-compile-test: called after javac compilation of JUnit tests
27+
-pre-compile-test-single: called before javac compilation of single JUnit test
28+
-post-compile-test-single: called after javac compilation of single JUunit test
29+
-pre-dist: called before archive building
30+
-post-dist: called after archive building
31+
-post-clean: called after cleaning build products
32+
-pre-run-deploy: called before deploying
33+
-post-run-deploy: called after deploying
34+
35+
Example of pluging an obfuscator after the compilation could look like
36+
37+
<target name="-post-compile">
38+
<obfuscate>
39+
<fileset dir="${build.classes.dir}"/>
40+
</obfuscate>
41+
</target>
42+
43+
For list of available properties check the imported
44+
nbproject/build-impl.xml file.
45+
46+
47+
Other way how to customize the build is by overriding existing main targets.
48+
The target of interest are:
49+
50+
init-macrodef-javac: defines macro for javac compilation
51+
init-macrodef-junit: defines macro for junit execution
52+
init-macrodef-debug: defines macro for class debugging
53+
do-dist: archive building
54+
run: execution of project
55+
javadoc-build: javadoc generation
56+
57+
Example of overriding the target for project execution could look like
58+
59+
<target name="run" depends="<PROJNAME>-impl.jar">
60+
<exec dir="bin" executable="launcher.exe">
61+
<arg file="${dist.jar}"/>
62+
</exec>
63+
</target>
64+
65+
Notice that overridden target depends on jar target and not only on
66+
compile target as regular run target does. Again, for list of available
67+
properties which you can use check the target you are overriding in
68+
nbproject/build-impl.xml file.
69+
70+
-->
71+
</project>

build/web/CartPage.jsp

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
<%--
2+
Document : CartPage
3+
Created on : Apr 18, 2021, 2:36:30 PM
4+
Author : engryankey
5+
--%>
6+
7+
<%@page import="src.CartItem"%>
8+
<%@page import="java.util.List"%>
9+
<%@page import="java.util.ArrayList"%>
10+
<%@page contentType="text/html" pageEncoding="UTF-8"%>
11+
<!DOCTYPE html>
12+
<html>
13+
<jsp:include page="head.jsp" >
14+
<jsp:param name="title" value="Dashboard" />
15+
</jsp:include>
16+
<%
17+
if (session.getAttribute("user") == null) {
18+
response.sendRedirect("login.jsp");
19+
}
20+
%>
21+
<body>
22+
<jsp:include page="navbar.jsp" >
23+
<jsp:param name="login" value="" />
24+
<jsp:param name="register" value="" />
25+
<jsp:param name="home" value="" />
26+
<jsp:param name="dashboard" value="active" />
27+
</jsp:include>
28+
<div class="container">
29+
<div class="row">
30+
<div class="col-sm-4 toggleds" id="leftdash">
31+
<div align="center" class="dashimage">
32+
<img src="img/dp.png" class="al" align="center">
33+
</div>
34+
<br>
35+
<div align="center">
36+
<h3 class="head">${user.getName()}</h3>
37+
<strong>Member since</strong><br>
38+
${user.getJoined()}
39+
<br><br>
40+
41+
</div>
42+
</div>
43+
<div class="col-sm-8" id="rightdash">
44+
<div class="row">
45+
<div class="col-1"></div>
46+
<div class="col-10">
47+
<div class="display container">
48+
<% if(session.getAttribute("cart") != null) {%>
49+
<%
50+
List cart = (ArrayList) session.getAttribute("cart");
51+
int total_price = 0;
52+
int total_items = 0;
53+
%>
54+
<% if (cart.size() != 0 ) { %>
55+
<h4 align="center" class="head">Your Shopping Cart</h4>
56+
<br>
57+
<% for(int i=0; i < cart.size(); i++) { %>
58+
<% CartItem product = (CartItem) cart.get(i); %>
59+
<%
60+
total_price += Integer.parseInt(product.getProduct().getPrice()) * product.getQuantity();
61+
total_items += product.getQuantity();
62+
%>
63+
<div class="product">
64+
<div class="row g-3">
65+
<div class="col-md-4" align="center">
66+
<form action="Products" method="GET">
67+
<a href="" style="text-decoration: none;" onclick="this.closest('form').submit();return false;"><img src="img/uploaded/<%= product.getProduct().getImage()%>" alt="" srcset="" width="150" height="200"></a>
68+
<input type="hidden" name="id" value="<%= product.getId() %>">
69+
</form>
70+
</div>
71+
<div class="col-md-6">
72+
<h4>
73+
<a href="" style="text-decoration: none;" onclick="this.closest('form').submit();return false;"><%= product.getProduct().getPtitle() %></a>
74+
75+
</h4>
76+
<span class="price">
77+
&#163;<%= product.getProduct().getPrice() %> <span style="color: black">unit price</span>
78+
<% if(product.getQuantity() > 1) { %>
79+
<br> &#163;<%= Integer.parseInt(product.getProduct().getPrice()) * product.getQuantity() %> <span style="color: black">Total price</span>
80+
<% } %>
81+
</span>
82+
<br>
83+
<br>
84+
<br>
85+
<center class="row edit_delete">
86+
<form action="CartServlet" method="POST">
87+
<div class="row g-3">
88+
<div class="col-auto">
89+
<input type="text" name="quantity" placeholder="Quantity" value="<%= product.getQuantity() %>" class="form-control" size="3">
90+
</div>
91+
<div class="col-auto">
92+
<button type="submit" class="btn btn-outline-success" id="bt">
93+
UPDATE <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-check2-circle" viewBox="0 0 16 16">
94+
<path d="M2.5 8a5.5 5.5 0 0 1 8.25-4.764.5.5 0 0 0 .5-.866A6.5 6.5 0 1 0 14.5 8a.5.5 0 0 0-1 0 5.5 5.5 0 1 1-11 0z"/>
95+
<path d="M15.354 3.354a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l7-7z"/>
96+
</svg>
97+
</button>
98+
</div>
99+
<input type="hidden" name="action" value="UPDATE_QUANTITY">
100+
<input type="hidden" name="id" value="<%= product.getId() %>">
101+
</div>
102+
</form>
103+
</center>
104+
</div>
105+
<div class="col-md-1" align="right">
106+
<form action="CartServlet" method="POST">
107+
<a href="" style="text-decoration: none;" onclick="this.closest('form').submit();return false;">
108+
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="red" class="bi bi-trash danger" viewBox="0 0 16 16">
109+
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"/>
110+
<path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"/>
111+
</svg>
112+
</a>
113+
<input type="hidden" name="action" value="REMOVE_FROM_CART">
114+
<input type="hidden" name="id" value="<%= product.getId() %>">
115+
</form>
116+
</div>
117+
</div>
118+
</div>
119+
<% } %>
120+
<h4 class="category" align="center">
121+
Total Price <span class="price">&#163;<%= total_price %></span>
122+
</h4>
123+
<h4 class="category" align="center">
124+
You have <span class="price"><%= total_items %></span> total item(s) in the cart
125+
</h4>
126+
<h4 align="center">
127+
<form action="CartServlet" method="POST">
128+
<a href="" style="text-decoration: none;" onclick="this.closest('form').submit();return false;">
129+
<button class="btn btn-primary btn-lg">CHECK OUT</button>
130+
</a>
131+
<input type="hidden" name="action" value="CHECKOUT">
132+
<input type="hidden" name="id" value="6">
133+
<input type="hidden" name="total_price" value="<%= total_price %>">
134+
<input type="hidden" name="total_items" value="<%= total_items %>">
135+
</form>
136+
</h4>
137+
<% } else { %>
138+
<center class="head">
139+
<br>
140+
<br>
141+
<br>
142+
<h3>You do not have any item in your cart</h3>
143+
<a href="index.jsp"><button class="btn btn-primary btn-lg">GO TO MARKET</button></a>
144+
</center>
145+
<% } %>
146+
<% } else { %>
147+
<center class="head">
148+
<br>
149+
<br>
150+
<br>
151+
<h3>You do not have any item in your cart</h3>
152+
<a href="index.jsp"><button class="btn btn-primary btn-lg">GO TO MARKET</button></a>
153+
</center>
154+
<% } %>
155+
</div>
156+
</div>
157+
<div class="col-1"></div>
158+
</div>
159+
</div>
160+
</div>
161+
</div>
162+
<jsp:include page="footer.jsp" />
163+
</html>

build/web/META-INF/MANIFEST.MF

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Manifest-Version: 1.0
2+

build/web/WEB-INF/classes/.netbeans_automatic_build

Whitespace-only changes.

build/web/WEB-INF/classes/.netbeans_update_resources

Whitespace-only changes.
1.1 KB
Binary file not shown.
7.63 KB
Binary file not shown.
Binary file not shown.
266 Bytes
Binary file not shown.
1.93 KB
Binary file not shown.

0 commit comments

Comments
 (0)