You are on page 1of 20

December 21, 2011 [DBS FINAL PROJECT]

1 | P a g e

HANOI UNIVERSITY
Faculty of information Technology
**********************************************************************
WINE SALES
ONLINE SHOP


Developer: Vu Trong The(leader)
Nguyen Thai Phuong
Nguyen Dac Thuy
Bui Khanh Nam
Class 4C-09
Instructor: Luyen Thu Trang




December 21, 2011 [DBS FINAL PROJECT]

2 | P a g e

Table of Contents
Introduction .................................................................................................................................................. 3
Introduce the real-world application and the database solution that you will create with the project .. 3
Project identification and selection .......................................................................................................... 3
Body .............................................................................................................................................................. 4
Planning .................................................................................................................................................... 4
What did you do to plan the project? ................................................................................................... 4
What questions were asked? ................................................................................................................ 4
Analysis ..................................................................................................................................................... 4
Requirements ........................................................................................................................................ 4
Conceptual models ............................................................................................................................... 5
Design ........................................................................................................................................................ 6
Logical and physical designs.................................................................................................................. 6
Forms and reports ................................................................................................................................. 9
Development........................................................................................................................................... 12
Implementation ...................................................................................................................................... 13
The final product (run on localhost) ................................................................................................... 13
Form .................................................................................................................................................... 14
Report ................................................................................................................................................. 17
Database Usage................................................................................................................................... 19
Maintenance ........................................................................................................................................... 19
Closing ......................................................................................................................................................... 20
Summary ................................................................................................................................................. 20
Difficulties/Challenges ............................................................................................................................ 20
Appendices .................................................................................................................................................. 20
Sample data ............................................................................................................................................ 20

December 21, 2011 [DBS FINAL PROJECT]

3 | P a g e

Introduction
Introduce the real-world application and the database solution that you will
create with the project
Nowadays, selling online is used every day by thousands of international buyers and sellers. In
general, selling online can be defined as the online transfer of a product, service or idea to a buyer by
paying by cash or transfer of money. So, my group tends to create a website to sell wine online, which is
very popular and easy to approach the product. To consider every aspect of selling online, we can
recognize that it brings some advantages and disadvantages.
- Advantages:
Saving in set-up and operational costs. You don't need to rent high street premises, pay
shop assistants or answer a lot of pre-sales queries. Reducing order processing costs - customer
orders can automatically come straight into your orders database from the website, Offer a
wider choice and allow cheaper prices. The customer can order 24h a day and 7 days a week.
Sale online is cheaper than sell in the store.

- Disadvantages:
Firstly, its about privacy and security issues. Privacy is the number one reason that non-
online shoppers do not shop online. Many people do not trust the private of the Internet and
are concerned with their credit card fauds, unwanted solicitation, and use of their information
for other purposes. Security of Web sites is not the top concern because many shop on Web
sites that they trust so that other factors appear to be more important than security.
Secondly, because all activities of the shop are performed on the Internet, the reliance
on the Internet is a drawback. If something happens that prevents users from accessing the
website, they cannot trade with us and it will affect our income.
Project identification and selection
In order to select this project we have to discuss a lot to make agree in decision. Actually, there
are a lot of topics that we can choose, for example: book, car, movie, song, etc. However all of these are
selected by other group so we chose wine sales to make this unique, plus during the time we collect
data about the project we find out that this topic is very feasible and can be carried out by all member
based on their skill, and this is not too difficult to implement.

December 21, 2011 [DBS FINAL PROJECT]

4 | P a g e

Body
Planning
What did you do to plan the project?
The main function of the shop is selling wines to user. Besides, therell be a section on the
website that provides some highlighted articles related to wine, so that users can enjoy the news. Users
can browse by categories or use the search box to find their desired items. The shop will sort the
products by name, brand name providing a numerous way for user to select the products.
Because of the incompleteness of online payment in Vietnam, our shop will only accept the
payment via making direct contacts with users. In detail, the shop will use the information that users
provide to them via the website to contact them using telephone or email to confirm the orders, users
then transfer money to the shop and the shop will send the goods to them. This solution can be quite
uncomfortable for users: they will have to make some complex steps to pay their bills (go to the bank,
transfer their money to the shops account for example), but it is the most reliable way today. In the
future, when the online payment in Vietnam is upgraded, the shop will provide the function that accepts
the payment via credit card.
What questions were asked?
Where can we collect the source information about wine?
What is the type of customer that we support?
How can we store data?
What function that we need to perform?
How can customer order?
How can we display information?
Does customer need to login to see wine/s information?
How do our website interface look? (simple or complex)
Analysis
Requirements
1. Websites main functions:
+ User registration: This function helps customer to register an account to trade with the
shop.
+ Order fulfillment: After selecting goods, this function helps users to fulfill the order,
which includes: name, address, phone number of the receiver and the payer, etc
+ Search function: This small but important function helps users to find and buy their
favorite wine.
+ Admins function: manage users, items, orders.
2. Database: The database will contain the following basic tables:
+ User - contains information about users: UserID, Name, Address, Number, Recipient's
Email, Total number of bought items, Total money paid, Rank of member
+ Item - contains information about items of the shop: - Item IDs, Name, Brand name,
Origin, Year of Production, Quantity, Price, Alcohol
December 21, 2011 [DBS FINAL PROJECT]

