A simple application E-Shop with PHP and MySQL

2:57 PM
A simple application E-Shop with PHP and MySQL -

SPECIFICATION:

Write a simple application E-shop with PHP and MySQL *. This can be a library, music store, clothing store, or whatever you want. There should be a "user interface" to allow customers to select and purchase items (do not worry about the payment side of things). Ideally there should also be a password protected "owner" interface, to allow the operator E-shop to view pending orders / stock and change.

The exercise is deliberately "tough", given the short-term, and I do not expect that all need to complete to perfection. This will be taken into account in the marking.

mark system:

[A 5%] Ability to write work HTML code (the code that creates markup success of a browser window). **

[B 5%] Ability to publish an HTML web page on a server so that it is visible on the World Wide Web. ***

[C 10%] Ability to make an HTML form to communicate with a PHP script. **

[D 10%] Ability to make a PHP script to interact with a MySQL database. **

[E 40%] Functionality (the extent to which the operation of the software conforms - or exceeds- original specifications).

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

[G 10%] Presentation. (This could include appropriate use of images, color, text fonts, style sheets and dynamic HTML functions.)

[H 10%] The clarity and readability of the code and documentation ( for example the use of comments, etc. appropriate indentation)

Notes:

* If you want to use different web-based technologies (such as ASP, JSP, Pearl) please do it. However, please do not use high-level software packages that require programming skills (such as "WYSIWYG" HTML editor), as these rather defeat the purpose of taking this form.

** In categories A to D, the signs are allocated in a "binary" (ie the student receives either the entire mark weighting or zero). So the 30% can be achieved simply by demonstrating a basic knowledge of HTML, PHP and MySQL. The remaining categories are marked in a "continuous" (that is to say any number of frames between zero and the weighting value can be assigned).

*** In case of a server failure (or other unsolvable technical difficulties) Category B will be removed and the weights of the other categories in scale accordingly.

SOLUTION:

My application electronics store is for the sale of books and other assorted item sold by the Wandle Industrial Museum.

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

The main interface:

The initial screen, not counting the original frames used in the Museum's website. Most of the content in the upper and lower frames is not functional and is included for completeness, this also helps demonstrate dynamic HTML code that has provided secondary navigation structures.

This screen shows the main body of the store information and functions of "shopping cart" to the button. This page provides access to:

1) The full list of "catalog" on-line;

2) A subset of the catalog listed by product category;

3) A subset of the catalog based on user-defined search terms;

4) More detailed information about an item;

5) Ability to add items to a basic session "shopping cart";

6) Capacity is registered users to write reviews of books;

If a user is new to the application, he / she will see the message "Welcome. Already a customer? Click here to access", otherwise they see their user name and a button to the right called " my account ", which allows them to edit their information. This information is stored in a client-side cookie that is maintained for 30 minutes.

About viewing SUMMARY:

The synthesis of the elements shows the level of object code, title, price, description and inventory of all items. The display also includes two additional further options, 1 items that are sold out are show in red. 2 items that are not sold through the online store are "gray-out" the "buy" button in both cases is removed from all the displays for a specific item.

BASKETBALL:

The carriage Initially there shopping basket until the user adds an item, until the time by clicking the "View button cart shows a default screen.

When you add an item, its quantity is set to a default one, this can be both increased with the addition of new the same item to the basket or by clicking the increment button on the screen basket shown here. once a basket has been created and the user enters the system are available under the product description of the following options:

1) Delete spending

;

2) Continue;

3) Checkout;

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

basket is based on sessions PHP and, unlike the identity of users, which is braked for. 30 minutes, not persist after the instance of the browser is closed.

If the user is not known to the application when he / she tries to complete the transaction, they will be asked to log in, if the user has an account he / she can login and continue with the operation.

If the user does not have his / her account must register before you can end up buying anything.

items to the shopping basket:

The elements can be added to the cart or from any summary list, or a description page.

A summary page displays basic element of information in a tabular format whithout images, like the one on the right by clicking on the "buy" button on the left on the voice line.

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

Each item detail page also includes a "buy" button, as well as other shopping basket instruments "These are the summary page, but basically so require scrolling

The database supports two types of voices, "books", as shown above, including specific information for reading materials, and "assets" which include only information basic product, item number, title and. price

where AE images a replacement is not available is automatically set up when the administrator specifies a real image

user :.

If the user is unknown to the application when he / she tries to complete the transaction, they will be asked to log in, if the user has an account he / she can login and continue with the operation

If the user does not have an account yet he / she must register before you can end up buying anything. Here we see the effect of an invalid attempt to register a new account. The user is given a text description and suspicious entities are culminating in sequence until all errors have been resolved.

