Project Report on Online Shopping System
February 18, 2017 | Author: FreeProjectz.com | Category: N/A
Short Description
Download Project Report on Online Shopping System...
Description
Project Report On Online Shopping System Title of the Project :
Online Shopping System Introduction and objective of the project: 1. Project Description An Online Shopping System which will allow formal and informal merchants in developing countries to advertise and sell their goods on the internet. This would permit rural communities to make their wares available to the rest of the world via the World Wide Web. The objective of this project is to create an Online Shopping System web portal with a content management system which would allow product information to be updated securely using a mobile device. The web portal will have an online interface in the form of an Online Shopping System website that will allow users to buy goods from the merchants. This project will be divided into following separate components:
The content management system (CMS) The Online Shopping System website/portal The product, merchant and customer database The coupans, affliates, discount managements Reporting of the sales, orders, shipments etc The online transaction security system The data security system
1.1 Content Management System (CMS) The CMS will be responsible for managing the product, merchant and customer database (MySQL). The CMS will also handle any changes that must be made to the database as a result of transactions on the Online Shopping System website. This information would be processed and the database would be updated accordingly using SQL queries. 1.2 The Online Shopping System Website/Portal The Online Shopping System
website/portal will provide merchants with a
medium through which they will be able to sell their merchandise. It will provide
Project Online Shopping System
Page 1
Project Report On Online Shopping System online shoppers with an interface through which they will be able to purchase merchandise from formal and informal merchants. This Online Shopping System website component will be written in PHP, which is a very popular and versatile Online Shopping System programming language. The website will provide shoppers with information about the various products that are for sale. The information will include prices, product descriptions, stock availability as well as photographs of the products. 1.3 Product, Merchant and Customer Database The product, merchant and customer database will store all information about the products that will be sold on the Online Shopping System (prices, product descriptions, photos of products). It will also store merchant information (names, banking details, contact details) as well as customer details (credit card information, shipping address). This database will use the MySQL architecture and will be manipulated using SQL queries via the content management system. The Online Shopping System will have the following key features:
An online shop that will allow online shoppers to buy wares from formal and
informal merchants. A search engine on the website to allow customers to find specific types of
merchandise. A secure online transaction system that will allow shoppers to purchase
goods safely using their credit cards. A database of merchandise with photos, product descriptions and stock information. This database will also contain
all relevant merchant and
customer information. A data security system that will ensure that all data that is transmitted between the various system
Project Online Shopping System
Page 2
Project Report On Online Shopping System Project Category: Relational Database Management System (RDBMS) : This is an RDBMS based project which is currently using MySQL for all the transaction statements. MySQL is an opensource RDBMS System. Brief Introduction about RDBSM : A relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model as invented by E. F. Codd, of IBM's San Jose Research Laboratory. Many popular databases currently in use are based on the relational database model. RDBMSs have become a predominant choice for the storage of information in new databases used for financial records, manufacturing and logistical information, personnel data, and much more since the 1980s. Relational databases have often replaced legacy hierarchical databases and network databases because they are easier to understand and use. However, relational databases have been challenged by
object
databases,
which were introduced
in
an
attempt to
address
the objectrelational impedance
mismatch
in
relational
database,
and
XML
databases.
RDBMS
Architecture Diagram Project Online Shopping System
Page 3
Project Report On Online Shopping System Tools/Platform, Hardware and Software Requirement specifications: For setting this ecommerce portal, it requires certain technical requirements to be met for the store to operate properly. First, a web server must be created to make the ecommerce store publicly available on the web. Domain names and hosting services can easily be purchased for an affordable price. When selecting a hosting service, you should check to see that these server requirements are provided and installed on their web servers: Software Details for running Online Shopping System Portal
Web Server (preferably Apache) PHP (at least 5.2) MySQL Curl
Required PHP libraries / modules
Curl ZIP Zlib GD Shopping Mcrypt Mbstrings
The above PHP extensions should be available by almost all hosting providers, during the install processa it will check you have them all enabled. You should contact your hosting provider if one is missing.
Project Online Shopping System
Page 4
Project Report On Online Shopping System Process Logic of each module: Orders Module: When a customer goes through checkout, the information on their order is automatically transferred to the Orders section for you to keep track of. In the administration, you can view all of the orders made on their site, manually add orders, or edit the details of existing orders. The Orders section is located under Sales > Orders. On this page, every order ever made from the store is listed in detail. Customer Module: Shop owners should know who their customers are and how to manage their information. In the administration, customer information will need to be stored efficiently to remember any transactions made with their account. To access customer information, you can log into the administration panel of the OpenCart store. The Customer management sections are located under Sales > Customers. There are three sections used to manage customer information: Customers, Customer Groups, and IP Blacklist. Affiliate Module: Ecommerce gives you the opportunity to set up an affiliate program to promote additional traffic to your shop. Affiliates will receive a commission for each time they direct traffic or sales to your site. The commission % can be adjusted in the administration under Sales > Affiliate. Coupons Module: You may create and designate coupons to specific products or product categories under Sales > Coupons. The Coupons page will display a list of all the coupons created in the administration. Gift vouchers: Gift vouchers can be individually sent to customers through their email by other customers in the store front. The customer receiving the gift certificate can use the code provided in the email at the shopping cart to deduct the gift voucher amount from the order total. To manage the Gift Vouchers of the store, go to Sales > Gift Vouchers > Gift Vouchers.
Project Online Shopping System
Page 5
Project Report On Online Shopping System Mail Module: The Mail system in OpenCart lets you send emails to specific customer groups. You can use this feature to send
newsletters, information on
specials, or to communicate any type of store information to select groups of customers.
Customer groups are especially useful in emailing specific groups of
people instead of every customer stored in the
administration. For more
information on how to create a customer group, see Customer Groups. The Mail page can be accessed from Sales > Mail. Profiles Module: Profiles are a new, optional feature in OpenCart 1.5.6. allow you to set up recurring payments for your customers.
They
Profiles are useful if
you plan to sell products by subscription, if you are promoting a discount or member's club, or if you are simply breaking up payments into smaller portions. This feature gives the store owner more control over how customers are charged for products or services. Manufacturers Module: The Manufacturer section is used to categorize products by manufacturer. This section can be accessed under Catalog > Manufacturers. The Manufacturer names below came with the install. They can be deleted, and new manufacturer information can be added in its place. The manufacturer information should be created before products are added, so the manufacturer category can be selected when adding the product. Saving a product without including the manufacturer isn't advised, because customers can search for products in the store front through their manufacturer page. With the manufacturer missing from the product information, the product will not be available on those pages. Categories Module: In the default theme of the store front, parent categories are listed in the top menu of the home page, and on the left side of product pages. This navigational feature is used to guide customers to similar products within the same category.
Exposing customers to different products within a category lets the
customer compare the similarities and differences between products to make the most informed purchase. When adding products to the store, you will be asked for a product category to sort them in. It is a good idea to establish these categories Project Online Shopping System
Page 6
Project Report On Online Shopping System before adding products, to save yourself the trouble of adding the category name to the products later.
Project Online Shopping System
Page 7
Project Report On Online Shopping System Implementation methodology: Model View Controller or MVC as it is popularly called, is a software design pattern for developing web applications. A Model View Controller pattern is made up of the following three parts:
Model - The lowest level of the pattern which is responsible for maintaining
data. View - This is responsible for displaying all or a portion of the data to the
user. Controller - Software Code that controls the interactions between the Model and View.
MVC is popular as it isolates the application logic from the user interface layer and supports separation of concerns. Here the Controller receives all requests for the application and then works with the Model to prepare any data needed by the View. The View then uses the data prepared by the Controller to generate a final presentable response. The MVC abstraction can be graphically represented as follows.
Project Online Shopping System
Page 8
Project Report On Online Shopping System
MVC (Model View Controller Flow) Diagram List of reports that are likely to be generated. Affiliate commission
report: The Affiliate
Commission Report can
be accessed from
Reports>Affiliates>Commission in the administration. This report lets you keep track of the affiliates who are making a commission for referring customers to the store.
The Affiliate Commission Report displays the following information: Affiliate Name: The name of the individual/company acting as an affiliate for
the store. E-mail: The e-mail for contacting the affiliate. Status: Shows if the affiliate is enabled or disabled. Commission: The commission amount made from a customer purchase. No. Orders: The number of orders obtained through this affiliate. Total: The total amount that this affiliate has earned through the affiliate program.
Customer reports: The Customer Reports section can be accessed under Reports>Customers. These reports display specific information to track orders made, reward points, and store credit for each customer using the store.
Project Online Shopping System
Page 9
Project Report On Online Shopping System Order reports : The Order Report section can be accessed under Reports>Customers>Orders. The following information will be displayed about customer orders:
Customer Name E-Mail Customer Group: The customer group the customer is categorized in. Status: Shows if the customer is currently allowed to login to their store
account. No. Orders: The total number of orders made by this customer. No. Products: The total number of products purchased by this customer. Total: The total amount purchased from this customer. Customers are arranged on the list from the highest amount to the lowest.
Reward points report : The Order Report section can be accessed under Reports>Customers>Reward Points. The following information will be displayed about customer reward point usage:
Customer Name E-Mail Customer Group: The customer group the customer is categorized in. Status: Shows if the customer is currently allowed to login to their store
account. Reward Points: The amount of reward points obtained by this customer. Reward points can be acquired by a customer by purchasing a product with reward points designated to it under its Data tab under Catalog>Products.
See Reward Points for more information. No. Orders: The total number of orders made by this customer. Total: The total amount purchased from this customer.
Customer credit report : The Order Report section can be accessed under Reports>Customers>Credit. The following information will be displayed about customer store credit:
Customer Name E-Mail Customer Group: The customer group the customer is categorized in.
Project Online Shopping System Page 10
Project Report On Online Shopping System
Status: Shows if the customer is currently allowed to login to their store
account. Total: The total amount purchased from this customer.
Products viewed report : The Products Viewed Report gives you an idea of what products are being viewed the most, or the least, in the store front. You can access this section under Reports > Products > Viewed in the administration side. The report will position the top viewed product first. Along with the product name and model, the report will display the number of customers who viewed that product in the store front, and the percentage of views for this specific product out of all the views for products on the site. Clicking "Reset" will clear the information below and reset the report to only collect information from that moment on. Sales reports : The reports under Sales Reports can be accessed from Reports Sales. Orders, taxes, shipping, returns, and coupon sales information can be tracked in list form. Tax Report : The Tax Report can be accessed through Reports > Sales > Tax. The Tax report displays which type of tax is being paid the most by customers in the store front. Tax information is displayed in either daily, weekly, monthly, or yearly increments depending on which option you select in the "Group By" drop box. The Tax Report displays the following information:
Date Start: The date of the first day of the week tracked (if set to week in
Group By). Date End: The date of the last day of the week tracked (if set to week in
Group By). Tax Title: The title of the tax type used. No. of Orders: The number of orders made through the store between the
date start and end. Total: The total amount of money paid for taxes by customers between the date start and end.
Project Online Shopping System Page 11
Project Report On Online Shopping System Shipping report : The Shipping Report can be accessed through Reports > Sales > Shipping. The Shipping report displays which shipping method is being used the most by customers in the store front. Shipping information is displayed in either daily, weekly, monthly, or yearly increments depending on which option you select in the "Group By" drop box. The Shipping Report displays the following information:
Date Start: The date of the first day of the week tracked (if set to week in
Group By). Date End: The date of the last day of the week tracked (if set to week in
Group By). Shipping Title: The shipping method used. The shipping title with the highest
total will be displayed at the top. The lowest total will be at the bottom. No. of Orders: The number of orders made through the store between the
date start and end. Total: The total amount of money paid for shipping between the date start and end.
Returns report : The Returns Report can be accessed through Reports>Sales>Returns. The returns report shows how many returns were requested within a given time frame. The returns information is displayed in either daily, weekly, monthly, or yearly increments depending on which option you select in the "Group By" drop box.
The Returns Report displays the following information: Date Start: The date of the first day of the week tracked (if set to week in
Group By) Date End: The date of the last day of the week tracked (if set to week in
Group By) No. Returns: The number of return requests submitted or created between the date start and date end.
Implementation of security mechanisms at various levels
Project Online Shopping System Page 12
Project Report On Online Shopping System Online Transaction Security System : The online transaction security system will provide a safe and secure method for online shoppers to make credit card purchases on the Online Shopping System website. When a credit purchase is made using the website, the credit card information will be encrypted using Secure Socket Layer (SSL) and transmitted to the bank for processing. This security system will also provide access control for website visitors, which will allow only registered users to make purchases. The registered customers account information will be stored in the customer information database mentioned earlier. Data Security System: The data security system will allow data to be securely transmitted between the various components of the Online Shopping System portal. This includes transmission of product, merchant and customer information from the content management system to the website, and also the transmission of data from the website to the content management system. Folder Security using .htaccess:
The .htaccess (short for “Hypertext
Accessâ€) file in your site’s directory is a configuration file you can use to override the settings on your web server. With the right commands, you can enable/disable extra functionality and features to protect your site from spammers, hackers and other threats. Prevent Directory Browsing: Protecting directories from being listed is, at best, security by obscurity. That is, its hiding your stuff from view, preventing meddling visitors from browsing through your directories. Really, its the web equivalent of hiding your cash under your mattress.Still, its good practice to prevent directory browsing, along with implementing other measures to secure your site. To disable browsing of your directories, add this to your .htaccess file: Options All –Indexes Restrict Access to Your Admin Area : A simple way to restrict access if your internet has a fixed IP address and you always access your site form the same location is by creating a new .htaccess file with the following snippet: order deny,allow allow from 192.168.5.1 Project Online Shopping System Page 13
Project Report On Online Shopping System deny from all
Project Online Shopping System Page 14
Project Report On Online Shopping System
Project Online Shopping System Page 15
Project Report On Online Shopping System Online Shopping System high level process Workflow
Dataflow Diagram Level 0
Online Shopping System
Online Shopping System Database
Project Online Shopping System Page 16
Project Report On Online Shopping System Dataflow Diagram Level 1
Project Online Shopping System Page 17
Project Report On Online Shopping System Dataflow Diagram Level 2
Project Online Shopping System Page 18
Project Report On Online Shopping System Database Structure and Table Details Category Table Coupon Table
Customer Table
Manufacturer Table
Customer Table Description
Project Online Shopping System Page 19
Project Report On Online Shopping System
Order History Table Description
Project Online Shopping System Page 20
Project Report On Online Shopping System Product Discount Table Description
Product Image Table Description
Project Online Shopping System Page 21
Project Report On Online Shopping System Order Table Description
Store Table Description Product Table Description
Project Online Shopping System Page 22
Project Report On Online Shopping System
Project Online Shopping System Page 23
Project Report On Online Shopping System Voucher Table Description
User Table Description
Project Online Shopping System Page 24
Project Report On Online Shopping System Return Table Description Tax Rate Table Description
Project Online Shopping System Page 25
Project Report On Online Shopping System
SYSTEM ANALYSIS The analysis model is a concise, precise abstraction of what the desired system must do, and not how it will be done after the study of the existing system is completed. This basically includes
system
study
and
the
requirement
analysis.
Interacting with the clients regarding their requirements and expectations from the system does requirement analysis. The steps, which are essential for system analysis, are: 1. Research and define essential components. 2. Analyze current processes and identify gaps. 3. Interview personnel
users,
Trainee,
regarding
Trainers
essential
and
other
components
concerned
and
current
processes. 4. Write requirements document. 5. Define standards for standards, policies, and procedures. 6. Review draft requirements document with users, Trainee, Trainers and other concerned personnel. 7. Update and expand project plan.
Project Online Shopping System Page 26
Project Report On Online Shopping System
IDENTIFICATION OF NEED Online Shopping Management Systems described above can lead to error free, secure reliable and fast management system for Shopping . It can assist the staff to concentrate on their related (for Shopping) activities rather to concentrate on the records and reports of issuing Products, registration and suppliers. This will help organization in better utilization of human resources. In this phase, the user identifies the need for a new or improved system. In large organizations this identification may be part of a systems planning process.
Project Online Shopping System Page 27
Project Report On Online Shopping System
PRELIMINARY INVESTIGATION Benefit to Organization The organization will obviously be able to gain benefits such as savings in operating cost, reduction in paperwork, better utilization of human resources and more presentable image increasing goodwill. The other benefits are improved service and faster and better access to up-to-date information. The Initial Cost The initial cost of setting up the system will include the cost of hardware
(server/clients,
network
adapter
and
related
hardware), software (server OS, add-on software, utilities) & labor (setup & maintenance). The same has to bear by the organization. Running Cost Besides, the initial cost the long term cost will include the running cost for the system including the AMC, Product charges, cost for human resources, cost for update/renewal of various related software. Need for Training The users along with the administrator need to be trained at the time of implementation of the system for smooth running of the system. The client will provide the training site. Project Online Shopping System Page 28
Project Report On Online Shopping System
Depending upon this definition, we analyzed the present Shopping
Management System, during the analysis process;
we had to go through the entire manual system that was being followed in the Organization for past few years. We talked to the management people who were managing a the financial issues of the center, staff who were keeping the records in lots of registers and the reporting manager regarding their existing system, their requirements and their expectations from the new proposed system. Then, we did the system study of the entire system based on their requirements and the additional features they wanted to incorporate in this system. The manual system was very complex to be managed and searching or updating the information was also very difficult. There was a lengthy procedure for entering the details of Products, members, visitors, and then making their timings and Bills. The other problem with the manual system was of report generation.
The
reports
to
be
generated
on
a
daily/weekly/monthly basis required lot of paper work and calculations etc. Thus, Reporting Manager had to manually Project Online Shopping System Page 29
Project Report On Online Shopping System calculate all the consultation fees of every player at the end of every day/week/month. Even a small calculation mistake was leading to reanalysis and recreation of whole work.
Project Online Shopping System Page 30
Project Report On Online Shopping System
FEASIBILITY STUDY At this stage, the analyst estimates the urgency of the project and estimates the development cost. In feasibility analysis, we have to study the following: 1)Technical Feasibility: Technical feasibility is concerned with the availability of hardware and software required for the development of the system, to see compatibility and maturity of the technology proposed to be used and to see the availability of the required technical manpower to develop the system. After the study we came to conclusion that we proceed further with the tools and development environment chosen by us. This was important in our case as we were working on two various phases of the department that will need to be integrated in future to make an extended system. 2)Operational Feasibility: Operational feasibility is all about problems that may arise during operations. There are two aspects related with this issue: What is the probability that the solution developed may not be put to use or may not work?
Project Online Shopping System Page 31
Project Report On Online Shopping System What is the inclination of the management and end users towards the solution? Though, there is very least possibility of management being averse to the solution, there is a significant probability that the end users may not be interested in using the solution due to lack of training, insight etc. 3)Economic Feasibility: It is the measure of cost effectiveness of the project. The economic feasibility is nothing but judging whether the possible benefit of solving the problems is worthwhile of not. At the feasibility study level, it is impossible to estimate the cost
because
member’s
requirements
and
alternative
solutions have not been identified at this stage. However, when the specific requirements and solutions have been identified, the analyst weighs the cost and benefits of all solutions, this is called “cost benefit analysis.
Project Online Shopping System Page 32
Project Report On Online Shopping System
PROJECT PLANNING Software project plan can be viewed as the following: 1)Within the organisation: How the project is to be implemented? What are various constraints (time, cost, staff)? What is market strategy? 2)With respect to the customer: Weekly or timely meetings with the customer with presentation on status reports. Customers feedback is also taken and further modification and
developments
are
done.
Project
milestones
and
deliverables are also presented to the customer. For a successful software project, the following steps can be followed: Select a project o Identifying project’s aims and objectives o Understanding requirements and specification o Methods of analysis, design and implementation o Testing techniques o Documentation Project milestones and deliverables Budget allocation Project Online Shopping System Page 33
Project Report On Online Shopping System o Exceeding limits within control Project Estimates o Cost o Time o Size of code o Duration Resource Allocation o Hardware o Software o Previous relevant project information o Digital Shopping Risk Management o Risk avoidance o Risk detection
Project Online Shopping System Page 34
Project Report On Online Shopping System
PROJECT SCHEDULING An elementary Gantt chart or Timeline chart for the development plan is given below. The plan explains the tasks versus the time (in weeks) they will take to complete.
January
February
March
Requirement Gathering Analysis Design Coding Testing Implement W1
W2
W3
W4
W1
Wi‘s are weeks of the months, for i =1, 2, 3, 4
Project Online Shopping System Page 35
W2
W3
W4
W1
W2
W3
W4
Project Report On Online Shopping System
SOFTWARE
REQUIREMENT
SPECIFICATION The Software Requirements Specification is produced at the culmination of the analysis task. The function and performance allocated to software as part of system engineering are refined by establishing a complete information description, a detailed functional
and
behavioral
description,
an
indication
of
performance requirements and design constraints, appropriate validation criteria, and other data pertinent to requirements. 1. Introduction 1.1.
Purpose –
The main purpose, to make this software
is to over come of
problems of data base handling,
maintain registers of members, Products, and information about worker which are works at Shopping etc. 1.2.
Intended Audience – This SRS is meant for basically
my final semester project report of MCA. Besides, it is obviously targeted for the managers of mentioned center, the client, to get and overall description and advantage of the proposed system over the existing manual system.
Project Online Shopping System Page 36
Project Report On Online Shopping System 1.3.
Product Vision and Scope – The proposed system is
being developed keeping in mind the requirements/need of the client to automate its existing system for record keeping,
report
generation
and
management
level
information system. Keeping in mind the needs, the system has been developed as per guidelines laid by the client’s center. The system is capable enough to handle Shopping records,
Product’s
records,
report
records,
member’s
generation,
and
records,
storing
other
visitors related
information. 2. Overall Description 2.1 Product Perspectives: The proposed system falls under RDBMS (Relational Data Base Management System) category. I have adopted PHP as front end for the software and MYSQL as back end. PHP is at present one of the most popular development platform for web based system that is efficient for web programming. MYSQL is at present the most reliable and secure RDBMS tool. MYSQL Server works to efficiently manage its resource, a database of information, among the multiple clients requesting and sending data in the network. MYSQL has many important features
that
make
it
not
only
Project Online Shopping System Page 37
an
exceptional
database
Project Report On Online Shopping System management system but also an excellent database server choice for client/server database computing. So the overall system will prove to reliable, secure and efficient for the organization. 2.2
Product Functions
Functionalities:
2.2.1 Any person can query for Products availability according to specified conditions. 2.2.3
A Person can Product/cancel the Product only after he
logs in. 2.2.4
2.2.4 A user can sign up for a profile if he doesn’t have
one already. 2.2.5
On logging in, the user has options to 1. Product issued . 2. Edit Profile information 3. Cancellation of his Producted issued. 4. View all current Products Producted by him. 5. Logout
Project Online Shopping System Page 38
Project Report On Online Shopping System 2.2.6
A person can get all information regarding a Shopping
if he keys in it. A person can get all information about a Products if he keys in the Product id. A person can get the availability of all Products for the next 20 days. Official members are suppose to do that work which distributed by the administrator Administrator
or
assigned
official
members
can
members
can
add/modify/delete Shopping information. Administrator
or
assigned
official
add/modify/delete seat type according their availability and generate report. Administrator
or
assigned
official
members
can
add/modify/delete Shopping information. Administrator or assigned official members can define and manage charges information. Administrator or assigned official members can define scheme and modify time to time and generate report. Administrator can add/modify/delete official member and generate report. Project Online Shopping System Page 39
Project Report On Online Shopping System Administrator can add/modify/delete user information and generate report.
2.3. Operating Environment – The proposed software is to run on
client/server model network.
A client/server can deliver the better performance than the file server system because a client application and database server work together to split processing load of applications (thus the term distributed processing). The server manages the database among the number of clients, while the client send, request, and analyze the data entry form with small specific data set, such as rows in a table not file as in the file server system. A database server is intelligent enough so that it lock and return only the rows a client request, which ensure
concurrency, minimize
the
network
traffic
and
increase the system performance. 2.4. Assumptions
and Dependencies – While cost
estimation of the proposed system it has been assumed that the cost hardware and for license of Operating System and back end will be met by client (the organization). Hence only the cost incurred for the proposed software is included therein.
Project Online Shopping System Page 40
Project Report On Online Shopping System The followings are identified as some of the potential risk factors or
dependencies:
(1)
Non-availability of required resources.
(2)
Power cuts.
(3)
Slippage of schedule due to unpredictable holidays, etc.
2.5 Life Cycle Model – I am using SDLC model that begin at system level and progresses through analysis, design, coding, testing, implementation and maintenance. 3.
External Interface Requirements
3.1 User Interfaces – It has been required that every form’s interface should be user friendly and simple to use. Besides, there should be facility of accessing the system through keyboard along with the mouse i.e.
keyboard shortcuts.
3.2 Software Interfaces – It has been required that there could be a necessity of using the stored data for some kind of report that is not supported by proposed system at present. So the proposed system is required to export its data as text file so that some other application software can import the data. 4.
System Future Requirement – Other than descriptions
provided above, the following features were required by the client: Project Online Shopping System Page 41
Project Report On Online Shopping System (1)
The system should be secured enough to rely upon.
(2)
Users should not be allowed to delete/modify any records.
(3)
Users should not be allowed to take financial reports.
(4)
Every users report should keep the tracks of user inputting the record.
(5)
System should provide facility of exporting its data in text format.
(6)
System should be able to integrate with its Phase II developments.
5. Other Nonfunctional Requirements a. Performance Requirements – As it is going to be used by all the concerned employees within the organization, the system should have a good performance in terms of speed and accuracy. The proposed system should be accurate and fast enough to handle huge data. It should provide fast communication between server and clients. b. Safety Requirements – As the system is going to handle records for a long run eliminating the manual Project Online Shopping System Page 42
Project Report On Online Shopping System system, it is supposed to ensure the retaining of data avoiding or eliminating any probable cause for data loss. c. Security Requirements – The software should not allow unauthorized access to any module of the system. Besides, it should maintain the privileges granted to users at various user levels. d. Software Quality Attributes – The prioritization of the software quality attributes are assumed as under: (1)
Accurate and hence reliable.
(2)
Secured.
(3)
Fast speed.
(4)
Compatibility.
(5)
Portability.
Project Online Shopping System Page 43
Project Report On Online Shopping System
System Design In this phase, a logical system is built which fulfils the given requirements. Design phase of software development deals with transforming the customer’s requirements into a logically working system. Normally, design is performed in the following in the following two steps: 1)Primary Design Phase: In this phase, the system is designed at block level. The blocks are created on the basis of analysis
done in the problem
identification
phase.
Different blocks are created for different functions emphasis is put on minimising the information flow between blocks. Thus, all activities which require more interaction are kept in one block. 2)Secondary Design Phase : In the secondary phase the detailed design of every block is performed. The general tasks involved in the design process are the following: I. Design various blocks for overall system processes. II. Design smaller, compact and workable modules in each block. III. Design various database structures.
Project Online Shopping System Page 44
Project Report On Online Shopping System IV. Specify
details
of
programs
to
achieve
desired
functionality. V. Design the form of inputs, and outputs of the system. VI. Perform documentation of the design. VII. System reviews.
User Interface Design User Interface Design is concerned with the dialogue between a user and the computer. It is concerned with everything from starting the system or logging into the system to the eventually presentation of desired inputs and outputs. The overall flow of screens and messages is called a dialogue. The
following
steps
are
various
guidelines
for
User
Interface Design: 1) The system user should always be aware of what to do next. 2) The screen should be formatted so that various types of information, instructions and messages always appear in the same general display area. 3) Message, instructions or information should be displayed long enough to allow the system user to read them. Project Online Shopping System Page 45
Project Report On Online Shopping System 4) Use display attributes sparingly. 5) Default values for fields and answers to be entered by the user should be specified. 6) A user should not be allowed to proceed without correcting an error. 7) The system user should never get an operating system message or fatal error.
Project Online Shopping System Page 46
Project Report On Online Shopping System TESTING Testing is the process in which the system is run on manually created input so that the system is correctly working as desired or not. During systems testing, the system is used experimentally to ensure that the software does not fail. In other words, we can say that it will run according to its specifications and in the way users expect. Special test data are input for processing, and the results examined. A limited number of users may be allowed to use the system so that analyst can see whether they try to use it in unforeseen ways. It is desirable to discover any surprises before the organization implements the system and depends on it. Testing of a system is generally done in two phases – One is Unit Testing which is done for each module independently on its completion and the other one is System Testing which is done at the end of a project.
Project Online Shopping System Page 47
Project Report On Online Shopping System VALIDATION CRITERIA The validation criteria in this project are as follows... In Online Shopping System System also, the user inputs are validated before storing them, and then further for displaying etc. The main validations that are done in Online Shopping System System are as follows – All the screens have a similar look and feel. They all have the almost same color combinations in its background. This provides a better user interface to the users. 1) The primary key values cannot be duplicated. 2) All the entries in any combo box have been sorted in alphabetical order. This helps a user while selecting a value from the combo box.
IMPORTANCE OF TESTING During systems testing, the system is used experimentally to ensure that the software does not fail. In other words, we can say that it will run according to its specifications and in the way users expect. Special test data are input for processing, and the results examined. The importance of system testing is that the system is expected to run according to member’s requirement before delivering it to the customer.
Project Online Shopping System Page 48
Project Report On Online Shopping System The System is tested on the basis of specification so that it does not fail on user site.
Project Online Shopping System Page 49
Project Report On Online Shopping System
Implementation and Testing
Implementation Detailed Design of Implementation - This phase of the systems development life cycle refines hardware and software specifications, establishes programming plans, trains users and implements extensive testing procedures, to evaluate design and operating specifications and/or provide the basis for further modification. Technical Design - This activity builds upon specifications produced during new system design, adding detailed technical specifications and documentation. Test Specifications and Planning - This activity prepares detailed test specifications for individual modules and programs, job streams, subsystems, and for the system as a whole. Programming and Testing - This activity encompasses actual development, writing, and testing of program units or modules. User
Training
-
procedure manuals,
This
activity
preparation
encompasses of user
writing
user
training materials,
conducting training programs, and testing procedures. Acceptance Test - A final procedural review to demonstrate a system and secure user approval before a system becomes Project Online Shopping System Page 50
Project Report On Online Shopping System operational. Installation Phase - In this phase the new Computerized system is installed, the conversion to new procedures is fully implemented, and the potential of the new system is explored. System Installation: The process of starting the actual use of a system and training user personnel in its operation. Review Phase - This phase evaluates the successes and failures during a systems development project, and to measure the results of a new Computerized Transystem in terms of benefits and savings projected at the start of the project. Development Recap - A review of a project immediately after completion to find successes and potential problems in future work. Post-Implementation Review - A review, conducted after a new system has been in operation for some time, to evaluate actual system performance against original expectations and projections for cost-benefit improvements. Also identifies maintenance projects to enhance or improve the system.
THE STEPS IN THE SOFTWARE TESTING The steps involved during Unit testing are as follows: a) Preparation of the test cases. b) Preparation of the possible test data with all the validation Project Online Shopping System Page 51
Project Report On Online Shopping System checks. c) Complete code review of the module. d) Actual testing done manually. e) Modifications done for the errors found during testing. f) Prepared the test result scripts. The unit testing done included the testing of the following items: 1) Functionality of the entire module/forms. 2) Validations for user input. 3) Checking of the Coding standards to be maintained during coding. 4) Testing the module with all the possible test data. 5) Testing of the functionality involving all type of calculations etc. 6) Commenting standard in the source files. After completing the Unit testing of all the modules, the whole system is integrated with all its dependencies in that module. While System Integration, We integrated the modules one by one and tested the system at each step. This helped in reduction of errors at the time of the system testing. The steps involved during System testing are as follows: Integration of all the modules/forms in the system. Preparation of the test cases. Project Online Shopping System Page 52
Project Report On Online Shopping System Preparation of the possible test data with all the validation checks. Actual testing done manually. Recording of all the reproduced errors. Modifications done for the errors found during testing. Prepared the test result scripts after rectification of the errors.
The System Testing done included the testing of the following items: 1. Functionality of the entire system as a whole. 2. User Interface of the system. 3. Testing the dependent modules together with all the possible test data scripts. 4. Verification and Validation testing. 5. Testing the reports with all its functionality. After the completion of system testing, the next following phase was the Acceptance Testing. Clients at their end did this and accepted the system with appreciation. Thus, we reached the final phase of the project delivery.
Project Online Shopping System Page 53
Project Report On Online Shopping System There are other six tests, which fall under special category. They are described below: i.
Peak Load Test: It determines whether the system will handle the volume of activities that occur when the system is at the peak of its processing demand. For example, test the system by activating all terminals at the same time.
ii.
Storage Testing: It determines the capacity of the system to store transaction data on a disk or in other files.
iii.
Performance Time Testing: it determines the length of time system used by the system to process transaction data. This test is conducted prior to implementation to determine how long it takes to get a response to an inquiry, make a backup copy of a file, or send a transmission and get a response.
iv.
Recovery Testing: This testing determines the ability of user to recover data or re-start system after failure. For example, load backup copy of data and resume processing without data or integrity loss.
v.
Procedure
Testing:
It
determines
the
clarity
of
documentation on operation and uses of system by having users do exactly what manuals request. For example, powering down system at the end of week or responding to paper-out light on printer. Project Online Shopping System Page 54
Project Report On Online Shopping System vi.
Human Factors Testing: It determines how users will use the system when processing data or preparing reports.
Project Online Shopping System Page 55
Project Report On Online Shopping System COST ESTIMATION OF THE PROJECT Software cost comprises a small percentage of overall computerbased system cost. There are a number of factors, which are considered, that can affect the ultimate cost of the software such as - human, technical, Hardware and Software availability etc. The main point that was considered during the cost estimation of project was its sizing. In spite of complete software sizing, function point and approximate lines of code were also used to "size" each element of the Software and their costing. The cost estimation done by me for Project also depend upon the baseline metrics collected from past projects and these were used in conjunction with estimation variables to develop cost and effort projections. We have basically estimated this project mainly on two bases 1) Effort Estimation - This refers to the total man-hours required for the development of the project. It even includes the time required for doing documentation and user manual. 2) Hardware Required Estimation - This includes the cost of the PCs and the hardware cost required for development of this project.
Project Online Shopping System Page 56
Project Report On Online Shopping System GANTT CHART
January
February
March
Requirement Gathering Analysis Design Coding Testing Implement W1
W2
W3
W4
W1
Wi‘s are weeks of the months, for i =1, 2, 3, 4
Project Online Shopping System Page 57
W2
W3
W4
W1
W2
W3
W4
Project Report On Online Shopping System
Project Online Shopping System Page 58
Project Report On Online Shopping System
Project Online Shopping System Page 59
Project Report On Online Shopping System
Project Online Shopping System Page 60
Project Report On Online Shopping System
Project Online Shopping System Page 61
Project Report On Online Shopping System
Project Online Shopping System Page 62
Project Report On Online Shopping System
Project Online Shopping System Page 63
Project Report On Online Shopping System
Project Online Shopping System Page 64
Project Report On Online Shopping System
Project Online Shopping System Page 65
Project Report On Online Shopping System
Project Online Shopping System Page 66
Project Report On Online Shopping System
Project Online Shopping System Page 67
Project Report On Online Shopping System
Project Online Shopping System Page 68
Project Report On Online Shopping System
Project Online Shopping System Page 69
Project Report On Online Shopping System
Project Online Shopping System Page 70
Project Report On Online Shopping System
Project Online Shopping System Page 71
Project Report On Online Shopping System
Project Online Shopping System Page 72
Project Report On Online Shopping System
Project Online Shopping System Page 73
Project Report On Online Shopping System
Project Online Shopping System Page 74
Project Report On Online Shopping System
Project Online Shopping System Page 75
Project Report On Online Shopping System
Project Online Shopping System Page 76
Project Report On Online Shopping System
Project Online Shopping System Page 77
Project Report On Online Shopping System Code for Cart.java package Model; import java.util.*; import java.sql.*; import com.*; import java.io.*;
public class Cart extends Connect { /////Function for connect to the MySQL Server Database//////////// public Cart() { Connect.connect_mysql(); } //////////Save User Details ///// public String saveCart(HashMap cartData) { String SQL = ""; String error = ""; int count = 0; /// Check the Item exits in the cart or not //// try { SQL = "SELECT * FROM `cart` WHERE cart_product_id = "+cartData.get("cart_product_id"); Project Online Shopping System Page 78
Project Report On Online Shopping System statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next()) { count++; } if(count != 0) { SQL="DELETE FROM cart WHERE cart_product_id = "+cartData.get("cart_product_id"); statement.executeUpdate(SQL); }
//// Insert Item into cart //// SQL = "INSERT INTO `cart` (`cart_user_id`, `cart_product_id`, `cart_quantity`, `cart_total`, `cart_price_per_unit`) VALUES (?, ?, ?, ?, ?);"; int record=0;
pstmt = connection.prepareStatement(SQL); pstmt.setString(1,(String) cartData.get("cart_user_id")); pstmt.setString(2,(String) cartData.get("cart_product_id")); pstmt.setString(3,(String) cartData.get("cart_quantity")); pstmt.setString(4,(String) cartData.get("cart_total")); pstmt.setString(5,(String) cartData.get("cart_price_per_unit")); Project Online Shopping System Page 79
Project Report On Online Shopping System
record = pstmt.executeUpdate(); pstmt.close(); connection.close(); } catch(Exception e) { StringWriter writer = new StringWriter(); PrintWriter printWriter = new PrintWriter( writer ); e.printStackTrace( printWriter ); printWriter.flush(); String stackTrace = writer.toString(); error+="Error : "+stackTrace; System.out.println(" Error : "+ e.toString()); } return error; } ////////////////Function for getting all the Airport Details//////////////////// public ArrayList getAllCart() { String SQL = "SELECT * FROM `cart`,`product` WHERE product_id = cart_product_id"; int count=0; ArrayList resultArray = new ArrayList(); Project Online Shopping System Page 80
Project Report On Online Shopping System try { statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next()) { HashMap results = new HashMap(); results.put("cart_id",rs.getString("cart_id"));
results.put("cart_product_id",Integer.parseInt(rs.getString("cart_product_id" ))); results.put("cart_quantity",rs.getString("cart_quantity")); results.put("cart_total",rs.getString("cart_total")); results.put("cart_price_per_unit",rs.getString("cart_price_per_unit")); results.put("product_name",rs.getString("product_name")); results.put("product_image",rs.getString("product_image")); count++; resultArray.add(results); } } catch(Exception e) {
Project Online Shopping System Page 81
Project Report On Online Shopping System System.out.println("Error is: "+ e); } return resultArray; } //////////////////Funtion for delete the record////////////////////////// public boolean deleteCart(int cart_id) { String SQL="DELETE FROM cart WHERE cart_id = "+cart_id; int is_deleted=0; try { is_deleted = statement.executeUpdate(SQL); } catch(Exception e) { System.out.println("Error : "+e); } if(is_deleted==1) return true; return false; } }
Project Online Shopping System Page 82
Project Report On Online Shopping System Code for Customer.java package Model;
import java.util.*; import java.sql.*; import com.*; import java.io.*;
public class Customer extends Connect { /////Function for connect to the MySQL Server Database//////////// public Customer() { Connect.connect_mysql(); } //////////Save User Details ///// public String saveCustomer(HashMap customerData) { String SQL = "INSERT INTO `customer` (`customer_name`, `customer_mobile`, `customer_email`, `customer_password`, `customer_address`, `customer_city`, `customer_state`, `customer_pincode`) VALUES (?, ?, ?, ?, ?, ?, ?, ?);"; int record=0; String error = "";
Project Online Shopping System Page 83
Project Report On Online Shopping System try { pstmt = connection.prepareStatement(SQL); pstmt.setString(1,(String) customerData.get("customer_name")); pstmt.setString(2,(String) customerData.get("customer_mobile")); pstmt.setString(3,(String) customerData.get("customer_email")); pstmt.setString(4,(String) customerData.get("customer_password")); pstmt.setString(5,(String) customerData.get("customer_address")); pstmt.setString(6,(String) customerData.get("customer_city")); pstmt.setString(7,(String) customerData.get("customer_state")); pstmt.setString(8,(String) customerData.get("customer_pincode"));
record = pstmt.executeUpdate(); pstmt.close(); connection.close(); } catch(Exception e) { StringWriter writer = new StringWriter();
Project Online Shopping System Page 84
Project Report On Online Shopping System PrintWriter printWriter = new PrintWriter( writer ); e.printStackTrace( printWriter ); printWriter.flush(); String stackTrace = writer.toString(); error+="Error : "+stackTrace; System.out.println(" Error : "+ e.toString()); } return error; } //////////////////Function for getting Users Details////////// public HashMap getCustomerDetails(int customer_id) { HashMap results = new HashMap(); int count=0; try { String SQL = "SELECT * FROM `customer` WHERE customer_id = "+customer_id ; statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next()) { results.put("customer_name",rs.getString("customer_name"));
Project Online Shopping System Page 85
Project Report On Online Shopping System results.put("customer_mobile",rs.getString("customer_mobile")); results.put("customer_email",rs.getString("customer_email")); results.put("customer_password",rs.getString("customer_password")); results.put("customer_address",rs.getString("customer_address")); results.put("customer_city",rs.getString("customer_city"));
results.put("customer_state",Integer.parseInt(rs.getString("customer_state" ))); results.put("customer_pincode",rs.getString("customer_pincode")); results.put("customer_id",rs.getString("customer_id")); count++; } if(count==0) { results.put("customer_name",""); results.put("customer_mobile",""); results.put("customer_email",""); results.put("customer_password",""); results.put("customer_address",""); results.put("customer_city",""); Project Online Shopping System Page 86
Project Report On Online Shopping System results.put("customer_state",0); results.put("customer_pincode",""); results.put("customer_id",""); } } catch(Exception e) { System.out.println("Error is: "+ e); } return results; } /// Update the Customer //// public String updateCustomer(HashMap customerData) { String SQL = "UPDATE `customer` SET `customer_name` = ?, `customer_mobile` = ?, `customer_email` = ?, `customer_password` = ?, `customer_address` = ?, `customer_city` = ?, `customer_state` = ?, `customer_pincode` = ? WHERE `customer_id` = ?;"; String error = "";
int record=0;
try { pstmt = connection.prepareStatement(SQL);
Project Online Shopping System Page 87
Project Report On Online Shopping System pstmt.setString(1,(String) customerData.get("customer_name")); pstmt.setString(2,(String) customerData.get("customer_mobile")); pstmt.setString(3,(String) customerData.get("customer_email")); pstmt.setString(4,(String) customerData.get("customer_password")); pstmt.setString(5,(String) customerData.get("customer_address")); pstmt.setString(6,(String) customerData.get("customer_city")); pstmt.setString(7,(String) customerData.get("customer_state")); pstmt.setString(8,(String) customerData.get("customer_pincode")); pstmt.setString(9,(String) customerData.get("customer_id")); record = pstmt.executeUpdate(); pstmt.close(); connection.close(); } catch(Exception e) { StringWriter writer = new StringWriter(); PrintWriter printWriter = new PrintWriter( writer ); e.printStackTrace( printWriter ); printWriter.flush(); Project Online Shopping System Page 88
Project Report On Online Shopping System String stackTrace = writer.toString(); error+="Error : "+stackTrace; System.out.println(" Error : "+ e.toString()); } return error; }
////////////////Function for getting all the Airport Details//////////////////// public ArrayList getAllCustomer() { String SQL = "SELECT * FROM `customer`"; int count=0; ArrayList resultArray = new ArrayList(); try { statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next()) { HashMap results = new HashMap(); results.put("customer_name",rs.getString("customer_name")); results.put("customer_mobile",rs.getString("customer_mobile"));
Project Online Shopping System Page 89
Project Report On Online Shopping System results.put("customer_email",rs.getString("customer_email")); results.put("customer_password",rs.getString("customer_password")); results.put("customer_address",rs.getString("customer_address")); results.put("customer_city",rs.getString("customer_city"));
results.put("customer_state",Integer.parseInt(rs.getString("customer_state" ))); results.put("customer_pincode",rs.getString("customer_pincode")); results.put("customer_id",rs.getString("customer_id")); count++; resultArray.add(results); } } catch(Exception e) { System.out.println("Error is: "+ e); } return resultArray; } /////Function for Getting the List//////////// public String getStateOption(Integer SelID) Project Online Shopping System Page 90
Project Report On Online Shopping System { int selectedID = SelID.intValue(); return Connect.getOptionList("state","state_id","state_name","state_id,state_name ",selectedID,"1"); } //////////////////Function for getting Login Details////////// public HashMap getLoginDetails(String login_user,String login_password) { HashMap resultsArray = new HashMap(); int count=0; try { String SQL = "SELECT * FROM customer WHERE customer_email = '"+login_user+"' AND customer_password = '"+login_password+"'" ; statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next()) { resultsArray.put("customer_id",rs.getString("customer_id")); resultsArray.put("customer_name",rs.getString("customer_name")); resultsArray.put("login_level",4); count++; } Project Online Shopping System Page 91
Project Report On Online Shopping System if(count==0) { resultsArray.put("customer_id",""); resultsArray.put("customer_name",""); resultsArray.put("login_level",0); } } catch(Exception e) { System.out.println("Error is: "+ e); } return resultsArray; } //////////////////Function for checking the existing username////////// public int checkUsernameExits(String login_user, int type) { HashMap resultsArray = new HashMap(); int exits=0; try { String SQL = ""; if(type == 1) { SQL = "SELECT * FROM customer WHERE customer_email = '"+login_user+"'" ; } Project Online Shopping System Page 92
Project Report On Online Shopping System statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next()) { exits++; } } catch(Exception e) { System.out.println("Error is: "+ e); } return exits; } //////////////////Function for geting the Single Airport Details////////// public boolean checkLogin(String login_user,String login_password) { int count=0; try { String SQL = "SELECT * FROM customer WHERE customer_email = '"+login_user+"' AND customer_password = '"+login_password+"'" ; statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next())
count++;
} Project Online Shopping System Page 93
Project Report On Online Shopping System catch(Exception e) { System.out.println("Error is: "+ e); } if(count==0) return false; return true; } }
Project Online Shopping System Page 94
Project Report On Online Shopping System Code Fro Employee.java package Model;
import java.util.*; import java.sql.*; import com.*; import java.io.*;
public class Employee extends Connect { /////Function for connect to the MySQL Server Database//////////// public Employee() { Connect.connect_mysql(); } //////////Save User Details ///// public String saveEmployee(HashMap employeeData) {
String SQL = "INSERT INTO employee (employee_sal, employee_first_name, employee_middle_name, employee_last_name, employee_gender, employee_address, employee_village, employee_state, employee_country, employee_landline, employee_mobile, employee_email, employee_status, employee_deparment, employee_dob, employee_nationalty, employee_manager_id, employee_role) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);";
Project Online Shopping System Page 95
Project Report On Online Shopping System int record=0,last_inserted_id=0; String error = "";
try { pstmt = connection.prepareStatement(SQL, Statement.RETURN_GENERATED_KEYS); pstmt.setString(1,(String) employeeData.get("employee_sal")); pstmt.setString(2,(String) employeeData.get("employee_first_name")); pstmt.setString(3,(String) employeeData.get("employee_middle_name")); pstmt.setString(4,(String) employeeData.get("employee_last_name")); pstmt.setString(5,(String) employeeData.get("employee_gender")); pstmt.setString(6,(String) employeeData.get("employee_address")); pstmt.setString(7,(String) employeeData.get("employee_village")); pstmt.setString(8,(String) employeeData.get("employee_state")); pstmt.setString(9,(String) employeeData.get("employee_country")); pstmt.setString(10,(String) employeeData.get("employee_landline")); pstmt.setString(11,(String) employeeData.get("employee_mobile"));
Project Online Shopping System Page 96
Project Report On Online Shopping System pstmt.setString(12,(String) employeeData.get("employee_email")); pstmt.setString(13,(String) employeeData.get("employee_status")); pstmt.setString(14,(String) employeeData.get("employee_deparment")); pstmt.setString(15,(String) employeeData.get("employee_dob")); pstmt.setString(16,(String) employeeData.get("employee_nationalty")); pstmt.setString(17,(String) employeeData.get("employee_manager_id")); pstmt.setString(18,(String) employeeData.get("employee_role"));
record = pstmt.executeUpdate(); /// Get the Last Insert ID /// rs = pstmt.getGeneratedKeys(); if(rs.next()) { last_inserted_id = rs.getInt(1); }
pstmt.close(); } catch(Exception e) { Project Online Shopping System Page 97
Project Report On Online Shopping System StringWriter writer = new StringWriter(); PrintWriter printWriter = new PrintWriter( writer ); e.printStackTrace( printWriter ); printWriter.flush(); String stackTrace = writer.toString(); error+="Error : "+stackTrace; System.out.println(" Error : "+ e.toString()); }
/// Save Credentials to Login //// SQL = "INSERT INTO login (login_emp_id, login_user, login_password, login_email, login_level) VALUES (?, ?, ?, ?, ?);"; try { pstmt = connection.prepareStatement(SQL); pstmt.setInt(1,last_inserted_id); pstmt.setString(2,(String) employeeData.get("employee_user")); pstmt.setString(3,(String) employeeData.get("employee_password")); pstmt.setString(4,(String) employeeData.get("employee_email")); pstmt.setString(5,(String) employeeData.get("employee_role")); record = pstmt.executeUpdate(); pstmt.close(); connection.close(); Project Online Shopping System Page 98
Project Report On Online Shopping System } catch(Exception e) { StringWriter writer = new StringWriter(); PrintWriter printWriter = new PrintWriter( writer ); e.printStackTrace( printWriter ); printWriter.flush(); String stackTrace = writer.toString(); error+="Error : "+stackTrace; System.out.println(" Error : "+ e.toString()); }
return error; }
//////////////////Function for getting Users Details////////// public HashMap getEmployeeDetails(int employee_id) { HashMap resultsArray = new HashMap(); int count=0; try { String SQL = "SELECT * FROM employee WHERE employee_id = "+employee_id ; statement = connection.createStatement(); Project Online Shopping System Page 99
Project Report On Online Shopping System rs = statement.executeQuery(SQL); while(rs.next()) { resultsArray.put("employee_id",rs.getString("employee_id"));
resultsArray.put("employee_manager_id",Integer.parseInt(rs.getString("emp loyee_manager_id")));
resultsArray.put("employee_role",Integer.parseInt(rs.getString("employee_r ole")));
resultsArray.put("employee_sal",Integer.parseInt(rs.getString("employee_sal ")));
resultsArray.put("employee_first_name",rs.getString("employee_first_name" ));
resultsArray.put("employee_middle_name",rs.getString("employee_middle_n ame"));
resultsArray.put("employee_last_name",rs.getString("employee_last_name") );
resultsArray.put("employee_gender",rs.getString("employee_gender"));
resultsArray.put("employee_address",rs.getString("employee_address")); Project Online Shopping System Page 100
Project Report On Online Shopping System resultsArray.put("employee_village",rs.getString("employee_village"));
resultsArray.put("employee_state",Integer.parseInt(rs.getString("employee_ state")));
resultsArray.put("employee_country",Integer.parseInt(rs.getString("employe e_country")));
resultsArray.put("employee_landline",rs.getString("employee_landline"));
resultsArray.put("employee_mobile",rs.getString("employee_mobile")); resultsArray.put("employee_email",rs.getString("employee_email"));
resultsArray.put("employee_status",Integer.parseInt(rs.getString("employee _status")));
resultsArray.put("employee_deparment",Integer.parseInt(rs.getString("empl oyee_deparment"))); resultsArray.put("employee_dob",rs.getString("employee_dob"));
resultsArray.put("employee_nationalty",rs.getString("employee_nationalty")) ; count++; } Project Online Shopping System Page 101
Project Report On Online Shopping System if(count==0) { resultsArray.put("employee_id",""); resultsArray.put("employee_manager_id",0); resultsArray.put("employee_role",0); resultsArray.put("employee_user",""); resultsArray.put("employee_sal",0); resultsArray.put("employee_first_name",""); resultsArray.put("employee_middle_name",""); resultsArray.put("employee_last_name",""); resultsArray.put("employee_gender",""); resultsArray.put("employee_address",""); resultsArray.put("employee_village",""); resultsArray.put("employee_state",0); resultsArray.put("employee_country",0); resultsArray.put("employee_landline",""); resultsArray.put("employee_mobile",""); resultsArray.put("employee_email",""); resultsArray.put("employee_status",0); resultsArray.put("employee_deparment",0); resultsArray.put("employee_dob",""); resultsArray.put("employee_nationalty","");
} Project Online Shopping System Page 102
Project Report On Online Shopping System } catch(Exception e) { System.out.println("Error is: "+ e); } return resultsArray; }
public String updateEmployee(HashMap employeeData) { String SQL = "UPDATE employee SET employee_sal = ?, employee_first_name = ?, employee_middle_name = ?, employee_last_name = ?, employee_gender = ?, employee_address = ?, employee_village = ?, employee_state = ?, employee_country = ?, employee_landline = ?, employee_mobile = ?, employee_email = ?, employee_status = ?, employee_deparment = ?, employee_dob = ?, employee_nationalty = ?, employee_manager_id = ?, employee_role = ? WHERE employee_id = ?"; String error = "";
int record=0; try { pstmt = connection.prepareStatement(SQL); pstmt.setString(1,(String) employeeData.get("employee_sal")); pstmt.setString(2,(String) employeeData.get("employee_first_name")); Project Online Shopping System Page 103
Project Report On Online Shopping System pstmt.setString(3,(String) employeeData.get("employee_middle_name")); pstmt.setString(4,(String) employeeData.get("employee_last_name")); pstmt.setString(5,(String) employeeData.get("employee_gender")); pstmt.setString(6,(String) employeeData.get("employee_address")); pstmt.setString(7,(String) employeeData.get("employee_village")); pstmt.setString(8,(String) employeeData.get("employee_state")); pstmt.setString(9,(String) employeeData.get("employee_country")); pstmt.setString(10,(String) employeeData.get("employee_landline")); pstmt.setString(11,(String) employeeData.get("employee_mobile")); pstmt.setString(12,(String) employeeData.get("employee_email")); pstmt.setString(13,(String) employeeData.get("employee_status")); pstmt.setString(14,(String) employeeData.get("employee_deparment")); pstmt.setString(15,(String) employeeData.get("employee_dob")); pstmt.setString(16,(String) employeeData.get("employee_nationalty")); pstmt.setString(17,(String) employeeData.get("employee_manager_id")); Project Online Shopping System Page 104
Project Report On Online Shopping System pstmt.setString(18,(String) employeeData.get("employee_role")); pstmt.setString(19,(String) employeeData.get("employee_id")); record = pstmt.executeUpdate(); pstmt.close(); connection.close(); } catch(Exception e) { StringWriter writer = new StringWriter(); PrintWriter printWriter = new PrintWriter( writer ); e.printStackTrace( printWriter ); printWriter.flush(); String stackTrace = writer.toString(); error+="Error : "+stackTrace; System.out.println(" Error : "+ e.toString()); } return error; } public boolean deleteEmployee(int employee_id) { return true; }
Project Online Shopping System Page 105
Project Report On Online Shopping System /////Function for Getting the List//////////// public String getStateOption(Integer SelID) { int selectedID = SelID.intValue(); return Connect.getOptionList("state","state_id","state_name","state_id,state_name ",selectedID,"1"); } /////Function for Getting the List//////////// public String getEmployeeOption(Integer SelID) { int selectedID = SelID.intValue(); return Connect.getOptionList("employee","employee_id","employee_id","employee_ id,employee_id",selectedID,"1"); } /////Function for Getting the List//////////// public String getRoleOption(Integer SelID) { int selectedID = SelID.intValue(); return Connect.getOptionList("roles","role_id","role_title","role_id,role_title",selecte dID,"1"); } /////Function for Getting the List//////////// public String getCountryOption(Integer SelID)
Project Online Shopping System Page 106
Project Report On Online Shopping System { int selectedID = SelID.intValue(); return Connect.getOptionList("country","country_id","country_name","country_id,c ountry_name",selectedID,"1"); }
/////Function for Getting the List//////////// public String getSalutionOption(Integer SelID) { int selectedID = SelID.intValue(); return Connect.getOptionList("salutions","sl_id","sl_name","sl_id,sl_name",selected ID,"1"); }
/////Function for Getting the List//////////// public String getStatusOption(Integer SelID) { int selectedID = SelID.intValue(); return Connect.getOptionList("status","status_id","status_name","status_id,status_ name",selectedID,"1"); }
/////Function for Getting the List//////////// public String getDepartmentOption(Integer SelID) Project Online Shopping System Page 107
Project Report On Online Shopping System { int selectedID = SelID.intValue(); return Connect.getOptionList("department","dept_id","dept_name","dept_id,dept_n ame",selectedID,"1"); }
////////////////Function for getting all the Airport Details//////////////////// public ArrayList getAllEmployee(String managerID) { int count=0; String error = ""; String SQL = "SELECT * FROM employee";
ArrayList resultArray = new ArrayList(); try { if(!managerID.equals("0")) { SQL = "SELECT * FROM employee WHERE employee_manager_id = "+managerID; } statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next()) Project Online Shopping System Page 108
Project Report On Online Shopping System { HashMap results = new HashMap(); results.put("employee_id",rs.getString("employee_id")); results.put("employee_role",rs.getString("employee_role")); results.put("employee_sal",rs.getString("employee_sal"));
results.put("employee_first_name",rs.getString("employee_first_name"));
results.put("employee_middle_name",rs.getString("employee_middle_name" ));
results.put("employee_last_name",rs.getString("employee_last_name")); results.put("employee_gender",rs.getString("employee_gender")); results.put("employee_address",rs.getString("employee_address")); results.put("employee_village",rs.getString("employee_village")); results.put("employee_state",rs.getString("employee_state")); results.put("employee_country",rs.getString("employee_country")); results.put("employee_landline",rs.getString("employee_landline")); results.put("employee_mobile",rs.getString("employee_mobile")); Project Online Shopping System Page 109
Project Report On Online Shopping System results.put("employee_email",rs.getString("employee_email"));
results.put("employee_status",Integer.parseInt(rs.getString("employee_stat us")));
results.put("employee_deparment",Integer.parseInt(rs.getString("employee_ deparment"))); results.put("employee_dob",rs.getString("employee_dob"));
results.put("employee_nationalty",rs.getString("employee_nationalty"));
results.put("employee_manager_id",Integer.parseInt(rs.getString("employee _manager_id"))); count++; resultArray.add(results); } } catch(Exception e) { StringWriter writer = new StringWriter(); PrintWriter printWriter = new PrintWriter( writer ); e.printStackTrace( printWriter ); printWriter.flush(); String stackTrace = writer.toString(); Project Online Shopping System Page 110
Project Report On Online Shopping System error+="Error : "+stackTrace; System.out.println(" Error : "+ e.toString()); } return resultArray; }
public String getDepartment(int dept_id) { HashMap results = new HashMap(); String SQL = ""; String value = ""; int count=0; try { SQL = "SELECT dept_name FROM department WHERE dept_id = "+dept_id ; statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next()) { value = rs.getString("dept_name"); } } catch(Exception e) { Project Online Shopping System Page 111
Project Report On Online Shopping System System.out.println("Error is: "+ e); } return value; }
public String getStatus(int status_id) { HashMap results = new HashMap(); String SQL = ""; String value = ""; int count=0; try { SQL = "SELECT status_name FROM status WHERE status_id = "+status_id ; statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next()) { value = rs.getString("status_name"); } } catch(Exception e) { System.out.println("Error is: "+ e); Project Online Shopping System Page 112
Project Report On Online Shopping System } return value
Project Online Shopping System Page 113
Project Report On Online Shopping System Code for Login.java package Model;
import java.util.*; import java.sql.*; import com.*; import java.io.*;
public class Login extends Connect { /////Function for connect to the MySQL Server Database//////////// public Login() { Connect.connect_mysql(); } //////////////////Function for Update the airport//////////////////////// public boolean changePassword(String old_password,String new_password, int login_id) { String SQL; int count = 0; try { SQL = "SELECT * FROM login WHERE login_password = '"+old_password+"' AND login_id = "+login_id ; Project Online Shopping System Page 114
Project Report On Online Shopping System statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next())
count++;
if(count==1) { SQL = "UPDATE login SET login_password=? WHERE login_id=?"; int record=0; pstmt = connection.prepareStatement(SQL); pstmt.setString(1,new_password); pstmt.setInt(2,login_id); record = pstmt.executeUpdate(); pstmt.close(); connection.close(); } } catch(Exception e) { System.out.println(" Error : "+ e.toString()); } if(count==0) return false; return true; } //////////////////Function for geting the Single Airport Details////////// Project Online Shopping System Page 115
Project Report On Online Shopping System public boolean checkLogin(String login_user,String login_password) { int count=0; try { String SQL = "SELECT * FROM login WHERE login_user = '"+login_user+"' AND login_password = '"+login_password+"'" ; statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next())
count++;
} catch(Exception e) { System.out.println("Error is: "+ e); } if(count==0) return false; return true; } //////////////////Function for getting Login Details////////// public HashMap getLoginDetails(String login_user,String login_password) { HashMap resultsArray = new HashMap(); int count=0; try Project Online Shopping System Page 116
Project Report On Online Shopping System { String SQL = "SELECT * FROM login WHERE login_user = '"+login_user+"' AND login_password = '"+login_password+"'" ; statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next()) { resultsArray.put("login_id",rs.getString("login_id")); resultsArray.put("login_emp_id",rs.getString("login_emp_id")); resultsArray.put("login_user",rs.getString("login_user")); resultsArray.put("login_level",rs.getString("login_level")); count++; } if(count==0) { resultsArray.put("login_id",""); resultsArray.put("login_emp_id",""); resultsArray.put("login_user",""); resultsArray.put("login_level",""); } } catch(Exception e) { Project Online Shopping System Page 117
Project Report On Online Shopping System System.out.println("Error is: "+ e); } return resultsArray; } //////////////////Function for getting Login Details////////// public int checkUsernameExits(String login_user, int type) { HashMap resultsArray = new HashMap(); int exits=0; try { String SQL = ""; if(type == 1) { SQL = "SELECT * FROM login WHERE login_user = '"+login_user+"'" ; } if(type == 2) { SQL = "SELECT * FROM login WHERE login_email = '"+login_user+"'" ; } statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next()) { exits++; Project Online Shopping System Page 118
Project Report On Online Shopping System } } catch(Exception e) { System.out.println("Error is: "+ e); } return exits; } }
Project Online Shopping System Page 119
Project Report On Online Shopping System Code for Order.java package Model;
import java.util.*; import java.sql.*; import com.*; import java.io.*;
public class Order extends Connect { /////Function for connect to the MySQL Server Database//////////// public Order() { Connect.connect_mysql(); } //////////Save User Details ///// public String saveOrder(HashMap orderData) { String SQL = "INSERT INTO `order` (`order_user_id`, `order_date`, `order_status`, `order_total`) VALUES (?, ?, ?, ?);"; int record = 0,last_inserted_id = 0; String error = "";
try { Project Online Shopping System Page 120
Project Report On Online Shopping System pstmt = connection.prepareStatement(SQL, Statement.RETURN_GENERATED_KEYS); pstmt.setString(1,(String) orderData.get("order_user_id")); pstmt.setString(2,(String) orderData.get("order_date")); pstmt.setString(3,(String) orderData.get("order_status")); pstmt.setString(4,(String) orderData.get("order_total"));
record = pstmt.executeUpdate(); //// Get the Order ID //// rs = pstmt.getGeneratedKeys(); if(rs.next()) { last_inserted_id = rs.getInt(1); }
//// Get all the Items of cart and save it into the order Item /// SQL = "SELECT * FROM cart"; statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next()) { ///// Update the Product Stock //////
Project Online Shopping System Page 121
Project Report On Online Shopping System SQL = "UPDATE product SET product_stock = (product_stock - "+rs.getString("cart_quantity")+") WHERE product_id = "+rs.getString("cart_product_id"); pstmt = connection.prepareStatement(SQL); pstmt.executeUpdate();
///// Insert Into Order Items ////// SQL = "INSERT INTO `order_item` (`oi_order_id`, `oi_product_id`, `oi_price_per_unit`, `oi_cart_quantity`, `oi_total`) VALUES (?, ?, ?, ?, ?);"; pstmt = connection.prepareStatement(SQL); pstmt.setString(1, String.valueOf(last_inserted_id)); pstmt.setString(2, rs.getString("cart_product_id")); pstmt.setString(3, rs.getString("cart_price_per_unit")); pstmt.setString(4, rs.getString("cart_quantity")); pstmt.setString(5, rs.getString("cart_total")); record = pstmt.executeUpdate(); }
//// Delete all the cart Item ////// SQL="DELETE FROM cart WHERE 1"; statement.executeUpdate(SQL);
pstmt.close(); connection.close();
Project Online Shopping System Page 122
Project Report On Online Shopping System error = last_inserted_id+""; } catch(Exception e) { StringWriter writer = new StringWriter(); PrintWriter printWriter = new PrintWriter( writer ); e.printStackTrace( printWriter ); printWriter.flush(); String stackTrace = writer.toString(); error+="Error : "+stackTrace; System.out.println(" Error : "+ e.toString()); } return error; } //////////////////Function for getting Users Details////////// public HashMap getOrderDetails(int order_id) { HashMap results = new HashMap(); int count=0; try { String SQL = "SELECT * FROM `order` WHERE order_id ="+order_id; statement = connection.createStatement(); rs = statement.executeQuery(SQL); Project Online Shopping System Page 123
Project Report On Online Shopping System while(rs.next()) { results.put("order_user_id",rs.getString("order_user_id")); results.put("order_date",rs.getString("order_date"));
results.put("order_status",Integer.parseInt(rs.getString("order_status"))); results.put("order_total",rs.getString("order_total")); results.put("order_id",rs.getString("order_id"));
count++; } if(count==0) { results.put("order_user_id",""); results.put("order_date",""); results.put("order_status",0); results.put("order_total",""); results.put("order_id",""); } } catch(Exception e) { System.out.println("Error is: "+ e); } Project Online Shopping System Page 124
Project Report On Online Shopping System return results; } /// Update the Order //// public String updateOrder(HashMap orderData) { String SQL = "UPDATE `order` SET `order_status` = ? WHERE `order_id` = ?;"; String error = "";
int record=0;
try { pstmt = connection.prepareStatement(SQL); pstmt.setString(1,(String) orderData.get("order_status")); pstmt.setString(2,(String) orderData.get("order_id")); record = pstmt.executeUpdate(); pstmt.close(); connection.close(); } catch(Exception e) { StringWriter writer = new StringWriter(); PrintWriter printWriter = new PrintWriter( writer ); e.printStackTrace( printWriter ); Project Online Shopping System Page 125
Project Report On Online Shopping System printWriter.flush(); String stackTrace = writer.toString(); error+="Error : "+stackTrace; System.out.println(" Error : "+ e.toString()); } return error; }
////////////////Function for getting all the Order Details//////////////////// public ArrayList getAllOrder(int userID) { int count=0; String SQL = ""; if(userID != 0) SQL = "SELECT * FROM `order`, `order_status` WHERE order_status = os_id AND order_user_id = "+userID; else SQL = "SELECT * FROM `order`, `order_status` WHERE order_status = os_id"; ArrayList resultArray = new ArrayList(); try { statement = connection.createStatement(); rs = statement.executeQuery(SQL);
Project Online Shopping System Page 126
Project Report On Online Shopping System while(rs.next()) { HashMap results = new HashMap(); results.put("order_user_id",rs.getString("order_user_id")); results.put("order_date",rs.getString("order_date")); results.put("order_status",rs.getString("os_title")); results.put("order_total",rs.getString("order_total")); results.put("order_id",rs.getString("order_id")); count++; resultArray.add(results); } } catch(Exception e) { System.out.println("Error is: "+ e); } return resultArray; } ////////////////Function for getting all the Order Details//////////////////// public ArrayList getAllOrderItems(String orderID) { int count=0; String SQL = "";
Project Online Shopping System Page 127
Project Report On Online Shopping System SQL = "SELECT * FROM `order_item`,`product` WHERE oi_product_id = product_id AND oi_order_id = "+orderID; ArrayList resultArray = new ArrayList(); try { statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next()) { HashMap results = new HashMap(); results.put("oi_product_id",rs.getString("oi_product_id")); results.put("oi_price_per_unit",rs.getString("oi_price_per_unit")); results.put("oi_cart_quantity",rs.getString("oi_cart_quantity")); results.put("oi_total",rs.getString("oi_total")); results.put("product_name",rs.getString("product_name")); results.put("product_image",rs.getString("product_image")); count++; resultArray.add(results); } } catch(Exception e) { Project Online Shopping System Page 128
Project Report On Online Shopping System System.out.println("Error is: "+ e); } return resultArray; } /////Function for Getting the List//////////// public String getStatusOption(Integer SelID) { int selectedID = SelID.intValue(); return Connect.getOptionList("order_status","os_id","os_title","os_id,os_title",selec tedID,"1"); } }
Project Online Shopping System Page 129
Project Report On Online Shopping System Code for Product.java package Model;
import java.util.*; import java.sql.*; import com.*; import java.io.*;
public class Product extends Connect { /////Function for connect to the MySQL Server Database//////////// public Product() { Connect.connect_mysql(); } //////////Save User Details ///// public String saveProduct(HashMap productData) { String SQL = "INSERT INTO `product` (`product_name`, `product_type_id`, `product_company_id`, `product_price`, `product_image`, `product_description`,`product_stock`) VALUES (?, ?, ?, ?, ?, ?, ?);"; int record=0; String error = "";
Project Online Shopping System Page 130
Project Report On Online Shopping System try { pstmt = connection.prepareStatement(SQL); pstmt.setString(1,(String) productData.get("product_name")); pstmt.setString(2,(String) productData.get("product_type_id")); pstmt.setString(3,(String) productData.get("product_company_id")); pstmt.setString(4,(String) productData.get("product_price")); pstmt.setString(5,(String) productData.get("product_image")); pstmt.setString(6,(String) productData.get("product_description")); pstmt.setString(7,(String) productData.get("product_stock"));
record = pstmt.executeUpdate(); pstmt.close(); connection.close(); } catch(Exception e) { StringWriter writer = new StringWriter(); PrintWriter printWriter = new PrintWriter( writer ); e.printStackTrace( printWriter ); Project Online Shopping System Page 131
Project Report On Online Shopping System printWriter.flush(); String stackTrace = writer.toString(); error+="Error : "+stackTrace; System.out.println(" Error : "+ e.toString()); } return error; } //////////////////Function for getting Users Details////////// public HashMap getProductDetails(int product_id) { HashMap results = new HashMap(); int count=0; try { String SQL = "SELECT * FROM `product`,`company`,`type` WHERE product_company_id = company_id AND product_type_id = type_id AND product_id = "+product_id ; statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next()) { results.put("product_name",rs.getString("product_name"));
results.put("product_type_id",Integer.parseInt(rs.getString("product_type_id "))); Project Online Shopping System Page 132
Project Report On Online Shopping System
results.put("product_company_id",Integer.parseInt(rs.getString("product_co mpany_id"))); results.put("product_description",rs.getString("product_description")); results.put("product_price",rs.getString("product_price")); results.put("product_id",rs.getString("product_id")); results.put("product_image",rs.getString("product_image")); results.put("product_company",rs.getString("company_name")); results.put("product_type",rs.getString("type_name")); results.put("product_stock",rs.getString("product_stock"));
count++; } if(count==0) { results.put("product_name",""); results.put("product_type_id",0); results.put("product_company_id",0); results.put("product_description",""); results.put("product_price",""); results.put("product_image",""); Project Online Shopping System Page 133
Project Report On Online Shopping System results.put("product_id",""); results.put("product_stock",""); } } catch(Exception e) { System.out.println("Error is: "+ e); } return results; } /// Update the Product //// public String updateProduct(HashMap productData) { String SQL = "UPDATE `product` SET `product_name` = ?, `product_type_id` = ?, `product_company_id` = ?, `product_price` = ?, `product_image` = ?, `product_description` = ?, `product_stock` = ? WHERE `product_id` = ?;"; String error = "";
int record=0;
try { pstmt = connection.prepareStatement(SQL);
Project Online Shopping System Page 134
Project Report On Online Shopping System pstmt.setString(1,(String) productData.get("product_name")); pstmt.setString(2,(String) productData.get("product_type_id")); pstmt.setString(3,(String) productData.get("product_company_id")); pstmt.setString(4,(String) productData.get("product_price")); pstmt.setString(5,(String) productData.get("product_image")); pstmt.setString(6,(String) productData.get("product_description")); pstmt.setString(7,(String) productData.get("product_stock")); pstmt.setString(8,(String) productData.get("product_id")); record = pstmt.executeUpdate(); pstmt.close(); connection.close(); } catch(Exception e) { StringWriter writer = new StringWriter(); PrintWriter printWriter = new PrintWriter( writer ); e.printStackTrace( printWriter ); printWriter.flush(); String stackTrace = writer.toString(); error+="Error : "+stackTrace; Project Online Shopping System Page 135
Project Report On Online Shopping System System.out.println(" Error : "+ e.toString()); } return error; }
////////////////Function for getting all the Airport Details//////////////////// public ArrayList getAllProduct(int typeID) { int count=0; String SQL = ""; if(typeID != 0) SQL = "SELECT * FROM `product`,`company`,`type` WHERE product_company_id = company_id AND product_type_id = type_id AND type_id = "+typeID; else SQL = "SELECT * FROM `product`,`company`,`type` WHERE product_company_id = company_id AND product_type_id = type_id"; ArrayList resultArray = new ArrayList(); try { statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next()) { Project Online Shopping System Page 136
Project Report On Online Shopping System HashMap results = new HashMap(); results.put("product_name",rs.getString("product_name"));
results.put("product_type_id",Integer.parseInt(rs.getString("product_type_id ")));
results.put("product_company_id",Integer.parseInt(rs.getString("product_co mpany_id"))); results.put("product_description",rs.getString("product_description")); results.put("product_price",rs.getString("product_price")); results.put("product_id",rs.getString("product_id")); results.put("product_image",rs.getString("product_image")); results.put("product_company",rs.getString("company_name")); results.put("product_type",rs.getString("type_name")); results.put("product_stock",rs.getString("product_stock")); count++; resultArray.add(results); } } catch(Exception e) { Project Online Shopping System Page 137
Project Report On Online Shopping System System.out.println("Error is: "+ e); } return resultArray; } /////Function for Getting the List//////////// public String getCompanyOption(Integer SelID) { int selectedID = SelID.intValue(); return Connect.getOptionList("company","company_id","company_name","compan y_id,company_name",selectedID,"1"); } /////Function for Getting the List//////////// public String getTypeOption(Integer SelID) { int selectedID = SelID.intValue(); return Connect.getOptionList("type","type_id","type_name","type_id,type_name",s electedID,"1"); } }
Project Online Shopping System Page 138
Project Report On Online Shopping System Code for Stock.java package Model;
import java.util.*; import java.sql.*; import com.*; import java.io.*;
public class Stock extends Connect { /////Function for connect to the MySQL Server Database//////////// public Stock() { Connect.connect_mysql(); } //////////Save User Details ///// public String saveStock(HashMap stockData) { String SQL = "INSERT INTO stock (stock_product_id, stock_number) VALUES (?, ?);"; int record=0; String error = "";
try { Project Online Shopping System Page 139
Project Report On Online Shopping System pstmt = connection.prepareStatement(SQL); pstmt.setString(1,(String) stockData.get("stock_product_id")); pstmt.setString(2,(String) stockData.get("stock_number"));
record = pstmt.executeUpdate(); pstmt.close(); connection.close(); } catch(Exception e) { StringWriter writer = new StringWriter(); PrintWriter printWriter = new PrintWriter( writer ); e.printStackTrace( printWriter ); printWriter.flush(); String stackTrace = writer.toString(); error+="Error : "+stackTrace; System.out.println(" Error : "+ e.toString()); } return error; } //////////////////Function for getting Users Details////////// public HashMap getStockDetails(int stock_id) { Project Online Shopping System Page 140
Project Report On Online Shopping System HashMap results = new HashMap(); int count=0; try { String SQL = "SELECT * FROM `stock`,`product` WHERE stock_id = "+stock_id ; statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next()) {
results.put("stock_product_id",Integer.parseInt(rs.getString("stock_product_ id"))); results.put("stock_number",rs.getString("stock_number")); results.put("product_name",rs.getString("product_name")); results.put("product_image",rs.getString("product_image")); results.put("stock_id",rs.getString("stock_id")); count++; } if(count==0) { results.put("stock_product_id",0); results.put("stock_number",""); Project Online Shopping System Page 141
Project Report On Online Shopping System results.put("product_name",""); results.put("product_image","no-image.jpg"); results.put("stock_id",""); } } catch(Exception e) { System.out.println("Error is: "+ e); } return results; } /// Update the Stock //// public String updateStock(HashMap stockData) { String SQL = "UPDATE stock SET stock_product_id = ?, stock_number = ? WHERE stock_id = ?;"; String error = "";
int record=0;
try { pstmt = connection.prepareStatement(SQL); pstmt.setString(1,(String) stockData.get("stock_product_id")); Project Online Shopping System Page 142
Project Report On Online Shopping System pstmt.setString(2,(String) stockData.get("stock_number")); pstmt.setString(3,(String) stockData.get("stock_id"));
record = pstmt.executeUpdate(); pstmt.close(); connection.close(); } catch(Exception e) { StringWriter writer = new StringWriter(); PrintWriter printWriter = new PrintWriter( writer ); e.printStackTrace( printWriter ); printWriter.flush(); String stackTrace = writer.toString(); error+="Error : "+stackTrace; System.out.println(" Error : "+ e.toString()); } return error; }
////////////////Function for getting all the Airport Details//////////////////// public ArrayList getAllStock(int product_id) { Project Online Shopping System Page 143
Project Report On Online Shopping System String SQL = "SELECT * FROM `stock`,`product` WHERE product_id = stock_product_id and product_id = "+product_id ; int count=0; ArrayList resultArray = new ArrayList(); try { statement = connection.createStatement(); rs = statement.executeQuery(SQL); while(rs.next()) { HashMap results = new HashMap();
results.put("stock_product_id",Integer.parseInt(rs.getString("stock_product_ id"))); results.put("stock_number",rs.getString("stock_number")); results.put("product_name",rs.getString("product_name")); results.put("product_image",rs.getString("product_image")); results.put("stock_id",rs.getString("stock_id")); count++; resultArray.add(results); } } catch(Exception e) Project Online Shopping System Page 144
Project Report On Online Shopping System { System.out.println("Error is: "+ e); } return resultArray; } /////Function for Getting the List//////////// public String getProductOption(Integer SelID) { int selectedID = SelID.intValue(); return Connect.getOptionList("product","product_id","product_id","product_id,prod uct_id",selectedID,"1"); } }
Project Online Shopping System Page 145
Project Report On Online Shopping System Future scope and further enhancement of the project: Today, the market place is flooded with several Online Shopping System options for shoppers to choose from. A variety of innovative products and services are being offered spoiling customers for choice. Online shopping is no more a privilege enjoyed by your friends and family living in the US or UK. Today, it is a reality in India. In the last couple of years, the growth of Online Shopping System industry in India has been phenomenal as more shoppers have started discovering the benefits of using this platform. There is enough scope for online businesses in the future if they understand the Indian shoppers psyche and cater to their needs. Bibliography: Articles on Ecommerce http://www.epaynews.com/statistics/ Articles on Ecommerce http://www.merchantpicks.com Articles on Ecommerce http://www.google.com Articles on Ecommerce http://www.emarketer.com Articles on Ecommerce http://www.internet-story.com/ Articles
on
Ecommerce
http://www.networld.com/hosting/Online
Shopping
Ecommerce
http://www.exploit-lib.org/issue3/Online
Shopping
System .cfm Articles
on
System / Articles
on
Ecommerce
http://www.Online
times.com/perl/story/18403.html Articles on Ecommerce http://www.e-global.es/cisco_view.pdf Articles on Ecommerce http://www.cnn.com
Project Online Shopping System Page 146
Shopping
System
View more...
Comments