5 | P a g e

+ Order - contains information about orders that users have made with the shop: User ID,
Item IDs, Quantity, Total of Money, Time of order placement, Recipient's name, Recipient's
Address, Recipient's Phone Number, Recipient's Email
Conceptual models

Figure. Conceptual Model
As can be seen from the graph, there are 3 entities: User, Order and Item. Wine, here is item will be
introduced via the website to the user, by this way they can chose what is the most appropriate for
them in a certain time. After that user can place the order to buy item that they want of course at this
step, they dont need to spend a lot of time because of the functions of our site to support; note that
one user can place as many order as they one. According to this, the placement of user will be for the
item, one order can contain many items or one item can be selected for many orders so that the user
can save their time for ordering and request.
December 21, 2011 [DBS FINAL PROJECT]

6 | P a g e

Design
Logical and physical designs
Logical Design:
ERD:
December 21, 2011 [DBS FINAL PROJECT]

7 | P a g e

Figure. Entity-Relationship Diagram

Relational Diagram:
The Order table has a foreign key: user_ID which references to the ID attribute of User table.
Although item_IDs of Order table holds the data of ID of Item table, it is not a foreign key. The reason
here is: The data type of item_IDs is varchar, it contains the list of items IDs that user chose to buy( if an
user wants to buy two (or more) bottles of an item, the ID of that ID will be shown twice in the
item_IDs, so that we do not have to be confusing about the quantity of the items a PHP function can
convert from this list into the items with their quantity easily) while the data type of Items ID is int, so
that it cannot be the foreign key of ID. This reason is applied to Users bought_item_IDs.
User
PK ID
user_name
password
name
address
phone_number
email
total_of_bought_money
bought_item_IDs
Order
PK ID
FK1 user_ID
item_IDs
time_of_order_placement
recipient_name
recipient_address
recipient_phone_number
Item
PK ID
name
type
brand_name
year_of_production
origin
price
quantity
alcohol

Figure. Relational Diagram

Physical Design:
Here are the physical designs of the 3 entities: Order, Item and User.
Item

December 21, 2011 [DBS FINAL PROJECT]

8 | P a g e

Figure. Physical Design of Item

Order

Figure. Physical Design of Order

- The recipient_name, recipient_address, recipient_phone_number fields can be null, when they
are empty, the system will understand that the order is for the user, so he is the recipient.
User

Figure. Physical Design of User

- In this design, email is not null because we need to validate users information when he
registers to our shop.
December 21, 2011 [DBS FINAL PROJECT]

9 | P a g e

- As we considered in the Project Draft, our shop will validate the order and inform to users
about the payment via telephone, user must provide a phone number to us, that is the reason why the
field phone_number must not be null.
Forms and reports
Form:
Here are some forms that we think they will be presented in our shop:
- This form is for customer who wants to register an account to shop our wine.

Figure. User Registration

December 21, 2011 [DBS FINAL PROJECT]

10 | P a g e

- This form is for login purpose:

Figure. User Login

- Below is the form that user has to fill when he wants to place an order. The Items field is a drop
down menu, its elements are the items that user has chosen during the shopping, when an
element is selected, the quantity field will show its quantity and user can change to the number
that they desire to buy.

Figure. Order Information


December 21, 2011 [DBS FINAL PROJECT]

11 | P a g e

- Here is the form for the shops assistants to input information about the wine that they sell
(users cannot see this form)

Figure. Item Information

Report
Below are the reports that will be shown when being requested. All of them have the same
format:
{Table Name} Details
{Representative of Attribute} | {Value}
- The first report is about user, it provides the main details about user. The rank field is auto-
generated using the attribute total_paid_money, it is used to rank user, so that the shop can have some
bonuses for those users who buy their items the most.
User Details
Name Vu Trong The
Address Hanoi Vietnam
December 21, 2011 [DBS FINAL PROJECT]

12 | P a g e

Phone Number 0123456789
Email vu_trong_the@yahoo.co.uk
Rank Gold User
Total Paid Money 1,000,000 $
Bought Items - Np Ci Hoa Vng
- ABC
- XYZ

- The second report is Item Details.
Item Details
Name Chivas
Type Red Wine
Brand Name ABC
Year of Production 1333
Origin Hanoi
Price 1,000,000 $
Quantity 10
Alcohol 40%

