Você está na página 1de 27

Software Project Management 2013

LABORATORY MANUAL B.TECH (I.T) FINAL YEAR (7TH SEMESTER) Distributed Computing (TIT-442)

Submitted to: Mr. Ashok Kumar Assistant Professor Deptt. of I.T.

Submitted by: Shubham Bansal (40725) Navan Anand (40742) Neetika Tamta (40744) Shipra Chauhan (40745)

College of Technology Govind Ballabh Pant University of Agriculture and Technology


I

Software Project Management 2013


Pantnagar Table of Content
1. INTRODUCTION ............................................................................................... 1 2. TECHNOLOGICAL BACKGROUND ....................................................... 1 3. SYSTEM ANALYSIS & DESIGN ................................................................ 2
3.1 USE CASES ......................................................................................................... 2 3.1.1 Customer Interface .................................................................................... 3 3.1.2 Admin Interface ......................................................................................... 6 3.2 SEQUENCE DIAGRAMS ....................................................................................... 7 3.2.1 Customer Interface .................................................................................... 7 3.2.2 Admin Interface ......................................................................................... 8 3.3 WEBPAGE DIAGRAMS ...................................................................................... 10 3.3.1 A general diagram of the Customer Side ................................................ 10 3.3.2 A general diagram of the Admin Side ..................................................... 12 WEB PAGE ..................................................................................................................... 12

4. IMPLEMENTATION DETAIL ................................................................... 12


4.1 ADMIN SIDE ...................................................................................................... 13 4.1.1 Create Username & Password ................................................................. 13 4.1.2 Login ......................................................................................................... 13 4.1.3 Delete items .............................................................................................. 13 4.1.4 Modify items ............................................................................................. 13 4.1.5 Query Sale ................................................................................................ 13 4.1.6 Query Information ................................................................................... 13 4.1.7 Logout ....................................................................................................... 14 4.2 CUSTOMER SIDE ............................................................................................... 14 4.2.1 Categories are selected ............................................................................. 14 4.2.2 Search Products ....................................................................................... 14 4.2.3 Buy Items .................................................................................................. 14 4.2.4 Continue Shopping .................................................................................. 14 4.2.5 View Cart .................................................................................................. 14 4.2.6 Change Quantity (in View Cart page) ..................................................... 14 4.2.7 Remove Items ........................................................................................... 14 4.2.8 Checkout ................................................................................................... 14 4.2.10 Sign-in ...................................................................................................... 14 4.2.11 Billing/Shipping Information .................................................................. 14 4.2.12 Change (in Bill/Ship Information page) ................................................. 15 4.2.13 Submit (in Bill/Ship Information page) .................................................. 15 4.2.14 Delete Order (in Confirm page)............................................................... 15 4.2.15 Send Order (in Confirm page) ................................................................. 15 II

Software Project Management 2013


5. CONCLUSION ................................................................................................... 15 7. FUTURE WORK ............................................................................................... 16
WORKS CITED.............................................................................................................. 17

APPENDIX A .............................................................................................................. 18 APPENDIX B .............................................................................................................. 20

III

Software Project Management 2013


Successkart: An Online Store
Abstract: This report covers the design and implementation of the shopping cart in Successkart, which is the name of the company that we are working for. The application is implemented in PHP and consists of two main components: Admin and Customer side. Admin side consists of the features such as Creating Username & Password, Input Items, Modify Items, Delete items, Query Sale Data, Query Databases data, and Logout. Customer side consists of the features such as Select Products, Search Products, Buy Items, Continue Shopping, View Cart, Checkout, Sign-in, Creating an Account, Bill/Ship Information, Confirm, Send Order, and Delete Order. There are also the future works for this application.

1.

Introduction

The main goal of this project was to create a shopping cart, which allows customers to shop and purchase the Successkart products online. Moreover, the project is also

designed in such a way it lets managers manage the products information online. The Successkart online store sells book. Customers can orders products, and they will be contacted to further process the orders.

2.

Technological Background

The tools used to develop the shopping cart include: - PHP scripting language - MySQL database server - Apache server - HTML - Text Editor PHP is a server side scripting language designed specially for the Web. Within an HTML page, PHP code can be embedded and it will be executed each time the page is visited. PHP is an Open Source product. PHP source code can be accessed, used, altered, and redistributed without any charges.

