November 15, 2011

A straightforward E-Shop Application Using Php and MySql

Specification:

Write a straightforward E-shop application using Php and MySql*. This may be a bookshop, music shop, clothes store, or whatever else you wish. There should be a "user" interface to allow customers to opt and purchase items (don't worry about the payment side of things). Ideally there should also be a password-protected "owner" interface, to allow the E-shop operator to view/edit stock and pending orders.

Basic Stamp 2 Module

The practice is deliberately "hard" given the short deadline, and I do not expect everybody necessarily to unblemished it to perfection. This will be taken into catalogue in the marking.

Marking Scheme:

[A 5%] capability to write working Html code (i.e. Code that creates thriving markup on a browser window).**

[B 5%] capability to post an Html web-page on a server such that it is graphic on the World Wide Web. ***

[C 10%] capability to make an Html form delineate with a Php script.**

[D 10%] capability to make a Php script interact with a MySql database.**

[E 40%] Functionality (the extent to which the software's carrying out complies with - or exceeds- the primary specification).

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

[G 10%] Presentation. (This could comprise accepted use of images, colour, text fonts, style-sheets and dynamic Html functions.)

[H 10%] Clarity and readability of coding and related documentation (e.g. Use of comments, accepted indentation etc.)

Notes:

*If you wish to use separate web-based technologies (e.g. Asp, Jsp, Pearl) please do so. However, please do Not use high-level software packages which need no programming skills (e.g. "wysiwyg" Html editors), as these rather defeat the purpose of taking this module.

** In categories A to D, the marks are awarded in a "binary" manner (i.e. The trainee receives whether the whole weighting mark or else zero). Thus 30% can be obtained naturally by demonstrating a basic knowledge of Html, Php and MySql. The remaining categories are marked in a "continuous" fashion (i.e. Any whole of marks in the middle of zero and the weighting value can be awarded).

*** In the event of server failure (or other irresolvable technical difficulties) type B will be removed and the weightings of the other categories scaled accordingly.

Solution:

My electronic shop application is for the sale of books and other assorted item sold by the Wandle market Museum.

This amelioration is a logical extension to an existing static website. The data and basic layout of my application are derived from this pre-existing work.

The Main Interface:

the first screen, not together with the primary frames used in the Museum website. Most of the article in the top and bottom frames is non functional and is included for completeness, this also helps demonstrate the dynamic Html that in case,granted secondary navigation structures.

This screen shown the main body of the shop facts and the "shopping basket" functions at the button. This page provides entrance to:

1) A unblemished list of the online "catalogue";

2) A subset of the catalogue listed by stock category;

3) A subset of the catalogue based on user defined quest terms;

4) More detailed facts about an item;

5) capability to add items to a session based "shopping basket";

6) capability you registered users to write book reviews;

If a user is new to the application, he/she is shown the message "Welcome. Already a customer? Click here to sign in", otherwise they see their user name and a button to the right named "My account" which allows them to edit their facts . This facts is stored in a client side cookie that is retained for 30 minutes.

About The summary Display:

The summary of items shows the item code, title, price, narrative and stock level of all items. The display also includes two additional other possibilities, 1 items that are out of stock are show in red text. 2 items that are not sold straight through the online shop are "grayed-out" in both these cases the "buy" button is removed from all displays for a given item.

The Basket:

The Basket Initially there is not shopping basket until the user adds an item, until such time clicking on the "view basket button shows a default screen.

When an item is added, its quantity is set to one by default, this can whether be increased by adding the same item to the basket again or by clicking in the increment button on the basket display screen shown here. Once a basket is created and the user enters the law the following options are available under the stock description:

1) Clear cart;

2) Continue shopping;

3) Checkout;

If the item is de-incremented to zero then it is removed from the basket.

The basket is based on Php sessions and unlike the users identity, which is reined for 30 minutes, will not persist after the instance on the browser is closed.

If the user is unknown to the application when he/she attempts to unblemished the transaction, they will be asked to sign in, if the user has an catalogue he/she can login and continue with the transaction.