After the user has recorded / she is asked to print out the form for his / her reference. Then he entered and I can bypass authentication at the time of purchase.

The application has been hard coded with an administrative account, the user name is "system" and the password is "God" Note there is currently no way to change this.

The display board allows users to:

1) define new types of elements;

2) Edit and delete users;

3) add, edit and delete categories;

This screen allows the user to modify both an existing data item in a specific category identified by its product code, or create a new item on the product. The application includes a specific set of validation criteria as shown in the next image. Items are listed in numerical alpha, from left to right.

Here we see the result of a failed input operation of the data indicated with crosses to indicate the invalid entries or missing for certain fields, also a check mark indicates that the field is valid.
E 'possible to have a correct entry - for example vacuum, if there are no images these boxes should be left clear.

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

This screen shows that theadministrator chose to remove a user account from the database - the edit and delete functions use the same display, except the edit function does not show the elimination of warning

interface image shows the home screen (welcome), excluding the frame used in the site Museum.

This screen shows the main body of the information store and the "shopping cart" function at the top and the button. This page provides access to:

1) The full list of "catalog" on-line;

2) A subset of the catalog listed by product category;

3) Ability to order a catalog listed by product code, price or title, in order to membership;

4) A subset of the catalog based on user-defined search terms;

5) More detailed information about an item;

6) Ability to add items to a basic session "shopping cart";

If a user is new to the application, he / she will see the message "Welcome. Already a customer? Click here to access", otherwise they see their user name and a button to the right called " my account ", which allows them to edit their information. This information is stored in a client-side cookie that is maintained for 30 minutes.

The display board allows users to:

1) define new types of elements;

2) Edit and delete users;

3) add, edit and delete categories;

4) Add, edit, move and delete products;

5) Change the information and add help;

6) Create and restore dumps of tables;

dictionary database:

A data dictionary defines common terms, codes and conventions used. Here are the search tables of the database required for the application of the store databases.

 Table: bookinfo: 
Comments: Book-specific metadata. Null default field type of
code varchar (5) No No
author varchar (50) No Unknown varchar
poster (100) No Unknown
ISBN varchar (15) No None
illustrations varchar (15) Yes Yes - gray
Yes NULL date
size varchar (100) No unknown
No text summary
varchar (16) no

Table: categories:
Comments: the product metadata Null default field type
id int (3) No
name varchar (50) No
etype int (1) No 2
Keywords varchar (100 ) n

Table: customer:
Comments: customer billing information. Null default field type
uname varchar (15) No
FIRST_NAME varchar (25) No
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 (0) No
changed timestamp (14) Yes NULL

Table: orderdata:
Comments: customer order field type Null default information
ORDERNUMBER int (5) No 0
itemcode varchar (5) title varchar (100) n
int amount (3) No 0
total float No 0
int status (11) No 0
timestamp stamp (14) NULL

Table: orders:
Comments: data customers refferance order. Null default field type
uname varchar (15) No 0
ORDERNUMBER int (5) No
int status (1) No 0
Yes NULL Date

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

Table: product:
comments Table: primary product data. Null default field type
code varchar (5) No
category_id int (3) No 1
title varchar (100) n
Keywords varchar (255) n
small_image varchar (15 ) No nopic.jpg
large_image varchar (15) No nopic.jpg
No description
price decimal (5.2) n 00:00
DATE_MODIFIED No date 0000-00-00
int status (1) No. 1
Table: purchase:
Comments: data of primary products. Null default field type
code varchar (5) No
timestamp Date (14) Yes NULL
stock int (3) n> 15
decimal cost (5.2) n 00:00

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

Table: syshelpindex:
Comments: Support system object index.Field default type Null
cat int (2) No 0
subject varchar (30) No

Table: syshelpinfo:
Comments: help system information.Field type null default
cat int (3) No 0
title varchar (30) No
No information text
image varchar (20) No
int (1) No 0

FILE STRUCTURE:
application is the electronic store for the sale of books and other assorted item sold by the Wandle industrial Museum. This development is a logical extension of an existing static website.