Software Project Management 2013


MySQL is a very fast, robust, relational database management system (RDBMS). A database enables the users to efficiently store, search, sort, and retrieve data. Apache server interprets the PHP code at the Web server and generates HTML or other output that the visitor will see. Text editor such as Textpad is used to write the coding in plain text that the Web server can recognize and translate into binary code. There are advantages of using these tools to develop and run the software. Apache server, MySQL server, and PHP are free to download from the internet if one does not have any tools.

3.

System Analysis & Design

The system was analyzed and designed before implementation began. In this section, use cases, sequence diagrams, and webpage diagrams are described in details.

3.1

Use Cases

The following use cases outline the requirements for the online shopping. They have been revised during the course of the project to more accurately reflect the system.

Software Project Management 2013


3.1.1 Customer Interface
Remove Item Browse Products Add Item Change Quanti ty Search Items Vi ew Cart

Check out

Customer Bi l l /Shi p

Confi rm

Send Order

1. Customer shops for a product The customer initiates this action by clicking on the desired category for item to be displayed. The page sends a message to the server requesting a listing of all products from the particular category from the database. The action is complete when a page is returned for the customer to view, which contains available products with product names along with their picture, price, capacity, and an option to add the product to the shopping cart. There is an option to link to next page, if more products are available than can fit on the page. If a given item is out of stock, a drop down button with a message not available is displayed.

Software Project Management 2013


2. Customer searches for item The customer starts this action by typing a query into a text box named description to search for description of an item. The page sends a message to the server asking for a listing of products, whose names match the query, from the database. The action is complete when a page is returned for the customer to view, which contains a list of the resulting products along with their picture, price, and an option to add the product to the shopping cart. If a given description doesnt match with any descriptions in the database, a message indicating such is displayed instead of the option to add to cart. The customer can also search for an item using model number or combination of both description and model. 3. Customer adds an item The customer initiates this action by clicking on the buy button on the right side of to a products listing. An item is added to the cart including the price and displayed with the total price. If the product already exists in the customers cart, its quantity is increased by 1. There is a Continue Shopping button for the customer to continuing shopping for other products. 4. Customer views cart The customer initiates this action by clicking on the view cart button, available on any webpage. The page sends message to the server and shows a list of all products in the customers cart, along with their quantity and total price. 5. Customer removes item from cart The customer starts this action by clicking on the Remove button on the view cart page. The web page sends a message to the server, which removes the product from the customers shopping cart. 6. Customer changes quantity from cart The customer starts this action by changing the quantity of the item and clicking on the Change button on the view cart page. The web page sends a message to the server, which updating the product from the customers shopping cart. 7. Customer checks out

Software Project Management 2013


The customer starts this action by click on checkout button the on the view cart page. A check out page is displayed letting the customer to create a new account or sign in depending the customer status. An existing customer would sign in his/her email address and password and click sign in button. The web page is sending the message to the server. Then, the server validated the email address and password from the database. If they are both correct, then a shipping and billing information page is displayed letting the customer to fill out the information. After submitting billing and shipping information, a confirmation page is displayed showing item in the customers cart and billing and shipping information. 8. Customer sends order The customer starts this action by clicking on the send order from Confirm Information page. Once send order button is clicked, the page is sending the message to the server, which sends emails to the customer and sale person. It also stores the customers cart and billing and shipping information into the database.

Software Project Management 2013


3.1.2 Admin Interface
Insert Items

Logi n

Del ete Item

Modi fy Item

Admin

Query Informati on

. 1. Admin logs in The admin starts this action by inputting the username and password and clicking on the submit button. The page is sent the message to the server to validate the information from the database. After successful validation, the logged in page is returned with options for the admin to add, modify, or delete products, or query information. 1. Admin inserts item The admin starts this action by clicking the Input Items button from the logged in page. The page is displayed with a form for the admin to insert item and its details. Once Insert button is clicked, the web page sends this information to the server, which in turns stores it in the database. 2. Admin removes item

Software Project Management 2013


