Skip to content
Permalink
Browse files
Initial commit
  • Loading branch information
ravurid committed Aug 25, 2022
1 parent be29709 commit ea189a713f8c05751fc4ac6624e23a4850e8ba33
Show file tree
Hide file tree
Showing 94 changed files with 7,949 additions and 0 deletions.
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/web/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/web" relative="/" />
</webroots>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Tomcat 9.0.38" level="application_server_libraries" />
<orderEntry type="library" name="mysql-connector-java-5.1.45-bin" level="project" />
<orderEntry type="library" name="java-json-schema" level="project" />
</component>
</module>
@@ -0,0 +1,191 @@
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 19, 2022 at 03:02 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.3

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `computerforyou`
--

-- --------------------------------------------------------

--
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
`id` int(11) NOT NULL,
`customerid` int(11) NOT NULL DEFAULT 1,
`customername` varchar(255) NOT NULL DEFAULT 'john smith',
`total_price` double NOT NULL,
`status` int(11) NOT NULL DEFAULT 0,
`payment_status` tinyint(1) NOT NULL DEFAULT 1,
`deletestatus` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `orders`
--

INSERT INTO `orders` (`id`, `customerid`, `customername`, `total_price`, `status`, `payment_status`, `deletestatus`) VALUES
(1, 1, 'john smith', 230, 1, 0, 0),
(2, 3, 'willium', 185, 0, 0, 0);

-- --------------------------------------------------------

--
-- Table structure for table `order_details`
--