application files are stored in subdirectory 9. These are as follows:
../ htdocs / order.htg / This is the root of web application, which contains all the resources related to the website. All generic files and accessories elements are stored at this level. (3.74MB 263 files)

  • continfo.php - Ordering contacts and information (PHP 4.01kb).
  • create_db.sql - the database structure (SQL dump 5.82kb).
  • credit-cards.gif - used types of credit cards (image 2.02kb).
  • cvc.jpg - Clarify where to find a value of CVC (6.0kb image).
  • dictionary.txt - MySQL Data Dictionary (2.85kb text).
  • discount.gif - Animalised 10% discount for Members to note (111.kb image).
  • discount1.gif - Advertising a discount of 10% for members (53.6kb image).
  • avicon.ico - Representation of a simple water wheel (318B icon).
  • index.htm - Custom Error 404 page site (HTML 1.76kb).
  • new_ani.gif - An animation of the word 'new' (image 1.66kb).
  • offers.gif - graphic text 'control these specials' (picture 1.77).
  • pleasenote.gif - searing An animation of the text 'remembers' (image 14.7kb).
  • reset.gif - graphic reset input form button (image 1.28kb).
  • shop.gif - small photograph of the actual shop museum (image7.31kb).
  • submit.gif - the submit button graphic input module (image 1.18kb).
