Capstone Chapter 1 23 and 4 Printable
Capstone Chapter 1 23 and 4 Printable
CHAPTER I
INTRODUCTION
Project Context
The project study converted the traditional fill-up form transaction into a website
substructure that solved the preservation and reduced the cost of creating one. The
traditional fill-up form gets lost, stolen and drenched in water during the rainy season. As
the researcher and proponents of this study, it has been attested that employee and the
owner were less likely to lose or damage the website. The owner can access the website
anytime and anywhere. The project analyze to make it more effective when it comes on
transacting to the client and to monitor the monthly sales, As a researchers of the said
system. The client encounters over number of applicants, spurious and unpunctual
growth of technology for the company. The owner can use the said website to monitor the
sales for the month, client information, and last transaction and the incoming due date of
the client.
to the development of e-commerce, the process of marketing and selling goods was a mass-
marketing and sales force driven process, consumers were considered to be trapped by
geographical and social boundaries, unable to search widely for the best quality and price.
The purpose of this study is to help the consumer to purchase the product easily,
however the proponents formulated the idea and came up with the project proposed. This
The study intended to help the client to monitor the daily transaction of the sales
report to the costumer, secured and reliable Web Based System for Tail-g electric motor
cycle. To reduce effort in fill-up form. In all manners accepted, the deviation of platform
used by client in compliance with these changes is paramount. The beneficiaries of this
Client. The Web Based System will help the client to lessen the effort of going into
Owner. It will help the owner to monitor the monthly, weekly sales and transaction
Employee. It will help the employee to easily find the form or the record of the
Project Objectives
To develop an efficient and fast web base transaction system in Tailg E-motorcycle.
General Objective
The general objective of the study is to develop a functional system through Web
Based for Tail-G Electric motorcycle as a replacement for the traditional prepared
Specific Objectives
1. To Integrate the following significant features in the developed system such as:
2.4 JavaScript;
3. To evaluate the system using the software quality evaluation criteria such as:
3.1 functionality;
3.2 reliability;
3.3 usability;
3.4 maintainability;
3.5 portability;
The Tail-G electronic motorcycle web based sales and transaction system it is
provided detailed information about the electronic bikes and electric motors. The goal is to
4
innovate; made these manual transaction goes to online selling and increased accessibility
The system of proponents has given an idea for other customer spectator about the
system, can viewed the featured photos of electric motor from wall, and the system have a
monthly sales report for admin. This section can view all monthly sales report through bar
graph.
Security system offer a secured system because it has a fixed username and
password given by the proponents, signing in is the fill up form section for the employee
of Tailg E-motorcycle for the authorization to adding, deleting and updating the new
product of company. Account for customer is the provided from admin to view and entering
inside of the web page and for the customer willing to buying item of Tailg E-motorcycle
and history and recent of customer is to knowing the detailed transaction of the customer.
The limitation of the system proposes that there is no installment transaction while
about for the payment is through Paypal only, SMS update through manual sending
message using a gmail account of the company and the system was not a downloadable
CHAPTER II
THEORETICAL FRAMEWORK
This chapter includes different literatures that are related to the study, concept of
Related Literature
The following is a review of related literature that show the different transaction
requirements for a business and the importance of a transaction management system. The
relationship between the motorcycle industry and the business phenomenon which is
purchase-on-installment basis, whose intricate processes are the object for automation
through the system, is also supported. All documents, which are result of research, contain
Sales Mastery
According to Heineman (2015), States a sale is the activity of selling, which forms
an integral part of any commercial activity. It could be argued that it is the cornerstone of
business as it is the meeting of buyers and sellers. All other areas of business have the goal
of making the meeting successful. Sales Mastery is considered by many as some sort of
his offering enabling the buyer to visualize how to achieve his goal in an economic way.
6
and finance, however, a change in the status of the finances of two or more businesses or
meaning. A transaction may be thought of as any interaction with the system that results in
a change to the system state. In the book of Java Web Services Architecture, McGovern
(2016) said that the notion of a transaction is fundamental to business system architectures.
A transaction, simply put, ensures that only agreed-upon, consistent, and acceptable state
changes are made to a system regardless of system failure or concurrent access to the
system’s resources
Automate Management
processes and procedures used to ensure that an organization can fulfill all task required to
achieve its objectives. However, a sales management system is an information system used
all concerned members in planning to establish mutually understood and accepted sales
achievements of sales objectives are prescribed. Criteria for success in each sales position
According to Garcia (2015), the design of this system encourages specifics report
generation tailored to you. Information presented “your way” is an integral part of the
EXNICO Sales Management System. Basic reporting capabilities allow the user to view
reports by taxable and non-taxable sales by state and tax code within state for sales or
excise tax reporting. In addition, sales may be viewed by inventory item – including units,
consideration current inventory, production capability, and orders from customers. It can
inform customers of the expected delivery date for items by analyzing CTP(Capable to
In addition, it can check all the changes throughout the process ranging from production,
According to Mellon (2017), as defined earlier, a sale is the activity of selling. This
activity is integrated in the system and may be seen in the Transaction portion of the
system. The sales feature is where the system concentrates most of its processes. From
getting the customer information, to the last step which is recording the customer’s
8
payment information, all these steps are followed to ensure the ease and comfort and most
Performance Management
According to Jorgenson (2012), over the past two years, we have seen business
deployment and data gathering techniques. “Traditional” BTM solutions that are expensive
to deploy, tough to scale and time consuming to maintain are losing ground to alternative
“lightweight” approaches that have made it much easier for the mainstream to adopt this
granular transaction data at the network level have given IT operations and managed
services teams access to the grass roots information of every business transaction, without
According to Doug (2011), transactions are one of, if not the most, critical
components of how IT supports the business in meeting business goals and objectives.
They are the simple and complex entities that get work done. They are the “movers and
shakers” within the IT environment that are actively responding to client or business
requests via the business services and applications that IT delivers. They move key data
business services and applications that exist in nearly every company today.
9
Related Studies
The following review of related studies show the already success of the Transaction
the Philippines. These studies provide data and statistics to enhance clarity and
understandability of the documentation of the system. All noted documents are results of
research and contain important information that will help in the development of the system.
were presented in a general perspective because unlike the system, no client is specified.
Barrios’ objectives are also left flexible in case any company may want to implement his
system. This study also differs from the system because in the SDLC, planning and
development are given utmost importance because no existing system analyzed. Moreover,
defining the project scope wasn’t done with any assistance of a concerned party again
mainly because there is no target client. Therefore, Barrios’ system is evaluated based on
a general view of people who may or may not be able to totally relate to the system. Its
usability is therefore judge only by the general computer using public and not of a specific
user who may have involvement in defining the project scope in the first place as a client
would most probably prefer. In addition, the overall evaluation of the system is based
mostly on the system’s design, efficiency and security and not very much on the accuracy
because no specific company goals were stated and also less on the usability because it was
evaluated not by people who would use it in the future. On the other hand, in the thesis
Management System
According to Bernardino et. al., (2013), accuracy was very important factor that
was considered because the system’s main goal is effective data management. When
managing of data is the priority, it is very important that these data be accurate and at the
The importance of defining the project scope is magnified by comparing the TailG E-
Motorcycle Web based Sales and Transaction Management system to other related studies.
General needs are very different from a company’s specific needs and different companies
have varying needs. A general system may be applied by one company but not by a similar
company of a different location. Many factors should be put into consideration most
According to Miller (2014) entitled Billing, Order Production Inventory System for
Phoenix Industries, is very similar to the system yet variations in the project scope
differentiate the two. As a billing feature is included in the TailG E-Motorcycle Web based
Sales and Transaction Management system, Coguin’s billing system include features that
allow the user to send bills to customers through the internet. This is not featured in the
11
CHAPTER III
Technical Background
This chapter focuses and discusses the technical background used in developing the
Web based transactions of Tailg E-motorcycle. The discussion covers the project
diagrams
The researchers have used the Web Application because it consists of all the API
required to develop a Web page. Chrome browser has using of researchers to test the
developed Web application. Java Script can be used to create complete applications that
may run on a single computer or be distributed among servers and clients in a network. It
can also be used to build a small application module or applet for use as part of a webpage.
In this section is the discussion what are the technologies to be used and how did
SQL. Standard Query Language. It used to make a database, used for adding and
modifying information in the database. The SQL common commands are ADD, DROP,
INSERT and UPDATE can be used with MySQL is commonly found on Web Service.
12
PHP. Hypertext Preprocessor. It used a web server to control the data and all
information inside or behind the system that are displayed, and also PHP help the
HTML. Hypertext Markup Language (HTML), used for the front end of Web
browsers receive HTML documents from a web server or from local storage and render the
documents into multimedia web pages. HTML elements are the building blocks of HTML
pages. With HTML constructs, images and other object such as interactive forms may be
embedded into the rendered page. HTML provides a means to create structured documents
by denoting structural semantics for text such as headings, paragraphs, lists, links, quotes
and other items. HTML elements are delineated by tags, written using angle brackets.
enabled the separation can improve content accessibility, provide more flexibility and
share formatting by specifying the relevant CSS in a separate .css file, and reduce
JavaScript. (JS), Alongside HTML and CSS, proponents also used the JavaScript
to give an action or function of every buttons of the system and to trapping the invalid
inputted from the users. enables interactive web pages and thus is an essential part of web
applications. The vast majority of websites use it, and all major web browsers have a
supports even-driven, functional, and imperative (including object oriented and prototype-
based) programming styles. It has an API for working with text, arrays, dates, regular
expressions, basic manipulation if the DOM, but the language itself does not included and
13
I/O, such as networking, storage, or graphics facilities, relying for these upon the host
Specifically made for Tail-G Electric motorcycle. Users are required to make an
account by entering their username, password and e-mail for logging in.
every information that passes through online registration process. It will be maintained
weekly: for debugging, updates, announcement and other systems related resolutions.
Methodology
Figure 1 shows the development of the system using the agile method. The feature
or the process will be tested by IT expert and Client in every phase of the development
until the said user’s is satisfied with the design and functionality of the application.
The kind of model the proponents will used in developing the system was Agile
Development Model. The industry was accepted this kind of model as a better solution in
developing of project. This method can ensure that the value is being optimized throughout
the developing process. By the use of planning and feedback results, the researchers can
continuously align a delivered product that reflects the needs of a client. It easily changes
the requirements can of the client throughout the process by measuring and evaluating the
status of a project. The TailG Electric Motorcycle will follow the SCRUM Agile
Methodology as the software development model for the project. SCRUM is an agile
collaborating and communicating both with the people who are doing the work and the
people who need the work done. It’s about delivering often and responding to feedback,
increasing project value by ensuring that users get what they actually want.
15
Conceptual Framework
This includes the input, process and output of the system which provides how the
PROCESS OUTPUT
INPUT
Software Design and TailG E-Motorcycle
Part I: Develop of the
system development using
Web based Sales and
System AGILE MODEL:
requirements Transaction
Product Backlog
Review of Sprint Backlog Management System
related literature Sprint Week
and studies Sprint Review
Part II: Assessment of Meeting Release
the System to be
developed in terms of
the following
criterions:
Purpose
Coverage
Currency
Objective
Accuracy
Functionality
Flexibility
The Input Output (IPO) Model is a function graph that identifies the inputs, outputs
and required processing task required to transform inputs into outputs. The model is
sometimes configured to include any storage that might happen in the process as well. The
inputs represent the flow of data and materials into the process from the outside. The
16
processing step includes all task required to effect a transformation of the inputs. The
outputs are the data and materials flowing out of the transformation process.
Product Backlog
A product backlog is a prioritized list of work for the development team that is
derived from the roadmap and its requirements. The most important items are shown at the
top of the product backlog so the team knows what to deliver first.
Sprint Backlog
The sprint backlog is a list of tasks identified by the Scrum team to be completed
during the Scrum sprint. During the sprint planning meeting, the team selects some
number of product backlog items, usually in the form of user stories, and identifies the
Sprint Week
confined to a regular, repeatable work cycle, known as a sprint or iteration. Scrum sprints
The sprint review occurs on the last day of the sprint. The purpose of
the meeting is for the team to show the customers and stakeholders the work they have
accomplished over the sprint so that the entire Scrum team can receive feedback to fine-
Figure 3. Sign In
This picture shows the sign-in screen of the web. Here the user is required to input their
username and password to access the application.
Figure 4. Sign Up
This figure shows the sign up screen of the website. Here the Users are required to input
their personal information such as first name, last name, email address, password and
confirm password to register in the database to gain access for payment in the website.
18
Figure 8. Paypal
Figure 8 shows the paypal page when user click the paypal button and wants to pay the
product on his cart.
20
Figure 9. Category
This figure shows the category view and when user wants to see the specific products.
Table 1
Hardware Specification Requirements for the website
Hardware Resources Minimum Requirements Suggested Requirements
RAM 2 GB 4 GB
Table 3
Software Specification Requirements for the Website
Hardware Resources Minimum Requirements Suggested Requirements
CHAPTER IV
RESULT AND DISCUSSION
This Chapter shows the presentation of data and state the statistical treatment and
statistical results obtained and the level of significance and interconnections between and
among data in the context of the study.
Table 4
IT Experts 3 5%
Total 60 100%
33
Table 5 presents the respondents of the evaluation consisting of thirty-five motor users,
twelve BulSU faculty/staff, and three IT experts. The interpretation and presentation of the
tables discuss the overall mean distribution in each of the criteria. It also shows the
Data Instrumentation
The researchers used several instrument in gathering the data needed for the study.
The following were the tools were used in gathering the data.
system. The following criteria were provided in order to evaluate the developed system:
(a) Authority, (b) Purpose, (c) Coverage, (d) Currency, (e) Objectivity, (f) Accuracy, (g)
The proponent used several tools in gathering data needed for the study. The
following were the tools used in gathering the data. During the evaluation of the developed
system, the researcher distributes questionnaires to the respondent of the system and was
Data Analysis
Table 5
The rating from the respondent are treated statistically using a Likert Scale and was
recorded based on the weighted mean or average. Their response to Software Quality
There are three measurements of the central location widely used in descriptive
statistics: then mean of which has its appropriate used in describing the sample or
population being studied if three measurements; the weight mean, since it is more reliable
associated with the interval and/or ratio data provided that the distribution is normal.
= “Good”, 2 = “Fair”, 1 = “Poor”. The rating of the respondents on the different criteria
Formula:
M= 5(r)+4(r)+3(r)+2(r)+1(r)
N
Where:
M - Mean
N – Number of respondents
of TailG E-Motorcycle Web Based Transaction and Management System were sough using
a five-point Likert Scale interpreted as follows: Excellent (5), Very Good (4), Good (3),
Table 6
Mean Distribution of Evaluation and Respondents Rating
In terms of the System’s Authority
Response
INDICATORS Mean
description
A. Authority. This element reveals that the person,
institution or agency responsible for a site has the
qualifications and knowledge to do so.
1. Authorship: Is it clear who developed the site? 4.52 Excellence
2. Is contact information clearly provided: e-mail
address, snail mail address, phone number, and 3.98 Very Good
fax number?
3. Credentials: Did the author state qualifications,
credentials, or personal background that gives 4.13 Very Good
them authority to present information?
In terms of Authority, the experts graded the developed system as “Excellent” in term of
Suitability with a weighted mean of (4.52) which indicate that it is clear who developed
the site. In terms of contact information clearly provided, the respondents mark as ”Very
Good” with a mean performance of (3.98) which mean functions contact information are
correct. In terms of Credentials, Did the author state qualification, credentials, or personal
background that gives them authority to present information the respondents gave a “Very
Good” remark with a mean performance (4.13). The site supported by an organization or a
commercial body recorded a mean value of (4.50). As a whole, the proposed system
recorded a mean value of (4.12) which mean that the proposed system is excellent in terms
of Authority.
Table 7
Mean Distribution of Evaluation and Respondents Rating
In terms of the System’s Purpose
B. Purpose. The purpose of the information presented in the
site should be clear. Some sites are meant to inform, Response
Mean
persuade, state an opinion, entertain, or parody Description
something or someone.
1. Does the content support the purpose of the site? 3.94 Very Good
2. Is the information geared to a specific audience
3.80 Very Good
(students, scholars, general reader)?
3. Is the site organized and focused? 3.90 Very Good
4. Are the outside links appropriate for the site? 3.58 Very Good
5. Does the site evaluate the links? 3.76 Very Good
6. Check the domain of the site. The URL may indicate
3.56 Very Good
its purpose.
General weighted mean 3.75 Very Good
4.50 – 5.00 Excellent: 3.50 – 4.49 Very Good: 2.50 – 3.49 Good: 1.50 – 2.49 Fair: 1.00 – 1.49 Poor
The content support the purpose of the site is rated by the respondents as “Very Good”
with a weighted mean of (3.94) which mean the purpose of the site is to properly clear. In
terms of the information geared to a specific audience, the respondents rated as “Very
Good” with a weighted mean (3.80). In terms of the site organized and focused is rated by
respondents as “Very Good” with a weighted mean of (3.90) which mean the site is
properly organized. In terms of the outside links appropriate for the site the respondents
rated as “Very Good” with a weighted mean of (3.58). In terms of the site evaluate the links
the respondents gave a “Very Good” remark with a mean of (3.76). In terms of domain
of the site is rated by respondents as “Very Good “ remarks with a weighted mean of
(3.56) which mean the URL of the site is properly indicated .As a whole, the proposed
system recorded an average weighted mean of (3.75). Overall the application is mark “Very
Table 8
with a weighted of (3.66). For the information of the system its free open source and
rated by the respondents as “Very Good” with a weighted mean of (3.84). Lastly
there an option for text only, or frames, or suggested browser for better viewing got
rated by respondents as “Very Good” and got mean of value (3.70). As a whole, the
proposed system recorded an average weighted mean of (3.71). Overall, the
application is mark “Very Good” in terms of Coverage and it is surely agreed that
the system is visually appealing .
Table 9
Mean Distribution of Evaluation and Respondents Rating
In terms of the System’s Currency
D. Currency. This refers to: 1) how current the information
presented is, and 2) how often the site is updated or
Response
maintained. It is important to know when a site was Mean
Description
created, when it was last updated, and if all of the links
are current
1. Links are up-to-date 4.21 Very Good
2. Links provided should be reliable. Dead links or
3.62 Very Good
references to sites that have moved are not useful.
3. Information provided so trend related that its
3.58 Very Good
usefulness is limited to a certain time period?
4. Has the site been under construction for some time? 4.14 Very Good
General weighted mean 3.88 Very Good
4.50 – 5.00 Excellent: 3.50 – 4.49 Very Good: 2.50 – 3.49 Good: 1.50 – 2.49 Fair: 1.00 – 1.49 Poor
site been under construction for some time rated by respondents as “ Very Good” with a
weighted mean of (4.14) which means some time site has been under maintenance for
updating and change the new specification of the system .The respondents rated the terms
of Currency with an average weighted mean of (3.88) overall the is mark “Very Good”.
41
Table 10
Mean Distribution of Evaluation and Respondents Rating
In terms of the System’s Objectivity
Objectivity of the site should be clear and use language correctly.The information presented
with a particular bias as “Very Good” and got a weighted mean of (3.7) which mean the system
represent the freely objectives. In terms of information try to sway the audience is rated by the
respondents as “Very Good” remark with a mean performance of (3.52). Site advertising conflict
with the content the respondents give a “ Very Good” remark with a mean of (3.72). Lastly in
terms of the site trying to explain, inform , persuade, or sell something the respondents gave a “
Very Good “ remark with a mean of (3.84)which mean respondents agree that system inform to
persuade something. As a whole, the proposed system recorded a mean average of (3.69) and
overall rated as very good in terms of objectives.
42
43
44
45
46
Table 11
Mean Distribution of Evaluation and Respondents Rating
In terms of the System’s Accuracy
In terms of Reliability the author affiliated with a known respectable institution the
respondents graded the developed system as “Very Good” with a weighted mean of
(3.88).In terms of Reference the experts graded as “ Very Good” with a weighted mean
of (4.2) which mean the information receive proper references as to their origin. After
reading have already done on the subject the respondents gave a “Very Good “ remark
with a weighted mean of (4.04) it is mean they agree that our system seem accurate. Tail-
G information is completely compared to other sites web based sale and transaction
system the respondents mark as “Very Good” with a weighted mean of (3.94). Basic rules
of grammar and spelling is rated by the respondents as “ Very Good” with a weighted
mean of (3.92). As a whole, the proposed system recorded an average weighted mean of
Table 12
Mean Distribution of Evaluation and Respondents Rating
In terms of the System’s Functionality
Response
G. Functionality Mean
Description
1. Accessibility. Is there breadth of browser
compatibility? A minimum & maximum monitor
resolution? Is there is an appeal to universal 4.18 Very Good
audience - multilingual translations, cultural
sensitivity, disability access & services?
2. Speed & Bandwidth Sensitivity. Consider overall
page sizes & complexity, average download times,
4.1 Very Good
download order & image redraws; wait to first
reaction/interaction times.
3. HTML Quality. Clean HTML with no faulty code,
workability of active x, rollovers, applets, etc.,
4.08 Very Good
page titles, descriptions, keywords & tags, Java &
JavaScript dependency, image dependency.
4. Navigation & Links. Navigation functionality &
clarity, link integrity, quality & depth of links 4.24 Very Good
provided.
5. Legality. Original artwork, music, intellectual
property etc., international copyright laws are
correctly observed, quotations, images &
3.94 Very Good
intellectual property from 3rd parties are
appropriately cited, legal site content & legal site
activities.
6. Compliance. Adherence to standards. 4.02 Very Good
7. Security. Provision for security requirements. 3.96 Very Good
General weight mean 4.093333 Very Good
4.50 – 5.00 Excellent: 3.50 – 4.49 Very Good: 2.50 – 3.49 Good: 1.50 – 2.49 Fair: 1.00 – 1.49 Poor
graded the developed system as “ Very Good” with a weighted mean of (4.18) which
48
mean that functions are appropriate to specifications. Speed and bandwidth sensitivity the
respondents rated as “ Very Good “ with weighted mean of (4.1) which mean consider
Good “ with an weighted mean of (4.08). Navigations and links functionality rated by the
respondents as “Very Good “and got a mean of (4.24). The Legality for original artwork,
music intellectual property etc, got a mean of (3.94) and a mark of “Very Good”. The
compliance that define adherence to standards recorded a mean of value of (4.02) and the
respondents gave a “Very Good” remark. In terms of security provision for security
requirements the respondent mark as “ Very Good” with a mean performance of (3.96).
As a whole, the proposed system recorded average mean of (4.09) which mean the
Table 13
Mean Distribution of Evaluation and Respondents Rating
In terms of the System’s Training and Documentation
Response
H. Training and Documentation Mean
Description
1. Availability of guides and printed documentation
3.96 Very Good
(technical or user’s manual).
2. Provision for trainings/tutorials or real interactive
3.96 Very Good
learning.
3. Provision for help component. Text should be clear
and use language correctly, with appropriate headings
and subheadings. Unfamiliar terms should be defined
3.84 Very Good
and explained. Organization should be logical. All
information should be readily accessible for
reference.
General weight mean 3.92 Very Good
4.50 – 5.00 Excellent: 3.50 – 4.49 Very Good: 2.50 – 3.49 Good: 1.50 – 2.49 Fair: 1.00 – 1.49 Poor
The respondent rated Training and Documentation of the Tailg E-motorcycle Web base,
Transaction and Management System as” Very Good” and got average mean of (3.92).
Having the availability of guides and printed documentation got mean (3.96) and mark as
“Very Good”. The provision for training or tutorials or real interactive learning got a
mean of (3.96) and mark as “Very Good”. Documentation content is organized in logical
manner and provision for help component got a mean of (3.84) were very good. It may be
surely concluding that the application provides guides and printed documentation and all
Chapter V
findings, evaluation and recommendations aimed to improve the research in the future.
Summary
The purpose of the study is to develop a tailg e-motorcycle web based management
and transaction system, an website created an designed to boost efficiency with portability.
To accomplish its goals, the data gathered were analyzed and interpreted with the
use of an Agile Scrum model. By focusing on process adaptability, the tailg e-motorcycle
web based management and transaction system, web based allows the users to know more
about the common customer of the tailg.Beneficiaries of the web based include every user
Summary of Findings
The general objective of the study is continually developing, enhance and maintain
The design model used in the study was IPO (Input-Process-Output) model. The
Agile scrum model and its ability to create and respond in an uncertain environment is
Table 14
Category Specifications
qualified of running in a windows 7 to windows 10. The system is developed use different
Table 15
Summary of the weighted mean for TailG E-motorcycle management and transaction
system.
Mean
Recommendations
The website is concluded to be acceptable yet some of its features can be enhanced
further. To the future researchers who will be interested in the same field of study and will
want to develop and improve the scope of this website, the following may be
recommended:
website
fastest way
APPENDICES
54
APPENDIX A
(Relevant Source Code)
55
</div>
<h4>You may <a href="login.php">Login</a> or back to <a
href="index.php">Homepage</a>.</h4>
';
}
else{
try{
$stmt = $conn->prepare("UPDATE users SET
status=:status WHERE id=:id");
$stmt->execute(['status'=>1, 'id'=>$row['id']]);
$output .= '
<div class="alert alert-success">
<h4><i class="icon fa fa-check"></i> Success!</h4>
Account activated - Email: <b>'.$row['email'].'</b>.
</div>
<h4>You may <a href="login.php">Login</a> or back to <a
href="index.php">Homepage</a>.</h4>
';
}
catch(PDOException $e){
$output .= '
<div class="alert alert-danger">
<h4><i class="icon fa fa-warning"></i> Error!</h4>
'.$e->getMessage().'
</div>
<h4>You may <a href="signup.php">Signup</a> or back to
<a href="index.php">Homepage</a>.</h4>
';
}
57
}
else{
$output .= '
<div class="alert alert-danger">
<h4><i class="icon fa fa-warning"></i> Error!</h4>
Cannot activate account. Wrong code.
</div>
<h4>You may <a href="signup.php">Signup</a> or back to <a
href="index.php">Homepage</a>.</h4>
';
}
$pdo->close();
}
?>
<?php include 'includes/header.php'; ?>
<body class="hold-transition skin-blue layout-top-nav">
<div class="wrapper">
<div class="content-wrapper">
<div class="container">
<div class="col-sm-9">
<?php echo $output; ?>
</div>
<div class="col-sm-3">
<?php include 'includes/sidebar.php'; ?>
</div>
</div>
</section>
</div>
</div>
cart_add.php
<?php
include 'includes/session.php';
$conn = $pdo->open();
$output = array('error'=>false);
$id = $_POST['id'];
$quantity = $_POST['quantity'];
if(isset($_SESSION['user'])){
$stmt = $conn->prepare("SELECT *, COUNT(*) AS numrows FROM cart
WHERE user_id=:user_id AND product_id=:product_id");
$stmt->execute(['user_id'=>$user['id'], 'product_id'=>$id]);
$row = $stmt->fetch();
if($row['numrows'] < 1){
try{
$stmt = $conn->prepare("INSERT INTO cart (user_id,
product_id, quantity) VALUES (:user_id, :product_id, :quantity)");
$stmt->execute(['user_id'=>$user['id'], 'product_id'=>$id,
'quantity'=>$quantity]);
$output['message'] = 'Item added to cart';
}
catch(PDOException $e){
$output['error'] = true;
$output['message'] = $e->getMessage();
}
60
}
else{
$output['error'] = true;
$output['message'] = 'Product already in cart';
}
}
else{
if(!isset($_SESSION['cart'])){
$_SESSION['cart'] = array();
}
$exist = array();
foreach($_SESSION['cart'] as $row){
array_push($exist, $row['productid']);
}
if(in_array($id, $exist)){
$output['error'] = true;
$output['message'] = 'Product already in cart';
}
else{
$data['productid'] = $id;
$data['quantity'] = $quantity;
if(array_push($_SESSION['cart'], $data)){
$output['message'] = 'Item added to cart';
}
61
else{
$output['error'] = true;
$output['message'] = 'Cannot add item to cart';
}
}
$pdo->close();
echo json_encode($output);
?>
62
cart_delete.php
<?php
include 'includes/session.php';
$conn = $pdo->open();
$output = array('error'=>false);
$id = $_POST['id'];
if(isset($_SESSION['user'])){
try{
$stmt = $conn->prepare("DELETE FROM cart WHERE id=:id");
$stmt->execute(['id'=>$id]);
$output['message'] = 'Deleted';
}
catch(PDOException $e){
$output['message'] = $e->getMessage();
}
}
else{
foreach($_SESSION['cart'] as $key => $row){
if($row['productid'] == $id){
unset($_SESSION['cart'][$key]);
$output['message'] = 'Deleted';
}
}
}
63
$pdo->close();
echo json_encode($output);
?>
64
cart_details.php
<?php
include 'includes/session.php';
$conn = $pdo->open();
$output = '';
if(isset($_SESSION['user'])){
if(isset($_SESSION['cart'])){
foreach($_SESSION['cart'] as $row){
$stmt = $conn->prepare("SELECT *, COUNT(*) AS
numrows FROM cart WHERE user_id=:user_id AND product_id=:product_id");
$stmt->execute(['user_id'=>$user['id'],
'product_id'=>$row['productid']]);
$crow = $stmt->fetch();
if($crow['numrows'] < 1){
$stmt = $conn->prepare("INSERT INTO cart
(user_id, product_id, quantity) VALUES (:user_id, :product_id, :quantity)");
$stmt->execute(['user_id'=>$user['id'],
'product_id'=>$row['productid'], 'quantity'=>$row['quantity']]);
}
else{
$stmt = $conn->prepare("UPDATE cart SET
quantity=:quantity WHERE user_id=:user_id AND product_id=:product_id");
$stmt->execute(['quantity'=>$row['quantity'],
'user_id'=>$user['id'], 'product_id'=>$row['productid']]);
}
}
unset($_SESSION['cart']);
}
65
try{
$total = 0;
$stmt = $conn->prepare("SELECT *, cart.id AS cartid FROM cart
LEFT JOIN products ON products.id=cart.product_id WHERE user_id=:user");
$stmt->execute(['user'=>$user['id']]);
foreach($stmt as $row){
$image = (!empty($row['photo'])) ? 'images/'.$row['photo'] :
'images/noimage.jpg';
$subtotal = $row['price']*$row['quantity'];
$total += $subtotal;
$output .= "
<tr>
<td><button type='button' data-
id='".$row['cartid']."' class='btn btn-danger btn-flat cart_delete'><i class='fa fa-
remove'></i></button></td>
<td><img src='".$image."' width='30px'
height='30px'></td>
<td>".$row['name']."</td>
<td>₱
".number_format($row['price'], 2)."</td>
<td class='input-group'>
<span class='input-group-btn'>
<button type='button' id='minus' class='btn
btn-default btn-flat minus' data-id='".$row['cartid']."'><i class='fa fa-
minus'></i></button>
</span>
<input type='text' class='form-control'
value='".$row['quantity']."' id='qty_".$row['cartid']."'>
<span class='input-group-btn'>
<button type='button' id='add' class='btn btn-
default btn-flat add' data-id='".$row['cartid']."'><i class='fa fa-plus'></i>
66
</button>
</span>
</td>
<td>₱ ".number_format($subtotal,
2)."</td>
</tr>
";
}
$output .= "
<tr>
<td colspan='5' align='right'><b>Total</b></td>
<td><b>₱ ".number_format($total,
2)."</b></td>
<tr>
";
}
catch(PDOException $e){
$output .= $e->getMessage();
}
}
else{
if(count($_SESSION['cart']) != 0){
$total = 0;
foreach($_SESSION['cart'] as $row){
$stmt = $conn->prepare("SELECT *, products.name AS
prodname, category.name AS catname FROM products LEFT JOIN category ON
category.id=products.category_id WHERE products.id=:id");
$stmt->execute(['id'=>$row['productid']]);
67
$product = $stmt->fetch();
$image = (!empty($product['photo'])) ?
'images/'.$product['photo'] : 'images/noimage.jpg';
$subtotal = $product['price']*$row['quantity'];
$total += $subtotal;
$output .= "
<tr>
<td><button type='button' data-
id='".$row['productid']."' class='btn btn-danger btn-flat cart_delete'><i class='fa fa-
remove'></i></button></td>
<td><img src='".$image."' width='30px'
height='30px'></td>
<td>".$product['name']."</td>
<td>₱
".number_format($product['price'], 2)."</td>
<td class='input-group'>
<span class='input-group-btn'>
<button type='button' id='minus' class='btn
btn-default btn-flat minus' data-id='".$row['productid']."'><i class='fa fa-
minus'></i></button>
</span>
<input type='text' class='form-control'
value='".$row['quantity']."' id='qty_".$row['productid']."'>
<span class='input-group-btn'>
<button type='button' id='add' class='btn btn-
default btn-flat add' data-id='".$row['productid']."'><i class='fa fa-plus'></i>
</button>
</span>
</td>
<td>₱ ".number_format($subtotal,
2)."</td>
</tr>
68
";
$output .= "
<tr>
<td colspan='5' align='right'><b>Total</b></td>
<td><b>₱ ".number_format($total,
2)."</b></td>
<tr>
";
}
else{
$output .= "
<tr>
<td colspan='6' align='center'>Shopping cart
empty</td>
<tr>
";
}
$pdo->close();
echo json_encode($output);
?>
69
cart_fetch.php
<?php
include 'includes/session.php';
$conn = $pdo->open();
$output = array('list'=>'','count'=>0);
if(isset($_SESSION['user'])){
try{
$stmt = $conn->prepare("SELECT *, products.name AS prodname,
category.name AS catname FROM cart LEFT JOIN products ON
products.id=cart.product_id LEFT JOIN category ON category.id=products.category_id
WHERE user_id=:user_id");
$stmt->execute(['user_id'=>$user['id']]);
foreach($stmt as $row){
$output['count']++;
$image = (!empty($row['photo'])) ? 'images/'.$row['photo'] :
'images/noimage.jpg';
$productname = (strlen($row['prodname']) > 30) ?
substr_replace($row['prodname'], '...', 27) : $row['prodname'];
$output['list'] .= "
<li>
<a
href='product.php?product=".$row['slug']."'>
<div class='pull-left'>
<img src='".$image."'
class='thumbnail' alt='User Image'>
</div>
<h4>
<b>".$row['catname']."</b>
<small>× ".$row['quantity']."</small>
70
</h4>
<p>".$productname."</p>
</a>
</li>
";
}
}
catch(PDOException $e){
$output['message'] = $e->getMessage();
}
}
else{
if(!isset($_SESSION['cart'])){
$_SESSION['cart'] = array();
}
if(empty($_SESSION['cart'])){
$output['count'] = 0;
}
else{
foreach($_SESSION['cart'] as $row){
$output['count']++;
$stmt = $conn->prepare("SELECT *, products.name AS
prodname, category.name AS catname FROM products LEFT JOIN category ON
category.id=products.category_id WHERE products.id=:id");
$stmt->execute(['id'=>$row['productid']]);
$product = $stmt->fetch();
$image = (!empty($product['photo'])) ?
'images/'.$product['photo'] : 'images/noimage.jpg';
71
$output['list'] .= "
<li>
<a
href='product.php?product=".$product['slug']."'>
<div class='pull-left'>
<img src='".$image."'
class='img-circle' alt='User Image'>
</div>
<h4>
<b>".$product['catname']."</b>
<small>× ".$row['quantity']."</small>
</h4>
<p>".$product['prodname']."</p>
</a>
</li>
";
}
}
}
$pdo->close();
echo json_encode($output);
?>
72
cart_total.php
<?php
include 'includes/session.php';
if(isset($_SESSION['user'])){
$conn = $pdo->open();
$total = 0;
foreach($stmt as $row){
$subtotal = $row['price'] * $row['quantity'];
$total += $subtotal;
}
$pdo->close();
echo json_encode($total);
}
?>
73
cart_update.php
<?php
include 'includes/session.php';
$conn = $pdo->open();
$output = array('error'=>false);
$id = $_POST['id'];
$qty = $_POST['qty'];
if(isset($_SESSION['user'])){
try{
$stmt = $conn->prepare("UPDATE cart SET quantity=:quantity
WHERE id=:id");
$stmt->execute(['quantity'=>$qty, 'id'=>$id]);
$output['message'] = 'Updated';
}
catch(PDOException $e){
$output['message'] = $e->getMessage();
}
}
else{
foreach($_SESSION['cart'] as $key => $row){
if($row['productid'] == $id){
$_SESSION['cart'][$key]['quantity'] = $qty;
$output['message'] = 'Updated';
}
}
74
$pdo->close();
echo json_encode($output);
?>
75
cart_view.php
<?php include 'includes/session.php'; ?>
<?php include 'includes/header.php'; ?>
<body class="hold-transition skin-blue layout-top-nav">
<div class="wrapper">
<link rel="stylesheet" href="secondfooters.css">
<?php include 'includes/navbar.php'; ?>
<div class="content-wrapper">
<div class="container">
</tbody>
</table>
</div>
</div>
<?php
if(isset($_SESSION['user'])){
echo "
<div id='paypal-button'></div>
";
}
else{
echo "
<h4>You need to <a
href='login.php'>Login</a> to checkout.</h4>
";
}
?>
</div>
<div class="col-sm-3">
<?php include 'includes/sidebar.php'; ?>
</div>
</div>
</section>
</div>
</div>
<?php $pdo->close(); ?>
<div id="contact">
77
<footer>
<font color="redorange"><h3> VISIT US AND TRY OUR STORE</h3></font>
<h4> HOURS</h4>
<h5> Monday 8:00am - 8:00pm </br>
Tuesday 8:00am - 8:00pm</br>
Wednesday 8:00am - 8:00pm</br>
Thursday 8:00am - 8:00pm</br>
Friday 8:00am - 8:00pm</h5>
</div>
</footer>
<?php include 'includes/footer.php'; ?>
</div>
dataType: 'json',
success: function(response){
if(!response.error){
getDetails();
getCart();
getTotal();
}
}
});
});
if(!response.error){
getDetails();
getCart();
getTotal();
}
}
});
});
}
}
});
});
getDetails();
getTotal();
});
function getDetails(){
$.ajax({
type: 'POST',
url: 'cart_details.php',
dataType: 'json',
success: function(response){
$('#tbody').html(response);
getCart();
}
});
}
function getTotal(){
$.ajax({
type: 'POST',
url: 'cart_total.php',
dataType: 'json',
success:function(response){
81
total = response;
}
});
}
</script>
<!-- Paypal Express -->
<script>
paypal.Button.render({
env: 'sandbox', // change for production if app is live,
client: {
sandbox: 'ASb1ZbVxG5ZFzCWLdYLi_d1-
k5rmSjvBZhxP2etCxBKXaJHxPba13JJD_D3dTNriRbAv3Kp_72cgDvaZ',
//production: 'AaBHKJFEej4V6yaArjzSx9cuf-
UYesQYKqynQVCdBlKuZKawDDzFyuQdidPOBSGEhWaNQnnvfzuFB9SM'
},
style: {
color: 'gold',
size: 'small'
},
//total purchase
amount: {
total: total,
currency: 'PHP'
}
}
]
}
});
},
}, '#paypal-button');
</script>
</body>
</html>
83
category.php
<?php include 'includes/session.php'; ?>
<?php
$slug = $_GET['category'];
$conn = $pdo->open();
try{
$stmt = $conn->prepare("SELECT * FROM category WHERE cat_slug =
:slug");
$stmt->execute(['slug' => $slug]);
$cat = $stmt->fetch();
$catid = $cat['id'];
}
catch(PDOException $e){
echo "There is some problem in connection: " . $e->getMessage();
}
$pdo->close();
?>
<?php include 'includes/header.php'; ?>
<head>
<link rel="icon" href="TaiLG.png"/>
</head>
<body class="hold-transition skin-blue layout-top-nav">
<div class="wrapper">
<link rel="stylesheet" href="secondfooters.css">
<?php include 'includes/navbar.php'; ?>
84
<div class="content-wrapper">
<div class="container">
$conn = $pdo->open();
try{
$inc = 3;
$stmt = $conn->prepare("SELECT *
FROM products WHERE category_id = :catid");
$stmt->execute(['catid' => $catid]);
foreach ($stmt as $row) {
$image = (!empty($row['photo'])) ?
'images/'.$row['photo'] : 'images/noimage.jpg';
$inc = ($inc == 3) ? 1 : $inc + 1;
if($inc == 1) echo "<div
class='row'>";
echo "
<div class='col-sm-4'>
<div class='box box-
solid'><a href='product.php?product=".$row['slug']."'>".$row['name']."
<div
class='box-body prod-body'>
85
<img
src='".$image."' width='100%' height='230px' class='thumbnail'>
$pdo->close();
?>
</div>
<div class="col-sm-3">
<?php include 'includes/sidebar.php'; ?>
</div>
</div>
</section>
86
</div>
<div id="contact">
<footer>
<font color="redorange"><h3> VISIT US AND TRY OUR STORE</h3></font>
<h4> HOURS</h4>
<h5> Monday 8:00am - 8:00pm </br>
Tuesday 8:00am - 8:00pm</br>
Wednesday 8:00am - 8:00pm</br>
Thursday 8:00am - 8:00pm</br>
Friday 8:00am - 8:00pm</h5>
index.php
<?php include 'includes/session.php'; ?>
<?php include 'includes/header.php'; ?>
<head>
<link rel="icon" href="TaiLG.png"/>
</head>
<body class="hold-transition skin-blue layout-top-nav">
<div class="wrapper">
<link rel="stylesheet" href="secondfooters.css">
<div class="content-wrapper">
<div class="container">
?>
<div id="carousel-example-generic" class="carousel slide" data-
ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0"
class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"
class=""></li>
<li data-target="#carousel-example-generic" data-slide-to="2"
class=""></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src="images/motor1.jpg" alt="First slide">
</div>
<div class="item">
<img src="images/motor2.jpg" alt="Second slide">
</div>
<div class="item">
<img src="images/motor3.jpg" alt="Third slide">
</div>
</div>
<a class="left carousel-control" href="#carousel-example-
generic" data-slide="prev">
<span class="fa fa-angle-left"></span>
</a>
<a class="right carousel-control" href="#carousel-example-
generic" data-slide="next">
<span class="fa fa-angle-right"></span>
</a>
89
</div>
<h2>Monthly Top Sellers</h2>
<?php
$month = date('m');
$conn = $pdo->open();
try{
$inc = 3;
$stmt = $conn->prepare("SELECT *,
SUM(quantity) AS total_qty FROM details LEFT JOIN sales ON sales.id=details.sales_id
LEFT JOIN products ON products.id=details.product_id WHERE MONTH(sales_date) =
'$month' GROUP BY details.product_id ORDER BY total_qty DESC LIMIT 6");
$stmt->execute();
foreach ($stmt as $row) {
$image = (!empty($row['photo'])) ?
'images/'.$row['photo'] : 'images/noimage.jpg';
$inc = ($inc == 3) ? 1 : $inc + 1;
if($inc == 1) echo "<div
class='row'>";
echo "
<div class='col-sm-4'>
<div class='box box-
solid'>
<div
class='box-body prod-body'>
<img
src='".$image."' width='100%' height='230px' class='thumbnail'>
<h5><a href='product.php?product=".$row['slug']."'>".$row['name']."</a></h5>
</div>
<div
class='box-footer'>
90
$pdo->close();
?>
</div>
<div class="col-sm-3">
<?php include 'includes/sidebar.php'; ?>
</div>
</div>
</section>
</div>
</div>
91
<div id="contact">
<footer>
<font color="redorange"><h3> VISIT US AND TRY OUR STORE</h3></font>
<h4> HOURS</h4>
<h5> Monday 8:00am - 8:00pm </br>
Tuesday 8:00am - 8:00pm</br>
Wednesday 8:00am - 8:00pm</br>
Thursday 8:00am - 8:00pm</br>
Friday 8:00am - 8:00pm</h5>
</body>
</html>
92
login.php
<?php include 'includes/session.php'; ?>
<?php
if(isset($_SESSION['user'])){
header('location: cart_view.php');
}
?>
<?php include 'includes/header.php'; ?>
<head>
<link rel="icon" href="TaiLG.png"/>
</head>
<body class="hold-transition login-page">
<div class="login-box">
<?php
if(isset($_SESSION['error'])){
echo "
<div class='callout callout-danger text-center'>
<p>".$_SESSION['error']."</p>
</div>
";
unset($_SESSION['error']);
}
if(isset($_SESSION['success'])){
echo "
<div class='callout callout-success text-center'>
<p>".$_SESSION['success']."</p>
</div>
";
93
unset($_SESSION['success']);
}
?>
<div class="login-box-body">
<p class="login-box-msg">Sign in to start your session</p>
</center>
</div>
</div>
logout.php
<?php
session_start();
session_destroy();
header('location: index.php');
?>
password_forgot.php
<?php include 'includes/session.php'; ?>
<?php include 'includes/header.php'; ?>
<body class="hold-transition login-page">
<div class="login-box">
<?php
if(isset($_SESSION['error'])){
echo "
<div class='callout callout-danger text-center'>
<p>".$_SESSION['error']."</p>
</div>
";
unset($_SESSION['error']);
}
if(isset($_SESSION['success'])){
echo "
<div class='callout callout-success text-center'>
<p>".$_SESSION['success']."</p>
</div>
";
96
unset($_SESSION['success']);
}
?>
<div class="login-box-body">
<p class="login-box-msg">Enter email associated with account</p>
password_new.php
<?php
include 'includes/session.php';
if(!isset($_GET['code']) OR !isset($_GET['user'])){
header('location: index.php');
exit();
}
$path = 'password_reset.php?code='.$_GET['code'].'&user='.$_GET['user'];
if(isset($_POST['reset'])){
$password = $_POST['password'];
$repassword = $_POST['repassword'];
if($password != $repassword){
$_SESSION['error'] = 'Passwords did not match';
header('location: '.$path);
}
else{
$conn = $pdo->open();
$password = password_hash($password,
PASSWORD_DEFAULT);
try{
$stmt = $conn->prepare("UPDATE users SET
password=:password WHERE id=:id");
$stmt->execute(['password'=>$password,
'id'=>$row['id']]);
$pdo->close();
}
}
else{
$_SESSION['error'] = 'Input new password first';
header('location: '.$path);
99
?>
password_reset.php
<?php include 'includes/session.php'; ?>
<?php
if(!isset($_GET['code']) OR !isset($_GET['user'])){
header('location: index.php');
exit();
}
?>
<?php include 'includes/header.php'; ?>
<body class="hold-transition login-page">
<div class="login-box">
<?php
if(isset($_SESSION['error'])){
echo "
<div class='callout callout-danger text-center'>
<p>".$_SESSION['error']."</p>
</div>
";
unset($_SESSION['error']);
}
?>
<div class="login-box-body">
<p class="login-box-msg">Enter new password</p>
100
product.php
<?php include 'includes/session.php'; ?>
<?php
$conn = $pdo->open();
$slug = $_GET['product'];
try{
}
catch(PDOException $e){
echo "There is some problem in connection: " . $e->getMessage();
}
//page view
$now = date('Y-m-d');
if($product['date_view'] == $now){
$stmt = $conn->prepare("UPDATE products SET counter=counter+1
WHERE id=:id");
$stmt->execute(['id'=>$product['prodid']]);
}
else{
$stmt = $conn->prepare("UPDATE products SET counter=1,
date_view=:now WHERE id=:id");
102
$stmt->execute(['id'=>$product['prodid'], 'now'=>$now]);
}
?>
<?php include 'includes/header.php'; ?>
<body class="hold-transition skin-blue layout-top-nav">
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.12';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="wrapper">
<div class="content-wrapper">
<div class="container">
<span class="input-group-
btn">
<button type="button"
id="minus" class="btn btn-default btn-flat btn-lg"><i class="fa fa-minus"></i></button>
</span>
<input type="text"
name="quantity" id="quantity" class="form-control input-lg" value="1">
<span class="input-group-
btn">
<button type="button"
id="add" class="btn btn-default btn-flat btn-lg"><i class="fa fa-plus"></i>
</button>
</span>
<input type="hidden"
value="<?php echo $product['prodid']; ?>" name="id">
</div>
<button type="submit" class="btn
btn-primary btn-lg btn-flat"><i class="fa fa-shopping-cart"></i> Add to Cart</button>
104
</div>
</form>
</div>
<div class="col-sm-6">
<h1 class="page-header"><?php echo
$product['prodname']; ?></h1>
<h3><b>₱ <?php echo
number_format($product['price'], 2); ?></b></h3>
<p><b>Category:</b> <a
href="category.php?category=<?php echo $product['cat_slug']; ?>"><?php echo
$product['catname']; ?></a></p>
<p><b>Description:</b></p>
<p><?php echo $product['description']; ?></p>
</div>
</div>
<br>
<div class="fb-comments" data-
href="http://localhost/CapstoneProject2/product.php?product=<?php echo $slug; ?>"
data-numposts="10" width="100%"></div>
</div>
<div class="col-sm-3">
<?php include 'includes/sidebar.php'; ?>
</div>
</div>
</section>
</div>
</div>
<?php $pdo->close(); ?>
<?php include 'includes/footer.php'; ?>
105
<!-- -->
</div>
$('#add').click(function(e){
e.preventDefault();
var quantity = $('#quantity').val();
quantity++;
$('#quantity').val(quantity);
});
$('#minus').click(function(e){
e.preventDefault();
var quantity = $('#quantity').val();
if(quantity > 1){
quantity--;
}
$('#quantity').val(quantity);
});
});
</script>
</body>
</html>
107
profile.php
<?php include 'includes/session.php'; ?>
<?php
if(!isset($_SESSION['user'])){
header('location: index.php');
}
?>
<?php include 'includes/header.php'; ?>
<body class="hold-transition skin-blue layout-top-nav">
<div class="wrapper">
<div class="content-wrapper">
<div class="container">
if(isset($_SESSION['success'])){
echo "
<div class='callout callout-success'>
".$_SESSION['success']."
</div>
";
unset($_SESSION['success']);
}
?>
<div class="box box-solid">
<div class="box-body">
<div class="col-sm-3">
<img src="<?php echo
(!empty($user['photo'])) ? 'images/'.$user['photo'] : 'images/profile.jpg'; ?>"
width="100%">
</div>
<div class="col-sm-9">
<div class="row">
<div class="col-sm-3">
<h4>Name:</h4>
<h4>Email:</h4>
<h4>Contact Info:</h4>
<h4>Address:</h4>
<h4>Member Since:</h4>
</div>
<div class="col-sm-9">
109
<h4><?php echo
$user['firstname'].' '.$user['lastname']; ?>
<span class="pull-
right">
<a
href="#edit" class="btn btn-success btn-flat btn-sm" data-toggle="modal"><i class="fa fa-
edit"></i> Edit</a>
</span>
</h4>
<h4><?php echo
$user['email']; ?></h4>
<h4><?php echo
(!empty($user['contact_info'])) ? $user['contact_info'] : 'N/a'; ?></h4>
<h4><?php echo
(!empty($user['address'])) ? $user['address'] : 'N/a'; ?></h4>
<h4><?php echo date('M d,
Y', strtotime($user['created_on'])); ?></h4>
</div>
</div>
</div>
</div>
</div>
<div class="box box-solid">
<div class="box-header with-border">
<h4 class="box-title"><i class="fa fa-
calendar"></i> <b>Transaction History</b></h4>
</div>
<div class="box-body">
<table class="table table-bordered" id="example1">
<thead>
<th class="hidden"></th>
110
<th>Date</th>
<th>Transaction#</th>
<th>Amount</th>
<th>Full Details</th>
</thead>
<tbody>
<?php
$conn = $pdo->open();
try{
$stmt = $conn-
>prepare("SELECT * FROM sales WHERE user_id=:user_id ORDER BY sales_date
DESC");
$stmt-
>execute(['user_id'=>$user['id']]);
foreach($stmt as $row){
$stmt2 = $conn-
>prepare("SELECT * FROM details LEFT JOIN products ON
products.id=details.product_id WHERE sales_id=:id");
$stmt2-
>execute(['id'=>$row['id']]);
$total = 0;
foreach($stmt2 as
$row2){
$subtotal =
$row2['price']*$row2['quantity'];
$total +=
$subtotal;
}
echo "
<tr>
111
<td
class='hidden'></td>
<td>".$row['pay_id']."</td>
}
catch(PDOException $e){
echo "There is
some problem in connection: " . $e->getMessage();
}
$pdo->close();
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-sm-3">
<?php include 'includes/sidebar.php'; ?>
</div>
112
</div>
</section>
</div>
</div>
});
});
$("#transaction").on("hidden.bs.modal", function () {
$('.prepend_items').remove();
});
});
</script>
</body>
</html>
profile_edit.php
<?php
include 'includes/session.php';
$conn = $pdo->open();
if(isset($_POST['edit'])){
$curr_password = $_POST['curr_password'];
$email = $_POST['email'];
$password = $_POST['password'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$contact = $_POST['contact'];
$address = $_POST['address'];
$photo = $_FILES['photo']['name'];
if(password_verify($curr_password, $user['password'])){
if(!empty($photo)){
114
move_uploaded_file($_FILES['photo']['tmp_name'],
'images/'.$photo);
$filename = $photo;
}
else{
$filename = $user['photo'];
}
if($password == $user['password']){
$password = $user['password'];
}
else{
$password = password_hash($password,
PASSWORD_DEFAULT);
}
try{
$stmt = $conn->prepare("UPDATE users SET
email=:email, password=:password, firstname=:firstname, lastname=:lastname,
contact_info=:contact, address=:address, photo=:photo WHERE id=:id");
$stmt->execute(['email'=>$email, 'password'=>$password,
'firstname'=>$firstname, 'lastname'=>$lastname, 'contact'=>$contact, 'address'=>$address,
'photo'=>$filename, 'id'=>$user['id']]);
}
else{
$_SESSION['error'] = 'Incorrect password';
}
}
else{
$_SESSION['error'] = 'Fill up edit form first';
}
$pdo->close();
header('location: profile.php');
?>
register.php
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
include 'includes/session.php';
if(isset($_POST['signup'])){
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$email = $_POST['email'];
$password = $_POST['password'];
$repassword = $_POST['repassword'];
116
$_SESSION['firstname'] = $firstname;
$_SESSION['lastname'] = $lastname;
$_SESSION['email'] = $email;
if(!isset($_SESSION['captcha'])){
require('recaptcha/src/autoload.php');
$recaptcha = new
\ReCaptcha\ReCaptcha('6LevO1IUAAAAAFCCiOHERRXjh3VrHa5oywciMKcw', new
\ReCaptcha\RequestMethod\SocketPost());
$resp = $recaptcha->verify($_POST['g-recaptcha-response'],
$_SERVER['REMOTE_ADDR']);
if (!$resp->isSuccess()){
$_SESSION['error'] = 'Please answer recaptcha correctly';
header('location: signup.php');
exit();
}
else{
$_SESSION['captcha'] = time() + (10*60);
}
if($password != $repassword){
$_SESSION['error'] = 'Passwords did not match';
header('location: signup.php');
}
else{
117
$conn = $pdo->open();
//generate code
$set='123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU
VWXYZ';
$code=substr(str_shuffle($set), 0, 12);
try{
$stmt = $conn->prepare("INSERT INTO users
(email, password, firstname, lastname, activate_code, created_on) VALUES (:email,
:password, :firstname, :lastname, :code, :now)");
$stmt->execute(['email'=>$email,
'password'=>$password, 'firstname'=>$firstname, 'lastname'=>$lastname, 'code'=>$code,
'now'=>$now]);
$userid = $conn->lastInsertId();
$message = "
118
//Load phpmailer
require 'vendor/autoload.php';
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->setFrom('[email protected]');
//Recipients
$mail->addAddress($email);
$mail->addReplyTo('[email protected]');
//Content
$mail->isHTML(true);
$mail->Subject = 'ECommerce Site Sign Up';
$mail->Body = $message;
$mail->send();
unset($_SESSION['firstname']);
unset($_SESSION['lastname']);
unset($_SESSION['email']);
}
catch (Exception $e) {
$_SESSION['error'] = 'Message could not be sent.
Mailer Error: '.$mail->ErrorInfo;
header('location: signup.php');
120
}
catch(PDOException $e){
$_SESSION['error'] = $e->getMessage();
header('location: register.php');
}
$pdo->close();
}
else{
$_SESSION['error'] = 'Fill up signup form first';
header('location: signup.php');
}
?>
reset.php
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
121
include 'includes/session.php';
if(isset($_POST['reset'])){
$email = $_POST['email'];
$conn = $pdo->open();
$set='123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU
VWXYZ';
$code=substr(str_shuffle($set), 0, 15);
try{
$stmt = $conn->prepare("UPDATE users SET
reset_code=:code WHERE id=:id");
$stmt->execute(['code'=>$code, 'id'=>$row['id']]);
$message = "
<h2>Password Reset</h2>
<p>Your Account:</p>
<p>Email: ".$email."</p>
<p>Please click the link below to reset your
password.</p>
122
<a
href='http://localhost/ecommerce/password_reset.php?code=".$code."&user=".$row['id'].
"'>Reset Password</a>
";
//Load phpmailer
require 'vendor/autoload.php';
$mail->setFrom('[email protected]');
//Recipients
123
$mail->addAddress($email);
$mail->addReplyTo('[email protected]');
//Content
$mail->isHTML(true);
$mail->Subject = 'ECommerce Site Password Reset';
$mail->Body = $message;
$mail->send();
}
catch (Exception $e) {
$_SESSION['error'] = 'Message could not be sent. Mailer
Error: '.$mail->ErrorInfo;
}
}
catch(PDOException $e){
$_SESSION['error'] = $e->getMessage();
}
}
else{
$_SESSION['error'] = 'Email not found';
}
$pdo->close();
}
124
else{
$_SESSION['error'] = 'Input email associated with account';
}
header('location: password_forgot.php');
?>
125
sales.php
<?php
include 'includes/session.php';
if(isset($_GET['pay'])){
$payid = $_GET['pay'];
$date = date('Y-m-d');
$conn = $pdo->open();
try{
try{
$stmt = $conn->prepare("SELECT * FROM cart LEFT
JOIN products ON products.id=cart.product_id WHERE user_id=:user_id");
$stmt->execute(['user_id'=>$user['id']]);
foreach($stmt as $row){
$stmt = $conn->prepare("INSERT INTO details
(sales_id, product_id, quantity) VALUES (:sales_id, :product_id, :quantity)");
$stmt->execute(['sales_id'=>$salesid,
'product_id'=>$row['product_id'], 'quantity'=>$row['quantity']]);
}
126
}
catch(PDOException $e){
$_SESSION['error'] = $e->getMessage();
}
}
catch(PDOException $e){
$_SESSION['error'] = $e->getMessage();
}
$pdo->close();
}
header('location: profile.php');
?>
127
search.php
<?php include 'includes/session.php'; ?>
<?php include 'includes/header.php'; ?>
<body class="hold-transition skin-blue layout-top-nav">
<div class="wrapper">
<div class="content-wrapper">
<div class="container">
$conn = $pdo->open();
<h5><a href='product.php?product=".$row['slug']."'>".$highlighted."</a></h5>
</div>
<div
class='box-footer'>
</div>
</div>
</div>
";
if($inc == 3) echo "</div>";
}
if($inc == 1) echo "<div class='col-sm-
4'></div><div class='col-sm-4'></div></div>";
if($inc == 2) echo "<div class='col-
sm-4'></div></div>";
}
catch(PDOException $e){
echo "There is some problem in
connection: " . $e->getMessage();
}
}
$pdo->close();
?>
</div>
<div class="col-sm-3">
<?php include 'includes/sidebar.php'; ?>
</div>
</div>
</section>
</div>
130
</div>
signup.php
<?php include 'includes/session.php'; ?>
<?php
if(isset($_SESSION['user'])){
header('location: cart_view.php');
}
if(isset($_SESSION['captcha'])){
$now = time();
if($now >= $_SESSION['captcha']){
unset($_SESSION['captcha']);
}
}
?>
<?php include 'includes/header.php'; ?>
<head>
<link rel="icon" href="TaiLG.png"/>
</head>
131
if(isset($_SESSION['success'])){
echo "
<div class='callout callout-success text-center'>
<p>".$_SESSION['success']."</p>
</div>
";
unset($_SESSION['success']);
}
?>
<div class="register-box-body">
<p class="login-box-msg">Register a new membership</p>
</di>
';
}
?>
<hr>
<div class="row">
<div class="col-xs-4">
<button type="submit" class="btn btn-primary btn-block btn-flat"
name="signup"><i class="fa fa-pencil"></i> Sign Up</button>
</div>
</div>
</form>
<br>
<a href="login.php">I already have a membership</a><br>
<a href="index.php"><i class="fa fa-home"></i> Home</a>
</div>
</div>
transaction.php
<?php
include 'includes/session.php';
$id = $_POST['id'];
$conn = $pdo->open();
$output = array('list'=>'');
$total = 0;
foreach($stmt as $row){
$output['transaction'] = $row['pay_id'];
$output['date'] = date('M d, Y', strtotime($row['sales_date']));
$subtotal = $row['price']*$row['quantity'];
$total += $subtotal;
$output['list'] .= "
<tr class='prepend_items'>
<td>".$row['name']."</td>
<td>Php ".number_format($row['price'], 2)."</td>
<td>".$row['quantity']."</td>
<td>Php ".number_format($subtotal, 2)."</td>
</tr>
";
135
?>
verify.php
<?php
include 'includes/session.php';
$conn = $pdo->open();
if(isset($_POST['login'])){
$email = $_POST['email'];
$password = $_POST['password'];
try{
}
else{
$_SESSION['user'] = $row['id'];
}
}
else{
$_SESSION['error'] = 'Incorrect Password';
}
}
else{
$_SESSION['error'] = 'Account not activated.';
}
}
else{
$_SESSION['error'] = 'Email not found';
}
}
catch(PDOException $e){
echo "There is some problem in connection: " . $e->getMessage();
}
}
else{
$_SESSION['error'] = 'Input login credentails first';
}
$pdo->close();
header('location: login.php');
?>
137
APPENDIX B
(User Manual)
138
APPENDIX C
(Evaluation Tool)
139
Please evaluate the instrument by using the given scale and placing a checkmark () under
the corresponding rating.
Rating Description
5 Excellent
4 Very Good
3 Good
2 Fair
1 Poor
INDICATORS 5 4 3 2 1
A. Authority. This element reveals that the person, intuition or
agency responsible for a site has qualifications and knowledge
to do so.
1. Authorship: Is it clear who developed the site?
2. Is contact information clearly provided: e-mail address,
snail mail address, phone number, and fax number?
3. Credentials: Did the author state qualifications,
credentials, or personal background that gives them
authority to present information?
4. Is the site supported by an organization or a commercial
body?
B. Purpose. The purpose of the information presented in the site
should be clear. Some sites are meant to inform, persuade, state
an opinion, entertain, or parody something or someone.
1. Does the content support the purpose of the site?
2. Is the information geared to a specific audience (students,
scholar, general reader)?
3. Is the site organized and focused?
4. Are the outside links appropriate for the site?
5. Does the site evaluate the links?
6. Check the domain of the site. The URL may indicate its
purpose.
140
Comment/Suggestion: _____________________________________________________
________________________________________________________________________
________________________________________________________________________
142
APPENDICX D
(Curriculum Vitae)
143
CAREER OBJECTIVES:
PERSONAL DATA:
Sex : Male
Present Address : 032 Talabahan St. Barangay Bagna. Malolos City, Bulacan
Date of Birth : December 03, 1997
Place of Birth : Bulacan
Nationality : Filipino
Civil Status : Single
Religion : Roman Catholic
Language Spoken : Filipino and English
EDUCATIONAL BACKGROUND:
SKILLS
Technical Skills
SEMINARS:
The 2th Computer Technology Summit "Molding the Computer Technology
Generation for better Future"
Hiyas ng Bulacan Convention Center, City of Malolos, Bulacan
February 18, 2014
The 3rd Compter Technology Summit "Linking Today's Dream Tomorrow's
Reality"
Hiyas ng Bulacan Convention Center, City of Malolos, Bulacan
October 01, 2015
6th IT Congress "IT’S HOW WE CONNECT"
Bulacan Capitol Gymnasium, Malolos
November 25, 2016
7th IT Congress "WAR ON HACK"
Bulacan Capitol Gymnasium, Malolos
November 17, 2017
3rd ENABLEMENT SEMINAR "Zentalk Campus Invasion (w/ ASUS, INVIDIA and
SEAGATE)"
Disaster Preparedness and Risk Reduction Managenent
Vallencia Hall, Bulacan State University
October 19, 2017
CHARACTER REFERENCES:
Mr. Jamie P. Pulumbarit
College Dean
I hereby certify that the above information is true and correct to the best of my knowledge and
belief.
_________________________
Rey Francis M. Hernandez