If the user has not got an catalogue he/she must register before being able to end buying anything.

Adding Items To The Shopping Basket:

Items can be added to shopping basket whether from any summary listing, or an item narrative page.

A summary page displays basic item facts in a tabular format whithout images, such as the one shown right by clicking on the "buy" button at the left on the item line.

This can also be done from the item information page, which is displayed by clicking the items code shown on the left of the summary display.

Each item information page also includes a "buy" button as well as the other shopping basket tools" These are on the summary page but at the bottom so need scrolling

The database supports two forms of items, "books", as shown above, which comprise facts specific to reading materials, and "goods" which only comprise basic item information, item code, title and price.

Where images ae not available a exchange is automatically instituted until the administrator specifies a real image.

About The User:

If the user is unknown to the application when he/she attempts to unblemished the transaction, they will be asked to sign in, if the user has an catalogue he/she can login and continue with the transaction

If the user has not got an catalogue he/she must register before being able to end buying anything. Here we see the corollary of an invalid effort to register a new account. The user is given a text narrative of the error and the surmise entities are feature in sequence until all anomalies have been resolved.

After the user has registered he/she is asked to print the form for his/her reference. Then is logged in and can bypass authentication when buying.

The application has been hard coded with one executive account, the username is "system" and the password is "god" Note there is currently no way to turn this.

The supervision display allows the users to:

1) define new item types;

2) Edit and delete users;

3) Add, edit and delete categories;

This screen allows the user to whether edit an existing data item in a given type identified by its stock code or generate a new stock date item. The application includes a specific set of validation criteria as shown in the next image. Items are listed alpha numerically, left to right.

Here we see the corollary of a failed data entry carrying out denoted by crosses to denote invalid or missing entries for given fields, likewise a tick indicates the field is valid.
It is inherent to have a blank exact entry - eg, if there are no images these boxes should be left clear.

The question mark is to double check the intention to leave blank in definite cases

This screen shows that theadministrator has chosen to delete a user's catalogue from the database - the edit and delete functions use the same display except that the edit function does not show the delete warning

The interface The image shows the first (welcome) screen, not together with the frames used in the Museum website.

This screen shown the main body of the shop facts and the "shopping basket" functions at top and the button. This page provides entrance to:

1) A unblemished list of the online "catalogue";

2) A subset of the catalogue listed by stock category;

3) capability to order the catalogue listed by stock code, price or title, in acceding order;

4) A subset of the catalogue based on user defined quest terms;

5) More detailed facts about an item;

6) capability to add items to a session based "shopping basket";

If a user is new to the application, he/she is shown the message "Welcome. Already a customer? Click here to sign in", otherwise they see their user name and a button to the right named "My account" which allows them to edit their information. This facts is stored in a client side cookie that is retained for 30 minutes.

The supervision display allows the users to:

1) Define new item types;

2) Edit and delete users;

3) Add, edit and delete categories;

4) Add, edit, move and delete products;

5) Edit and add help information;

6) generate and restore dumps of tables;

Database Dictionary:

A data dictionary defines the common terms, codes, and conventions used. Listed below are the database lookup tables required for the shop database application.

Table: bookinfo:

Comments: Book specific metadata. Field Type Null Default
code varchar(5) No No
author varchar(50) No Unknown
publisher varchar(100) No Unknown
isbn varchar(15) No None
illustrations varchar(15) Yes Yes - gray
date date Yes Null
dimensions varchar(100) No Unknown
summary text No
type varchar(16) No

Table: categories:
Comments: stock metadata Field Type Null Default
id int(3) No
name varchar(50) No
etype int(1) No 2
Keywords varchar(100) No

Table: customers:
Comments: buyer billing information. Field Type Null Default
uname varchar(15) No
first_name varchar(25) No
last_name varchar(25) No
phone varchar(20) No
email varchar(50) No
zip varchar(10) No
city varchar(50) No
country_code int(2) No 0
bill_address varchar(90) No
changed timestamp(14) Yes Null