../ htdocs / order.htg / common.htg / This directory contains all common utility scripts , and other resources that the web application depends on. (185KB 50 files)
  • about0.gif - graphic text 'homepage' (image 0.98kb).
  • alart.gif - Animalised rotating red warning light bulb (image 2.04kb).
  • alert.gif - A human skull with the word 'warning' (3.39kb).
  • archive0.gif - graphic text (image 970b) 'archive'.
  • backg.jpg - design wallpaper depicting a water mill, as a watermark (image 13.6kb).
  • background.jpg - Wallpaper with a type of marble stone effect (image 4.59kb).
  • basic.css - Website formatting and formatting descriptions (of 7.53kb style sheet).
  • brics.gif - Animalised circuits exposed in a wall behind the wallpaper (image 7.46kb).
  • caurtion.gif - Animalised rotation caution sign on the road (image 6.53kb).
  • cnote.htm - Site copyright and attribution information (HTML 1.95kb).
  • constants.inc - Application of global data values ​​(PHP includes 161b).
  • contact0.gif - graphic text (976B image) 'contacts'.
  • db_lib.php - access to the common database functions and utilities (PHP 25.2kb
  • disclaimer.gif - .. Animalised blinking text 'disclaimer' (graphic image 4.57kb)
  • email2.gif -. Drawing of a mail box outside the post on a globe (image 1.12kb)
  • fax.gif -. Drawing a basic fax (231B image)
  • feed0. gif -. graph of the text 'feedback' (image 90B)
  • focus.js - script to put attention on a hidden pop-up window (javascript 165b)
  • home0 .gif -. graph of the text 'general' (image 967b)
  • iiv.gif -. clear graphic of the Investing in volunteers logo (image 2.63kb)
  • iiv.fpg -. graphic matt Investing in volunteers the logo (image 4.49kb)
  • index.htm - .. custom error page 404 site (HTML 1.76kb)
  • info.gif - transparent museum with logo contact information (image 2/31).
  • jfooter.js - code to dynamically generate the footer information of the page (javascript 2.41kb)
  • letter.gif - two simple letters design (image 698b).
  • linksb.jpg - A spider in a spider web on a small representation of a browser (1.18.kb image).
  • linkware.gif - transparent graphical text 'all the material on this site have ware Connection' (picture 1.56).
  • map0.gif - text graphic 'site' (image 989b).
  • members0.gif - graphic text (984B image) 'members'.
  • misc.inc - Freeola SQL authentication data access to the service (PHP includes 144b).
  • news0.gif - graphic text 'News Letter' (image 947b).
  • l_misc.inc - SQL authentication data to my server (PHP includes 144b).
  • nopic.jpg - Notice of there being no photos available (5:40 picture).
  • order0.gif - graphic text 'Mail Order' (image 0.96kb).
  • phone.gif - Transparent graphic of a red phone (281KB image).
  • print.css - the screen formatting descriptions (of 3.65kb style sheet).
  • registered.gif - Opaque graphic of the registered museums logo (image 428b).
  • registered3.gif - clear graphic of the registered logo Museums (picture 2.80b).
  • resize.js - code to dynamically change a window to the image size (javascript 1.05kb).
  • search.gif - search graphic '(image 108b).
  • sqldumper.inc - code to dynamically create a SQL dump files (PHP includes
  • stop.gif -. Transparent graphic of a red hand (image 2.64kb)
  • .js time - code to dynamically display a countdown (javascript 591b)
  • toc.js -. code to dynamically display a navigation structure (javascript 3.34kb)
  • wandlemuseu.gif - transparent animated graphics of the text 'the Wandle industrial Museum' (image 42.3kb)
  • webbo.gif - .. transparent graph of webbo head (image 1.16kb)
  • webo1.gif - graphic clear of webbo (image 3.81kb)
  • wimlogo.gif -. matte graphic museum logo waterwheel (417B image)
../ htdocs / order.htg / DATA_BACKUP / this directory is used to store SQL the file dump .. (242KB file 3)
../ htdocs / order.htg / help / this directory is used to store the graphics help the desktop database. (336KB 26 files)
../ htdocs / order.htg / images.htg / This directory is used to store the graphic for the store database. (2.41MB 91 files)

../ htdocs / order.htg / mysqlsnips This directory contains a number of texts files related to commands such as SQL.

../ htdocs / order.htg / shop.htg / This directory contains all the source files relative to public areas of the store database utility scripts and other resources that model the web application depends. (85.1kb 20 files)

  • basket.php - Create and maintain a commercial basis basked (PHP 9.29bk) session.
  • book_detail.php - block of code to display detailed information for a selected book (PHP 2.41kb).
  • buttons.inc - block of code for displaying the bottoms of action relating to product information (including 2.43kb).
  • catalog.php - Generates view primary catalog interface users (PHP 6.63kb).
  • checkout.php - Script to update the product and order database (PHP 5.02kb).
  • help.php - user interface view Show help desk system (PHP 6.71kb).
  • login.php - Scripts for the users and access database administration tasks (PHP 7.91).
  • old login.php - script of obsolete access (PHP8.99kb).
  • orderend.php - block of code for displaying the basket buttons (PHP 1.36kb).
  • ordertop.php - block of code for the display of information shot and primary controls (PHP5.73kb).
  • pagefoot.inc - block of code to create the structure of the final HTML page (Includes 801B).
  • pagehead.inc - block of code to create the HTML page starting structure (Include 854b).
  • product_detail.php - block of code for displaying detailed product information (PHP 1.15kb).
  • product_list.php - block of code to display summary information object (PHP 3.07kb).
  • product_show.php - code block that displays the alternative synthesis information (PHP3.16).
  • prompt.inc - block of code for displaying a message to the user (including 897B).
  • signin.php - Display simple to access the login screen. (PHP 3.08kb).
  • terms.php - terms and viewing conditions (PHP 5.83kb).
  • terms2.php - terms and conditions by far display a secondary window (PHP 5.75kb).
  • thankyou.php - display the final confirmation screen (PHP 3.28kb).
../ htdocs / order.htg / update.htg / This directory contains all the source files related to store database administration areas and other utility scripts. (240kb 34 files)
  • addcat.php - Add additional categories of entry to the database (PHP 2.18kb).
  • addproduct.php - Add additional elements to the database (PHP 6.30kb).
  • admin.php - web content management interface (PHP 65.9kb).
  • backup.php - generates the database dump file (PHP 5.21kb).
  • berror_form.inc - current errors to the new elements of the book database (Includes PHP 3.0kb).
  • bookinfo.inc - code block for entering the book data (Include 6.64kb).
  • bookup.inc - Display editable book information (Includes 10.2kb).
  • buttons.inc - block of code to create the edit control buttons (Include 4.41kb).
  • change.php - The source code for the update confirmation messages (PHP14.4kb).
  • edithelp.php - Allows editing and creation of information help desk (PHP14.0kb).
  • entbuttons.inc - code block for data entry of forms control buttons (Include 1.21kb).
  • error.gif - Transparent graphic of a cartoon cross (image 118b).
  • fine.gif - transparent graphical fo a cartoon checkmark (image 126b).
  • help.php - the interface view display help desk system administrators (PHP 6.22kb).
  • index.php - administrative access to the database editing functionality (PHP 12.5kb)
  • invoice.php - generate invoices customer display for printing (PHP 5.33kb).
  • mysqlsend.php - Enables the user to execute custom SQL statements (PHP 4:59)
  • newcat_form.inc - The new event the correction of the name of the category errors (Includes 773B).
  • newname_table.inc - Display new product entry form (Include 438b).
  • newproduct.php - update / delete data from the inventory database (781kb PHP).
  • newtypeform.inc - Viewing new category entry form (Include 563KB).
  • note.inc - Show information messages system (Includes 524B).
  • oldorders.php - the display summary data for closed orders (PHP 3.22kb).
  • orders.php - View selected random order (PHP 7.77kb).
  • perror_form.inc - Display the errors Product Information (Includes 1.99).
  • productinfo.inc - input form displays the product (Includes 3.68).
  • productup.inc - Display the editable product (Include 7.02kb).
  • quest.gif - transparent graphical fo a question mark (image 114b).
  • stock.php - Administrative summary data warehouse (PHP 9.07).
  • upload.jpg - Upload button graphics (image 1.84kb).
  • upload.php - copy images in images.htg directory on the server (PHP 5.40kb).
  • userorders.php - user viewing order history (PHP 2.36kb).
  • users.php - Display editable user access information (PHP10.04kb).

Previous
Next Post »
0 Komentar