Escolar Documentos
Profissional Documentos
Cultura Documentos
LABORATORY MANUAL B.TECH (I.T) FINAL YEAR (7TH SEMESTER) Distributed Computing (TIT-442)
Submitted by: Shubham Bansal (40725) Navan Anand (40742) Neetika Tamta (40744) Shipra Chauhan (40745)
III
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.
3.
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.
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.
Logi n
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
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
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
DB : database server
Log in
Check validty
Valid Input item Input into table Back to form Delete/Modify Item Back to form Delete/Overwrite Item
DB : database server
3.3
Webpage Diagrams
categories.php
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
confirm.php
10
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
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
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.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
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.8 Checkout displayForm() 4.2.9 Create an Account (in Checkout form) validateNewUser(), insertNewUserData()
14
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
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
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
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
19
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
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
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
Screenshots
Admin main
Admin login
23
User panel
24