The admin starts this action by clicking on the Remove Items button. The web page is displayed a drop down menu for the admin to send the item he/she wants to delete. Once, delete button is clicked, the page is send message to the server which in turns tells the database to remove the item 3. Admin modifies item The admin starts this action by clicking on the Modify Items button. The web page is displayed a list available products from the database. The admin then chooses the item he/she wants to modify by clicking on particular item. A page is displayed letting the admin to modify all item information, except its UPC code and model name. Once, the Modify button is clicked, the web page sends a message to the server, which updating the information from the database. 4. Admin queries information The admin starts this action by clicking on the Query Sales button. The web page is displayed, allowing the admin query by period model, or order ID for the sales information. Once, Query button is clicked, the page is sent message to the server which in turns requests all sales that match the query from the database.

3.2

Sequence Diagrams

The next step is to develop scenarios through sequence diagrams. The sequence diagram below outlines the requirements for online shopping 3.2.1 Customer Interface

Software Project Management 2013

Front End

Back End

DB

Select Products Query Products Display Products Buy Items Show Cart

Change/Remove Quanity Update Cart View Cart Display Cart Details Continue Shopping Display Products Check out Display Form Create an Account Check validty Invalid Sign In Check Validity Show Bill/Ship Form Input Billing /Shipping Form Show Confirm Order Send Order Store Information Send Comfirm Email

Front End: web browser; 3.2.2 Admin Interface

Back End: web server;

DB : database server

Software Project Management 2013


Front End Back End DB

Log in

Check validty
Valid Input item Input into table Back to form Delete/Modify Item Back to form Delete/Overwrite Item

Query Sales/Information Compare

Display Results Log Out

Display Log In Page

Front End: web browser;

Back End: web server;

DB : database server

Software Project Management 2013

3.3

Webpage Diagrams

3.3.1 A general diagram of the Customer Side

categories.php

add_to_cart.php Search Buy A link to categories. php after order is sent

Check_out.php

continue shopping

Check out

bill_ship_infor.php
invalid inform ation

sign in

create account
Valid in on formati

Billing

Shipping

submit
in valid ation form

check_bill_ship_infor.php

confirm.php

submit

change
dis p inf ne lay or w ma tio n

send order

delete order

Link : Button: Web page:


submit

confirm.php

10

Software Project Management 2013


A description for the above diagram can be describes as follows: A customer finds an item to buy by browsing or searching from the categories.php page. A list of products is displayed. After the customer adds an item to the shopping cart, the add_to_cart.php page displays the carts contents. When the

shopping cart is not empty, the customer can view the cart. In the add_to_cart.php page (view cart), an item can be removed from the cart or its quantity can be changed. When the customer clicks on the check out button, the check_out.php page displays a form for customer to sign in or create a new account. After signing or creating the account, the bill_ship_infor.php page shows the form for the customer to input the information. After submitting the billing or shipping information, the

check_bill_ship_infor.php page displays the billing and and shipping information so that the customer can make a change or submit the desired information. After that action is done, the confirm.php page displays with cart and billing and shipping information before the customer sends the order or deletes the order.

11

Software Project Management 2013

3.3.2 A general diagram of the Admin Side


Input Login

Query Sale Main Delete

Modify Query Table Shopping Logout

Link: Delete Web page

Like Customers webpages, this diagram represents a general look of the admin side through webpages. After logging in, an administrator can input item, delete item, modify item, or query information from the database.

4.

Implementation Detail

In the Admin and Customer side, for each feature (e.g. feature Create Username & Password in Admin side), there are classes function(s) or PHP codes in web pages

12

Software Project Management 2013


involving to process the requests from users or display the results on the web pages. The descriptions of the classes functions are in the Appendix A.

4.1

Admin side
Validating username and password Storing valid username and password in database The PHP codes in creating_userpass.php are used for these processes.

4.1.1 Create Username & Password

4.1.2 Login main(): validate the username and password (in check_userpass.php)

4.1.3 Delete items The PHP codes in the delete_item2.php page are used to delete the item selected from database and update database. 4.1.4 Modify items The PHP codes in the queryTable3.php page are used to display the selected item to be modify on the web page. The new input data is validated by using the PHP codes in the validate_Input.php page. If it is valid, the modified item data is stored in database by using the PHP codes in the make_change_item2.php page. 4.1.5 Query Sale validate_from_to() in the query_sales.php page is used to validate the time , from and to. process_query() in the query_sales.php page is used to query data from database and display the result on the webpage. 4.1.6 Query Information Functions get_customer(), get_order_detail(), get_order_main(), or

