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 select 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.
The practice is deliberately "hard" given the short deadline, and I do not expect everyone necessarily to perfect it to perfection. This will be taken into list in the marking.
Marking Scheme:
[A 5%] ability to write working Html code (i.e. Code that creates prosperous markup on a browser window).**
[B 5%] ability to post an Html web-page on a server such that it is visible on the World Wide Web. ***
[C 10%] ability to make an Html form reveal with a Php script.**
[D 10%] ability to make a Php script interact with a MySql database.**
[E 40%] Functionality (the extent to which the software's execution complies with - or exceeds- the customary specification).
[F 10%] User friendliness (the extent to which the browser displays are clear and self-explanatory).
[G 10%] Presentation. (This could contain accepted use of images, colour, text fonts, style-sheets and dynamic Html functions.)
[H 10%] Clarity and readability of coding and associated documentation (e.g. Use of comments, accepted indentation etc.)
Notes:
*If you wish to use distinct 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 plainly by demonstrating a basic knowledge of Html, Php and MySql. The remaining categories are marked in a "continuous" fashion (i.e. Any estimate of marks between zero and the weighting value can be awarded).
*** In the event of server failure (or other irresolvable technical difficulties) class 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 commercial Museum.
This development 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 initial screen, not including the customary frames used in the Museum website. Most of the article in the top and lowest frames is non functional and is included for completeness, this also helps demonstrate the dynamic Html that in case,granted secondary pilotage structures.
This screen shown the main body of the shop facts and the "shopping basket" functions at the button. This page provides passage to:
1) A perfect list of the online "catalogue";
2) A subset of the list listed by goods category;
3) A subset of the list based on user defined crusade terms;
4) More detailed facts about an item;
5) ability to add items to a session based "shopping basket";
6) ability 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, description 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 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 system the following options are available under the goods 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 perfect the transaction, they will be asked to sign in, if the user has an list he/she can login and continue with the transaction.
If the user has not got an list he/she must register before being able to finish buying anything.
Adding Items To The Shopping Basket:
Items can be added to shopping basket whether from any summary listing, or an item description 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 detail page, which is displayed by clicking the items code shown on the left of the summary display.
Each item detail page also includes a "buy" button as well as the other shopping basket tools" These are on the summary page but at the lowest so need scrolling
The database supports two forms of items, "books", as shown above, which contain facts definite to reading materials, and "goods" which only contain basic item information, item code, title and price.
Where images ae not available a change 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 perfect the transaction, they will be asked to sign in, if the user has an list he/she can login and continue with the transaction
If the user has not got an list he/she must register before being able to finish buying anything. Here we see the ensue of an invalid endeavor to register a new account. The user is given a text description of the error and the suspect 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 menagerial account, the username is "system" and the password is "god" Note there is currently no way to convert 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 class identified by its goods code or originate a new goods date item. The application includes a definite set of validation criteria as shown in the next image. Items are listed alpha numerically, left to right.
Here we see the ensue of a failed data entry execution denoted by crosses to denote invalid or missing entries for given fields, likewise a tick indicates the field is valid.
It is potential to have a blank literal, entry - eg, if there are no images these boxes should be left clear.
The demand mark is to double check the intention to leave blank in certain cases
This screen shows that theadministrator has chosen to delete a user's list 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 initial (welcome) screen, not including 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 passage to:
1) A perfect list of the online "catalogue";
2) A subset of the list listed by goods category;
3) ability to order the list listed by goods code, price or title, in acceding order;
4) A subset of the list based on user defined crusade terms;
5) More detailed facts about an item;
6) ability 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) originate 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 definite 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) NoTable: categories:
Comments: goods metadata Field Type Null Default
id int(3) No
name varchar(50) No
etype int(1) No 2
Keywords varchar(100) NoTable: customers:
Comments: customer 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 NullTable: orderdata:
Comments: customer 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 NullTable: orders:
Comments: customer order refferance data. Field Type Null Default
uname varchar(15) No 0
ordernumber int(5) No
status int(1) No 0
date date Yes NullTable: 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 NoTable: products:
Table comments: customary goods 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: customary goods 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.00Table: pwl:
Comments: User password/access information. Field Type Null Default
uname varchar(15) No
upass varchar(100) No 5d2e19393cc5ef67
created timestamp(14) Yes NullTable: syshelpindex:
Comments: system help branch index.Field Type Null Default
cat int(2) No 0
subject varchar(30) NoTable: syshelpinfo:
Comments: system 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 commercial Museum. This development 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 associated to the website. All generic files and ancillary elements are stored at this level. (3.74mb 263 files)
- continfo.php - contact and ordering facts (Php 4.01kb).
- create_db.sql - Database buildings (Sql dump 5.82kb).
- credit-cards.gif - Usable prestige 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% discount for members observation (image 111.kb).
- discount1.gif - Advertising a 10% discount for members (image 53.6kb).
- avicon.ico - Depiction of a straightforward waterwheel (icon 318b).
- index.htm - practice website 404 error page (Html 1.76kb).
- new_ani.gif - An animation of the word 'new' (image 1.66kb).
- offers.gif - visible of the text 'check these special 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 photo 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 - visible 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 - visible 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 ensue (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 contain 161b).
- contact0.gif - visible of the text 'contacts' (image 976b).
- db_lib.php - common database passage functions and utilities (Php 25.2kb .
- disclaimer.gif - Animalised flashing visible 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 - visible of the text 'feedback' (image 990b).
- focus.js - Script to place focus on a incommunicable popup window (javascript 165b).
- home0.gif - visible of the text 'general' (image 967b).
- iiv.gif - Transparent visible of the Investing in Volunteers logo (image 2.63kb).
- iiv.fpg - Opaque visible of the Investing in Volunteers logo (image 4.49kb).
- index.htm - practice website 404 error page (Html 1.76kb).
- info.gif - Transparent museum logo with contact facts (image 2.31).
- jfooter.js - Code to dynamically originate 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 visible of the text 'all materials on this website are link ware' (image 1.56).
- map0.gif - visible of the text 'sitemap' (image 989b).
- members0.gif - visible of the text 'members' (image 984b).
- misc.inc - Freeola Sql service passage authentication data (Php contain 144b).
- news0.gif - visible of the text 'news letter' (image 947b).
- l_misc.inc - Sql authentication data for my server (Php contain 144b).
- nopic.jpg - observation of there being no available photo (image 5.40).
- order0.gif - visible of the text 'Mail Order' (image 0.96kb).
- phone.gif - Transparent visible of a red telephone (image 281kb).
- print.css - Screen formatting descriptions (style sheet 3.65kb).
- registered.gif - Opaque visible of the registered museums logo (image 428b).
- registered3.gif - Transparent visible of the registered museums logo (image 2.80b).
- resize.js - Code to dynamically convert a window to the image size (javascript 1.05kb).
- search.gif - visible of the text search' (image 108b).
- sqldumper.inc - Code to dynamically originate an Sql dump file (Php contain
- stop.gif - Transparent visible 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 pilotage buildings (javascript 3.34kb)
- wandlemuseu.gif - Transparent enthralling visible of the text 'The Wandle commercial Museum' (image 42.3kb).
- webbo.gif - Transparent visible of webbo's head (image 1.16kb).
- webo1.gif - Transparent visible of webbo (image 3.81kb).
- wimlogo.gif - Opaque visible 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 associated to example Sql commands.
../htdocs/order.htg/shop.htg/ This directory contains all the source files associated 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 - originate 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 operation bottoms associated to goods facts (include 2.43kb).
- catalog.php - Generates users view of the customary list interface (Php 6.63kb).
- checkout.php - Script for updating the goods and order database (Php 5.02kb).
- help.php - Display users view of the system 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 customary controls (Php5.73kb).
- pagefoot.inc - Code block to originate the ending Html page buildings (Include 801b).
- pagehead.inc - Code block to originate the beginning Html page buildings (Include 854b).
- product_detail.php - Code block for displaying detailed goods 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 associated 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 originate 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 visible of a cartoon cross (Image 118b).
- fine.gif - Transparent visible fo a cartoon tick (Image 126b).
- help.php - Display administrators view of the system help desk interface (Php 6.22kb).
- index.php - menagerial passage to database modification functionality (Php 12.5kb)
- invoice.php - originate display customer invoices for printing (Php 5.33kb).
- mysqlsend.php - Enable user to execute practice Sql instructions (Php 4.59)
- newcat_form.inc - .Display new the class name error correction (Include 773b).
- newname_table.inc - Display new goods entry form (Include 438b).
- newproduct.php - Update/delete data from the list database (Php 781kb).
- newtypeform.inc - Display new class entry form (Include 563kb).
- note.inc - Display system 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 goods facts Errors (Include 1.99).
- productinfo.inc - Display goods input form (Include 3.68).
- productup.inc - Display editable goods facts (Include 7.02kb).
- quest.gif - Transparent visible fo a demand mark (Image 114b).
- stock.php - menagerial 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).