Table: orderdata:
Comments: buyer order facts Field Type Null Default
ordernumber int(5) No 0
itemcode varchar(5) title varchar(100) No
quantity int(3) No 0
total float No 0
status int(11) No 0
stamp timestamp(14) Yes Null

Table: orders:
Comments: buyer order refferance data. Field Type Null Default
uname varchar(15) No 0
ordernumber int(5) No
status int(1) No 0
date date Yes Null

Table: reviews:
Comments: user book reviews and rations. Field Type Null Default
uname varchar(15) No 0
type int(1) No
rating int(1) No 0
stamp timestamp(14) Yes Null
review text No

Table: products:
Table comments: primary stock data. Field Type Null Default
code varchar(5) No
category_id int(3) No 1
title varchar(100) No
keywords varchar(255) No
small_image varchar(15) No nopic.jpg
large_image varchar(15) No nopic.jpg
description text No
price decimal(5,2) No 00.00
date_modified date No 0000-00-00
status int(1) No 1
Table: purchase:
Comments: primary stock data. Field Type Null Default
code varchar(5) No
date timestamp(14) Yes Null
stock int(3) No> 15
cost decimal(5,2) No 00.00

Table: pwl:
Comments: User password/access information. Field Type Null Default
uname varchar(15) No
upass varchar(100) No 5d2e19393cc5ef67
created timestamp(14) Yes Null

Table: syshelpindex:
Comments: law help field index.Field Type Null Default
cat int(2) No 0
subject varchar(30) No

Table: syshelpinfo:
Comments: law help information.Field Type Null Default
cat int(3) No 0
title varchar(30) No
info text No
image varchar(20) No
type int(1) No 0

File Structure:
The electronic shop application is for the sale of books and other assorted item sold by the Wandle market Museum. This amelioration is a logical extension to an existing static website.

The application's files are stored in 9 subdirectories. These are as follows:
../htdocs/order.htg/ This is the root directory of the web application, it contains all resources related to the website. All generic files and ancillary elements are stored at this level. (3.74mb 263 files)

  • continfo.php - taste and ordering facts (Php 4.01kb).
  • create_db.sql - Database buildings (Sql dump 5.82kb).
  • credit-cards.gif - Usable reputation cards types (image 2.02kb).
  • cvc.jpg - Clarifying where to find a Cvc value (image 6.0kb).
  • dictionary.txt - Mysql Data Dictionary (text 2.85kb).
  • discount.gif - Animalised 10% reduction for members observation (image 111.kb).
  • discount1.gif - Advertising a 10% reduction for members (image 53.6kb).
  • avicon.ico - Depiction of a straightforward waterwheel (icon 318b).
  • index.htm - institution website 404 error page (Html 1.76kb).
  • new_ani.gif - An animation of the word 'new' (image 1.66kb).
  • offers.gif - graphic of the text 'check these extra offers' (image 1.77).
  • pleasenote.gif - A burning animation of the text 'please note' (image 14.7kb).
  • reset.gif - Graphical input form reset button (image 1.28kb).
  • shop.gif - Small picture of the real museum shop (image7.31kb).
  • submit.gif - Graphical input form submit button (image 1.18kb).

