Create code files for an e-commerce website that sells physical copies of old and new video games
Question:
Create code files for an e-commerce website that sells physical copies of old and new video games and allows users to download games to their PC. Also create a admin page for the website that will change status of the users order from pending to shipped and allows the user-admin to add to the inventory in the database. Use HTML, CSS, and PHP to construct the website using the descriptions below.
Create code for all the php files below read thoroughly:
- AddInventory.php: This php will connect to the quantityonhand.php this will allow user-admin to increase the number of the current inventory of the Products in the database
- Admin.php: This php will display the order information from the order table. We will then click UpdateOrderStatus which will process the code from UpdateOrderStatus.php changing the user order from pending to shipped in the database. On this php we will also have a navbar have a section that says inventory when clicked it takes user-admin to ViewInventory.php page.
- AdminLogin.html will be taking the email and password that is recorded in the UserAdmin table and once entered they will be taken to the admin.php
- Login.php will be connected to the UserAdmin table which will link the email and password in adminlogin.html it will take the email and password from the the table
- Cart.php will contain the item selected from the Product.php, here it will display the selected product have a remove function that will utilize code from the Clear_cart.php to remove item from cart, allow the user to increases the quantity of the item, displays the price of items in the cart. Then on the right hand side of the cart.php it will show the the subtotal of the items in the cart add the shipping and handling cost to subtotal and output the total cost. After this the user will click checkout and be taken to the Checkout.php
- Checkout.php will ask the user for their Name, EmailAddress, ShippingAddress, CreditCardNumber, and CreditCardExperationDate. At the bottom of this text input it will display the subtotal cost, shipping and handling charge, and total cost of order. Once filling in the information there will be a button to click on called place order. Once place order is clicked the user's Name, EmailAddress, ShippingAddress, CreditCardNumber, and CreditCardExperationDate will be saved in the user table, their order in will be placed in the order table and the details of that order in the orderdetail table. If all information is placed in all 3 tables then the user upon clicking place order will be taken to the ThankYou.php
- Clear_cart.php will link to the remove function in cart.php allowing users to remove items from the cart.php
- Index.html(homepage) will be the main home page for the website, I will contain the banner image, a navigation bar containing links to the other php files, these being home, products, about us, contact, administrator, download, cart, and login. In the navbar there will be a section named administrator, when clicked it will take us to the AdminLogin.html.
- Product.php will display the information from the Games table along with the quantity for each of those items recorded in the QuantityonHand tables. The user can select the number they would like to have for each item, and a button to add the item selected to cart.php
- Style.css will diplomacy the layout design of the website.
- ThankYou.php will be displayed after the user clicks place order. Here it will display the message "Thank You For Your Order"
- UpDateOrderStatus.php will update the information in order from pending to shipped in the orders table.
- ViewInventory.php here will display the information from the inventory table allowing the user-admin to see what items are in-stock from the inventory database.
Use the GameStop.com as reference for design look
user the following database SQL to program the website:
/*Create the Database*/
CREATE DATABASE OldNewGenGamingCenter;
/*Use the Database*/
USE OldNewGenGamingCenter;
/*Create Table for users*/
CREATE TABLE Users (
UserID INT AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(255) NOT NULL UNIQUE,
EmailAddress VARCHAR(255),
ShippingAddress VARCHAR (255),
CreditCardNumber VARCHAR(255),
CreditCardExpirationDate DATE
);
/*Create Table for user-admin*/
CREATE TABLE UserAdmin (
UserAdminID INT AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(255) NOT NULL UNIQUE,
Address VARCHAR(255),
PhoneNumber VARCHAR(255),
EmailAddress VARCHAR (255),
Password VARCHAR (255)
);
CREATE TABLE Games (
VideoGameID INT PRIMARY KEY,
VideoGameName VARCHAR(255),
PictureLink VARCHAR(255);
Genre VARCHAR(255),
EsrbRating VARCHAR(255),
GameAge VARCHAR(255),
Price DECIMAL(10,2)
);
CREATE TABLE QuantityonHand(
VideoGameID INT,
Quantity INT,
PRIMARY KEY (VideoGameID),
FOREIGN KEY (VideoGameID) REFERENCES Games(VideoGameID)
);
CREATE TABLE Orders (
OrderID INT AUTO_INCREMENT PRIMARY KEY,
CustomerID INT,
TotalWeight DECIMAL (10,2),
TotalPrice DECIMAL (10, 2),
ShippingCharge DECIMAL (10,2),
Date DATE,
Status VARCHAR (50),
FOREIGN KEY (CustomerID) REFERENCES Users (UserID)
);
CREATE TABLE OrderDetails (
OrderID INT, VideoGameID INT, Quantity INT,
Price DECIMAL (10, 2),
PRIMARY KEY (OrderID, VideoGameID),
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
FOREIGN KEY (VideoGameID) REFERENCES Games(VideoGameID)
);
CREATE TABLE Inventory (
VideoGameID INT PRIMARY KEY,
Name VARCHAR(255),
Description VARCHAR(255),
QuantityOnHand INT,
FOREIGN KEY (VideoGameID) REFERENCES Games (VideoGameID)
);
CREATE TABLE ShippingHandlingCharges (
WeightBracket INT PRIMARY KEY,
Charge DECIMAL (10,2)
);
INSERT INTO `games` (`VideoGameID`, `VideoGameName`, `PictureLink`, `Genre`, `EsrbRating`, `GameAge`, `Price`) VALUES (1001, 'Devil May Cry 5', 'DevilMayCry5.jpg', 'hack & slash and action-adventure', 'M Rating', '5y', '39.99'), (1002, 'fate samurai remnant', 'FateSamuraiRemnant.jpeg', 'action RPG', 'Teen Rating', '1y', '59.99'), (1003, 'wii sports resort', 'WiiSportsResort.jpg', 'sports simulation', 'E', '15y', '30.99'), (1004, 'Ghost of Tsushima Director's Cut', 'Ghost.jpg', 'Action-adventure, Stealth', 'M', '4y', '59.99'), (1005, 'ben 10 omniverse 2 3ds', 'ben10.jpg', 'Beat 'em up, Runner', 'E10+', '11y', '34.99');
INSERT INTO `inventory` (`VideoGameID`, `Name`, `Description`, `PartNumber`, `QuantityOnHand`) VALUES
(1001, 'Devil May Cry 5', 'hack & slash and action-adventure', 1001, 150), (1002, 'fate samurai remnant', 'action RPG', 1002, 60), (1003, 'wii sports resort', 'sports simulation', 1003, 25), (1004, 'Ghost of Tsushima Director's Cut', 'In the late 13th century, the Mongol empire has laid waste to entire nations along their campaign to conquer the east.', 1004, 250), (1005, 'ben 10 omniverse 2 3ds', ''Beat 'em up, Runner', 1005, 75);
INSERT INTO `useradmin`(`UserAdminID`, `Name`, `Address`, `PhoneNumber`, `EmailAddress`, `Password`) VALUES (1, 'Shadow', '2454 W 90th place', '312-859-9134', '..w@mygmail.com', '7dlh1420S@')
INSERT INTO `quantityonhand` (`VideoGameID`, `Quantity`) VALUES (1001, 150), (1002, 60), (1003, 25), (1004, 250), (1005, 75);
INSERT INTO `shippinghandlingcharges` (`WeightBracket`, `Charge`) VALUES
(1, 5.00), (2, 5.25), (3, 5.45), (4, 5.65), (5, 5.85), (6, 6.00);
Accounting Information Systems
ISBN: 978-0133428537
13th edition
Authors: Marshall B. Romney, Paul J. Steinbart