A Simple E-Shop Application Using PHP and MySQL

[ad_1]

SPECIFICATION:

Write a easy E-shop utility utilizing PHP and MySQL*. This can be a bookshop, music store, garments retailer, or anything you would like. There must be a "person" interface to permit prospects to pick and buy gadgets (don't fret in regards to the fee aspect of issues). Ideally there must also be a password-protected "proprietor" interface, to permit the E-shop operator to view/edit inventory and pending orders.

The train is intentionally "exhausting" given the brief deadline, and I don't count on everybody essentially to finish it to perfection. This will probably be taken under consideration within the marking.

MARKING SCHEME:

[A 5%] Capacity to put in writing working HTML code (i.e. code that creates profitable markup on a browser window).**

[B 5%] Capacity to publish an HTML web-page on a server such that it's seen on the World Vast Internet. ***

[C 10%] Capacity to make an HTML kind talk with a PHP script.**

[D 10%] Capacity to make a PHP script work together with a MySQL database.**

[E 40%] Performance (the extent to which the software program's operation complies with - or exceeds- the unique specification).

[F 10%] Consumer friendliness (the extent to which the browser shows are clear and self-explanatory).

[G 10%] Presentation. (This might embody acceptable use of photographs, color, textual content fonts, style-sheets and dynamic HTML capabilities.)

[H 10%] Readability and readability of coding and associated documentation (e.g. use of feedback, acceptable indentation and so forth.)

NOTES:

*If you happen to want to use completely different web-based applied sciences (e.g. ASP, JSP, Pearl) please achieve this. Nevertheless, please do NOT use high-level software program packages which require no programming expertise (e.g. "wysiwyg" HTML editors), as these reasonably defeat the aim of taking this module.

** In classes A to D, the marks are awarded in a "binary" method (i.e. the coed receives both your complete weighting mark or else zero). Thus 30% might be obtained just by demonstrating a fundamental information of HTML, PHP and MySQL. The remaining classes are marked in a "steady" style (i.e. any variety of marks between zero and the weighting worth might be awarded).

*** Within the occasion of server failure (or different irresolvable technical difficulties) Class B will probably be eliminated and the weightings of the opposite classes scaled accordingly.

SOLUTION:

My digital store utility is for the sale of books and different assorted merchandise bought by the Wandle Industrial Museum.

This growth is a logical extension to an present static web site. The information and fundamental format of my utility are derived from this pre-existing work.

THE MAIN INTERFACE:

the preliminary display screen, not together with the unique frames used within the Museum web site. A lot of the content material within the high and backside frames is non purposeful and is included for completeness, this additionally helps exhibit the dynamic HTML that supplied secondary navigation buildings.

This display screen proven the principle physique of the store data and the "procuring basket" capabilities on the button. This web page offers entry to:

1) An entire checklist of the web "catalogue";

2) A subset of listed by product class;

three) A subset of primarily based on person outlined search phrases;

four) Extra detailed details about an merchandise;

5) Capacity so as to add gadgets to a session primarily based "procuring basket";

6) Capacity you registered customers to put in writing e book critiques;

If a person is new to the appliance, he/she is proven the message "Welcome. Already a buyer? Click on right here to check in", in any other case they see their person identify and a button to the best named "My account" which permits them to edit their data . This data is saved in a consumer aspect cookie that's retained for 30 minutes.

ABOUT THE SUMMARY DISPLAY:

The abstract of things exhibits the merchandise code, title, value, description and inventory stage of all gadgets. The show additionally consists of two extra different prospects, 1 gadgets which can be out of inventory are present in purple textual content. 2 gadgets that aren't bought by way of the web store are "grayed-out" in each these instances the "purchase" button is faraway from all shows for a given merchandise.

THE BASKET:

The Basket Initially there's not procuring basket till the person provides an merchandise, till such time clicking on the "view basket button exhibits a default display screen.

When an merchandise is added, its amount is about to 1 by default, this could both be elevated by including the identical merchandise to the basket once more or by clicking within the increment button on the basket show display screen proven right here. As soon as a basket is created and the person enters the system the next choices can be found beneath the product description:

1) Clear cart;

2) Proceed procuring;

three) Checkout;

If the merchandise is de-incremented to zero then it's faraway from the basket.

The basket is predicated on PHP periods and in contrast to the customers identification, which is reined for 30 minutes, is not going to persist after the occasion on the browser is closed.