../htdocs/order.htg/common.htg/ This directory contains all common utility scripts and other resources that the web application depends upon.(185kb 50 files)
  • about0.gif - graphic of the text 'home page' (image 0.98kb).
  • alart.gif - Animalised rotating red warning bulb (image 2.04kb).
  • alert.gif - A human skull with the word 'warning' (3.39kb).
  • archive0.gif - graphic of the text 'archive' (image 970b).
  • backg.jpg - Wallpaper drawing depicting a watermill as a watermark (image 13.6kb).
  • background.jpg - Wallpaper featuring a marble stone type corollary (image 4.59kb).
  • basic.css - Website formatting and formatting descriptions (style sheet 7.53kb).
  • brics.gif - Animalised exposed circuits in a wall behind the wallpaper (image 7.46kb).
  • caurtion.gif - Animalised rotating caution road sign (image 6.53kb).
  • cnote.htm - Website copyright and attribution facts (Html 1.95kb).
  • constants.inc - Application global data values (Php comprise 161b).
  • contact0.gif - graphic of the text 'contacts' (image 976b).
  • db_lib.php - common database entrance functions and utilities (Php 25.2kb .
  • disclaimer.gif - Animalised flashing graphic of the text 'disclaimer' (image 4.57kb).
  • email2.gif - Drawing of an mail out box over a globe (image 1.12kb).
  • fax.gif - Drawing of a basic fax motor (image 231b).
  • feed0.gif - graphic of the text 'feedback' (image 990b).
  • focus.js - Script to place focus on a hidden popup window (javascript 165b).
  • home0.gif - graphic of the text 'general' (image 967b).
  • iiv.gif - Transparent graphic of the Investing in Volunteers logo (image 2.63kb).
  • iiv.fpg - Opaque graphic of the Investing in Volunteers logo (image 4.49kb).
  • index.htm - institution website 404 error page (Html 1.76kb).
  • info.gif - Transparent museum logo with taste facts (image 2.31).
  • jfooter.js - Code to dynamically generate page footer facts (javascript 2.41kb)
  • letter.gif - Drawing of two straightforward letters (image 698b).
  • linksb.jpg - A spider in a web on a small depiction of a browser (image 1.18.kb).
  • linkware.gif - Transparent graphic of the text 'all materials on this website are link ware' (image 1.56).
  • map0.gif - graphic of the text 'sitemap' (image 989b).
  • members0.gif - graphic of the text 'members' (image 984b).
  • misc.inc - Freeola Sql assistance entrance authentication data (Php comprise 144b).
  • news0.gif - graphic of the text 'news letter' (image 947b).
  • l_misc.inc - Sql authentication data for my server (Php comprise 144b).
  • nopic.jpg - observation of there being no available photo (image 5.40).
  • order0.gif - graphic of the text 'Mail Order' (image 0.96kb).
  • phone.gif - Transparent graphic of a red telephone (image 281kb).
  • print.css - Screen formatting descriptions (style sheet 3.65kb).
  • registered.gif - Opaque graphic of the registered museums logo (image 428b).
  • registered3.gif - Transparent graphic of the registered museums logo (image 2.80b).
  • resize.js - Code to dynamically turn a window to the image size (javascript 1.05kb).
  • search.gif - graphic of the text search' (image 108b).
  • sqldumper.inc - Code to dynamically generate an Sql dump file (Php comprise
  • stop.gif - Transparent graphic of a red hand (image 2.64kb).
  • time.js - Code to dynamically display a countdown timer (javascript 591b).
  • toc.js - Code to dynamically display a navigation buildings (javascript 3.34kb)
  • wandlemuseu.gif - Transparent challenging graphic of the text 'The Wandle market Museum' (image 42.3kb).
  • webbo.gif - Transparent graphic of webbo's head (image 1.16kb).
  • webo1.gif - Transparent graphic of webbo (image 3.81kb).
  • wimlogo.gif - Opaque graphic of the museum's waterwheel logo (image 417b)

../htdocs/order.htg/data_backup/ This directory is used to store Sql dump files..(242kb 3 files)
../htdocs/order.htg/help/ This directory is used to store graphics for help desk database. (336kb 26 files)
../htdocs/order.htg/images.htg/ This directory is used to store graphics for the shop database. (2.41mb 91 files)

../htdocs/order.htg/mysqlsnips This directory contains a set of text files related to example Sql commands.

../htdocs/order.htg/shop.htg/ This directory contains all the source files related to the communal areas of the shop database utility scripts and other template resources that the web application depends upon. (85.1kb 20 files)

  • basket.php - generate and maintains a session based shopping basked (Php 9.29bk).
  • book_detail.php - Code block for displaying detailed facts for a prime book (Php 2.41kb).
  • buttons.inc - Code block for displaying action bottoms related to stock facts (include 2.43kb).
  • catalog.php - Generates users view of the primary catalogue interface (Php 6.63kb).
  • checkout.php - Script for updating the stock and order database (Php 5.02kb).
  • help.php - Display users view of the law help desk interface (Php 6.71kb).
  • login.php - Script for user and database supervision login operations (Php 7.91).
  • old login.php - Obsolete login script (Php8.99kb).
  • orderend.php - Code block for displaying shopping basket buttons (Php 1.36kb).
  • ordertop.php - Code block for displaying shot facts and primary controls (Php5.73kb).
  • pagefoot.inc - Code block to generate the ending Html page buildings (Include 801b).
  • pagehead.inc - Code block to generate the starting Html page buildings (Include 854b).
  • product_detail.php - Code block for displaying detailed stock facts (Php 1.15kb).
  • product_list.php - Code block for displaying summary item facts (Php 3.07kb).
  • product_show.php - Code block that displays alternative summary facts (Php3.16).
  • prompt.inc - Code block for displaying a message to the user (include 897b).
  • signin.php - Display logon straightforward login screen.(Php 3.08kb).
  • terms.php - Display terms and conditions (Php 5.83kb).
  • terms2.php - Display terms and conditions far a child window (Php 5.75kb).
  • thankyou.php - Display final confirmation screen (Php 3.28kb).

../htdocs/order.htg/update.htg/ This directory contains all the source files related to the supervision areas of the shop database and other utility scripts. (240kb 34 files)
  • addcat.php - Add additional item categories to the database (Php 2.18kb).
  • addproduct.php - Add additional items to the database (Php 6.30kb).
  • admin.php - Website article supervision interface (Php 65.9kb).
  • backup.php - Generates database dump files (Php 5.21kb).
  • berror_form.inc - Current errors for new book database items (Include Php 3.0kb).
  • bookinfo.inc - Code block for book data entry (Include 6.64kb).
  • bookup.inc - Display editable book facts (Include 10.2kb).
  • buttons.inc - Code block to generate editing command buttons (Include 4.41kb).
  • change.php - Source code for update confirmation messages (Php14.4kb).
  • edithelp.php - Enables editing and creation of help desk facts (Php14.0kb).
  • entbuttons.inc - Code block for data entry forms command buttons (Include 1.21kb).
  • error.gif - Transparent graphic of a cartoon cross (Image 118b).
  • fine.gif - Transparent graphic fo a cartoon tick (Image 126b).
  • help.php - Display administrators view of the law help desk interface (Php 6.22kb).
  • index.php - executive entrance to database modification functionality (Php 12.5kb)
  • invoice.php - generate display buyer invoices for printing (Php 5.33kb).
  • mysqlsend.php - Enable user to execute institution Sql instructions (Php 4.59)
  • newcat_form.inc - .Display new the type name error revision (Include 773b).
  • newname_table.inc - Display new stock entry form (Include 438b).
  • newproduct.php - Update/delete data from the catalogue database (Php 781kb).
  • newtypeform.inc - Display new type entry form (Include 563kb).
  • note.inc - Display law facts messages (Include 524b).
  • oldorders.php - Display summary data for concluded orders (Php 3.22kb).
  • orders.php - Display prime open order facts (Php 7.77kb).
  • perror_form.inc - Display stock facts Errors (Include 1.99).
  • productinfo.inc - Display stock input form (Include 3.68).
  • productup.inc - Display editable stock facts (Include 7.02kb).
  • quest.gif - Transparent graphic fo a question mark (Image 114b).
  • stock.php - executive stock data summary (Php 9.07).
  • upload.jpg - Graphical upload button (image 1.84kb).
  • upload.php - Copy images to the images.htg directory on the server (Php 5.40kb).
  • userorders.php - Display user order history (Php 2.36kb).
  • users.php - Display editable user login facts (Php10.04kb).

A straightforward E-Shop Application Using Php and MySql

Home Made Yogurt Ice Cream Porter Cable Compressor Troubleshooting Air Pressure Sensor