CREATE TABLE `order_details` (
`id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`product_name` varchar(255) NOT NULL DEFAULT 'Product Name',
`quantity` int(11) NOT NULL,
`sub_total` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `order_details`
--

INSERT INTO `order_details` (`id`, `product_id`, `product_name`, `quantity`, `sub_total`) VALUES
(1, 1, 'Product 1', 2, 90),
(2, 2, 'Product 2', 3, 135),
(3, 1, 'Product 1', 1, 45),
(4, 2, 'Product 2', 3, 135);

-- --------------------------------------------------------

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL DEFAULT 'Product ',
`price` float NOT NULL DEFAULT 45,
`description` longtext NOT NULL DEFAULT 'Product Description',
`quantity` int(11) NOT NULL DEFAULT 100,
`image` longtext NOT NULL DEFAULT 'default.png',
`deletestatus` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `products`
--

INSERT INTO `products` (`id`, `name`, `price`, `description`, `quantity`, `image`, `deletestatus`) VALUES
(1, 'Product 1', 45, 'Product Description 1', 1050, 'default.png', 0),
(2, 'Product 2', 45, 'Product Description 2', 765, 'image_2.png', 0),
(3, 'product 3', 125, 'Product Description pro item 3', 0, 'default.png', 1),
(4, 'product 4', 455, 'Product Description pro item 4', 0, 'default.png', 1),
(5, 'product 50', 850, 'Product Description pro item 50', 0, 'default.png', 1),
(6, 'Product 6', 120, 'Product Description pro item 6', 0, 'default.png', 1),
(7, 'product 70', 1500, 'Product Description pro item 70', 0, 'image_5.png', 0),
(8, 'Product 8', 290, 'Product Description pro item 8', 0, 'default.png', 1),
(9, 'test item name 10', 1200, 'test description test description 10', 0, 'image_4.png', 1),
(10, 'test item name 100', 1300, 'test description test description 100', 0, 'image_5.png', 1),
(11, 'test item name 20', 1250, 'test description test description 20', 0, 'image_3.png', 1);

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`role` int(11) NOT NULL DEFAULT 1,
`deletestatus` tinyint(1) NOT NULL DEFAULT 0,
`approvestatus` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `name`, `username`, `password`, `role`, `deletestatus`, `approvestatus`) VALUES
(1, 'john smith', 'customer1@gmail.com', 'test1234', 1, 0, 1),
(2, 'admin', 'admin@gmail.com', 'test1234', 100, 0, 1),
(3, 'willium', 'customer2@gmail.com', 'test123', 1, 0, 1),
(4, 'customer 3', 'custosmer33@gmail.com', 'test1234', 1, 0, 1),
(5, 'customer 6', 'customfer90@gmail.com', 'test1234', 1, 0, 1);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
ADD PRIMARY KEY (`id`);

--
-- Indexes for table `order_details`
--
ALTER TABLE `order_details`
ADD PRIMARY KEY (`id`);

--
-- Indexes for table `products`
--
ALTER TABLE `products`
ADD PRIMARY KEY (`id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `order_details`
--
ALTER TABLE `order_details`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">



<!-- login -->
<servlet>
<servlet-name>Login</servlet-name>
<servlet-class>Login</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Login</servlet-name>
<url-pattern>/Login</url-pattern>
</servlet-mapping>


<!-- RegisterClient -->
<servlet>
<servlet-name>RegisterClient</servlet-name>
<servlet-class>RegisterClient</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>RegisterClient</servlet-name>
<url-pattern>/RegisterClient</url-pattern>
</servlet-mapping>

<!-- PlaceOrder -->
<servlet>
<servlet-name>PlaceOrder</servlet-name>
<servlet-class>PlaceOrder</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>PlaceOrder</servlet-name>
<url-pattern>/PlaceOrder</url-pattern>
</servlet-mapping>


<!-- Products -->
<servlet>
<servlet-name>Products</servlet-name>
<servlet-class>Products</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Products</servlet-name>
<url-pattern>/Products</url-pattern>
</servlet-mapping>

<!-- Products -->
<servlet>
<servlet-name>Orders</servlet-name>
<servlet-class>Orders</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Orders</servlet-name>
<url-pattern>/Orders</url-pattern>
</servlet-mapping>


</web-app>
@@ -0,0 +1,97 @@


<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.util.Iterator"%>
<%@ page import="java.util.List"%>
<%@ page import="java.sql.*" %>








<%
Object objectt = session.getAttribute("user_role");
if(objectt == null){
String site = new String("/login.jsp");
response.setStatus(response.SC_MOVED_TEMPORARILY);
response.setHeader("Location", site);
}
else if((Integer) objectt == 100){
}
else if ((Integer) objectt == 1) {
String site = new String("/customer/home.jsp");
response.setStatus(response.SC_MOVED_TEMPORARILY);
response.setHeader("Location", site);
}
%>


<html>
<head>
<title>course-project</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="/resources/css/bootstrap.min.css">
<script src="/resources/js/jquery.min.js"></script>
<script src="/resources/js/bootstrap.min.js"></script>
<script src="/resources/js/main.js"></script>
<link rel="stylesheet" href="/resources/css/main.css">
</head>
<body>

<div class="navbar navbar-inverse navbar-fixed-left navbar-fixed-left-admin">
<div class="logo">
<a class="navbar-brand" href="#">${sessionScope.name}</a>
<p class="username">.</p>
<%-- <p class="username" > <%= username %> </p> --%>
</div>
<ul class="nav navbar-nav" >
<li class="activeNav"><a href="/admin/admin_home.jsp">Home</a></li>
<li class=""><a href="/Products"> Products</a></li>
<li class=""><a href="/Orders"> Orders</a></li>
<li ><a href="/destroysession.jsp">LOG OUT</a></li>
</ul>
</div>


<div class="container">
<br>
<div class="table-wrapper">
<div class="table-title table-title-admin">
<div class="row">
<div class="col-sm-6">
<h2><b>Home</b></h2>
</div>
</div>
</div>
<div class="row ">
<div class="col">
<h1>


<%
Object objecttt = session.getAttribute("name");
if(objecttt == null){
}else{
%>

<%= objecttt %> wellcome to Online Store :)

<%
}
%>
</h1>
</div>
</div>
</div>
</div>



</body>
</html>

0 comments on commit ea189a7

Please sign in to comment.