Skip to content
Permalink
Browse files
app restored
  • Loading branch information
Roshan Koshy Thomas committed Aug 24, 2022
0 parents commit 7e3c4d63b26e1931a9111b92c379a6cfd69f9fe3
Show file tree
Hide file tree
Showing 104 changed files with 19,141 additions and 0 deletions.
BIN +6 KB .DS_Store
Binary file not shown.
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-14">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v9.0">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Computer-for-you-WAA-12186042</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
<filteredResources>
<filter>
<id>0</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="WebContent"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>
@@ -0,0 +1,12 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=14
org.eclipse.jdt.core.compiler.compliance=14
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=14
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">



<wb-module deploy-name="e-cart-0.0.1-SNAPSHOT">



<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>



<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>



<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>



<property name="java-output-path" value="/e-cart/build/classes"/>
<property name="context-root" value="Computer-for-you-WAA-12186042"/>



</wb-module>



</project-modules>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="Apache Tomcat v9.0"/>
<fixed facet="wst.jsdt.web"/>
<fixed facet="java"/>
<fixed facet="jst.web"/>
<installed facet="java" version="14"/>
<installed facet="jst.web" version="4.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>
@@ -0,0 +1 @@
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
@@ -0,0 +1 @@
Window
@@ -0,0 +1,2 @@
disabled=06target
eclipse.preferences.version=1
Binary file not shown.
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Class-Path:

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" id="WebApp_ID" version="4.0">
<display-name>computer-for-you-12186042</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
@@ -0,0 +1,67 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>admin page</title>

<!-- font awesome cdn link -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">

<!-- custom css file link -->
<link rel="stylesheet" href="./css/admin.css">

</head>
<body>



<div class="container">

<div class="admin-product-form-container">

<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-data">
<h3>add a new product</h3>
<input type="text" placeholder="enter product name" name="product_name" class="box">
<input type="number" placeholder="enter product price" name="product_price" class="box">
<input type="file" accept="image/png, image/jpeg, image/jpg" name="product_image" class="box">
<input type="submit" class="btn" name="add_product" value="add product">
</form>

</div>

<?php

$select = mysqli_query($conn, "SELECT * FROM products");

?>
<div class="product-display">
<table class="product-display-table">
<thead>
<tr>
<th>product image</th>
<th>product name</th>
<th>product price</th>
<th>action</th>
</tr>
</thead>
<?php while($row = mysqli_fetch_assoc($select)){ ?>
<tr>
<td><img src="uploaded_img/<?php echo $row['image']; ?>" height="100" alt=""></td>
<td><?php echo $row['name']; ?></td>
<td>$<?php echo $row['price']; ?>/-</td>
<td>
<a href="admin_update.php?edit=<?php echo $row['id']; ?>" class="btn"> <i class="fas fa-edit"></i> edit </a>
<a href="admin_page.php?delete=<?php echo $row['id']; ?>" class="btn"> <i class="fas fa-trash"></i> delete </a>
</td>
</tr>
<?php } ?>
</table>
</div>

</div>


</body>
</html>
@@ -0,0 +1,105 @@
<%@page import="cfy.connection.DbCon"%>
<%@page import="cfy.dao.ProductDao"%>
<%@page import="cfy.model.*"%>
<%@page import="java.util.*"%>
<%@page import="java.text.DecimalFormat"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%
DecimalFormat dcf = new DecimalFormat("#.##");
request.setAttribute("dcf", dcf);
User auth = (User) request.getSession().getAttribute("auth");
if (auth != null) {
request.setAttribute("person", auth);
}
ArrayList<Cart> cart_list = (ArrayList<Cart>) session.getAttribute("cart-list");
List<Cart> cartProduct = null;
if (cart_list != null) {
ProductDao pDao = new ProductDao(DbCon.getConnection());
cartProduct = pDao.getCartProducts(cart_list);
double total = pDao.getTotalCartPrice(cart_list);
request.setAttribute("total", total);
request.setAttribute("cart_list", cart_list);
}
%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/includes/head.jsp"%>
<title>E-Commerce Cart</title>
<style type="text/css">
.table tbody td {
vertical-align: middle;
}
.btn-incre, .btn-decre {
box-shadow: none;
font-size: 25px;
}
</style>
</head>
<body>
<%@include file="/includes/navbar.jsp"%>




<div class="container my-3">

<div class="d-flex py-3">
<h3>Total Price: $ ${(total>0)?dcf.format(total):0}</h3>
<a class="mx-3 btn btn-primary" href="checkout.jsp">Check Out</a>
</div>
<table class="table table-light">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Category</th>
<th scope="col">Price</th>
<th scope="col">Buy Now</th>
<th scope="col">Cancel</th>
<th scope="col">Cancel</th>
</tr>

</thead>
<tbody>
<%
if (cart_list != null) {
for (Cart c : cartProduct) {
%>
<tr>
<td><%=c.getName()%></td>
<td><%=c.getCategory()%></td>
<td><%=dcf.format(c.getPrice())%></td>
<td>
<form action="order-now" method="post" class="form-inline">
<input type="hidden" name="id" value="<%=c.getId()%>"
class="form-input">
<div class="form-group d-flex justify-content-between">
<a class="btn bnt-sm btn-incre"
href="quantity-inc-dec?action=inc&id=<%=c.getId()%>"><i
class="fas fa-plus-square"></i></a> <input type="text"
name="quantity" class="form-control"
value="<%=c.getQuantity()%>" readonly> <a
class="btn btn-sm btn-decre"
href="quantity-inc-dec?action=dec&id=<%=c.getId()%>"><i
class="fas fa-minus-square"></i></a>
</div>
<button type="submit" class="btn btn-primary btn-sm">Buy</button>
</form>
</td>
<td><a href="remove-from-cart?id=<%=c.getId()%>"
class="btn btn-sm btn-danger">Remove</a></td>
</tr>

<%
}
}
%>
</tbody>
</table>
</div>

<%@include file="/includes/footer.jsp"%>
</body>
</html>

0 comments on commit 7e3c4d6

Please sign in to comment.