If the person is unknown to the appliance when he/she makes an attempt to finish the transaction, they are going to be requested to check in, if the person has an account he/she will be able to login and proceed with the transaction.

If the person has not received an account he/she should register earlier than with the ability to end shopping for something.

ADDING ITEMS TO THE SHOPPING BASKET:

Gadgets might be added to procuring basket both from any abstract itemizing, or an merchandise description web page.

A abstract web page shows fundamental merchandise data in a tabular format whithout photographs, such because the one proven proper by clicking on the "purchase" button on the left on the merchandise line.

This can be executed from the merchandise element web page, which is displayed by clicking the gadgets code proven on the left of the abstract show.

Every merchandise element web page additionally features a "purchase" button in addition to the opposite procuring basket instruments" These are on the abstract web page however on the backside so require scrolling

The database helps two types of gadgets, "books", as proven above, which embody data particular to studying supplies, and "items" which solely embody fundamental merchandise data, merchandise code, title and value.

The place photographs ae not obtainable a substitute is routinely instituted till the administrator specifies an actual picture.

ABOUT THE USER:

If the person is unknown to the appliance when he/she makes an attempt to finish the transaction, they are going to be requested to check in, if the person has an account he/she will be able to login and proceed with the transaction

If the person has not received an account he/she should register earlier than with the ability to end shopping for something. Right here we see the impact of an invalid try and register a brand new account. The person is given a textual content description of the error and the suspect entities are spotlight in sequence till all anomalies have been resolved.

After the person has registered he/she is requested to print the shape for his/her reference. Then is logged in and might bypass authentication when shopping for.

The appliance has been exhausting coded with one administrative account, the username is "system" and the password is "god" Notice there's at present no option to change this.

The administration show permits the customers to:

1) outline new merchandise sorts;

2) Edit and delete customers;

three) Add, edit and delete classes;

This display screen permits the person to both edit an present information merchandise in a given class recognized by its product code or create a brand new product date merchandise. The appliance features a particular set of validation standards as proven within the subsequent picture. Gadgets are listed alpha numerically, left to proper.

Right here we see the results of a failed information entry operation denoted by crosses to indicate invalid or lacking entries for given fields, likewise a tick signifies the sphere is legitimate.

It's doable to have a clean appropriate entry - eg, if there aren't any photographs these containers must be left clear.

The query mark is to double verify the intention to depart clean in sure instances

This display screen exhibits that theadministrator has chosen to delete a person's account from the database - the edit and delete capabilities use the identical show besides that the edit perform doesn't present the delete warning

The interface The picture exhibits the preliminary (welcome) display screen, not together with the frames used within the Museum web site.

This display screen proven the principle physique of the store data and the "procuring basket" capabilities at high and the button. This web page offers entry to:

1) An entire checklist of the web "catalogue";

2) A subset of listed by product class;

three) Capacity to order listed by product code, value or title, in acceding order;

four) A subset of primarily based on person outlined search phrases;

5) Extra detailed details about an merchandise;

6) Capacity so as to add gadgets to a session primarily based "procuring basket";

If a person is new to the appliance, he/she is proven the message "Welcome. Already a buyer? Click on right here to check in", in any other case they see their person identify and a button to the best named "My account" which permits them to edit their data. This data is saved in a consumer aspect cookie that's retained for 30 minutes.

The administration show permits the customers to:

1) Outline new merchandise sorts;

2) Edit and delete customers;

three) Add, edit and delete classes;

four) Add, edit, transfer and delete merchandise;

5) Edit and add assist data;

6) Create and restore dumps of tables;

DATABASE DICTIONARY:

An information dictionary defines the frequent phrases, codes, and conventions used. Listed under are the database lookup tables required for the store database utility.

Desk: bookinfo: 
Feedback: Ebook particular metadata. Discipline Sort Null Default
code varchar(5) No No
creator varchar(50) No Unknown
writer varchar(100) No Unknown
isbn varchar(15) No None
illustrations varchar(15) Sure Sure - grey
date date Sure NULL
dimensions varchar(100) No Unknown
abstract textual content No
sort varchar(16) No

Desk: classes:
Feedback: Product metadata Discipline Sort Null Default
id int(three) No
identify varchar(50) No
etype int(1) No 2
Key phrases varchar(100) No