get_inventory() in the query_infor_page.php page is used to query the data from a table in the database and display the data on the webpage for viewing.

13

Software Project Management 2013


4.1.7 Logout The PHP codes in the login_admin.php page is used to unset the username and password session variables.

4.2

Customer side
displayItems() displays a list of items on the web page. calculateProductListing() calculates numbers of rows for the result. This value parameter is used to query data for each page to be displayed, five items for each page. displayPage() displays page result being view (e.g. View page 1 of 5)

4.2.1 Categories are selected

4.2.2 Search Products displayLinkPage() and displaySearchItems()

4.2.3 Buy Items addToCart()

4.2.4 Continue Shopping displayItems(), calculateProductListing(), and displayPage()

4.2.5 View Cart viewCart(), calculatePrice()

4.2.6 Change Quantity (in View Cart page) viewCart(), calculatePrice()

4.2.7 Remove Items viewCart(), calculatePrice()

4.2.8 Checkout displayForm() 4.2.9 Create an Account (in Checkout form) validateNewUser(), insertNewUserData()

4.2.10 Sign-in validateSignIn()

4.2.11 Billing/Shipping Information printBillShipForm2(), printInvalidBill(), printInvalidShip()

14

Software Project Management 2013


4.2.12 Change (in Bill/Ship Information page) printBillShipForm2(), printInvalidBill(), printInvalidShip()

4.2.13 Submit (in Bill/Ship Information page) printItemsConfirm()

4.2.14 Delete Order (in Confirm page) unsetAllGlobalVariables() in the Confirm.php page is used to erase shopping cart and sign-in or new user information 4.2.15 Send Order (in Confirm page) sendOrder(), insertSaleTable(), and unsetAllGlobalVariables()

4.4 Database Tables: cat1_cat2 cat1_cat2_cat3 cat2_cat3 category category_List inventory customers order_detail order_main sale (See Appendix B for more details)

5.

Conclusion

The application is working well so far, and it is easy to install and use. However, feature such as Modify Item in the Admin side is still not working friendly. It asks users to rebrowse the image and the manual for the item to be modified. This feature will be fixed in the future works. More designs and decorations should be added to the web pages to make them more attractive.

15

Software Project Management 2013

7.

Future Work

WE will fix bugs if they are found. More features will be added into this application. For example, payment methods such as Pay Pal or credit cards will be available on this online store. The future works also enables users to customize features. Moreover, object-oriented approach will be applied through out the application.

16

Software Project Management 2013

Works Cited
Achour, Mehdi, Friedhelm Betz, Antony Dovgal, et al. PHP Manual. PHP Online Manual. The PHP Group. 15 January 2005 <http://us3.php.net/manual/en/index.php>. Argerich , Choi, et al. Professional PHP 4. Birmingham: Wrox Press Ltd, 2002.

Satzinger John W., Tore U. Orvik, The Object-Oriented Approach: Concepts, System Development, and Modeling with UML Wyke, R. Allen, Michael J. Walker, and Robert M. Cox. PHP Developers Dictionary. Indianapolis: SAMS, 2001.

17

Software Project Management 2013