- The final one is for Order. It provides for both user and shop assistant information about the
order that user has placed.
Order Details
Order ID 1492
User Vu Trong The
Items - Johny Walker Red Label
- Vodka Hanoi
- Nep Cai Hoa Vang
Price 1,000,000 $
Recipients Name Steve Jobs
Recipients Address Heaven
Recipients Phone Number -123445xxx
Time of Order Placement 1/1/2121
Development
Role of team members and Task order
Week 2: Project Draft
- Nguyn Thi Phng: Introduction
- Nguyn c Thy: Analysis
December 21, 2011 [DBS FINAL PROJECT]

13 | P a g e

- V Trng Th: Planning
- Bi Khnh Nam: Conceptual Model
Week 3: ERD Draft 1 Nguyn Thi Phng
Week 4: Design and Development [Draft 1]
- Nguyn Thi Phng: ER Diagram + Form
- Nguyn c Thy: Physical Design
- Bi Khnh Nam: Relational Model
- V Trng Th: Report + Review
Week 5-15: Implementation
- V Trng Th + Nguyn c Thy: Program website
- Nguyn Thi Phng+ Bi Khnh Nam: Design website interface + database
Week 15: Submit the final product
Implementation
The final product (run on localhost)
The final product currently runs on localhost because there are some problems prevent us from
bringing the site to the Internet. However, with the help of XAMPP, we are able to run the site as if it is
online. Therefore, we can experience our work more clearly.
Below is the final version of the database. As can be seen from the graph, its quite different
from the one that wed designed in the Design phase. In order to make a dynamic menu (which get the
list automatically), wed get two attributes: item_type & item_manufacturer and make new tables for
that purpose. In real-world action, this change does not affect the use of the item table and its
attributes. In addition, wed deleted two attributes: user_total_of_bought_money (because it is not
necessary in this version of the site) and user_bought_item_Ids(the order and order_line tables can
handle this data much more effectively).
A new table: order_item can be seen as the relationship table between order table and item
table. It holds the data about item_Id of all items that are in an order and their quantity.
December 21, 2011 [DBS FINAL PROJECT]

14 | P a g e


Figure. Physical Design
The final version of WineShop has the following basic function:
- User Registration/Login
- New Item Insertion (for Admin only)
- Browsing Items ( by Item Type or Item Manufacturer)
- Order Placement
- Viewing Order History
Form
Here are all the forms that are available in the online shop.

December 21, 2011 [DBS FINAL PROJECT]

15 | P a g e

Figure. User Login Form


Figure. User Registration Form

December 21, 2011 [DBS FINAL PROJECT]

16 | P a g e

Figure. Cart Details

Figure. Order Placement
December 21, 2011 [DBS FINAL PROJECT]

17 | P a g e


Figure. Add Item Form
Report
Here are all the reports that are generated automatically (with the data in the database) in the
online shop. Depending on the data, some report may vary a little bit but the overall forms are showed
below.

Figure. User Details
December 21, 2011 [DBS FINAL PROJECT]

18 | P a g e


Figure. Item Details

Figure. List of Order
December 21, 2011 [DBS FINAL PROJECT]

19 | P a g e


Figure. Order Details

Database Usage
The database of WineShop is used by both the shops administrator and its users. For example:
users retrieve their user details or orders details from the database, admin insert new item record to the
database. All these action are done via the webs interface (the site can be seen as a bridge to connect
user to the database).

Maintenance
The website is currently quite simple, although it has the essential functions. It doesnt provide
enough tools for user to exploit the data more effectively. Moreover, the site has never been run in real-
world environment, so that it can produce unknown errors. Therefore, in the future, we need to develop
the site more to complete it and satisfy our customers the most.
Some recommendation for maintenance and improvement:
- User Management function for Admin and User
- Online payment for the shop
- Rating products function
- Re-designed interface
December 21, 2011 [DBS FINAL PROJECT]

20 | P a g e

Closing
Summary
In summary, this project helps us in developing website/software very much. From all the
experiences that we get, we can determine the requirements; design the database/website more
suitable to the requirement and the ability of us.
The database solution meets exactly the requirements. It assists the sites administrator in
organizing all forms of information such as: user, item and order with the flexibility to adjust as he needs
to change.
Difficulties/Challenges
- The limited ability of members prevents us from producing our desired website ( that we has
designed from the first stages)
- New knowledge about programming, designing website requires self-study.
- The difficulties in scheduling and assigning the teams members (because of the differences
among members abilities).
Does the database solution meet the requirements?
As you can see in our database solution, every task and function that is created also support for the
requirement and make it become the goal that we want to archive. The Register button which is use for
user registration function, add to cart used for processing order and browse by type and manufacturer
which is for search. Moreover, the database contain all data for store information of user, order and
item (wine), all of these will be processed for making order and validate user when login our website.
Appendices
Sample data
The sample data of the products is retrieved from http://www.ruouvaqua.com website.

You might also like