Desk: prospects:
Feedback: Buyer billing data. Discipline Sort Null Default
uname varchar(15) No
first_name varchar(25) No
last_name varchar(25) No
cellphone varchar(20) No
e mail varchar(50) No
zip varchar(10) No
metropolis varchar(50) No
country_code int(2) No zero
bill_address varchar(90) No
modified timestamp(14) Sure NULL

Desk: orderdata:
Feedback: Buyer order data Discipline Sort Null Default
ordernumber int(5) No zero
itemcode varchar(5) title varchar(100) No
amount int(three) No zero
complete float No zero
standing int(11) No zero
stamp timestamp(14) Sure NULL

Desk: orders:
Feedback: buyer order refferance information. Discipline Sort Null Default
uname varchar(15) No zero
ordernumber int(5) No
standing int(1) No zero
date date Sure NULL

Desk: critiques:
Feedback: person e book critiques and rations. Discipline Sort Null Default
uname varchar(15) No zero
sort int(1) No
ranking int(1) No zero
stamp timestamp(14) Sure NULL
assessment textual content No

Desk: merchandise:
Desk feedback: Major product information. Discipline Sort Null Default
code varchar(5) No
category_id int(three) No 1
title varchar(100) No
key phrases varchar(255) No
small_image varchar(15) No nopic.jpg
large_image varchar(15) No nopic.jpg
description textual content No
value decimal(5,2) No 00.00
date_modified date No 0000-00-00
standing int(1) No 1
Desk: buy:
Feedback: Major product information. Discipline Sort Null Default
code varchar(5) No
date timestamp(14) Sure NULL
inventory int(three) No> 15
value decimal(5,2) No 00.00

Desk: pwl:
Feedback: Consumer password/entry data. Discipline Sort Null Default
uname varchar(15) No
upass varchar(100) No 5d2e19393cc5ef67
created timestamp(14) Sure NULL

Desk: syshelpindex:
Feedback: System assist topic index.Discipline Sort Null Default
cat int(2) No zero
topic varchar(30) No

Desk: syshelpinfo:
Feedback: system assist data.Discipline Sort Null Default
cat int(three) No zero
title varchar(30) No
data textual content No
picture varchar(20) No
sort int(1) No zero

FILE STRUCTURE:

The digital store utility is for the sale of books and different assorted merchandise bought by the Wandle Industrial Museum. This growth is a logical extension to an present static web site.

The appliance's information are saved in 9 subdirectories. These are as follows:

../htdocs/order.htg/ That is the foundation listing of the online utility, it incorporates all sources associated to the web site. All generic information and ancillary parts are saved at this stage. (three.74mb 263 information)

  • continfo.php - contact and ordering data (PHP four.01kb).
  • create_db.sql - Database construction (SQL dump 5.82kb).
  • credit-cards.gif - Usable bank cards sorts (picture 2.02kb).
  • cvc.jpg - Clarifying the place to discover a CVC worth (picture 6.0kb).
  • dictionary.txt - MYSQL Knowledge Dictionary (textual content 2.85kb).
  • low cost.gif - Animalised 10% low cost for members discover (picture 111.kb).
  • discount1.gif - Promoting a 10% low cost for members (picture 53.6kb).
  • avicon.ico - Depiction of a easy waterwheel (icon 318b).
  • index.htm - Customized web site 404 error web page (HTML 1.76kb).
  • new_ani.gif - An animation of the phrase 'new' (picture 1.66kb).
  • presents.gif - Graphic of the textual content 'verify these particular presents' (picture 1.77).
  • pleasenote.gif - A burning animation of the textual content 'please word' (picture 14.7kb).
  • reset.gif - Graphical enter kind reset button (picture 1.28kb).
  • store.gif - Small of the actual museum store (image7.31kb).
  • submit.gif - Graphical enter kind submit button (picture 1.18kb).