Appendix A
Classes functions and functions descriptions class Category_Search - displayLinkPage(Array): it passes an array parameter which contents the information such as search description, search model, number of rows, and page number to display. This information is used to calculate and to generate the number of pages for the search result . Each page contains five items. -displaySearchItems($display_page_arr): it passes an array parameter and is called to display the items of the search result. class Bill_Ship - printBillShipForm(Array, String, String, String): it passes four parameters, an array and three strings variables. It is called to print out two forms billing and shipping on billing information page. - stateList(): it is called to print out a drop down list ( HTML select tag) of the states of America - validateBill($bill_ship_array): it passes an array containing the information of the bill form that a customer fills in. The function validates this information and returns an array that contains the validation information - validateShip($ship_infor_array): it passes an array containing the information of the shipping form that a customer fills in. The function validates this information and returns an array that contains the validation information. - printInvalidBill($bill_invalid_array): it is called to print out the invalid field(s) in the billing information form. - printInvalidShip($ship_invalid_array): it is called to print out the invalid field(s) in the shipping information form class Checkout_Functions - displayForm(): it prints out a form which includes Create an Account and Sign- in parts. - validateSignIn($email_pass): An array which contains email and password is passed an a parameter. The function validates the email as a username and password in the Sign-in form by checking if they are matching any username and password in the database. The function returns true for valid information. Otherwise, it return false. - validateNewUser($new_user, $templateInstance): An array and a instance are passed as parameters. The array contains the information about a new user in the Create an Account form. The instance is used to call the function connectDatabase() of the Template_Functions object. - connectDatabase(): It is a template function called to connect the database.

18

Software Project Management 2013


- insertNewUserData($form_information): The parameter is an array containing all information a new user. This information is stored in database. class Dynamic_Functions - printCategories(): this function query data from database and prints out categories drop down lists in the sidebar part on the webpage for users to select when they shop. - display_cat1(): It prints out the first category list of items. - display_cat1_cat2($cate1, $cate2): There are two parameters are passed, the first and second selected categories. It queries data from database and prints out the first and the second category list of items. If the third category is already selected and stored in the HTTP_SESSION_VARS, all three categories lists are displayed. - printSelectedCategories($view_items): An array containing selected categories which are printed in the header content (above the main content part of the page). This is to help customers view the selected categories clearer. - displayLinks($links): An array parameter is passed. This parameter containing a list of link pages, which are displayed in the sidebar part of the webpage. - printSearchBox(): It prints out description and model search boxes in the sidebar part on the left most of the webpage. class Template_Functions - pageHeader(String): it passes a string which is the title of the webpage. It prints out the first line of a HTML page (e.g. "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN "http://www.w3.org/TR/html4/loose.dtd">) , and <html> , <head>, <title>, <meta>, <link>, and <body> tag elements. - pageFooter(): it prints out the line <body></html> to close the HTML webpage. - connectDatabase(): it is called to connect database. If the connecting database is not successful, an error message will be printed out. - headerArea($bold, $button_arr): it is called to print out the links and the phases in the header area of the webpage while a customer is shopping online. The links Continue Shopping, View Cart, and Check Out. The phases include Shopping, Billing, Checkout, and Confirm. These phases are used to remind customers that where they are during they are shopping. - upperSidebar(): it is a template function called to print out a HTML source code in the upper sidebar area. The line it prints is "<table><tr> <rowspan=\"2\"> <div class=\"sidebar\"> <table background=\"images/side_bar.jpg\width=\"250\" height=\"1000\"><td valign=\"top\">"); - lowerSidebar():it is a template function and prints out a HTML source code in the lower sidebar area (see appendix for the function implementation). - upperContentHeader(): it is a template function and prints out a HTML source code (see appendix for the function implementation). - lowerContentHeader(): it is a template function and prints out a HTML source code (see appendix for the function implementation). - upperContent(): it is a template function and prints out a HTML source code lowerContent(): it is a template function and prints out a HTML source code.

19

Software Project Management 2013


class Order_History - signInForm($main_arr): It prints out a form for customers to sign in to request their order history. - displayOrderHistory($main_arr): An array containing data used to connect database and query data from database. An order history page of the specific customer is displayed. class Product_Listing - calculateProductListing(): This functions calculates numbers of pages, and rows, start, and stop values. These data are used to calculate a displaying product listing page. checkDisplayPage($cat1, $cat2,$cat3,$num_rows,$each_page,$start,$row_displayed): ): It uses these parameters values to check if the product listing result is more or less than one page (each page displays five items). - displayPage($cat1,$cat2,$cat3,$num_rows,$each_page,$start,$row_displayed): It displays the page is being viewed. - displayItems($cat1,$cat2,$cat3,$num_rows,$each_page,$start,$row_displayed): It uses the parameters values to query data and displays a product listing on the webpage. - displayButtons($button_arr): It uses the arrays data to display link buttons such as Continue Shopping, View Cart, or Checkout. class Shop_Functions - addToCart():It involve processing HTTP_SESSION_VARS to adds items to cart when a customer chooses to buy an item. - viewCart($link_page, $change_button, $remove_button, $ship_price): - calculatePrice($cart): It uses parameters values to query data from database and calculates price for items in the cart. class Confirm - printItemsConfirm($template, $cart_items,$bill_ship_array): It uses the parameters values to print out cart, billing, shipping information to the confirm page for customers to take a review before they place an order. - inputOrder($template, $billing_infor, $cart_items, $all_charge): It stores order information in the database after customers send their orders. - sendOrder($email_body, $order_num, $billing_infor, $cart_items, $all_charges, $seller_email): It sends out order information to customers and shopping cart managers via emails.

Appendix B
Database Schema Definition Table: category_List Fields: -categoryID: int, primary key -category1 : varchar(255) -category2 : varchar(255) -category3 : varchar(255) Table: cat1_cat2_cat3 Fields: categoryID: int(4), not null category1: varchar(255), not null 20 category2: varchar(255), not null category3: varchar(255), not null

Software Project Management 2013

Table: sale Fields: -model_name: varchar(255) -orderID : int(6) -quantity : int(4) -price : decimal(10, 2) -total : decimal(10, 2) -date : varchar(255)

Table: order_detail Fields: order_num: int(6), not null quantity: int(3), not null item_num: varchar(255), not null

Table: inventory Fields: -upc_code -model_name : varchar(255), primary key -category1 : varchar(255) -category2 : varchar(255) -category3 : varchar(255) -suggested_price: decimal(10, 2) -web_price : decimal(10, 2) -image : varchar(255) -thumbnail : varchar(255) -sale : varchar(255) -status : varchar(255) -finish : varchar(255) -discription : text -feature : text -review : text -manual : varchar(255) -brand : varchar(255) -dimension : varchar(255) -capacity : int(6) -weight : decimal(10, 2)

Table: sale Fields: model_name: varchar(255), not null order_id: int(6), not null quantity: int(4), not null price: decimal(10, 2), not null total: decimail(10, 2), not null date: varchar(255), not null

Table: cat1_cat2 Fields: - cat1_cat2_ID: varchar(255) , not null - cat1 : varchar(255) not null - cat2 : varchar(255), not null

Table: category Fields: categoryID: int(11), not null category1: varchar(255), not null category2: varchar(255), not null category3: varchar(255), not null

Table: cat2_cat3 Fields: - cat2_cat3_ID: int(10), not null - cat2 : varchar(255), not null - cat3 :varchar(255), not null

21

Software Project Management 2013

Table: order_main Fields: order_num:[int(6), not null order_date: date, not null email: [varchar(30), not null subtotal: decimal(7,2) unsigned, null shipping: decimal(6,2) unsigned, not null tax: decimal(6,2)unsigned ,null total: decimal(7, 2) undigned, null ship_first: varchar(15), not null ship_last: varchar(50), nut null ship_company: varchar(50), null ship_address[varchar(50), not null ship_city[varchar(50), not null ship_state[char(2), not null ship_zip[varchar(5), not null ship_phone[varchar(12), not null ship_email[varchar(50), not null bill_first[varchar(50), not null bill_last[varchar(50), not null bill_address[varchar(50), not null bill_city[varchar(50), not null bill_state[char(2), not null bill_zip[varchar(5), not null bill_phone[varchar(12), not null bill_cell[varchar(12), null bill_email[varchar(50), null

Table: inventory Fields: upc_code: varchar(255), not null model_name: varchar(255), not null category: varchar(255), not null category2 varchar(255), not null category3: varchar(255), not null suggested_price: web_price: image: varchar(255), null sale: varchar(255), null status: varchar(255), null finish: varchar(255), null description: text null feature: text, null review: text null manual: varchar(255), null brand:varchar(255), null capacity: int(6), null weight: decimal, null

Table: customers Fields: email: varchar(255), not null password: varchar(255), not null firstname: varchar(255), not null lastname: varchar(255), not null zip: int(5), not null

22

Software Project Management 2013

Screenshots
Admin main

Admin login

23

Software Project Management 2013


User Site

User panel

24

Você também pode gostar