../htdocs/order.htg/frequent.htg/ This listing incorporates all frequent utility scripts and different sources that the online utility relies upon upon.(185kb 50 information)

  • about0.gif - Graphic of the textual content 'house web page' (picture zero.98kb).
  • alart.gif - Animalised rotating purple warning bulb (picture 2.04kb).
  • alert.gif - A human cranium with the phrase 'warning' (three.39kb).
  • archive0.gif - Graphic of the textual content 'archive' (picture 970b).
  • backg.jpg - Wallpaper drawing depicting a watermill as a watermark (picture 13.6kb).
  • background.jpg - Wallpaper that includes a marble stone sort impact (picture four.59kb).
  • fundamental.css - Web site formatting and formatting descriptions (fashion sheet 7.53kb).
  • brics.gif - Animalised uncovered circuits in a wall behind the wallpaper (picture 7.46kb).
  • caurtion.gif - Animalised rotating warning highway signal (picture 6.53kb).
  • cnote.htm - Web site copyright and attribution data (HTML 1.95kb).
  • constants.inc - Utility world information values (PHP embody 161b).
  • contact0.gif - Graphic of the textual content 'contacts' (picture 976b).
  • db_lib.php - Widespread database entry capabilities and utilities (PHP 25.2kb .
  • disclaimer.gif - Animalised flashing graphic of the textual content 'disclaimer' (picture four.57kb).
  • email2.gif - Drawing of an mail out field over a globe (picture 1.12kb).
  • fax.gif - Drawing of a fundamental fax machine (picture 231b).
  • feed0.gif - Graphic of the textual content 'suggestions' (picture 990b).
  • focus.js - Script to position give attention to a hidden popup window (javascript 165b).
  • home0.gif - Graphic of the textual content 'basic' (picture 967b).
  • iiv.gif - Clear graphic of the Investing in Volunteers enterprise brand (picture 2.63kb).
  • iiv.fpg - Opaque graphic of the Investing in Volunteers enterprise brand (picture four.49kb).
  • index.htm - Customized web site 404 error web page (HTML 1.76kb).
  • data.gif - Clear museum enterprise brand with contact data (picture 2.31).
  • jfooter.js - Code to dynamically generate web page footer data (javascript 2.41kb)
  • letter.gif - Drawing of two easy letters (picture 698b).
  • linksb.jpg - A spider in an internet on a small depiction of a browser (picture 1.18.kb).
  • linkware.gif - Clear graphic of the textual content 'all supplies on this web site are hyperlink ware' (picture 1.56).
  • map0.gif - Graphic of the textual content 'sitemap' (picture 989b).
  • members0.gif - Graphic of the textual content 'members' (picture 984b).
  • misc.inc - Freeola SQL service entry authentication information (PHP embody 144b).
  • news0.gif - Graphic of the textual content 'information letter' (picture 947b).
  • l_misc.inc - SQL authentication information for my server (PHP embody 144b).
  • nopic.jpg - Discover of there being no obtainable picture (picture 5.40).
  • order0.gif - Graphic of the textual content 'Mail Order' (picture zero.96kb).
  • cellphone.gif - Clear graphic of a purple phone (picture 281kb).
  • print.css - Display formatting descriptions (fashion sheet three.65kb).
  • registered.gif - Opaque graphic of the registered museums enterprise brand (picture 428b).
  • registered3.gif - Clear graphic of the registered museums enterprise brand (picture 2.80b).
  • resize.js - Code to dynamically change a window to the picture measurement (javascript 1.05kb).
  • search.gif - Graphic of the textual content search' (picture 108b).
  • sqldumper.inc - Code to dynamically create an SQL dump file (PHP embody
  • cease.gif - Clear graphic of a purple hand (picture 2.64kb).
  • time.js - Code to dynamically show a countdown timer (javascript 591b).
  • toc.js - Code to dynamically show a navigation construction (javascript three.34kb)
  • wandlemuseu.gif - Clear animated graphic of the textual content 'The Wandle Industrial Museum' (picture 42.3kb).
  • webbo.gif - Clear graphic of webbo's head (picture 1.16kb).
  • webo1.gif - Clear graphic of webbo (picture three.81kb).
  • wimlogo.gif - Opaque graphic of the museum's waterwheel enterprise brand (picture 417b)

../htdocs/order.htg/data_backup/ This listing is used to retailer SQL dump information..(242kb three information)

../htdocs/order.htg/assist/ This listing is used to retailer graphics for assist desk database. (336kb 26 information)

../htdocs/order.htg/photographs.htg/ This listing is used to retailer graphics for the store database. (2.41mb 91 information)

../htdocs/order.htg/mysqlsnips This listing incorporates a set of textual content information associated to instance SQL instructions.

../htdocs/order.htg/store.htg/ This listing incorporates all of the supply information associated to the general public areas of the store database utility scripts and different template sources that the online utility relies upon upon. (85.1kb 20 information)

  • basket.php - Create and maintains a session primarily based procuring basked (PHP 9.29bk).
  • book_detail.php - Code block for displaying detailed data for a specific e book (PHP 2.41kb).
  • buttons.inc - Code block for displaying motion bottoms associated to product data (embody 2.43kb).
  • catalog.php - Generates customers view of the first catalogue interface (PHP 6.63kb).
  • checkout.php - Script for updating the product and order database (PHP 5.02kb).
  • assist.php - Show customers view of the system assist desk interface (PHP 6.71kb).
  • login.php - Script for person and database administration login operations (PHP 7.91).
  • outdated login.php - Out of date login script (PHP8.99kb).
  • orderend.php - Code block for displaying procuring basket buttons (PHP 1.36kb).
  • ordertop.php - Code block for displaying shot data and first controls (PHP5.73kb).
  • pagefoot.inc - Code block to create the ending HTML web page construction (Embody 801b).
  • pagehead.inc - Code block to create the beginning HTML web page construction (Embody 854b).
  • product_detail.php - Code block for displaying detailed product data (PHP 1.15kb).
  • product_list.php - Code block for displaying abstract merchandise data (PHP three.07kb).
  • product_show.php - Code block that shows various abstract data (PHP3.16).
  • immediate.inc - Code block for displaying a message to the person (embody 897b).
  • signin.php - Show logon easy login display screen.(PHP three.08kb).
  • phrases.php - Show phrases and situations (PHP 5.83kb).
  • terms2.php - Show phrases and situations far a baby window (PHP 5.75kb).
  • thankyou.php - Show remaining affirmation display screen (PHP three.28kb).

../htdocs/order.htg/replace.htg/ This listing incorporates all of the supply information associated to the administration areas of the store database and different utility scripts. (240kb 34 information)

  • addcat.php - Add extra merchandise classes to the database (PHP 2.18kb).
  • addproduct.php - Add extra gadgets to the database (PHP 6.30kb).
  • admin.php - Web site content material administration interface (PHP 65.9kb).
  • backup.php - Generates database dump information (PHP 5.21kb).
  • berror_form.inc - Present errors for brand spanking new e book database gadgets (Embody PHP three.0kb).
  • bookinfo.inc - Code block for e book information entry (Embody 6.64kb).
  • bookup.inc - Show editable e book data (Embody 10.2kb).
  • buttons.inc - Code block to create enhancing command buttons (Embody four.41kb).
  • change.php - Supply code for replace affirmation messages (PHP14.4kb).
  • edithelp.php - Allows enhancing and creation of assist desk data (PHP14.0kb).
  • entbuttons.inc - Code block for information entry kinds command buttons (Embody 1.21kb).
  • error.gif - Clear graphic of a cartoon cross (Picture 118b).
  • positive.gif - Clear graphic fo a cartoon tick (Picture 126b).
  • assist.php - Show directors view of the system assist desk interface (PHP 6.22kb).
  • index.php - Administrative entry to database modification performance (PHP 12.5kb)
  • bill.php - Generate show buyer invoices for printing (PHP 5.33kb).
  • mysqlsend.php - Allow person to execute customized SQL directions (PHP four.59)
  • newcat_form.inc - .Show new the class identify error correction (Embody 773b).
  • newname_table.inc - Show new product entry kind (Embody 438b).
  • newproduct.php - Replace/delete information from the stock database (PHP 781kb).
  • newtypeform.inc - Show new class entry kind (Embody 563kb).
  • word.inc - Show system data messages (Embody 524b).
  • oldorders.php - Show abstract information for closed orders (PHP three.22kb).
  • orders.php - Show chosen open order data (PHP 7.77kb).
  • perror_form.inc - Show product data Errors (Embody 1.99).
  • productinfo.inc - Show product enter kind (Embody three.68).
  • productup.inc - Show editable product data (Embody 7.02kb).
  • quest.gif - Clear graphic fo a query mark (Picture 114b).
  • inventory.php - Administrative inventory information abstract (PHP 9.07).
  • add.jpg - Graphical add button (picture 1.84kb).
  • add.php - Copy photographs to the photographs.htg listing on the server (PHP 5.40kb).
  • userorders.php - Show person order historical past (PHP 2.36kb).
  • customers.php - Show editable person login data (PHP10.04kb).

GOOD THINGS COME TO THOSE WITH AN E-MAIL

Leave yours here for a chance to win a FREE logo design at the end of each month!
Spam FREE, I promise.