You are on page 1of 138

SRINIVAS UNIVERSITY

Smart Electricals
Submitted to Srinivas University on partial Completion of Sixth Semester

Bachelor of Computer Application


By
Aswanth BB (3SU21CC029)

VI Semester BCA

Under the Guidance of


Prof. Vajrakshi Shettigar
Faculty of
Srinivas University Institute of Computer
and Information Science
Pandeshwar ,Mangalore
2023-2024
SRINIVAS UNIVERSITY
Srinivas Nagar, Mukka– 574 146, Mangaluru, Karnataka. Phone : 0824-2477456
(Private University Established by Karnataka Govt. ACT No.42 of 2013, Recognized
by UGC, New Delhi & Member of Association of Indian Universities, New Delhi)
Web : www.srinivasuniversity.edu.in, Email: info@srinivasuniversity.edu.in

INSTITUTE OF COMPUTER SCIENCE & INFORMATION SCIENCES

CERTIFICATE
This is to certify that the project work entitled
“……………………………………………………………………………………………
.……..…………………………………………………………….” carried out by
Mr./Ms………………………………………………...……………

(Registration No………………………………… ), a bonafide student of


this institution, in partial fulfillment for the award of Degree
B.C.A/B.Sc/M.C.A at Srinivas University, City Campus,
Pandeshwara, Mangaluru – 575 001, during the academic year 2023-
2024. It is also certified that all corrections/suggestions indicated
during internal assessment have been incorporated in the Report.
The project report has been approved as it satisfies the academic
requirements in respect of Project work prescribed for the said
degree.

Name & Signature of the Guide Name & Signature of


the Dean
External Viva :

Name of the Examiners Signature with Date

1.
2
DECLARATION

This report serves as the culmination of our project work, a requisite for the attainment of
the Bachelor of Computer Application degree.

We acknowledge the invaluable guidance provided by Mrs. Vajrakshi Shettigar, a faculty


member within the Department of Computer Science and Information Science at Srinivas
University, Mangalore, during the development of our project titled "Smart Electricals."

We affirm that this report represents our independent efforts, and to the best of our
knowledge, none of the material contained herein has been previously submitted for the
fulfillment of any other academic degree, either at this university or elsewhere.

Place: Mangalore

Date: 19-04-2024 Mr.Aswanth BB(3SU21CC029)


ACKNOWLEDGEMENT

Every accomplishment, whether significant or modest, is propelled by the guidance and


encouragement of inspiring individuals. We extend our sincere thanks to Mrs. Vajrakshi
Shettigar, a distinguished member of the Department of Computer Science and
Information Science, and Dr. P Sridhara Acharya, the esteemed Head of ICIS at Srinivas
University, Mangalore. Their consistent support, valuable insights, and technical expertise
have been pivotal in shaping our project.

We are deeply grateful to our esteemed Principal, Dr. P.S. Aithal, and the Dean, Dr.
Subrahmanya Bhat, whose dedication to fostering a competitive academic environment has
inspired us throughout our journey.

Our appreciation also goes to the entire faculty and staff of the Department of Computer
Science and Information Science for their assistance, both direct and indirect, in the
successful completion of our project.

Lastly, we express our heartfelt thanks to our parents, friends, and loved ones, whose
unwavering encouragement and support have been the driving force behind our
perseverance. Their guidance and assistance have been invaluable throughout this
endeavor.

Mr.Aswanth.BB
CONTENTS
i. Declaration
ii. Acknowledgement
iii. Abstract
iv. List Of Figures

1. Synopsis
CHAPTER - 1-2
1.1 Title of the project
1.2 Introduction
1.3 Innovative idea behind the selection of the project
1.4 Literature review
1.5 Nature of the project
1.6 Project category
1.7 Language to be used
1.8 Hardware and software requirement
1.9 Conclusion

2. Software Requirement Specification


CHAPTER- 3-8
2.1 Introduction
2.2 Purpose
2.3 scope
2.4 Definition, Acronyms, Abbreviation
2.5 Overview
2.6 Overall Description
2.7 Productive Perspective
2.8 Product Features
2.9 User Characteristics
2.10 General Constraints
2.11 Assumptions and Dependencies
2.12 Specific Requirements
2.12.1software interface
2.12.2Hardware interface
2.12.3Communication Interface
2.13 Functional Requirements
2.14 Performance Requirements
2.15 Design Constraints
2.16 System Attributes
2.17 Other Requirements
2.17.1Safety Requirements
2.17.2Security Requirements

3. System Design
CHAPTER- 9-14
3.1 Introduction
3.2 Context flow Design
3.3 Data flow Diagram
3.4 Rules Regarding DFD Constraints
3.5 DFD Symbols
3.6 DFD for Admin
3.6.1 DFD for User
3.7 Entity relationship Diagram
3.7.1 ER diagram symbols
3.8 ER Diagram

4. Database Design
CHAPTER-15-18
4.1 Introduction
4.2 Scope
4.3 Table Description
4.3.1 Admin Table
4.3.2 Product Table
4.3.3 Feedback Table
4.3.4 Order Table
4.3.5 Payment Table
4.3.6 Category Table
4.3.7 Customer(user) Table
5. Detailed Design
CHAPTER-19-30
5.1 Introduction
5.2 Application Documents
5.3 structure of the software package
5.4 modular decomposition of componen
5.4.1 Manage Payment
5.4.1.1 Manage Products
5.4.2 Manage Customer
5.4.2.1 Manage order
5.4.3 View Feedback
5.4.3.1 Manage Category
5.4.4 Customer
5.4.4.1 Registration
5.4.4.2 Login
5.4.4.3 View Products
5.4.4.4 Orders
5.4.4.5 Payments
5.4.4.6 Write feedback

6. Coding
CHAPTER-31-94
6.1 Coding

7. TESTING
CHAPTER – 95-100
7.1 Introduction
7.2 Testing objectives
7.3 Testing Method
7.3.1 Testing Steps
7.3.2 Integration testing
7.3.3 Validation
7.3.4 Output testing
7.3.5 User acceptance testing
7.4 Test cases
8. USER INTERFACE
CHAPTER – 101-110

8.1 Screen short

9. USER MANUAL
CHAPTER –111
9.1 Introduction
9.2 Hardware requirements
9.3 Software requirements

10. CONCLUSION
CHAPTER –112
10.1 Conclusion

11. BIBLIOGRAPHY
CHAPTER – 113

11.1 Books and Website reference

12. PLAGIARISM REPORT


CHAPTER – 12
12.1 Plagiarism
1.SYNOPSIS
1.1 Tiltle of the Project

SMART ELECTRICALS

1.2 Introduction

"SMART ELECTRICALS" is a groundbreaking e-commerce platform dedicated to electrical products,


aiming to transform the accessibility and purchase process of electrical goods. Through its user-friendly
interface and extensive product catalog, SMART ELECTRICALS endeavors to deliver a seamless
shopping experience for individuals, businesses, and contractors in need of electrical products.

1.3 Innovative Idea Behind The Project

The concept of SMART ELECTRICALS is born out of the growing need for a centralized platform
dedicated solely to electrical products. The current e-commerce market lacks specialization in this area,
resulting in a disjointed shopping experience for consumers. “SMART ELECTRICALS” aims to bridge
this gap by providing a carefully curated selection of electrical products, thus offering a comprehensive
solution to meet all electrical needs under one roof.

1.4 Literature Review

Extensive research in the literature has highlighted the increasing significance of specialized e-
commerce platforms across various industries. The demand for a dedicated platform specifically for
electrical products is further emphasized by the rapid technological advancements in the electrical
sector and the notable shift towards online purchasing behaviors. SMART ELECTRICALS
acknowledges these trends and aligns itself accordingly, recognizing the potential for a focused
platform within the electrical market.
1.5 Nature Of The Project
The "SMART ELECTRICALS" project aims to develop a software solution to streamline and enhance
various functions of an electrical shop. This entails creating an online platform where customers can
register, login, and place orders conveniently. SMART ELECTRICALS offers a wide array of electrical
products, ranging from inverters and water purifiers to lighting solutions and power distribution
equipment. The platform is designed to be user-friendly, with detailed product descriptions, technical
specifications, and customer reviews provided to enable informed purchasing decisions.
1
PROJECT CATEGORY:
• Web Based Application
LANGUAGES TO BE USED:
• Frontend: HTML, CSS, and JavaScript for creating the user interface and enhancing interactivity.
• Backend: MySQL for database management and PHP for server-side scripting to handle data processing
and logic.

1.6 Hardware And Software Requirements

1.6.1 HARDWARE REQUIREMENT:

• Processors: Intel Pentium dual-core or above


• RAM: 2GB and above
• Hard Disk Utilization: 40GB and above

1.6.2 SOFTWARE REQUIREMENT:

• Text Editor: Sublime Text Editor


• Server: Apache
• Browsers: Internet Explorer, Google Chrome, Mozilla Firefox

1.7 Conclusion
"SMART ELECTRICALS" represents an innovative solution aimed at simplifying the process of
purchasing electrical products in the digital age. By catering to the unique requirements of the electrical
sector, SMART ELECTRICALS strives to establish itself as the preferred platform for individuals,
businesses, and contractors, offering a convenient and trustworthy source for all their electrical needs.

1.8 Team Members


• ASWANTH BB - 3SU21CCO29
• MUFEED M - 3SU21CC047

2
2.SOFTWARE REQUIREMENT AND SPECIFICATION

2.1 INTRODUCTION

The Software Requirements Specification (SRS) document encapsulates a detailed description of the
expected functionality of the system. Below are the subsections of the SRS document that provide a
comprehensive overview:
"SMART ELECTRICALS" is a web-based application meticulously crafted to facilitate the management
of electronic products, Admin, and Users. This system is geared towards providing a seamless platform
for customers to discover, purchase, and provide feedback on electronic products. Simultaneously, it
empowers administrators to showcase their offerings, manage orders efficiently, and seamlessly handle
payments.

2.1.1 PURPOSE

The Software Requirements Specification (SRS) for "SMART ELECTRICALS" offers a detailed
overview of the project's requirements. This document is essential for providing a clear
understanding of what the application is meant to accomplish. By comprehensively outlining the
functionalities and features, the SRS ensures that the software is tailored to meet the needs of its
users. Additionally, it serves as the cornerstone of the project, guiding the design, development,
and testing phases. With this SRS as a guide, "SMART ELECTRICALS" can be developed and
tested with precision to ensure its effectiveness and reliability.
2.1.2 SCOPE
This document, detailing every system requirement, is fundamental to the Software Development Life
Cycle (SDLC). It serves as a key resource for developers and forms the basis for thorough testing. Any
future modifications to these specifications will necessitate adherence to a formal change approval
procedure, ensuring the integrity and stability of the system.
2.1.3 DEFINITIONS, ACRONYMS AND ABBREVIATIONS

ADMIN The Administrator


I/O Input/output

3
CFD Context Flow Diagram
OS Operating System
DFD Data Flow Diagram
CSS Cascading style sheet
Q&A Queries and Answers
RAM Random Access Memory
SQL Structured Query Language
HTML Hyper Text Markup Language
SRS Software Requirement Specifications
IEEE Institute of Electrical and Electronic Engineering
ERD Entity Relationship Diagram
HTTP Hyper Text Transfer Protocol

2.1.4 OVERVIEW
The Software Requirements Specification (SRS) is divided into two main sections: the Overall Description
and the Specific Requirements. The Overall Description offers a general, high-level perspective of the
requirements for "SMART ELECTRICALS," while the Specific Requirements section provides detailed
descriptions of the system's requirements, ensuring a thorough understanding of its functionalities and
features.
2.2 OVERALL DESCRIPTION
2.2.1 PRODUCT PERSPECTIVE
The proposed web application boasts user-friendly graphical interfaces tailored to accommodate users of
all levels. It integrates streamlined databases, minimizing user complexities. Designed to be responsive, it
adjusts seamlessly across different platforms. As a newly developed, self-contained product, it operates
independently and efficiently. Furthermore, it ensures secure access to data through authentication
mechanisms, enhancing overall system security.

● The system boasts user-friendly interfaces, ensuring ease of use and accessibility for all users.
● The system offers dynamic workspaces equipped with a plethora of functions to facilitate user
productivity and efficiency.
2.2.2 PRODUCT FEATURES

● The project “SMART ELECRICALS” is a user-friendly application having simple interfaces.

4
● An effortless registration process for users.
● Detailed product displays with descriptions, images, and prices for electronic items.
● Ensured security levels to protect user information.
● User account creation options.

2.2.3 USER CHARACTERISTICS


Users of the "SMART ELECTRICALS" application are presumed to have basic internet skills and access.
Administrators should be familiar with the system interface.
ADMIN

● Login: Admins are required to log in to access their accounts securely.


● Order Management: Admins have the ability to view and manage incoming orders.
● Payment Management: Admins can manage payments within the system.
● User Details: Admins can view details related to users.

USER

● Access Services: Users can utilize services provided by the admin, including registration.
● Profile Management: Users have the ability to update their profiles and manage shipping addresses.
● Profile Management: Users have the ability to update their profiles and manage shipping addresses.
● Product Exploration: Users can explore the website to discover products of interest.

2.2.4 GENERAL CONSTRAINTS

● Efficient Coding: The application must be coded efficiently to ensure smooth performance on the
provided server hardware.
● Compatibility with Low-End Hardware: Client-side code and web pages should run smoothly even
on low-end hardware configurations.
● Database Optimization: The database should be designed and managed to maintain a reasonable
and manageable size, ensuring efficient data storage and retrieval.

5
2.2.5 ASSUMPTIONS AND DEPENDENCIES

● Non-Saving of Generated Reports: The system does not need to retain generated reports.
● Authentication Requirement: Users must input valid login credentials (ID and password)
to access the web application.
● Internet Accessibility: The application can be accessed via the Internet.

2.3 SPECIFIC REQUIREMENTS

2.3.1 EXTERNAL INTERFACE REQUIREMENTS


The “SMART ELECTRICALS” system will use the standard input/output devices for a personal computer.
includes the following:
● Keyboard
● Mouse
● Monitor
● Printer

2.3.2 USER INTERFACE


● User-Friendly Interfaces: The application features highly intuitive interfaces to ensure usability for users with
varying levels of computer skills.
● The system provides a user-friendly GUI to the users.
● An error message is raised when invalid performance occurs.

2.3.3 HARDWARE INTERFACE

● Processor: intel i3 or above

● RAM: 4GB and above

● Hard Disk Utilization: 4GB and above

● Input Devices: Mouse, Keyboard

● Output Devices: Monitor, Printer


2.3.4 SOFTWARE INTERFACE
• Browser: Internet Explorer, Google chrome, Mozilla Firefox.
• Server: Xampp Server.
• Editor: Sublime Text Editor

6
2.3.5 COMMUNICATION INTERFACE
The "SMART ELECTRICALS" product necessitates LAN (Local Area Network) connections across the
entire company to enable seamless communication and interaction among users.
2.3.6 FUNCTIONAL REQUIREMENTS
ADMIN
● Login: Admins authenticate themselves using a username and password.
● User Approval: Admins have the authority to accept or reject user registrations.
● User Management: Admins can view user details and manage user accounts.
● Payment Viewing: Admins can access payment records made by users.
● Product Management: Admins can add, edit, or delete products from the catalog.
● User Data Management: Admins can access user profiles and order histories for customer service
purposes

USER

● Registration: Users can register as recipients if they require electronic products.


● Login: Users can log in using their username and password.
● View Products: Users have the ability to browse products by categories, subcategories, or brands.
● Feedback: Users can provide feedback to the Admin.
● Add to Cart: Users can add products to their shopping cart.
● Purchase (Address Info): Users can purchase products by providing a specified address.
● Payment: Users can make payments online or choose cash on delivery (COD) options.
● Order Management: Users can view their order history and track the status of their orders.
2.3.7 PERFORMANCE REQUIREMENTS

Performance requirements define acceptable response times for system functionality.

• User Interface Load Time: UI screens should load within two seconds.
• Login Verification Time: The login information should be verified within five seconds.
• Query Response Time: Queries should return results within five seconds

7
2.3.8 DESIGN CONSTRAINTS

The "SMART ELECTRICALS" system will consist of two categories of end users: administrators and regular users.
It will operate within a Windows environment and will be developed using PHP for server-side scripting and
MySQL databases for data management.
2.3.8.1 SYSTEM ATTRIBUTES
● Reliability: Thorough testing, robust error handling, backup and recovery procedures, and
continuous monitoring will ensure the required reliability of the system.
● Availability: Reliable hosting infrastructure, regular maintenance, and redundancy mechanisms will
ensure the system is available during normal operating hours.
● Security: User authentication, role-based access control, encryption, and regular security audits will
protect access to the system and its subsystems.
● Portability: The system will run in any Microsoft Windows environment with WAMP server and
the Microsoft SQL database, ensuring compatibility and ease of deployment.
2.4 OTHER REQUIREMENTS
2.4.1 SAFETY REQUIREMENTS

• Password Recovery: The system includes a "forgot password" option in the main login window to
assist users who forget or lose their passwords.
• Caps Lock Notification: A notification will be displayed if the caps lock is on, ensuring users are
aware and can enter their credentials correctly.
• Centralized Server Control: All clients are required to be connected to a single server to ensure
proper control and management of information.
• Entity Validation and Features: The system checks for valid entities and provides appropriate
features for them, ensuring access control and tailored functionality.
2.4.2 SECURITY REQUIREMENTS

The "SMART ELECTRICALS" electronic e-commerce website prioritizes security to safeguard sensitive
user data, financial transactions, and platform integrity. Key security measures include utilizing the
HTTPS protocol for secure data transmission and integrating with reputable payment gateways that
comply with standards to handle payment transactions securely.

8
3.SYSTEM DESIGN
3.1 INTRODUCTION
System design encompasses defining the architecture, components, modules, interfaces, and data of a
system to meet specified requirements. It involves translating user needs into a detailed blueprint that
informs the implementation phase. During detailed design, we specify how system modules interact,
providing a natural language explanation of their intended functionality. This specification describes the
system's features and is a refinement of system design, offering a more detailed description of processing
logic and data structure to facilitate implementation.
3.2 CONTEXT FLOW DIAGRAM
A context flow diagram serves as a high-level overview of a system's data flow. It typically consists
of a single process node representing the entire system's function in relation to external entities. In
this diagram, the entire system is treated as a single process, and all its inputs, outputs, sinks, and
sources are identified and depicted.

Fig 3.1: CFD for Smart Electricals

3.3 DATA FLOW DIAGRAM


A Data Flow Diagram (DFD) is a graphical representation of a system or a portion of it, illustrating data
flows, processes, sources, sinks, and stores using easily understandable symbols. DFD is a crucial
modeling tool used to depict how a system functions, its components, interactions, and the flow of data
and information within the system. It shows how information moves through the system and how it is
transformed by various processes. DFD is also referred to as a bubble chart or Data Flow Graphs.
DFD can represent a system at any level of abstraction, allowing for partitioning into levels that represent
increasing information flows and functional details. It is an effective tool for understanding and
visualizing the structure and behavior of a system.

Rules Regarding DFD Construction:

• A process cannot have only outputs.

9
• A process cannot have only inputs.
• The inputs to a process must be sufficient to produce the outputs from the process.
• All data stores must be connected to at least one process.
• All data stores must be connected to a source or sink.
• A data flow can have only one direction of flow. Multiple data flows to and/or from thesame
process and data store must be shown by separate arrows.
• If the exact same data flows to two separate arrows, it should be represented by a forkedarrow.
• Data cannot flow directly back into the process it has just left. All data flows must benamed
using a noun phrase.
3.3.1 DFD Symbols

Name Notation Description

Process A process transforms incoming data flow into outgoing


data flow. The processes are shown by named circles.

Datastore Data stores are repositories of data in the system. Theyare


sometimes also referred to as files.

Dataflows Data flows are pipelines through which packets of


information flow. Label the arrows with the name of the
data that moves through it.
External External entities are objects outside the system with
Entity which the system communicates. External Entities are
sources and destinations of the system’s inputs and
outputs

3.3.2 DFD for Admin

10
Fig 3.2: DFD for Admin
3.3.3 DFD for User

Fig 3.3: DFD for user

11
3.4. ENTITY-RELATIONSHIP DIAGRAM

The primary objective of the Entity-Relationship (ER) model is to represent entities, which are real-world
"things" with independent existence. Entities can be physical items or collections of data items that are
significant to the business or system being analyzed. An entity represents an object within the information
system for which we wish to store information. In an ER diagram, entities are depicted as rectangles and
are named using singular nouns. Each entity is characterized by several attributes, which define the
properties or characteristics of the entity. Individual instances of an entity will have different values for
these attributes.
3.4.1 ER-Diagram Symbols

Name Notation Description

Entity A strong entity is represented by a rectangle in an


Entity Name Entity-Relationship (ER) diagram. It possesses a
primary key, which uniquely identifies each instance of
the entity and allows it to exist independently without
relying on another entity.
Weak Entity Weak entities, represented by a double
rectangular box in an Entity-Relationship (ER)
diagram, lack a primary key and cannot be
Weak Entity
identified independently. Instead, they depend
on another entity, known as the owner entity,
for their identification.

Attribute Attributes, represented by an ellipse in a


database diagram, define the characteristics or
Attribut properties of entities or objects stored in the
eName database. They specify the type of data that can
be stored in a particular field or column of a
table.

Relationship When an attribute of one entity refers to


another entity, a relationship exists between
Relation them. This relationship is represented by a
diamond shape in an Entity-Relationship (ER)
diagram.
Link
Lines in an ER diagram connect attributes to entity
sets and entity sets to relationships, illustrating
associations between entities and their attributes,
as well as relationships between different entity.

12
Derived A derived attribute is calculated or derived using
Attribute other attributes in the database. Its data is obtained
from attributes in another table within the same
database. Derived attributes are represented by
dashed ellipses in a database diagram.

Key Attribute An entity type typically has an attribute with

Key values that are unique for each individual entry in


Attribute the entity set. This attribute is represented by an
underlined word inside an ellipse in an Entity-
Relationship (ER) diagram.

Multivalued Attributes that can have multiple values for a


Attribute Multi-valued
particular entity are referred to as multi-valued
Attribute attributes. These attributes are represented by a
double ellipse in an Entity-Relationship (ER)
diagram.

Cardinality 1) 1:1 It specifies the maximum number ofrelationships


Ratio 2) 1:M instances that an entity can participate in. There
3) M:1 are four cardinality ratios.
4) M:M

13
3.4.1 ER Diagram

Fig 3.4: ER diagram for Smart Electricals

14
4.DATABASE DESIGN

5.1 INTRODUCTION
Database: A database is a collection of related data, varying in size and complexity, that facilitates the
storage and retrieval of information. Its primary purpose is to provide users with the data needed to meet
system requirements efficiently. Database Design: Database design is the process of creating a detailed
data model for a database before its construction. It encompasses defining the necessary data, data
structures, organization, relationships, and constraints to ensure data integrity and efficient retrieval. A
well-designed database is essential for building robust, scalable, and maintainable databases that
effectively meet the needs of end-users within a given information system.

5.2 SCOPE

The database system is referred to as self-describing because it not only contains the database itself, but
also metadata which defines and describes the data and relationships between tables in the database.
This information is used by the DBMS software or database users if needed.

5.3 TABLE DESCRIPTION

Table Name: Admin


Description: This table is used to store the login details of admin

Column Name Data Type Constraints Description

a_id Int(10) Primary Key Admin id

a_name Varchar(30) Not Null Name of the admin

a_password Varchar(250) Not Null Password

15
Table Name: Product
Description: This table is used to store product details

Column Name Data Type Constraints Description


p_id Int(11) Primary Key Product id
c_id Int(11) Not Null code id
p_name Varchar(30) Not Null Product name
p_price Float Not Null Product price
p_qty Int(11) Not Null Product quantity
p_desc longtext Not Null Product description
p_image Varchar(250) Not Null Product image
p_date datetime Not Null Product date
p_status Varchar(20) Not Null Product status

Table Name: Feedback


Description: This table is used to store the feedback details.

Column Name Data Type Constraints Description


f_id Int(11) Primary Key Feedback id
cust_id Int(11) Not Null Customer id
message longtext Not Null Description about
feedback
f_date datetime Not Null Feedback date

Table Name: Order


Description: This table is used to store the order details.

Column Name Data Type Constraints Description


o_id Int(11) Primary Key Order id
p_id Int(11) Not null Product id
cust_id Int(11) Not Null Customer id
qty Int(11) Not Null quantity
total float Not Null Total amount

16
total float Not Null Total amount
Varchar(40) Not Null Unified id
unid
o_date date Not Null Order date
o_status Varchar(20) Not Null Order status

Table Name: Payment


Description: This table is used to store the payment details.

Column Name Data Type Constraints Description


pay_id Int(11) Primary Key package id
o_id Int(11) Not null Duration of package
trans_id Varchar(50) Not Null Transaction id
paymethod Varchar(40) Not Null Payment method
unid Varchar(40) Not Null Unified id
pay_date datetime Not Null Payment date
pay_status Varchar(20) Not Null Payment status

Table Name: Category


Description: This table is used to store category details.

Column Name Data Type Constraints Description


c_id Int(11) Primary Key Category id
c_name Varchar(40) Not null Category name
c_date datetime Not Null Category name

17
Table Name: Customer(user)
Description: This table is used to store the customer(user) details.

Column Name Data Type Constraints Description

cust_id Int(11) Primary Key Customer id

cust_name Varchar(30) Not null Customer name

cust_email Varchar(50) Not Null Customer email

cust_phone bigint(10) Not null Customer phone

cust_address Varchar(90) Not null Customer address

cust_password Varchar(250) Not null Customer password

cust_date datetime Not null Date

cust_status Varchar(30) Not null Customer status

18
5.DETAILED DESIGN
5.1.INTRODUCTION

This document is the design report for the “SMART ELECTRICAL” This is mainly about
‘How to do’ and will help provide an insight to the whole system design and implementation
of the “SMART ELECTRICAL Detailed design is the second level of the design process.
During detailed design, we specify how the module in the system interacts with each other
and the internal logic of each of the modules specified during system design is decided, hence
it is also called as logic design. Detailed design essentially expands the system design and
database design to contain a more detailed description of the processing logic and data
structures so that the design is sufficiently complete for coding.

5.2 APPLICABLE DOCUMENTS

• Synopsis document for “SMART ELECTRICAL”


• Software Requirement Specification (SRS) for “SMART ELECTRICAL”
• Database Design document for “SMART ELECTRICAL”

5.3 STRUCTURE OF THE SOFTWARE PACKAGE

The functional components for:

• Admin
• Customer

19
5.3.1 STRUCTURE CHART FOR ADMIN

Figure 4.1 Structure chart for admin

5.3.3 STRUCTURE CHART FOR CUSTOMER:

Figure 4.3: Structure chart for Customer

6.4 MODULAR DECOMPOSITION OF COMPONENTS

4.4.1 ADMIN
4.4.2
a) LOGIN:

Input: `aid`, `aname`, `aemail`, `apassword`


Procedural details:
20
Figure 4.4: procedural details of Admin login
• File I/O interface: admin
• Output: Allows the admin to log in to the system using credentials..

b) MANAGE PAYMENT
• Input: `pay_id`, `uid`, `uid2`, `or_id`, `pay_type`, `trans_id`, `card_name`,
`card_no`, `date`, `unid`, `pay_status`, `admin_pay`

• Procedural details:

Figure 4.6 procedural details of view payment


21
• File I/O interface: payment
• Output: Admin can view the payment made by the user.

c) MANAGE PRODUCTS
• Input: `pid`, `pname`, `pimage`, `pprice`, `pdesc`, `postdate`, `poststatus`,
`uid`, `cid`
• Procedural details:

Figure 4.7 procedural details of Manage products


• File I/O interface: product
• Output: Provides an interface for the admin to view all customer

d) MANAGE CUSTOMER
• Input: `uid`, `uname`, `uemail`, `upassword`, `ugender`, `uaddress`
• Procedural details:

22
Figure 4.7 procedural details of View Customer

• File I/O interface: customer


• Output: Provides an interface for the admin to view all customers

a) MANAGE ORDER
• Input: `or_id`, `p_id`, `or_total`, `or_status`, `or_date`, `unid`, `uid`, `uid2`
• Procedural details:

23
Figure 4.8 procedural details of Manage order
• File I/O interface: order
• Output: Provides functionality to view user orders and proceed with
orders.
b) VIEW FEEDBACK
• Input :`fid`, `message`, `uid`, `fdate`, `fstatus`, `uid2`, `rating`

• Procedural details:

24
• File I/O interface: Feedback
• Output: Provides functionality for the admin to view feedback given by users.

c) MANAGE CATEGORY
• Input: `cid`, `cname`, `cstatus`, `cdate

• Procedural details:

Figure 4.8 procedural details of Manage category

25
• File I/O interface: category
• Output: Provides functionality to add, update, or delete categories.

5.4.2 CUSTOMER
a) REGISTRATION
• Input: u_id,u_name,u_phone,u_email,u_pass,u_date,u_status
• Procedural details:

Figure 4.11 procedural details of registration


• File I/O interface: user

• Output: Allows new users to create an account by providing


necessary details such as name, email, password, etc.

b) LOGIN

• Input: u_id, u_name, u_phone, u_email, u_pass, u_date, u_status


• Procedural Details:

26
Figure 4.12 procedural details of login
▪ File I/O interface: user
▪ Output: Enables registered users to log in to the system using their
credentials.

c)VIEW PRODUCTS
• Input: `pid`, `pname`, `pimage`, `pprice`, `pdesc`, `postdate`, `poststatus`, `uid`, `cid`

• Procedural details:

27
Figure 4.13 procedural details of View products
• File I/O interface: product
• Output: User can view products

d) ORDER

• Input: `or_id`, `p_id`, `or_total`, `or_status`, `or_date`, `unid`, `uid`, `uid2`


• Procedural details:

28
Figure 4.15 procedural details of order products
• File I/O interface: order
• Output: Facilitates users to order products.

h) PAYMENT

• Input: `pay_id`, `uid`, `uid2`, `or_id`, `pay_type`, `trans_id`, `card_name`, `card_no`, `date`,
`unid`, `pay_status`, `admin_pay`
• Procedural details:

29
Figure 4.8 procedural details of payment
• File I/O interface: payment
• Output: Enables user to make payment

i) WRITE FEEDBACK
• Input: f_id, f_msg, u_id, f_date, f_status, f_img, c_id, d_id
• Procedural details:

Figure 4.10 procedural details of Write Feedback

• File I/O interface: Feedback


• Output: Allows users to write feedback about their experience with the system

30
6. CODING
USER PAGE CONTROLLERS:

Login.php

<?php
include '../config.php';
$admin=new Admin();
if(isset($_POST['login'])){
$email=$_POST['email'];
$password=$_POST['password'];
$stmt=$admin->ret("SELECT * FROM `customer` WHERE `cust_email`='$email'");
$num=$stmt->rowCount();
if($num>0){
$row=$stmt->fetch(PDO::FETCH_ASSOC);
$dbpassword=$row['cust_password'];
if(password_verify($password,$dbpassword)){
$_SESSION['cid']=$row['cust_id'];
echo "<script>alert('Login Successfull');window.location='../index.php'</script>";
}else{
echo "<script>alert('You are entered wrong password');window.location='../login.php'</script>";
}

}else{
echo "<script>alert('You are not valid user');window.location='../login.php'</script>";
}
}
?>

Register.php

<?php
include '../config.php';
$admin=new Admin();
if(isset($_POST['register'])){
$name=$_POST['name'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$address=$_POST['address'];
$password=$_POST['password'];
$secpass=password_hash($password,PASSWORD_BCRYPT);
$stmt1=$admin->ret("SELECT * FROM `customer` WHERE `cust_email`='$email'");
$num=$stmt1->rowCount();
if($num>0){
echo "<script>alert('You have already registered');window.location='../login.php';</script>";
}else{
$stmt=$admin->cud("INSERT INTO `customer`(`cust_name`, `cust_email`, `cust_phone`,
`cust_address`, `cust_password`, `cust_date`) VALUES
31
('$name','$email','$phone','$address','$secpass',now())",'inserted');
echo "<script>alert('Registered Successfull');window.location='../login.php';</script>";
}
}
?>

Cart.php

<?php
include '../config.php';
$admin=new Admin();
$cid=$_SESSION['cid'];
if(isset($_GET['pid'])){
$pid=$_GET['pid'];

$quantity=1;
$stmt1=$admin->ret("SELECT * FROM `cart` WHERE `p_id`='$pid' AND `cust_id`='$cid' ");

$num=$stmt1->rowCount();
if($num>0){
$row=$stmt1->fetch(PDO::FETCH_ASSOC);

$newQty=$row['cart_qty']+1;
$stmt2=$admin->cud("UPDATE `cart` SET `cart_qty`='$newQty' WHERE `cust_id`='$cid' AND
`p_id`='$pid'",'updated');
echo "<script>alert('Item added to Cart');window.location='../shop.php';</script>";
}else{
$stmt=$admin->cud("INSERT INTO `cart`
(`p_id`,`cust_id`,`cart_qty`,`date`)VALUES('$pid','$cid','$quantity',now())",'inserted');
echo "<script>alert('Item added to Cart');window.location='../shop.php';</script>";
}
}
?>

Manage Orders.php

<?php
include '../config.php';
$admin=new Admin();
$cid=$_SESSION['cid'];
if(isset($_GET['cancel'])){
$oid=$_GET['cancel'];
$stmt=$admin->cud("UPDATE `order` SET `o_status`='Rejected' WHERE `o_id`='$oid' AND
`cust_id`='$cid'",'updated');
echo "<script>alert('Order has been Cancelled');window.location='../order_status.php';</script>";
}
?>

Order.php

<?php
32
include '../config.php';
$admin=new Admin();
$cid=$_SESSION['cid'];
if(isset($_POST['order'])){
$stmt=$admin->ret("SELECT * FROM `cart` INNER JOIN `product` ON cart.p_id=product.p_id
WHERE cart.cust_id='$cid'");
$un=uniqid();
while($row=$stmt->fetch(PDO::FETCH_ASSOC)){
$g_total=0;
$pid=$row['p_id'];

$qty=$row['cart_qty'];
$price=$row['p_price'];
$total=$qty*$price;
$g_total+=$total;

$stmt1=$admin->Rcud("INSERT INTO `order`( `p_id`, `cust_id`, `qty`, `total`, `unid`, `o_date`,


`o_status`) VALUES ('$pid','$cid','$qty','$g_total','$un',now(),'Pending')",'Inserted');

$name=$_POST['name'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$address=$_POST['address'];
$state=$_POST['state'];
$pincode=$_POST['pincode'];
$stmt2=$admin->cud("INSERT INTO `shipping`(`o_id`, `name`, `email`, `phone`, `address`, `state`,
`zipcode`, `unid`, `s_date`) VALUES
('$stmt1','$name','$email','$phone','$address','$state','$pincode','$un',now())",'inserted');

$paymethod=$_POST['paymentMethod'];
$trans_id=$_POST['trans_id'];
$stmt3=$admin->cud("INSERT INTO `payment`( `o_id`, `paymethod`,
`trans_id`,`unid`,`pay_date`,`pay_status`) VALUES
('$stmt1','$paymethod','$trans_id','$un',now(),'Pending')",'inserted');
$stmt5=$admin->ret("SELECT * FROM `product` WHERE `p_id`='$pid' ");
$row5=$stmt5->fetch(PDO::FETCH_ASSOC);
$new_qty=$row5['p_qty']-$qty;
$stmt6=$admin->cud("UPDATE `product` SET `p_qty`='$new_qty' WHERE `p_id`='$pid'
",'UPDATED');
}
$stmt4=$admin->cud("DELETE FROM `cart` WHERE `cus_id`='$cid'",'DELETED');
echo "<script>window.location='../thankyou.php';</script>";
}
?>

Update Profile.php

<?php
include '../config.php';
$admin=new Admin();
33
$cid=$_SESSION['cid'];
if(isset($_POST['update'])){
$name=$_POST['name'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$address=$_POST['address'];
$stmt=$admin->cud("UPDATE `customer` SET `cust_name`='$name', `cust_email`='$email',
`cust_phone`='$phone', `cust_address`='$address' WHERE `cust_id`='$cid'", 'updated');
echo "<script>alert('Profile Updated Successfully');window.location='../profile.php';</script>";

}
?>

Feedback.php

<?php
include '../config.php';
$admin=new Admin();
$cid=$_SESSION['cid'];
if(isset($_POST['feedback'])){
$msg=$_POST['msg'];
$stmt=$admin->cud("INSERT INTO `feedback`( `cust_id`, `message`, `f_date`) VALUES
('$cid','$msg',now())",'inserted');
echo "<script>alert('Thank you for giving Feedback');window.location='../order_status.php'</script>";
}
?>

Log Out.php

<?php
include '../config.php';
$admin=new Admin();
session_destroy();
header('location:../index.php');
?>
ADMIN PAGE CONTROLLERS:

Login.php

<?php
include '../../config.php';
$admin=new Admin();
if(isset($_POST['login'])){
$name=$_POST['name'];
$password=$_POST['password'];
$stmt=$admin->ret("SELECT * FROM `admin` WHERE `a_name`='$name'");
$num=$stmt->rowCount();
if($num>0){
$row=$stmt->fetch(PDO::FETCH_ASSOC);
$dbpassword=$row['a_password'];
if(password_verify($password,$dbpassword)){
34
$_SESSION['aid']=$row['a_id'];
echo "<script>alert('Login Successfull');window.location='../index.php'</script>";
}else{
echo "<script>alert('You are entered wrong password');window.location='../login.php'</script>";
}

}else{
echo "<script>alert('You are not valid user');window.location='../login.php'</script>";
}
}
?>

Delete Category.php

<?php
include '../../config.php';
$admin=new Admin();
if(isset($_GET['c_id'])){
$cid=$_GET['c_id'];
$stmt=$admin->cud("DELETE FROM `category` WHERE `c_id`='$cid'",'deleted');
echo "<script>alert('Category Deleted');window.location='../view_product.php'</script>";
}
?>

Delete Product.php

<?php
include '../../config.php';
$admin=new Admin();
if(isset($_GET['pid'])){
$pid=$_GET['pid'];
$stmt=$admin->cud("DELETE FROM `product` WHERE `p_id`='$pid'",'deleted');
echo "<script>alert('Product Deleted');window.location='../view_product.php';</script>";
}
?>

Manage Order.php

<?php
include '../../config.php';
$admin=new Admin();
if(isset($_GET['accept'])){
$oid=$_GET['accept'];
$stmt=$admin->cud("UPDATE `order` SET `o_status`='Accepted' WHERE `o_id` = '$oid'",'Updated');
echo "<script>alert('Order Accepted');window.location='../manage_order.php';</script>";
}
if(isset($_GET['reject'])){
$oid=$_GET['reject'];
$stmt=$admin->cud("UPDATE `order` SET `o_status`='Rejected' WHERE `o_id` = '$oid'",'Updated');
echo "<script>alert('Order Rejected');window.location='../manage_order.php';</script>";
}
35
if(isset($_GET['Shipped'])){
$oid=$_GET['Shipped'];
$stmt=$admin->cud("UPDATE `order` SET `o_status`='Shipped' WHERE `o_id` = '$oid'",'Updated');
echo "<script>alert('Order Shipped');window.location='../manage_order.php';</script>";
}
if(isset($_GET['Out_for_Delivery'])){
$oid=$_GET['Out_for_Delivery'];
$stmt=$admin->cud("UPDATE `order` SET `o_status`='Out for Delivery' WHERE `o_id` =
'$oid'",'Updated');
echo "<script>alert('Order Out for Delivery');window.location='../manage_order.php';</script>";
}
if(isset($_GET['Deliver'])){
$oid=$_GET['Deliver'];
$stmt=$admin->cud("UPDATE `order` SET `o_status`='Delivered' WHERE `o_id` =
'$oid'",'Updated');
echo "<script>alert('Order Delivered');window.location='../manage_order.php';</script>";
}
if(isset($_GET['unid'])){
$payid=$_GET['unid'];
$stmt=$admin->cud("UPDATE `payment` SET `pay_status`='Paid' WHERE `unid` =
'$payid'",'Updated');
echo "<script>alert('Paid Successfully');window.location='../manage_payment.php';</script>";
}
?>

Manage Product.php

<?php
include '../../config.php';
$admin=new Admin();
if(isset($_POST['add_category'])){
$cat_name=$_POST['cat_name'];
$stmt1=$admin->ret("SELECT * FROM `category`");
$row=$stmt1->fetch(PDO::FETCH_ASSOC);
if($row['c_name']==$cat_name){
echo "<script>alert('$cat_name Already Inserted');window.location='../add_product.php';</script>";
}else{
$stmt=$admin->cud("INSERT INTO
`category`(`c_name`,`c_date`)VALUES('$cat_name',now())",'inserted');
echo "<script>alert('Category Inserted');window.location='../add_product.php';</script>";
}
}
if(isset($_POST['addproduct'])){
$c_id=$_POST['c_id'];
$p_name=$_POST['p_name'];
$p_qty=$_POST['p_qty'];
$p_price=$_POST['p_price'];
$img='upload/'.basename($_FILES['img']['name']);
move_uploaded_file($_FILES['img']['tmp_name'],$img);
$desc = $_POST['var'];

36
// Replace commas with a pipe symbol
$desc_sanitized = array_map(function($item) {
return str_replace(',', '|', $item);
}, $desc);

// Implode the sanitized array


$description = implode(",", $desc_sanitized);

$stmt=$admin->cud("INSERT INTO `product`( `c_id`, `p_name`, `p_price`, `p_qty`, `p_desc`,


`p_image`, `p_date`) VALUES
('$c_id','$p_name','$p_price','$p_qty','$description','$img',now())",'inserted');
echo "<script>alert('Product Inserted');window.location='../add_product.php';</script>";
}
?>

Update Product.php

<?php
include '../../config.php';
$admin=new Admin();
if(isset($_POST['add_category'])){
$cat_name=$_POST['cat_name'];
$stmt1=$admin->ret("SELECT * FROM `category`");
$row=$stmt1->fetch(PDO::FETCH_ASSOC);
if($row['c_name']==$cat_name){
echo "<script>alert('$cat_name Already Inserted');window.location='../add_product.php';</script>";
}else{
$stmt=$admin->cud("INSERT INTO
`category`(`c_name`,`c_date`)VALUES('$cat_name',now())",'inserted');
echo "<script>alert('Category Inserted');window.location='../add_product.php';</script>";
}
}
if(isset($_POST['addproduct'])){
$c_id=$_POST['c_id'];
$p_name=$_POST['p_name'];
$p_qty=$_POST['p_qty'];
$p_price=$_POST['p_price'];
$img='upload/'.basename($_FILES['img']['name']);
move_uploaded_file($_FILES['img']['tmp_name'],$img);
$desc = $_POST['var'];

// Replace commas with a pipe symbol


$desc_sanitized = array_map(function($item) {
return str_replace(',', '|', $item);
}, $desc);

// Implode the sanitized array


$description = implode(",", $desc_sanitized);

$stmt=$admin->cud("INSERT INTO `product`( `c_id`, `p_name`, `p_price`, `p_qty`, `p_desc`,


`p_image`, `p_date`) VALUES
37
('$c_id','$p_name','$p_price','$p_qty','$description','$img',now())",'inserted');
echo "<script>alert('Product Inserted');window.location='../add_product.php';</script>";
}
?>
USERS PAGE:

Login.php

<!-- /*
* Bootstrap 5
* Template Name: Furni
* Template Author: Untree.co
* Template URI: https://untree.co/
* License: https://creativecommons.org/licenses/by/3.0/
*/ -->
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="Untree.co">
<!-- <link rel="shortcut icon" href="favicon.png"> -->

<meta name="description" content="" />


<meta name="keywords" content="bootstrap, bootstrap4" />

<!-- Bootstrap CSS -->


<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"
rel="stylesheet">
<link href="css/tiny-slider.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
</head>

<body style="overflow:hidden">

<!-- Start Header/Navigation -->

<!-- Start Contact Form -->


<div class=" hero col-md-12" style="height: 700px;">
<div class="container">
<div class="block">

<div class="row justify-content-center">


<div class="col-md-7 col-lg-6 card"
38
style="background-color: #F1FADA;border-radius:20px;padding:20px">

<form action="controller/login.php" method="POST" class="needs-validation forms-


sample" novalidate="">
<h3 class="" style="color:black;text-align:center;font-size:40px">Login</h3>
<div class="col-12">
<div class="form-group">
<label class="text-black font-monospace" for="lname">Email</label>
<input type="email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$"
required="" name="email" class="form-control" id="lname">
<div class="invalid-feedback"> Email is required. </div>
</div>
</div>

<div class="form-group mb-4">


<label class="text-black font-monospace" for="email">Password</label>
<input type="password" name="password" required="" class="form-control"
id="email">
<div class="invalid-feedback"> Password is required. </div>
</div>
<div style="display:flex;justify-content:space-between;align-items:center">
<div style="display:flex;gap:10px">
<p class="text-dark">Create new account?</p><a href="register.php">Register</a>
</div>
<button type="submit" class="btn btn-primary-hover-outline"
name="login">Login</button>
</div>

</form>
</div>
</div>
</div>
</div>
</div>
<!-- End Contact Form -->
<script>
(function () {
'use strict'
window.addEventListener('load', function () {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName('needs-validation')
// Loop over them and prevent submission
Array.prototype.filter.call(forms, function (form) {
form.addEventListener('submit', function (event) {
if (form.checkValidity() === false) {
event.preventDefault()
event.stopPropagation()
}
form.classList.add('was-validated')
}, false)
39
})
}, false)
}())
</script>

<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/tiny-slider.js"></script>
<script src="js/custom.js"></script>
</body>

</html>
Thankyou.php
<?php
include './config.php';
$admin=new Admin();
?>
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="Untree.co">
<!-- <link rel="shortcut icon" href="favicon.png"> -->

<meta name="description" content="" />


<meta name="keywords" content="bootstrap, bootstrap4" />

<!-- Bootstrap CSS -->


<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"
rel="stylesheet">
<link href="css/tiny-slider.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
</head>

<body>

<!-- Start Header/Navigation -->


<?php include 'navbar.php' ?>
<!-- End Header/Navigation -->

<!-- Start Hero Section -->


<div class="hero">
<div class="container">
<div class="row justify-content-between">
<div class="col-lg-5">
<div class="intro-excerpt">
<h1>Thank you!</h1>
40
</div>
</div>
<div class="col-lg-7">

</div>
</div>
</div>
</div>
<!-- End Hero Section -->
<div class="untree_co-section">
<div class="container">
<div class="row">
<div class="col-md-12 text-center pt-5">
<img src="signboard_2279398.png"
<p class="lead mb-5">You order was successfuly completed.</p>
<p>
<a href="shop.php" class="btn btn-sm btn-outline-black">Back to shop</a>
</p>
</div>
</div>
</div>
</div>
<!-- Start Footer Section -->
<?php include 'footer.php' ?>
<!-- End Footer Section -->
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/tiny-slider.js"></script>
<script src="js/custom.js"></script>
</body>

</html>

Index.php

<?php
include 'config.php';
$admin=new Admin();
?>
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="Untree.co">
<!-- <link rel="shortcut icon" href="favicon.png"> -->

<meta name="description" content="" />


<meta name="keywords" content="bootstrap, bootstrap4" />

<!-- Bootstrap CSS -->


41
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"
rel="stylesheet">
<link href="css/tiny-slider.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
</head>

<body>

<!-- Start Header/Navigation -->


<?php include 'navbar.php' ?>
<!-- End Header/Navigation -->

<!-- Start Hero Section -->


<div class="hero">
<div class="container">
<div class="row justify-content-between">
<div class="col-lg-5">
<div class="intro-excerpt">
<h1>Digital Design Tools</h1>
<p class="mb-4">Transition from traditional design tools to digital ones. Use software like
AutoCAD, SketchUp, or Revit for creating 2D and 3D designs.</p>
<p><a href="shop.php" class="btn btn-secondary me-2">Shop Now</a><a href="#"
class="btn btn-white-outline">Explore</a></p>
</div>
</div>
<div class="col-lg-7">
<div class="hero-img-wrap">
<img src="images/home2.png" class="img-fluid">
</div>
</div>
</div>
</div>
</div>
<!-- End Hero Section -->

<!-- Start Product Section -->


<div class="product-section">
<div class="container">
<div class="row">

<!-- Start Column 1 -->


<div class="col-md-12 col-lg-3 mb-5 mb-lg-0">
<h2 class="mb-4 section-title">Crafted with excellent material.</h2>
<p class="mb-4">Dimmer switches allow users to adjust the brightness levels of lighting
fixtures,
providing greater control over the ambiance of a room. </p>
<p><a href="shop.php" class="btn">Explore</a></p>
</div>
42
<!-- End Column 1 -->

<!-- Start Column 2 -->


<!-- <div class="col-12 col-md-4 col-lg-3 mb-5 mb-md-0"> -->
<?php
$stmt=$admin->ret("SELECT * FROM `product` LIMIT 3");
while($row=$stmt->fetch(PDO::FETCH_ASSOC)){
?>

<!-- Start Column 4 -->


<div class="col-12 col-md-4 col-lg-3 mb-5">
<a class="product-item" href="shop_details.php?pid=<?php echo $row['p_id'] ?>">
<img src="Admin/controller/<?php echo $row['p_image'] ?>" class="img-fluid product-
thumbnail">
<h3 class="product-title"><?php echo $row['p_name'] ?></h3>
<strong class="product-price">₹ <?php echo $row['p_price'] ?></strong>

<span class="icon-cross">
<img src="images/eye.svg" class="img-fluid " style="margin-left:3px;margin-top:5px">
</span>
</a>
</div>
<!-- End Column 4 -->
<?php } ?>
<!-- </div> -->
<!-- End Column 2 -->

<!-- Start Column 3 -->

<!-- End Column 3 -->

<!-- Start Column 4 -->

<!-- End Column 4 -->

</div>
</div>
</div>
<!-- End Product Section -->

<!-- Start Why Choose Us Section -->


<div class="why-choose-section">
<div class="container">
<div class="row justify-content-between align-items-center">
<div class="col-lg-6">
<h2 class="section-title">Why Choose Us</h2>
<p>
Choose us because we prioritize innovative design solutions tailored to your needs,
ensuring a
seamless and transformative experience for your space.</p>

43
<div class="row my-5">
<div class="col-6 col-md-6">
<div class="feature">
<div class="icon">
<img src="images/truck.svg"
alt="Image" class="imf-fluid">
</div>
<h3>Fast &amp; Free Shipping</h3>
<p>
Choose us for fast and free shipping, ensuring your orders arrive promptly without
any additional cost, so you can enjoy your products sooner and hassle-free.</p>
</div>
</div>

<div class="col-6 col-md-6">


<div class="feature">
<div class="icon">
<img src="images/bag.svg"
alt="Image" class="imf-fluid">
</div>
<h3>Easy to Shop</h3>
<p>
Choose us for an easy shopping experience, with intuitive navigation, clear product
descriptions, and seamless checkout, making it effortless to find and purchase
exactly what you need.</p>
</div>
</div>

<div class="col-6 col-md-6">


<div class="feature">
<div class="icon">
<img
src="images/support.svg" alt="Image" class="imf-fluid">
</div>
<h3>24/7 Support</h3>
<p>
Choose us for 24/7 support, ensuring assistance is always available whenever you
need it, guaranteeing peace of mind and prompt resolution to any inquiries or
concerns.</p>
</div>
</div>

<div class="col-6 col-md-6">


<div class="feature">
<div class="icon">
<img src="images/return.svg"
alt="Image" class="imf-fluid">
</div>
<h3>Hassle Free Returns</h3>
<p>Choose us for hassle-free returns,
providing you with a straightforward process to
44
return products if they don't meet your expectations, ensuring your satisfaction is
our top priority.

.</p>
</div>
</div>

</div>
</div>

<div class="col-lg-5">
<div class="img-wrap">
<img src="images/why-choose-us-img.jpg"
alt="Image" class="img-fluid">
</div>
</div>

</div>
</div>
</div>
<!-- End Why Choose Us Section -->

<!-- Start We Help Section -->


<div class="we-help-section">
<div class="container">
<div class="row justify-content-between">
<div class="col-lg-7 mb-5 mb-lg-0">
<div class="imgs-grid">
<div class="grid grid-1"><img src="images/home4.png" alt="Untree.co"></div>
<!-- <div class="grid grid-2"><img src="images/" alt="Untree.co"></div> -->
<!-- <div class="grid grid-3"><img src="images/img-grid-3.jpg" alt="Untree.co"></div> -
->
</div>
</div>
<div class="col-lg-5 ps-lg-5">
<h2 class="section-title mb-4">We Help You Make Modern Interior Design</h2>
<p>"We specialize in guiding you through the process of crafting modern interior designs
that
elevate your space, offering expert advice and inspiration every step of the way."</p>

<!-- <ul class="list-unstyled custom-list my-4">


<li>Donec vitae odio quis nisl dapibus
malesuada</li>
<li>Donec vitae odio quis nisl dapibus
malesuada</li>
<li>Donec vitae odio quis nisl dapibus
malesuada</li>
<li>Donec vitae odio quis nisl dapibus
45
malesuada</li>
</ul> -->
<p><a href="shop.php" class="btn">Explore</a></p>
</div>
</div>
</div>
</div>
<!-- End We Help Section -->

<!-- Start Popular Product -->


<div class="popular-product">
<div class="container">
<div class="row">

<div class="col-12 col-md-6 col-lg-4 mb-4 mb-lg-0">


<div class="product-item-sm d-flex">
<div class="thumbnail">
<img src="images/home7.png" alt="Image" class="img-fluid">
</div>
<div class="pt-3">
<h3>Table top light</h3>
<p>Table top lights add a touch of elegance and functionality to any space, illuminating
your
surroundings with style and sophistication.</p>
<p><a href="#">Read More</a></p>
</div>
</div>
</div>

<div class="col-12 col-md-6 col-lg-4 mb-4 mb-lg-0">


<div class="product-item-sm d-flex">
<div class="thumbnail">
<img src="images/home8.png" alt="Image" class="img-fluid">
</div>
<div class="pt-3">
<h3>Hanging light</h3>
<p>Hanging lights add a touch of elegance and functionality to any space, illuminating
your
surroundings with style and sophistication. </p>
<p><a href="#">Read More</a></p>
</div>
</div>
</div>

</div>
</div>

</div>
</div>
</div>
<!-- End Popular Product -->
46
<!-- Start Testimonial Slider -->

<!-- End Testimonial Slider -->

<!-- Start Footer Section -->


<?php include 'footer.php' ?>
<!-- End Footer Section -->

<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/tiny-slider.js"></script>
<script src="js/custom.js"></script>
</body>

</html>

About.php

<!-- /*
* Bootstrap 5
* Template Name: Furni
* Template Author: Untree.co
* Template URI: https://untree.co/
* License: https://creativecommons.org/licenses/by/3.0/
*/ -->
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="Untree.co">
<!-- <link rel="shortcut icon" href="favicon.png"> -->

<meta name="description" content="" />


<meta name="keywords" content="bootstrap, bootstrap4" />

<!-- Bootstrap CSS -->


<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"
rel="stylesheet">
<link href="css/tiny-slider.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
</head>

<body>
47
<!-- Start Header/Navigation -->
<?php include 'navbar.php' ?>
<!-- End Header/Navigation -->

<!-- Start Hero Section -->


<div class="hero">
<div class="container">
<div class="row justify-content-between">
<div class="col-lg-5">
<div class="intro-excerpt">
<h1>Digital Design Tools</h1>
<p class="mb-4">Transition from traditional design tools to digital ones. Use software like
AutoCAD, SketchUp, or Revit for creating 2D and 3D designs.</p>
<p><a href="shop.php" class="btn btn-secondary me-2">Shop Now</a><a href="#"
class="btn btn-white-outline">Explore</a></p>
</div>
</div>
<div class="col-lg-7">
<div class="hero-img-wrap">
<img src="images/home2.png" class="img-fluid">
</div>
</div>
</div>
</div>
</div>
<!-- End Hero Section -->

<!-- Start Why Choose Us Section -->


<div class="why-choose-section">
<div class="container">
<div class="row justify-content-between align-items-center">
<div class="col-lg-6">
<h2 class="section-title">Why Choose Us</h2>
<p>
Choose us because we prioritize innovative design solutions tailored to your needs,
ensuring a
seamless and transformative experience for your space.</p>

<div class="row my-5">


<div class="col-6 col-md-6">
<div class="feature">
<div class="icon">
<img src="images/truck.svg" alt="Image" class="imf-fluid">
</div>
<h3>Fast &amp; Free Shipping</h3>
<p>
Choose us for fast and free shipping, ensuring your orders arrive promptly without
any additional cost, so you can enjoy your products sooner and hassle-free.</p>
48
</div>
</div>

<div class="col-6 col-md-6">


<div class="feature">
<div class="icon">
<img src="images/bag.svg" alt="Image" class="imf-fluid">
</div>
<h3>Easy to Shop</h3>
<p>
Choose us for an easy shopping experience, with intuitive navigation, clear product
descriptions, and seamless checkout, making it effortless to find and purchase
exactly what you need.</p>
</div>
</div>

<div class="col-6 col-md-6">


<div class="feature">
<div class="icon">
<img src="images/support.svg" alt="Image" class="imf-fluid">
</div>
<h3>24/7 Support</h3>
<p>
Choose us for 24/7 support, ensuring assistance is always available whenever you
need it, guaranteeing peace of mind and prompt resolution to any inquiries or
concerns.</p>
</div>
</div>

<div class="col-6 col-md-6">


<div class="feature">
<div class="icon">
<img src="images/return.svg" alt="Image" class="imf-fluid">
</div>
<h3>Hassle Free Returns</h3>
<p>Choose us for hassle-free returns, providing you with a straightforward process to
return products if they don't meet your expectations, ensuring your satisfaction is
our top priority.

.</p>
</div>
</div>

</div>
</div>

<div class="col-lg-5">
<div class="img-wrap">
49
<img src="images/why-choose-us-img.jpg" alt="Image" class="img-fluid">
</div>
</div>

</div>
</div>
</div>
<!-- End Why Choose Us Section -->

<!-- Start Team Section -->

<!-- End Team Section -->

<!-- Start Testimonial Slider -->

<!-- End Testimonial Slider -->

<!-- Start Footer Section -->


<?php include 'footer.php' ?>
<!-- End Footer Section -->

<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/tiny-slider.js"></script>
<script src="js/custom.js"></script>
</body>

</html>

Cart.php

<?php
include 'config.php';
$admin=new Admin();
$cid=$_SESSION['cid'];
?>
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="Untree.co">
<!-- <link rel="shortcut icon" href="favicon.png"> -->

<meta name="description" content="" />


<meta name="keywords" content="bootstrap, bootstrap4" />
50
<!-- Bootstrap CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"
rel="stylesheet">
<link href="css/tiny-slider.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
</head>

<body>

<!-- Start Header/Navigation -->


<?php include 'navbar.php' ?>
<!-- End Header/Navigation -->

<!-- Start Hero Section -->


<div class="hero">
<div class="container">
<div class="row justify-content-between">
<div class="col-lg-5">
<div class="intro-excerpt">
<h1>Cart</h1>
</div>
</div>
<div class="col-lg-7">

</div>
</div>
</div>
</div>
<!-- End Hero Section -->

<div class="untree_co-section before-footer-section" id="ajax_table">


<?php
$g_total=0;
$stmt=$admin->ret("SELECT * FROM `cart` INNER JOIN
`product` ON product.p_id=cart.p_id WHERE cart.cust_id='$cid'");
if($stmt->rowCount() > 0) {
?>
<div class="container" >
<div class="row mb-5" >
<form class="col-md-12" method="post">
<div class="site-blocks-table" >

<table class="table">
<thead>
<tr>
51
<th class="product-thumbnail">Image</th>
<th class="product-name">Product</th>
<th class="product-price">Price</th>
<th class="product-quantity">Quantity</th>
<th class="product-total">Total</th>
<th class="product-remove">Remove</th>
</tr>
</thead>
<tbody>
<?php

while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$qty=$row['cart_qty'];
$price=$row['p_price'];
$total=$qty*$price;
$g_total+=$total;
?>
<tr>
<td class="product-thumbnail">
<img src="Admin/controller/<?php echo $row['p_image'] ?>" alt="Image"
class="img-fluid">
</td>
<td class="product-name">
<h2 class="h5 text-black"><?php echo $row['p_name'] ?></h2>
</td>
<td>₹ <?php echo $row['p_price'] ?></td>
<td>
<div class="input-group mb-3 d-flex align-items-center quantity-container"
style="max-width: 120px;">
<div class="input-group-prepend">
<?php
if($row['cart_qty'] >1){

?>
<button class="btn btn-outline-black decrease"
onclick="decrement(<?php echo $row['cart_id'] ?>)"
type="button">&minus;</button>
<?php }else{ ?>
<button class="btn btn-outline-black decrease" id="myButton"
style="cursor: not-allowed" type="button">&minus;</button>
<?php } ?>
</div>
<input type="text" value="<?php echo $row['cart_qty'] ?>" readonly
class="form-control text-center quantity-amount" placeholder=""
aria-label="Example text with button addon"
aria-describedby="button-addon1">
<div class="input-group-append">
<button class="btn btn-outline-black increase"
onclick="increment(<?php echo $row['cart_id'] ?>)"
type="button">&plus;</button>
</div>
52
</div>
</td>
<td>₹ <?php echo $total ?></td>
<td><a href="#" class="btn btn-black btn-sm"
onclick="removecart(<?php echo $row['cart_id'] ?>)">X</a></td>
</tr>
<?php } ?>
</tbody>

</table>
</div>
</form>
</div>
<script>
document.addEventListener("DOMContentLoaded", function() {
var myButton = document.getElementById("myButton");
myButton.disabled = true;
myButton.classList.add("disabled-cursor");
});
</script>
<div class="row">
<div class="col-md-6">
<div class="row mb-5">

<div class="col-md-6">
<a href="shop.php"> <button class="btn btn-outline-black btn-sm btn-block">Continue
Shopping</button></a>
</div>
</div>

</div>
<div class="col-md-6 pl-5">
<div class="row justify-content-end">
<div class="col-md-7">
<div class="row">
<div class="col-md-12 text-right border-bottom mb-5">
<h3 class="text-black h4 text-uppercase">Cart Totals</h3>
</div>
</div>

<div class="row mb-5">


<div class="col-md-6">
<span class="text-black">Total</span>
</div>
<div class="col-md-6 text-right">
<strong class="text-black">₹ <?php echo $g_total ?></strong>
</div>
</div>

<div class="row">
<div class="col-md-12">
53
<button class="btn btn-black btn-lg py-3 btn-block"
onclick="window.location='checkout.php'">Proceed To Checkout</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php }else{ ?>
<div style="display:flex;justify-content:center;align-items:center;flex-
direction:column">
<img src="remove-from-cart_4111506 (2).png" alt="">
<h3>Your Cart is Empty</h3>
<p>You have no items in your shopping cart.<br><span
style="display:flex;justify-content:center;align-items:center;">Let's go buy something</span></p>
<a href="shop.php" class="btn btn-sm btn-outline-black">Back to shop</a>
</div>
<?php } ?>
</div>

<!-- Start Footer Section -->


<?php include 'footer.php' ?>
<!-- End Footer Section -->
<script>
function increment(cart_id) { //getting from onclick function -can use any variable

var xmlhttp = new XMLHttpRequest();


xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
//table id
document.getElementById("ajax_table").innerHTML = this.responseText;
}
};
xmlhttp.open("GET", "cart_ajax.php ? cart_id_increment=" + cart_id, true);
xmlhttp.send();
}
</script>
<script>
function decrement(cart_id) { //getting from onclick function -can use any variable

var xmlhttp = new XMLHttpRequest();


xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
//table id
document.getElementById("ajax_table").innerHTML = this.responseText;
}
};
xmlhttp.open("GET", "cart_ajax.php ? cart_id_decrement=" + cart_id, true);
xmlhttp.send();
54
}
</script>
<script>
function removecart(cart_id) { //getting from onclick function -can use any variable

var xmlhttp = new XMLHttpRequest();


xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
//table id
document.getElementById("ajax_table").innerHTML = this.responseText;
}
};
xmlhttp.open("GET", "cart_ajax.php ? removecart=" + cart_id, true);
xmlhttp.send();
}
</script>

<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/tiny-slider.js"></script>
<script src="js/custom.js"></script>
</body>

</html>

Order Status.php

<?php
include 'config.php';
$admin=new Admin();
$cid=$_SESSION['cid'];
?>
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="Untree.co">
<!-- <link rel="shortcut icon" href="favicon.png"> -->

<meta name="description" content="" />


<meta name="keywords" content="bootstrap, bootstrap4" />
<style>
@import url('https://fonts.googleapis.com/css?family=Open+Sans&display=swap');
#feedback-form-wrapper #floating-icon > button {
position: fixed;
right: 0;
top: 50%;
transform: rotate(-90deg) translate(50%, -50%);
transform-origin: right;
55
}

#feedback-form-wrapper .rating-input-wrapper input[type="radio"] {


display: none;
}
#feedback-form-wrapper .rating-input-wrapper input[type="radio"] ~ span {
cursor: pointer;
}
#feedback-form-wrapper .rating-input-wrapper input[type="radio"]:checked ~ span {
background-color: #4261dc;
color: #fff;
}
#feedback-form-wrapper .rating-labels > label{
font-size: 14px;
color: #777;
}

body {
background-color: #eeeeee;
font-family: 'Open Sans', serif
}

.container1 {
margin-top: 50px;
margin-bottom: 50px
}

.card {
position: relative;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
min-width: 0;
word-wrap: break-word;
background-color: #fff;
background-clip: border-box;
border: 1px solid rgba(0, 0, 0, 0.1);
border-radius: 0.10rem
}

.card-header:first-child {
border-radius: calc(0.37rem - 1px) calc(0.37rem - 1px) 0 0
}

.card-header {
padding: 0.75rem 1.25rem;
margin-bottom: 0;
56
background-color: #fff;
border-bottom: 1px solid rgba(0, 0, 0, 0.1)
}

.track {
position: relative;
background-color: #ddd;
height: 7px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
margin-bottom: 60px;
margin-top: 50px
}

.track .step {
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;
width: 25%;
margin-top: -18px;
text-align: center;
position: relative
}

.track .step.active:before {
background: #FF5722
}

.track .step::before {
height: 7px;
position: absolute;
content: "";
width: 100%;
left: 0;
top: 18px
}

.track .step.active .icon {


background: #ee5435;
color: #fff
}

.track .icon {
display: inline-block;
width: 40px;
height: 40px;
line-height: 40px;
position: relative;
border-radius: 100%;
background: #ddd
57
}

.track .step.active .text {


font-weight: 400;
color: #000
}

.track .text {
display: block;
margin-top: 7px
}

.itemside {
position: relative;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
width: 100%
}

.itemside .aside {
position: relative;
-ms-flex-negative: 0;
flex-shrink: 0
}

.img-sm {
width: 80px;
height: 80px;
padding: 7px
}

ul.row,
ul.row-sm {
list-style: none;
padding: 0
}

.itemside .info {
padding-left: 15px;
padding-right: 7px
}

.itemside .title {
display: block;
margin-bottom: 5px;
color: #212529
}

p{
margin-top: 0;
58
margin-bottom: 1rem
}

.dashboard-progress {
/* width: 100px;
height:100px; */
border-radius: 50%;
/* background-color: #e0e0e0; */
position: relative;
}

.dashboard-progress p {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
<!-- Bootstrap CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"
rel="stylesheet">
<link href="css/tiny-slider.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
</head>

<body>

<!-- Start Header/Navigation -->


<?php include 'navbar.php' ?>
<i class="mdi mdi-close" id="bannerClose"></i>
<link rel="stylesheet" href="assets/vendors/mdi/css/materialdesignicons.min.css">
<link rel="stylesheet" href="Admin/assets/vendors/flag-icon-css/css/flag-icon.min.css">
<!-- endinject -->
<link rel="stylesheet" href="Admin/assets/vendors/css/vendor.bundle.base.css">
<!-- Plugin css for this page -->
<link rel="stylesheet" href="Admin/assets/vendors/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="Admin/assets/vendors/bootstrap-datepicker/bootstrap-
datepicker.min.css">

59
<!-- End plugin css for this page -->
<!-- inject:css -->
<!-- endinject -->
<!-- Layout styles -->
<!-- <link rel="stylesheet" href="Admin/assets/css/style.css"> -->
<!-- End layout styles -->
<!-- <link rel="shortcut icon" href="Admin/assets/images/favicon.png" /> -->
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/5.15.4/css/all.min.css"> -->

<?php
$stmt = $admin->ret("SELECT * FROM `order` WHERE `o_status` IN ('Pending', 'Accepted', 'Shipped',
'Out for Delivery', 'Delivered') AND `cust_id`='$cid' GROUP BY `unid`");

// Loop through each order


while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$unid = $row['unid'];
?>
<div class="container" style="margin-top: 50px; margin-bottom: 50px; background-color: #3b5d50;
padding: 5px">
<article class="card">
<div>
<div style="display:flex;justify-content:space-between;align-items:center;background-
color:#3b5d50">
<header class="card-header text-white"> My Orders / Tracking

</header>
<div >
<a class="text-white" style="text-decoration: none; margin-right: 20px; margin-top: 10px;
cursor: pointer; border: 1px solid; padding: 5px; font-weight: bold" onclick="showstatus(<?php echo
$row['o_id'] ?>)"> View Status</a>
<?php
$allowed_statuses = array('Delivered');
if (in_array($row['o_status'], $allowed_statuses)) {
?>

<a class="text-success" style="text-decoration: none; margin-right: 20px;


margin-top: 10px; cursor: pointer; border: 1px solid; padding: 5px; font-weight: bold" data-
toggle="modal" data-target="#exampleModal" >FeedBack</a>
<?php } ?>
</div>
</div>
</div>
<!-- </div> -->
<div class="card-body">
<article class="card" style="display:none" id="show_<?php echo $row['o_id']; ?>">
60
<div class="card-body row">
<div class="col">
<strong>Status:</strong>
<?php
// Check if the order status is one of the allowed statuses
$allowed_statuses = array('Pending', 'Accepted', 'Shipped', 'Out for Delivery', 'Delivered');
if (in_array($row['o_status'], $allowed_statuses)) {
// Display progress bar based on the order status
$status_index = array_search($row['o_status'], $allowed_statuses) + 1; // Get index of the status
?>

<div class="dashboard-progress dashboard-progress-<?php echo $status_index; ?> d-flex align-


items-center justify-content-center">
<p class="icon-md absolute-center text-dark" style="font-size: 15px"><?php echo
$row['o_status']; ?></p>
</div>
<?php
} else {
// If the status is not in the allowed list, display a generic message
?>
<p>Invalid Status</p>
<?php
}
?>
</div>
</div>
</article>

<hr>
<ul class="row">
<?php
$total = 0; // Initialize total amount
$stmt1 = $admin->ret("SELECT * FROM `order` INNER JOIN `product` ON order.p_id=product.p_id
WHERE order.cust_id='$cid' AND order.unid='$unid'");
while ($row1 = $stmt1->fetch(PDO::FETCH_ASSOC)) {
$price = $row1['p_price'];
$qty = $row1['qty'];
$subtotal = $qty * $price; // Calculate subtotal for each product
// Add subtotal to total amount
$total += $subtotal;

// Check if the order is cancelled and deduct its subtotal from the total
if ($row1['o_status'] == 'Rejected') {
$total -= $subtotal; // Deduct subtotal of cancelled products from total
}

?>
<li class="col-md-4">
61
<figure class="itemside mb-3">
<div class="aside"><img src="Admin/controller/<?php echo $row1['p_image'] ?>" class="img-sm
border"></div>
<figcaption class="info align-self-center">
<p class="title"><?php echo $row1['p_name'] ?><br>Quantity:<?php echo $row1['qty'] ?> * ₹
<?php echo $row1['p_price'] ?> = <span class="text-muted">₹ <?php echo $subtotal ?></span></p>
<?php
if ($row1['o_status'] == 'Pending') {
?>

<a class="text-danger" href="controller/manage_order.php?cancel=<?php echo $row1['o_id']


?>" style="text-decoration:none;margin-right:20px;margin-top:10px;cursor:pointer;border:1px
solid;padding:5px;font-weight:bold">Cancel</a>
<?php
} elseif ($row1['o_status'] == 'Rejected') {
?>
<span class="text-danger">Canceled</span>
<?php
}
?>
</figcaption>
</figure>
</li>
<?php } ?>
</ul>

<hr>
<div style="display:flex;justify-content:end">
<h3>Total: ₹ <?php echo $total; ?></h3>
<h6></h6>
</div>
</div>
</article>
</div>
<?php } ?>

<div id="feedback-form-wrapper">

<div id="feedback-form-modal">
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Feedback Form</h5>

62
</div>
<form action="controller/feedback.php" method="POST">
<div class="modal-body">

<div class="form-group">
<label for="input-two">Would you like to say something?</label>
<textarea class="form-control" name="msg" id="input-two" rows="3" required></textarea>
</div>

</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" name="feedback" class="btn btn-primary">Submit</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Start Footer Section -->

<!-- End Footer Section -->


<script>
function showstatus(id) {
var statusCard = document.getElementById("show_" + id);
console.log(statusCard)
if (statusCard.style.display === "none") {
statusCard.style.display = "block";
} else {
statusCard.style.display = "none";
}

}
</script>
<!-- plugins:js -->
<script src="Admin/assets/vendors/js/vendor.bundle.base.js"></script>
<!-- endinject -->
<!-- Plugin js for this page -->
<script src="Admin/assets/vendors/chart.js/Chart.min.js"></script>
<script src="Admin/assets/vendors/jquery-circle-progress/js/circle-progress.min.js"></script>
<!-- End plugin js for this page -->
<!-- inject:js -->
<script src="Admin/assets/js/off-canvas.js"></script>
<script src="Admin/assets/js/hoverable-collapse.js"></script>
63
<script src="Admin/assets/js/misc.js"></script>
<!-- endinject -->
<!-- Custom js for this page -->
<script src="Admin/assets/js/dashboard.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/tiny-slider.js"></script>
<script src="js/custom.js"></script>
</body>

</html>

Profile.php

<?php
include 'config.php';
$admin=new Admin();
$cid=$_SESSION['cid'];
$stmt=$admin->ret("SELECT * FROM `customer` WHERE `cust_id`='$cid'");
$row=$stmt->fetch(PDO::FETCH_ASSOC);
?>
<!doctype html>
<html lang="en">
<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="Untree.co">
<!-- <link rel="shortcut icon" href="favicon.png"> -->

<meta name="description" content="" />


<meta name="keywords" content="bootstrap, bootstrap4" />

<!-- Bootstrap CSS -->


<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-
beta3/css/all.min.css" rel="stylesheet">
<link href="css/tiny-slider.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
<style>
.gradient-custom {
/* fallback for old browsers */
background: #f6d365;

/* Chrome 10-25, Safari 5.1-6 */


background: -webkit-linear-gradient(to right bottom, rgba(246, 211, 101, 1), rgba(253, 160, 133, 1));

/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
64
background: linear-gradient(to right bottom, rgba(246, 211, 101, 1), rgba(253, 160, 133, 1))
}
</style>
</head>

<body>

<!-- Start Header/Navigation -->


<?php include 'navbar.php' ?>
<!-- End Header/Navigation -->
<div class="hero">
<div class="container">
<div class="row justify-content-between">
<div class="col-lg-5">
<div class="intro-excerpt">
<h1>Profile</h1>
</div>
</div>
<div class="col-lg-7">

</div>
</div>
</div>
</div>

<!-- Start Why Choose Us Section -->


<div class="why-choose-section" style="margin-top:-15rem">
<section class="vh-100" style="background-color: #f4f5f7;">
<div class="container py-5 h-100">
<div class="row d-flex justify-content-center align-items-center h-100">
<div class="col col-lg-12 mb-4 mb-lg-0">
<div class="card mb-3" style="border-radius: .5rem;">
<div class="row g-0">
<div class="col-md-4 gradient-custom text-white"
style="border-top-left-radius: .5rem; border-bottom-left-radius: .5rem;">
<div class="card-body p-4">
<h6>Information</h6>

<div class="row">
<!-- <h3 class="" style="color:black;text-align:center;font-
size:40px">Update</h3> -->
<div class="col-12">

<div class="form-group">
<label class="text-black font-monospace" for="fname">Name</label>
<input type="text" style="border:0px;color:white" disabled value="<?php
echo $row['cust_name'] ?>" pattern="[A-Za-z]{3,}" name="name" required="" class="form-control
gradient-custom " id="fname">
65
<div class="invalid-feedback"> Name is required. </div>
</div>
</div>
<div class="col-12">
<div class="form-group">
<label class="text-black font-monospace" for="lname">Email</label>
<input type="email" style="border:0px;color:white" disabled value="<?php
echo $row['cust_email'] ?>" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$" name="email"
required="" class="form-control gradient-custom" id="lname">
<div class="invalid-feedback"> Email is required. </div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">

<div class="form-group">
<label class="text-black font-monospace" for="fname">Phone</label>
<input type="tel" style="border:0px;color:white" disabled pattern="[0-
9]{10,10}" value="<?php echo $row['cust_phone'] ?>" name="phone" required="" class="form-control
gradient-custom" id="fname">
<div class="invalid-feedback"> Phone is required. </div>
</div>
</div>
<div class="col-12">
<div class="form-group">
<label class="text-black font-monospace font-weight-medium"
for="lname">Address</label>
<textarea name="address" style="border:0px;color:white" disabled
class="form-control gradient-custom" required="" id="message"><?php echo $row['cust_address']
?></textarea>
<div class="invalid-feedback"> Address is required. </div>
</div>
</div>
</div>
</div>

</div>
<div class="col-md-8">
<div class="card-body p-4">
<h6>Update</h6>
<div class="row justify-content-center">

<div class="col-md-5 col-lg-12 "


style="padding:10px">

<form action="controller/update_profile.php" method="POST" class="needs-validation


forms-sample" novalidate="">
66
<div>
<div class="row">
<!-- <h3 class="" style="color:black;text-align:center;font-
size:40px">Update</h3> -->
<div class="col-6">

<div class="form-group">
<label class="text-black font-monospace" for="fname">Name</label>
<input type="text" value="<?php echo $row['cust_name'] ?>" pattern="[A-
Za-z]{3,}" name="name" required="" class="form-control" id="fname">
<div class="invalid-feedback"> Name is required. </div>
</div>
</div>
<div class="col-6">
<div class="form-group">
<label class="text-black font-monospace" for="lname">Email</label>
<input type="email" value="<?php echo $row['cust_email'] ?>" pattern="[a-
z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$" name="email" required="" class="form-control" id="lname">
<div class="invalid-feedback"> Email is required. </div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">

<div class="form-group">
<label class="text-black font-monospace" for="fname">Phone</label>
<input type="tel" pattern="[0-9]{10,10}" value="<?php echo
$row['cust_phone'] ?>" name="phone" required="" class="form-control" id="fname">
<div class="invalid-feedback"> Phone is required. </div>
</div>
</div>
<div class="col-12">
<div class="form-group">
<label class="text-black font-monospace font-weight-medium"
for="lname">Address</label>
<textarea name="address" class="form-control" required=""
id="message"><?php echo $row['cust_address'] ?></textarea>
<div class="invalid-feedback"> Address is required. </div>
</div>
</div>
</div>
<!-- <div class="form-group mb-4">
<label class="text-black font-monospace" for="email">Password</label>
<input type="password" name="password" required="" class="form-control"
id="email">
<div class="invalid-feedback"> Password is required. </div>
</div> -->
</div>

<div style="display:flex;justify-content:space-between;align-items:center">
67
<div style="display:flex;gap:10px">
<!-- <p class="text-dark">Already Have an Account?</p><a
href="login.php">Login</a> -->
</div>
<button type="submit" class="btn btn-primary-hover-outline mt-4"
name="update">Update</button>
</div>
</div>

</form>

</div>

</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- End Why Choose Us Section -->

<!-- Start Team Section -->

<!-- End Team Section -->

<!-- Start Testimonial Slider -->

<!-- End Testimonial Slider -->

<!-- Start Footer Section -->


<?php include 'footer.php' ?>
<!-- End Footer Section -->

<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/tiny-slider.js"></script>
<script src="js/custom.js"></script>
</body>

</html>

Register.php

68
<!-- /*
* Bootstrap 5
* Template Name: Furni
* Template Author: Untree.co
* Template URI: https://untree.co/
* License: https://creativecommons.org/licenses/by/3.0/
*/ -->
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="Untree.co">
<!-- <link rel="shortcut icon" href="favicon.png"> -->

<meta name="description" content="" />


<meta name="keywords" content="bootstrap, bootstrap4" />

<!-- Bootstrap CSS -->


<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"
rel="stylesheet">
<link href="css/tiny-slider.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
</head>

<body style="overflow:hidden">

<!-- Start Header/Navigation -->

<!-- Start Contact Form -->


<div class=" hero ">
<div class="container">

<div class="block">
<div class="row justify-content-center">

<div class="col-md-7 col-lg-7 card"


style="background-color: #F1FADA;border-radius:20px;padding:20px">

<form action="controller/register.php" method="POST" class="needs-validation forms-


sample" novalidate="">
69
<div>
<div class="row">
<h3 class="" style="color:black;text-align:center;font-size:40px">Register</h3>
<div class="col-6">

<div class="form-group">
<label class="text-black font-monospace" for="fname">Name</label>
<input type="text" pattern="[A-Za-z]{3,}" name="name" required=""
class="form-control" id="fname">
<div class="invalid-feedback"> Name is required. </div>
</div>
</div>
<div class="col-6">
<div class="form-group">
<label class="text-black font-monospace" for="lname">Email</label>
<input type="email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$"
name="email" required="" class="form-control" id="lname">
<div class="invalid-feedback"> Email is required. </div>
</div>
</div>
</div>
<div class="row">
<div class="col-6">

<div class="form-group">
<label class="text-black font-monospace" for="fname">Phone</label>
<input type="tel" pattern="[0-9]{10,10}" name="phone" required=""
class="form-control" id="fname">
<div class="invalid-feedback"> Phone is required. </div>
</div>
</div>
<div class="col-6">
<div class="form-group">
<label class="text-black font-monospace font-weight-medium"
for="lname">Address</label>
<textarea name="address" class="form-control" required=""
id="message"></textarea>
<div class="invalid-feedback"> Address is required. </div>
</div>
</div>
</div>
<div class="form-group mb-4">
<label class="text-black font-monospace" for="email">Password</label>
<input type="password" name="password" required="" class="form-control"
id="email">
<div class="invalid-feedback"> Password is required. </div>
</div>
</div>

<div style="display:flex;justify-content:space-between;align-items:center">
<div style="display:flex;gap:10px">
70
<p class="text-dark">Already Have an Account?</p><a href="login.php">Login</a>
</div>
<button type="submit" class="btn btn-primary-hover-outline"
name="register">Register</button>
</div>
</div>

</form>

</div>

</div>

</div>

</div>

</div>
</div>

<!-- End Contact Form -->

<script>
(function () {
'use strict'

window.addEventListener('load', function () {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName('needs-validation')

// Loop over them and prevent submission


Array.prototype.filter.call(forms, function (form) {
form.addEventListener('submit', function (event) {
if (form.checkValidity() === false) {
event.preventDefault()
event.stopPropagation()
}
form.classList.add('was-validated')
}, false)
})
}, false)
}())
</script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/tiny-slider.js"></script>
71
<script src="js/custom.js"></script>
</body>

</html>

Shop.php

<?php
include 'config.php';
$admin=new Admin();
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="Untree.co">
<!-- <link rel="shortcut icon" href="favicon.png"> -->

<meta name="description" content="" />


<meta name="keywords" content="bootstrap, bootstrap4" />

<!-- Bootstrap CSS -->


<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-
beta3/css/all.min.css" rel="stylesheet">
<link href="css/tiny-slider.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
</head>

<body>

<!-- Start Header/Navigation -->


<?php include 'navbar.php' ?>
<!-- End Header/Navigation -->

<!-- Start Hero Section -->


<div class="hero">
<div class="container">
<div class="row justify-content-between">
<div class="col-lg-5">
<div class="intro-excerpt">
<h1>Shop</h1>
</div>
</div>
<div class="col-lg-7">

</div>
</div>
72
</div>
</div>
<!-- End Hero Section -->

<div class="untree_co-section product-section before-footer-section">


<div class="container">
<div class="row">

<?php
$stmt=$admin->ret("SELECT * FROM `product`");
while($row=$stmt->fetch(PDO::FETCH_ASSOC)){
?>

<!-- Start Column 4 -->


<div class="col-12 col-md-4 col-lg-3 mb-5">
<a class="product-item" href="shop_details.php?pid=<?php
echo $row['p_id'] ?>">
<img src="Admin/controller/<?php echo
$row['p_image'] ?>" class="img-fluid product-thumbnail">
<h3 class="product-title"><?php echo
$row['p_name'] ?></h3>
<strong class="product-price">₹ <?php echo
$row['p_price'] ?></strong>

<span class="icon-cross">
<img src="images/eye.svg" class="img-fluid
" style="margin-left:3px;margin-top:5px" >
</span>
</a>
</div>
<!-- End Column 4 -->
<?php } ?>

</div>
</div>
</div>

<!-- Start Footer Section -->


<?php include 'footer.php' ?>
<!-- End Footer Section -->

<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/tiny-slider.js"></script>
<script src="js/custom.js"></script>
</body>
73
</html>

Thankyou.php

<?php
include './config.php';
$admin=new Admin();
?>
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="Untree.co">
<!-- <link rel="shortcut icon" href="favicon.png"> -->

<meta name="description" content="" />


<meta name="keywords" content="bootstrap, bootstrap4" />

<!-- Bootstrap CSS -->


<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"
rel="stylesheet">
<link href="css/tiny-slider.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
</head>

<body>

<!-- Start Header/Navigation -->


<?php include 'navbar.php' ?>
<!-- End Header/Navigation -->

<!-- Start Hero Section -->


<div class="hero">
<div class="container">
<div class="row justify-content-between">
<div class="col-lg-5">
<div class="intro-excerpt">
<h1>Thank you!</h1>
</div>
</div>
<div class="col-lg-7">

</div>
</div>
</div>
74
</div>
<!-- End Hero Section -->

<div class="untree_co-section">
<div class="container">
<div class="row">
<div class="col-md-12 text-center pt-5">

<img src="signboard_2279398.png" alt="">

<p class="lead mb-5">You order was successfuly completed.</p>


<p>
<a href="shop.php" class="btn btn-sm btn-outline-black">Back to shop</a>
</p>
</div>
</div>
</div>
</div>

<!-- Start Footer Section -->


<?php include 'footer.php' ?>
<!-- End Footer Section -->

<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/tiny-slider.js"></script>
<script src="js/custom.js"></script>
</body>

</html>

ADMIN PAGES:

Index.php

<?php
include '../config.php';
$admin=new Admin();
if(!isset($_SESSION['aid'])){
header('location:login.php');

}
$stmt=$admin->ret("SELECT * FROM `order`");
$row=$stmt->rowCount();
$stmt1=$admin->ret("SELECT * FROM `customer`");
$row1=$stmt1->rowCount();
$stmt2=$admin->ret("SELECT * FROM `product`");
$row2=$stmt2->rowCount();
75
$stmt3=$admin->ret("SELECT * FROM `feedback`");
$row3=$stmt3->rowCount();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
<!-- plugins:css -->
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@mdi/font@7.4.47/css/materialdesignicons.min.css">
<link rel="stylesheet" href="assets/vendors/mdi/css/materialdesignicons.min.css">
<link rel="stylesheet" href="assets/vendors/flag-icon-css/css/flag-icon.min.css">
<link rel="stylesheet" href="assets/vendors/css/vendor.bundle.base.css">
<!-- endinject -->
<!-- Plugin css for this page -->
<link rel="stylesheet" href="assets/vendors/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="assets/vendors/bootstrap-datepicker/bootstrap-datepicker.min.css">
<!-- End plugin css for this page -->
<!-- inject:css -->
<!-- endinject -->
<!-- Layout styles -->
<link rel="stylesheet" href="assets/css/style.css">
<!-- End layout styles -->
<!-- <link rel="shortcut icon" href="assets/images/favicon.png" /> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/5.15.4/css/all.min.css">
<style>
.count-symbol.bg-success {
display: inline-block;
padding: 8px;
border-radius: 50%;
font-size:30px;
background-color: #28a745;
color: white;
}
</style>
</head>
<body>
<div class="container-scroller">
<!-- partial:partials/_navbar.html -->
<?php include 'navbar.php' ?>
<!-- partial -->
<div class="container-fluid page-body-wrapper">
<!-- partial:partials/_sidebar.html -->
<?php include 'sidebar.php' ?>
<!-- partial -->
<div class="main-panel">
76
<div class="content-wrapper">

<div class="row">
<div class="col-md-12">

<div class="tab-content tab-transparent-content">


<div class="tab-pane fade show active" id="business-1" role="tabpanel" aria-
labelledby="business-tab">
<div class="row">
<div class="col-xl-3 col-lg-6 col-sm-6 grid-margin stretch-card">
<div class="card">
<div class="card-body text-center">
<h5 class="mb-2 text-dark font-weight-normal">Orders</h5>
<h2 class="mb-4 text-dark font-weight-bold"><?php echo $row ?></h2>
<div class="dashboard-progress dashboard-progress-1 d-flex align-items-center justify-
content-center item-parent"><i class="mdi mdi-cart icon-md absolute-center text-dark"></i></div>

</div>
</div>
</div>
<div class="col-xl-3 col-lg-6 col-sm-6 grid-margin stretch-card">
<div class="card">
<div class="card-body text-center">
<h5 class="mb-2 text-dark font-weight-normal"> Registered User</h5>
<h2 class="mb-4 text-dark font-weight-bold"><?php echo $row1 ?></h2>
<div class="dashboard-progress dashboard-progress-2 d-flex align-items-center justify-
content-center item-parent"><i class="mdi mdi-account-circle icon-md absolute-center text-
dark"></i></div>

</div>
</div>
</div>
<div class="col-xl-3 col-lg-6 col-sm-6 grid-margin stretch-card">
<div class="card">
<div class="card-body text-center">
<h5 class="mb-2 text-dark font-weight-normal">Active Products</h5>
<h2 class="mb-4 text-dark font-weight-bold"><?php echo $row2 ?></h2>
<div style="margin-top: 100px;" class="dashboard-progress dashboard-progress-5 d-
flex align-items-center justify-content-center item-parent"><i class="mdi mdi-list-box-outline icon-md
absolute-center text-dark"></i></div>

</div>
</div>
</div>
<div class="col-xl-3 col-lg-6 col-sm-6 grid-margin stretch-card">
<div class="card">
<div class="card-body text-center">
<h5 class="mb-2 text-dark font-weight-normal">FeedBack</h5>
<h2 class="mb-4 text-dark font-weight-bold"><?php echo $row3 ?></h2>
<div class="dashboard-progress dashboard-progress-4 d-flex align-items-center justify-
77
content-center item-parent"><i class="mdi mdi-comment icon-md absolute-center text-dark"></i></div>

</div>
</div>
</div>
</div>

</div>
</div>
</div>
</div>
</div>

</div>
<!-- main-panel ends -->
</div>
<!-- page-body-wrapper ends -->
</div>
<!-- container-scroller -->
<!-- plugins:js -->
<script src="assets/vendors/js/vendor.bundle.base.js"></script>
<!-- endinject -->
<!-- Plugin js for this page -->
<script src="assets/vendors/chart.js/Chart.min.js"></script>
<script src="assets/vendors/jquery-circle-progress/js/circle-progress.min.js"></script>
<!-- End plugin js for this page -->
<!-- inject:js -->
<script src="assets/js/off-canvas.js"></script>
<script src="assets/js/hoverable-collapse.js"></script>
<script src="assets/js/misc.js"></script>
<!-- endinject -->
<!-- Custom js for this page -->
<script src="assets/js/dashboard.js"></script>
<!-- End custom js for this page -->
</body>
</html>

Manage Order:

<?php
include '../config.php';
$admin=new Admin();
if(!isset($_SESSION['aid'])){
header('location:login.php');

}
?>
<!DOCTYPE html>
<html lang="en">
<head>
78
<!-- Required meta tags -->
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
<!-- plugins:css -->
<link rel="stylesheet" href="assets/vendors/mdi/css/materialdesignicons.min.css">
<link rel="stylesheet" href="assets/vendors/flag-icon-css/css/flag-icon.min.css">
<link rel="stylesheet" href="assets/vendors/css/vendor.bundle.base.css">
<!-- endinject -->
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@mdi/font@7.4.47/css/materialdesignicons.min.css
">
<!-- Plugin css for this page -->
<link rel="stylesheet" href="assets/vendors/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="assets/vendors/bootstrap-datepicker/bootstrap-datepicker.min.css">
<!-- End plugin css for this page -->
<!-- inject:css -->
<!-- endinject -->
<!-- Layout styles -->
<link rel="stylesheet" href="assets/css/style.css">
<!-- End layout styles -->
<!-- <link rel="shortcut icon" href="assets/images/favicon.png" /> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/5.15.4/css/all.min.css">
</head>
<body>
<div class="container-scroller">
<!-- partial:partials/_navbar.html -->
<?php include 'navbar.php' ?>
<!-- partial -->
<div class="container-fluid page-body-wrapper">
<!-- partial:partials/_sidebar.html -->
<?php include 'sidebar.php' ?>
<!-- partial -->
<div class="main-panel">
<div class="content-wrapper">
<div class="page-header">
<h3 class="page-title">Manage order </h3>
<i class="mdi mdi-close" id="bannerClose"></i>
</div>
<div class="row">
<div class="col-lg-12 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<h4 class="card-title">Manage order</h4>

</p>
<table class="table">
<thead>
79
<tr>
<th>Sl.No</th>
<th>Name</th>
<th>Phone</th>
<th>Amount</th>
<th>Order Date</th>
<!-- <th>status</th> -->
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$i=1;
$sum = 0;
$stmt=$admin->ret("SELECT * FROM `order` INNER JOIN `shipping` ON
order.o_id=shipping.o_id GROUP BY order.unid");
while($row = $stmt->fetch(PDO::FETCH_ASSOC)){
$unid = $row['unid'];
$stmt1 = $admin->ret("SELECT * FROM `order` WHERE `unid`='$unid'");
$sum = 0;
// Reset the sum for each row
while ($row1 = $stmt1->fetch(PDO::FETCH_ASSOC)) {
$sum += $row1['total'];
}
$stmt2 = $admin->ret("SELECT SUM(total) AS rejected_total FROM `order` WHERE
`unid`='$unid' AND `o_status`='Rejected'");
$rejected_row = $stmt2->fetch(PDO::FETCH_ASSOC);
$rejected_total = $rejected_row['rejected_total'] ?? 0;
$sum -= $rejected_total;
?>
<tr>
<td><?php echo $i++ ?></td>
<td><?php echo $row['name'] ?></td>
<td><?php echo $row['phone'] ?></td>
<td>₹ <?php echo $sum ?></td>
<td> <?php

$timestamp = strtotime($row['o_date']);

$formatted_date = date('d-m-Y', $timestamp);


echo "<p>Date: $formatted_date</p>";

?></td>

<td> <a href="order_details.php?unid=<?php echo $row['unid'] ?>" title="View Order


Details" class="btn btn-outline-secondary btn-icon-text">
<i class="mdi mdi-eye mdi-18px"></i> </a>
<?php
80
if($orw['o_status']='Accepted'){
?>
<a href="generate_bill.php?unid=<?php echo $row['unid'] ?>" class="btn btn-outline-
success" title="Generate Bill"> <span class="mdi mdi-invoice-list-outline mdi-18px"></span></a>

<?php } ?>
</td>

</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>

</div>
</div>
<!-- content-wrapper ends -->
<!-- partial:partials/_footer.html -->

<!-- partial -->


</div>
<!-- main-panel ends -->
</div>
<!-- page-body-wrapper ends -->
</div>
<style>
.count-symbol.bg-success {
display: inline-block;
padding: 8px;
border-radius: 50%;
font-size:30px;
background-color: #28a745;
color: white;
}
</style>
<!-- container-scroller -->
<script src="assets/vendors/js/vendor.bundle.base.js"></script>
<!-- endinject -->
<!-- Plugin js for this page -->
<script src="assets/vendors/chart.js/Chart.min.js"></script>
<script src="assets/vendors/jquery-circle-progress/js/circle-progress.min.js"></script>
<!-- End plugin js for this page -->
<!-- inject:js -->
<script src="assets/js/off-canvas.js"></script>
<script src="assets/js/hoverable-collapse.js"></script>
81
<script src="assets/js/misc.js"></script>
<!-- endinject -->
<!-- Custom js for this page -->
<script src="assets/js/dashboard.js"></script>
<!-- End custom js for this page -->
</body>
</html>

Manage Payment.php

<?php
include '../config.php';
$admin=new Admin();
if(!isset($_SESSION['aid'])){
header('location:login.php');

}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
<!-- plugins:css -->
<link rel="stylesheet" href="assets/vendors/mdi/css/materialdesignicons.min.css">
<link rel="stylesheet" href="assets/vendors/flag-icon-css/css/flag-icon.min.css">
<link rel="stylesheet" href="assets/vendors/css/vendor.bundle.base.css">
<!-- endinject -->
<!-- Plugin css for this page -->
<link rel="stylesheet" href="assets/vendors/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="assets/vendors/bootstrap-datepicker/bootstrap-datepicker.min.css">
<!-- End plugin css for this page -->
<!-- inject:css -->
<!-- endinject -->
<!-- Layout styles -->
<link rel="stylesheet" href="assets/css/style.css">
<!-- End layout styles -->
<!-- <link rel="shortcut icon" href="assets/images/favicon.png" /> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/5.15.4/css/all.min.css">
</head>
<body>
<div class="container-scroller">
<!-- partial:partials/_navbar.html -->
<?php include 'navbar.php' ?>
<!-- partial -->
<div class="container-fluid page-body-wrapper">
<!-- partial:partials/_sidebar.html -->
82
<?php include 'sidebar.php' ?>
<!-- partial -->
<div class="main-panel">
<div class="content-wrapper">
<div class="page-header">
<h3 class="page-title">Manage Payment </h3>
<!-- <i class="mdi mdi-close" id="bannerClose"></i> -->
</div>
<div class="row">
<div class="col-lg-12 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<h4 class="card-title">Manage Payment</h4>

</p>
<table class="table">
<thead>
<tr>
<th>Sl.No</th>
<th>Name</th>
<th>Amount</th>
<th>Pay Mehtod</th>
<th>Transactions Id</th>
<!-- <th>status</th> -->
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$i=1;
$stmt = $admin->ret("SELECT order.unid,
shipping.name,payment.paymethod,payment.trans_id,payment.pay_id,payment.pay_status,
SUM(order.total) AS total_amount
FROM `order`
INNER JOIN shipping ON `order`.o_id = shipping.o_id INNER JOIN payment ON `order`.o_id =
payment.o_id
GROUP BY order.unid");

while($row=$stmt->fetch(PDO::FETCH_ASSOC)) {
$unid = $row['unid'];
$stmt1 = $admin->ret("SELECT * FROM `order` WHERE `unid`='$unid'");
$sum = 0;
// Reset the sum for each row
while ($row1 = $stmt1->fetch(PDO::FETCH_ASSOC)) {
$sum += $row1['total'];
}
$stmt2 = $admin->ret("SELECT SUM(total) AS rejected_total FROM `order` WHERE `unid`='$unid'
AND `o_status`='Rejected'");
$rejected_row = $stmt2->fetch(PDO::FETCH_ASSOC);
$rejected_total = $rejected_row['rejected_total'] ?? 0;
83
$sum -= $rejected_total;
?>
<tr>
<td><?php echo $i++?></td>
<td><?php echo $row['name'] ?></td>
<td>₹ <?php echo $sum ?></td>
<td><?php echo $row['paymethod'] ?></td>
<td><?php echo $row['trans_id'] ?> </td>
<!-- Additional columns if needed -->
<td>

<?php if($row['paymethod'] == 'upi'){ ?>


<span
class="badge bg-success rounded-1 fw-semibold">Paid</span>
<?php }elseif($row['pay_status']=='Pending'){ ?>

<a href="controller/manage_order.php?unid=<?php echo $row['unid'] ?>"> <span class="badge


bg-danger text-white rounded-1 fw-semibold">Not Paid</span></a>
<?php }elseif($row['pay_status']=='Paid'){ ?>

<span class="badge bg-success text-white rounded-1 fw-semibold">Paid</span>


<?php } ?>

</td>
</tr>
<?php } ?>
</tbody>

</table>
</div>
</div>
</div>

</div>
</div>
<!-- content-wrapper ends -->
<!-- partial:partials/_footer.html -->

<!-- partial -->


</div>
<!-- main-panel ends -->
</div>
<!-- page-body-wrapper ends -->
</div>
84
<style>
.count-symbol.bg-success {
display: inline-block;
padding: 8px;
border-radius: 50%;
font-size:30px;
background-color: #28a745;
color: white;
}
</style>
<!-- container-scroller -->
<script src="assets/vendors/js/vendor.bundle.base.js"></script>
<!-- endinject -->
<!-- Plugin js for this page -->
<script src="assets/vendors/chart.js/Chart.min.js"></script>
<script src="assets/vendors/jquery-circle-progress/js/circle-progress.min.js"></script>
<!-- End plugin js for this page -->
<!-- inject:js -->
<script src="assets/js/off-canvas.js"></script>
<script src="assets/js/hoverable-collapse.js"></script>
<script src="assets/js/misc.js"></script>
<!-- endinject -->
<!-- Custom js for this page -->
<script src="assets/js/dashboard.js"></script>
<!-- End custom js for this page -->
</body>
</html>

View Product.php

<?php
include '../config.php';
$admin=new Admin();
if(!isset($_SESSION['aid'])){
header('location:login.php');

}
?>
<!DOCTYPE html>
<html lang="en">

<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
<!-- plugins:css -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-
85
T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN"
crossorigin="anonymous">

<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@mdi/font@7.4.47/css/materialdesignicons.min.css">
<link rel="stylesheet" href="assets/vendors/mdi/css/materialdesignicons.min.css">
<link rel="stylesheet" href="assets/vendors/flag-icon-css/css/flag-icon.min.css">
<link rel="stylesheet" href="assets/vendors/css/vendor.bundle.base.css">
<!-- endinject -->
<!-- Plugin css for this page -->
<!-- End plugin css for this page -->
<!-- inject:css -->
<!-- endinject -->
<!-- Layout styles -->
<link rel="stylesheet" href="assets/css/style.css">
<!-- End layout styles -->
<!-- <link rel="shortcut icon" href="assets/images/favicon.png" /> -->
</head>

<body>
<div class="container-scroller">
<!-- partial:partials/_navbar.html -->
<?php include 'navbar.php' ?>
<!-- partial -->
<div class="container-fluid page-body-wrapper">
<!-- partial:partials/_sidebar.html -->
<?php include 'sidebar.php' ?>
<!-- partial -->
<div class="main-panel">
<div class="content-wrapper">
<div class="page-header">
<h3 class="page-title"> View Product </h3>

</div>
<div class="row">
<div class="col-lg-12 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<div class="d-flex justify-content-between mb-3">
<h4 class="card-title" id="product" style="display:block">View Products</h4>
<h4 class="card-title" id="category" style="display:none">View Category</h4>
<div>
<button id="viewProductsBtn" class="btn btn-primary mr-2">View
Products</button>
<button id="viewCategoriesBtn" class="btn btn-secondary">View
Categories</button>
</div>
</div>

<table id="productsTable" class="table table-striped">


<thead>
86
<tr>
<th> SL.No </th>
<th> Product Image </th>
<th> Product name</th>
<th> Quantity </th>
<th> Price </th>
<th> Action </th>
</tr>
</thead>
<tbody>
<?php
$i=1;
$stmt=$admin->ret("SELECT * fROM `product`");
while($row=$stmt->fetch(PDO::FETCH_ASSOC)){
?>
<tr>
<td class="py-1">
<?php echo $i++ ?>
</td>
<td class="py-1">
<img src="controller/<?php echo $row['p_image'] ?>" alt="image"
style="border-radius:0px;width:100px;height:100px" />
</td>
<td> <?php echo $row['p_name'] ?></td>
<td>
<?php
if($row['p_qty']<=5){
?>
<span class="badge bg-danger "
style="font-size:15px"><?php echo $row['p_qty'] ?></span>
<?php }else{ ?>
<span class="badge bg-success "
style="font-size:15px"><?php echo $row['p_qty'] ?></span>
<?php } ?>

</td>
<td>₹ <?php echo $row['p_price'] ?></td>
<td><a href="view_det_product.php?p_id=<?php echo $row['p_id']
?>"><span
class="mdi mdi-eye-outline "
style="font-size:30px;color:green"></span></a> </td>
</tr>
<?php } ?>

</tbody>
</table>

<table id="categoriesTable" class="table table-striped" style="display: none;">


<thead>
<tr>
<th> SL.No </th>
87
<th> Category Name </th>
<th> Date</th>
<th> Action </th>
</tr>
</thead>
<tbody>
<?php
$i=1;
$stmt=$admin->ret("SELECT * FROM `category`");
while($row=$stmt->fetch(PDO::FETCH_ASSOC)){
?>
<tr>
<td class="py-1">
<?php echo $i++ ?>
</td>

<td> <?php echo $row['c_name'] ?></td>

<td><?php echo $row['c_date'] ?></td>


<td>
<button type="button" style="border:none" class="" data-bs-
toggle="modal" data-bs-target="#exampleModal<?php echo $row['c_id'] ?>" data-bs-
whatever="@mdo"><span
class="mdi mdi-square-edit-outline"
style="font-size:30px;color:green"></span></button>
<a href="controller/delete_category.php?c_id=<?php echo $row['c_id'] ?>"
style="border:none" class="" ><span
class="mdi mdi-delete"
style="font-size:30px;color:red"></span></a>
</td>
</tr>

<div class="modal fade" id="exampleModal<?php echo $row['c_id'] ?>" tabindex="-1" aria-


labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form action="controller/update_product.php" method="POST">
<div class="modal-header">
<h1 class="modal-title fs-5" id="exampleModalLabel">Update Category</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">

<div class="mb-3">
<label for="recipient-name" class="col-form-label">Category:</label>
<input type="hidden" name="c_id" value="<?php echo $row['c_id'] ?>" class="form-control"
id="recipient-name">
<input type="text" name="c_name" value="<?php echo $row['c_name'] ?>" class="form-control"
88
id="recipient-name">
</div>

</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="submit" name="updatecat" class="btn btn-primary">Update</button>
</div>
</form>
</div>
</div>
</div>
<?php } ?>

</tbody>
</table>
</div>
</div>
</div>

</div>

</div>
<!-- content-wrapper ends -->
<!-- partial:partials/_footer.html -->

<!-- partial -->


</div>
<!-- main-panel ends -->
</div>
<!-- page-body-wrapper ends -->
</div>
<!-- container-scroller -->
<!-- plugins:js -->
<script src="assets/vendors/js/vendor.bundle.base.js"></script>
<!-- endinject -->
<!-- Plugin js for this page -->
<!-- End plugin js for this page -->
<!-- inject:js -->
<script src="assets/js/off-canvas.js"></script>
<script src="assets/js/hoverable-collapse.js"></script>
<script src="assets/js/misc.js"></script>
<!-- endinject -->
<script>
document.getElementById('viewProductsBtn').addEventListener('click', function() {
document.getElementById('productsTable').style.display = 'table';
document.getElementById('categoriesTable').style.display = 'none';
document.getElementById('category').style.display = 'none';
document.getElementById('product').style.display = 'block';
89
});

document.getElementById('viewCategoriesBtn').addEventListener('click', function() {
document.getElementById('productsTable').style.display = 'none';
document.getElementById('categoriesTable').style.display = 'table';
document.getElementById('category').style.display = 'block';
document.getElementById('product').style.display = 'none';
});
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-
C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js"
integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js" integrity="sha384-
BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+"
crossorigin="anonymous"></script>
<!-- Custom js for this page -->
<!-- End custom js for this page -->
</body>

</html>

View Customer.php

<?php
include '../config.php';
$admin=new Admin();
if(!isset($_SESSION['aid'])){
header('location:login.php');

}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
<!-- plugins:css -->
<link rel="stylesheet" href="assets/vendors/mdi/css/materialdesignicons.min.css">
<link rel="stylesheet" href="assets/vendors/flag-icon-css/css/flag-icon.min.css">
<link rel="stylesheet" href="assets/vendors/css/vendor.bundle.base.css">
<!-- endinject -->
<!-- Plugin css for this page -->
<!-- End plugin css for this page -->
<!-- inject:css -->
90
<!-- endinject -->
<!-- Layout styles -->
<link rel="stylesheet" href="assets/css/style.css">
<!-- End layout styles -->
<!-- <link rel="shortcut icon" href="assets/images/favicon.png" /> -->
</head>
<body>
<div class="container-scroller">
<!-- partial:partials/_navbar.html -->
<?php include 'navbar.php' ?>
<!-- partial -->
<div class="container-fluid page-body-wrapper">
<!-- partial:partials/_sidebar.html -->
<?php include 'sidebar.php' ?>
<!-- partial -->
<div class="main-panel">
<div class="content-wrapper">
<div class="page-header">
<h3 class="page-title"> View Customer </h3>

</div>
<div class="row">
<div class="col-lg-12 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<h4 class="card-title">View Customer</h4>

<table class="table">
<thead>
<tr>
<th>Sl.No</th>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>Address</th>
</tr>
</thead>
<tbody>
<?php
$i=1;
$stmt=$admin->ret("SELECT * FROM `customer` ");
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
?>
<tr>
<td><?php echo $i++ ?></td>
<td><?php echo $row['cust_name'] ?></td>
<td><?php echo $row['cust_email'] ?></td>

<td><?php echo $row['cust_phone'] ?></td>


<td><?php echo $row['cust_address'] ?></td>
91
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>

</div>
</div>
<!-- content-wrapper ends -->
<!-- partial:partials/_footer.html -->

<!-- partial -->


</div>
<!-- main-panel ends -->
</div>
<!-- page-body-wrapper ends -->
</div>
<!-- container-scroller -->
<!-- plugins:js -->
<script src="assets/vendors/js/vendor.bundle.base.js"></script>
<!-- endinject -->
<!-- Plugin js for this page -->
<!-- End plugin js for this page -->
<!-- inject:js -->
<script src="assets/js/off-canvas.js"></script>
<script src="assets/js/hoverable-collapse.js"></script>
<script src="assets/js/misc.js"></script>
<!-- endinject -->
<!-- Custom js for this page -->
<!-- End custom js for this page -->
</body>
</html>

Generate Bill.php

<?php
include '../config.php';
$admin=new Admin();
if(!isset($_SESSION['aid'])){
header('location:login.php');

}
$unid=$_GET['unid'];
$stmt=$admin->ret("SELECT * FROM `shipping` INNER JOIN `order` ON shipping.o_id=order.o_id
WHERE order.unid = '$unid'");
$row=$stmt->fetch(PDO::FETCH_ASSOC);
92
?>
<!DOCTYPE html>
<html lang="en">

<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
<!-- plugins:css -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
rel="stylesheet" />
<link rel="stylesheet" href="assets/vendors/mdi/css/materialdesignicons.min.css">
<link rel="stylesheet" href="assets/vendors/flag-icon-css/css/flag-icon.min.css">
<link rel="stylesheet" href="assets/vendors/css/vendor.bundle.base.css">
<!-- endinject -->
<!-- Plugin css for this page -->
<link rel="stylesheet" href="bill.css">
<link rel="stylesheet" href="assets/vendors/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="assets/vendors/bootstrap-datepicker/bootstrap-datepicker.min.css">
<!-- End plugin css for this page -->
<!-- inject:css -->
<!-- endinject -->
<!-- Layout styles -->
<link rel="stylesheet" href="assets/css/style.css">
<!-- End layout styles -->
<!-- <link rel="shortcut icon" href="assets/images/favicon.png" /> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/5.15.4/css/all.min.css">
<style>
.count-symbol.bg-success {
display: inline-block;
padding: 8px;
border-radius: 50%;
font-size: 30px;
background-color: #28a745;
color: white;
}
</style>
</head>

<body>
<div class="container-scroller">
<!-- partial:partials/_navbar.html -->
<?php include 'navbar.php' ?>
<!-- partial -->
<div class="container-fluid page-body-wrapper">
<!-- partial:partials/_sidebar.html -->
<?php include 'sidebar.php' ?>
<!-- partial -->
93
<div class="main-panel" style="padding:40px;">

<div class="page-content container">


<div class="page-header text-blue-d2">
<h1 class="page-title text-secondary-d1">
Invoice
<small class="page-info">
<i class="fa fa-angle-double-right text-80"></i>
ID: <?php echo $unid ?>
</small>
</h1>

<div class="page-tools">
<div class="action-buttons ">
<a class="btn bg-white btn-light mx-1px text-95 print-btn"
onclick="printInvoice()" href="#" data-title="Print">
<i class="mr-1 fa print-btn fa-print text-primary-m1 text-120 w-2"></i>
Print
</a>
<!-- <a class="btn bg-white btn-light mx-1px text-95" href="#" data-title="PDF">
<i class="mr-1 fa fa-file-pdf-o text-danger-m1 text-120 w-2"></i>
Export
</a> -->
</div>
</div>
</div>

<div class="container px-0">


<div class="row mt-4">
<div class="col-12 col-lg-12">
<div class="row">
<div class="col-12">
<div class="text-center text-150">
<img src="logo2.png" alt="" style="width:50px;height:50px">
<span class="text-default-d3">Smart Electronics</span>
</div>
</div>
</div>
<!-- .row -->

<hr class="row brc-default-l1 mx-n1 mb-4" />

<div class="row">
<div class="col-sm-6">
<div>
<span class="text-sm text-grey-m2 align-middle">To:</span>
94
<span class="text-600 text-110 text-blue align-middle"><?php echo
$row['name'] ?></span>
</div>
<div class="text-grey-m2">
<div class="my-1">
<?php echo $row['email'] ?>
</div>
<div class="my-1">
<?php echo $row['phone'] ?>
</div>
<div class="my-1">
<?php echo $row['address'] ?>
</div>
<div class="my-1">
<?php echo $row['state'] ?>
</div>
<div class="my-1">
<?php echo $row['zipcode'] ?>

</div>

</div>
</div>
<!-- /.col -->

<div class="text-95 col-sm-6 align-self-start d-sm-flex justify-content-end">


<hr class="d-sm-none" />
<div class="text-grey-m2">
<div class="mt-1 mb-2 text-secondary-m1 text-600 text-125">
Invoice
</div>

<div class="my-2"><i class="fa fa-circle text-blue-m2 text-xs mr-1"></i>


<span class="text-600 text-90">ID:</span> <?php echo $unid ?></div>
</html>

Cart ajax.php

<?php
include 'config.php';
$admin=new Admin();
$cid=$_SESSION['cid'];

if(isset($_GET['cart_id_increment'])){
$cart_id=$_GET['cart_id_increment'];
$stmt=$admin->ret("SELECT * FROM `cart` WHERE `cust_id`='$cid' AND `cart_id`='$cart_id'");
$row=$stmt->fetch(PDO::FETCH_ASSOC);
$old_qty=$row['cart_qty'];
95
$new_qty=$old_qty+1;
$stmt1=$admin->cud("UPDATE `cart` SET `cart_qty`='$new_qty' WHERE
`cart_id`='$cart_id'",'updated');

}
if(isset($_GET['cart_id_decrement'])){
$cart_id=$_GET['cart_id_decrement'];
$stmt=$admin->ret("SELECT * FROM `cart` WHERE `cust_id`='$cid' AND `cart_id`='$cart_id'");
$row=$stmt->fetch(PDO::FETCH_ASSOC);
$old_qty=$row['cart_qty'];
$new_qty=$old_qty-1;
$stmt1=$admin->cud("UPDATE `cart` SET `cart_qty`='$new_qty' WHERE
`cart_id`='$cart_id'",'updated');
}
if(isset($_GET['removecart'])){
$cart_id=$_GET['removecart'];

$stmt1=$admin->cud("DELETE FROM `cart` WHERE `cart_id`='$cart_id'",'deleted');


}
?>

<?php
$g_total=0;
$stmt=$admin->ret("SELECT * FROM `cart` INNER JOIN
`product` ON product.p_id=cart.p_id WHERE cart.cust_id='$cid'");
if($stmt->rowCount() > 0) {
?>
<div class="container" >
<div class="row mb-5" >
<form class="col-md-12" method="post">
<div class="site-blocks-table" >

<table class="table">

<thead>
<tr>
<th class="product-thumbnail">Image</th>
<th class="product-name">Product</th>
<th class="product-price">Price</th>
<th class="product-quantity">Quantity</th>
<th class="product-total">Total</th>
<th class="product-remove">Remove</th>
</tr>
</thead>
<tbody>
<?php

96
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$qty=$row['cart_qty'];
$price=$row['p_price'];
$total=$qty*$price;
$g_total+=$total;
?>
<tr>
<td class="product-thumbnail">
<img src="Admin/controller/<?php echo $row['p_image'] ?>" alt="Image"
class="img-fluid">
</td>
<td class="product-name">
<h2 class="h5 text-black"><?php echo $row['p_name'] ?></h2>
</td>
<td>₹ <?php echo $row['p_price'] ?></td>
<td>
<div class="input-group mb-3 d-flex align-items-center quantity-container"
style="max-width: 120px;">
<div class="input-group-prepend">
<?php
if($row['cart_qty'] >1){

?>
<button class="btn btn-outline-black decrease"
onclick="decrement(<?php echo $row['cart_id'] ?>)"
type="button">&minus;</button>
<?php }else{ ?>
<button class="btn btn-outline-black decrease" id="myButton"
style="cursor: not-allowed" type="button">&minus;</button>
<?php } ?>
</div>

<input type="text" value="<?php echo $row['cart_qty'] ?>" readonly


class="form-control text-center quantity-amount" placeholder=""
aria-label="Example text with button addon"
aria-describedby="button-addon1">
<div class="input-group-append">
<button class="btn btn-outline-black increase"
onclick="increment(<?php echo $row['cart_id'] ?>)"
type="button">&plus;</button>
</div>
</div>
</td>
<td>₹ <?php echo $total ?></td>
<td><a href="#" class="btn btn-black btn-sm"
onclick="removecart(<?php echo $row['cart_id'] ?>)">X</a></td>
</tr>
<?php } ?>
</tbody>
97
</table>
</div>
</form>

</div>
<script>
document.addEventListener("DOMContentLoaded", function() {
var myButton = document.getElementById("myButton");
myButton.disabled = true;
myButton.classList.add("disabled-cursor");
});
</script>
<div class="row">
<div class="col-md-6">
<div class="row mb-5">

<div class="col-md-6">
<a href="shop.php"> <button class="btn btn-outline-black btn-sm btn-block">Continue
Shopping</button></a>
</div>
</div>

</div>
<div class="col-md-6 pl-5">
<div class="row justify-content-end">
<div class="col-md-7">
<div class="row">
<div class="col-md-12 text-right border-bottom mb-5">
<h3 class="text-black h4 text-uppercase">Cart Totals</h3>
</div>
</div>

<div class="row mb-5">


<div class="col-md-6">
<span class="text-black">Total</span>
</div>
<div class="col-md-6 text-right">
<strong class="text-black">₹ <?php echo $g_total ?></strong>
</div>
</div>

<div class="row">
<div class="col-md-12">
<button class="btn btn-black btn-lg py-3 btn-block"
onclick="window.location='checkout.php'">Proceed To Checkout</button>
98
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php }else{ ?>
<div style="display:flex;justify-content:center;align-items:center;flex-
direction:column">
<img src="remove-from-cart_4111506 (2).png" alt="">
<h3>Your Cart is Empty</h3>
<p>You have no items in your shopping cart.<br><span
style="display:flex;justify-content:center;align-items:center;">Let's go buy something</span></p>
<a href="shop.php" class="btn btn-sm btn-outline-black">Back to shop</a>
</div>
<?php } ?>

Report.php

<?php
include '../config.php';
$admin=new Admin();
if(!isset($_SESSION['aid'])){
header('location:login.php');

?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
<!-- plugins:css -->

<link rel="stylesheet" href="assets/vendors/mdi/css/materialdesignicons.min.css">


<link rel="stylesheet" href="assets/vendors/flag-icon-css/css/flag-icon.min.css">
<link rel="stylesheet" href="assets/vendors/css/vendor.bundle.base.css">
<!-- endinject -->
<!-- Plugin css for this page -->
<link rel="stylesheet" href="assets/vendors/select2/select2.min.css">
99
<link rel="stylesheet" href="assets/vendors/select2-bootstrap-theme/select2-bootstrap.min.css">
<!-- End plugin css for this page -->
<!-- inject:css -->
<!-- endinject -->

<!-- Layout styles -->


<link rel="stylesheet" href="assets/css/style.css">
<!-- End layout styles -->
<!-- <link rel="shortcut icon" href="assets/images/favicon.png" /> -->
</head>
<body>
<div class="container-scroller">
<!-- partial:partials/_navbar.html -->
<?php include 'navbar.php' ?>
<!-- partial -->
<div class="container-fluid page-body-wrapper">
<!-- partial:partials/_sidebar.html -->
<?php include 'sidebar.php' ?>
<!-- partial -->
<div class="main-panel">
<div class="content-wrapper">
<div class="page-header">
<!-- <h3 class="page-title"> Report</h3> -->

</div>
<div class="row">
<div class="col-md-12 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<h4 class="card-title">Report</h4>
<?php
$startDate=0;
$endDate=0;
if(isset($_POST['report'])){
$startDate=$_POST['startdate'];
$endDate=$_POST['enddate'];
}
?>
<form class="needs-validation forms-sample" novalidate="" action="report.php"
method="POST">
<div class="row">
<div class="form-group col-md-6">
<label for="exampleInputUsername1">Start Date</label>
<input type="date" name="startdate" required="" class="form-control"
id="exampleInputUsername1" placeholder="Username">
<div class="invalid-feedback"> Date is required. </div>
</div>

100
<div class="form-group col-md-6">
<label for="exampleInputEmail1">End Date</label>
<input type="date" name="enddate" required="" class="form-control"
id="exampleInputEmail1" placeholder="Email">
<div class="invalid-feedback"> Date is required. </div>
</div>
</div>

<button type="submit" class="btn btn-primary mr-2" name="report">Submit</button>

</form>
</div>
</div>
</div>

</div>
<div class="col-lg-12 grid-margin stretch-card mt-5">
<div class="card">
<div class="card-body">
<h4 class="card-title">View Report</h4>
</p>
<div class="table-responsive">
<table class="table table-bordered">
<thead>

<tr>
<th>SL.NO</th>
<th>PRODUCT</th>
<th>PRICE</th>
<th>QUANTITY</th>
<th>TOTAL</th>
<th>DATE</th>
</tr>

</thead>
<tbody>
<?php
$i = 1;
$stmt = $admin->ret("SELECT * FROM `order` INNER JOIN `product` ON
product.p_id=order.p_id WHERE `o_status`!='Rejected' AND o_date BETWEEN '$startDate' AND
'$endDate' ");
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {

$qty = $row['qty'];
$price = $row['p_price'];
$total = $qty * $price;
101
?>
<tr>

<td><?php echo $i++ ?></td>


<td><?php echo $row['p_name'] ?></td>
<td><?php echo $row['p_price'] ?></td>
<td><?php echo $row['qty'] ?></td>
<td><?php echo $total ?></td>
<td><?php echo $row['o_date'] ?></td>

</tr>
<?php } ?>

</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- content-wrapper ends -->
<!-- partial:partials/_footer.html -->

<!-- partial -->


</div>
<!-- main-panel ends -->
</div>
<!-- page-body-wrapper ends -->
</div>
<!-- container-scroller -->
<!-- plugins:js -->
<script src="assets/vendors/js/vendor.bundle.base.js"></script>
<!-- endinject -->
<script>
(function () {
'use strict'

window.addEventListener('load', function () {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName('needs-validation')

// Loop over them and prevent submission


Array.prototype.filter.call(forms, function (form) {
form.addEventListener('submit', function (event) {
if (form.checkValidity() === false) {
102
event.preventDefault()
event.stopPropagation()
}
form.classList.add('was-validated')
}, false)
})
}, false)
}())
</script>
<!-- Plugin js for this page -->
<script src="assets/vendors/select2/select2.min.js"></script>
<script src="assets/vendors/typeahead.js/typeahead.bundle.min.js"></script>
<!-- End plugin js for this page -->
<!-- inject:js -->
<script src="assets/js/off-canvas.js"></script>
<script src="assets/js/hoverable-collapse.js"></script>
<script src="assets/js/misc.js"></script>
<!-- endinject -->
<!-- Custom js for this page -->
<script src="assets/js/file-upload.js"></script>
<script src="assets/js/typeahead.js"></script>
<script src="assets/js/select2.js"></script>
<!-- End custom js for this page -->
</body>
</html>

Add Product.php

<?php
include '../config.php';
$admin=new Admin();
if(!isset($_SESSION['aid'])){
header('location:login.php');

}
?>
<!DOCTYPE html>
<html lang="en">

<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Smart Electronics</title>
<link rel="shortcut icon" href="logo2.png" />
<!-- plugins:css -->
<link rel="stylesheet" href="assets/vendors/mdi/css/materialdesignicons.min.css">
<link rel="stylesheet" href="assets/vendors/flag-icon-css/css/flag-icon.min.css">
<link rel="stylesheet" href="assets/vendors/css/vendor.bundle.base.css">
<!-- endinject -->
<!-- Plugin css for this page -->
103
<link rel="stylesheet" href="assets/vendors/select2/select2.min.css">
<link rel="stylesheet" href="assets/vendors/select2-bootstrap-theme/select2-bootstrap.min.css">
<!-- End plugin css for this page -->
<!-- inject:css -->
<!-- endinject -->
<!-- Layout styles -->
<link rel="stylesheet" href="assets/css/style.css">
<!-- End layout styles -->
<!-- <link rel="shortcut icon" href="assets/images/favicon.png" /> -->
</head>

<body>
<div class="container-scroller">
<!-- partial:partials/_navbar.html -->
<?php include 'navbar.php' ?>
<!-- partial -->
<div class="container-fluid page-body-wrapper">
<!-- partial:partials/_sidebar.html -->
<?php include 'sidebar.php' ?>
<!-- partial -->
<div class="main-panel">
<div class="content-wrapper">
<div class="page-header">
<h3 class="page-title">Manage Product</h3>

</div>
<div class="row">
<div class="col-md-6 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<h4 class="card-title">Add Ctegory</h4>

<div class="form-group">
<form action="controller/manage_product.php" class="needs-validation forms-
sample" novalidate="" method="POST">
<label for="exampleInputUsername1">Category Name</label>
<input type="text" class="form-control" required=""
id="exampleInputUsername1"
name="cat_name" placeholder="Category Name">
<div class="invalid-feedback"> Category is required. </div>
</div>
<button type="submit" name="add_category" class="btn btn-primary mr-2">Add
Category</button>

</form>
</div>
</div>
</div>

<div class="col-12 grid-margin stretch-card">


<div class="card">
104
<div class="card-body">
<h4 class="card-title">Add Products</h4>

<form class="needs-validation forms-sample" novalidate=""


action="controller/manage_product.php" method="POST" enctype="multipart/form-data">
<div class="row">
<div class="form-group col-md-6">
<label for="exampleSelectGender">Select Category</label>
<select class="form-control" required="" name="c_id"
id="exampleSelectGender">
<option selected value="">Select Category</option>
<?php
$stmt = $admin->ret('SELECT * FROM `category`');
while($row = $stmt->fetch(PDO::FETCH_ASSOC)){
?>
<option value="<?php echo $row['c_id'] ?>">
<?php echo $row['c_name'] ?>
</option>
<?php } ?>
</select>
<div class="invalid-feedback"> Select Category is required. </div>

</div>
<div class="form-group col-md-6">
<label for="exampleInputName1">Product Name</label>
<input type="text" name="p_name" required="" class="form-control"
id="exampleInputName1"
placeholder="Product Name">
<div class="invalid-feedback"> Product Name is required. </div>
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label for="exampleInputEmail3">Product Quantity</label>
<input type="text" name="p_qty" class="form-control"
id="exampleInputEmail3"
placeholder="Product Quantity" required="">
<div class="invalid-feedback"> Product Quantity is required. </div>
</div>
<div class="form-group col-md-6">
<label for="exampleInputPassword4">Product Price</label>
<input type="text" required="" name="p_price" class="form-control"
id="exampleInputPassword4" placeholder="Product Price">
<div class="invalid-feedback"> Product Price is required. </div>
</div>
</div>

<div class="form-group">
<label>Product Image</label>
<input type="file" required="" name="img" class="file-upload-default">

105
<div class="input-group col-xs-12">
<input type="text" class="form-control file-upload-info" disabled
placeholder="Product Image">

<span class="input-group-append">
<button class="file-upload-browse btn btn-primary"
type="button">Upload</button>
</span>

</div>
<div class="invalid-feedback"> Product Image is required. </div>
</div>

<!-- <div class="form-group">


<label for="exampleTextarea1">Product Description</label>
<textarea class="form-control" id="exampleTextarea1" rows="4"></textarea>
</div> -->
<div class="table-responsive ">
<form id="add_name">
<table class="table" id="dynamic_field">
<thead>
<tr>
<th>Product Description</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="text" style="width:750px" required name="var[]"
placeholder="Product Description"
class="form-control name_list" /> <div class="invalid-
feedback"> Product Description is required. </div></td>
<td><button type="button" name="add" id="add"
class="btn btn-success">Add More</button></td>
</tr>

</tbody>

</table>

</div>
<button type="submit" name="addproduct" class="btn btn-primary mr-
2">Submit</button>
<button class="btn btn-light">Cancel</button>
</form>
</div>
</div>
</div>
</div>
</div>
106
<!-- content-wrapper ends -->
<!-- partial:partials/_footer.html -->

<!-- partial -->


</div>
<!-- main-panel ends -->
</div>
<!-- page-body-wrapper ends -->
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
var i = 1;

$('#add').click(function() {
i++;
$('#dynamic_field tbody').append('<tr id="row' + i + '"><td><input type="text" name="var[]"
placeholder="Product Description" class="form-control name_list" required /></td><td><button
type="button" name="remove" id="' + i + '" class="btn btn-danger btn_remove">X</button></td></tr>');
});

$(document).on('click', '.btn_remove', function() {


var button_id = $(this).attr("id");
$('#row' + button_id).remove();
});

$('#submit').click(function() {
$.ajax({
url: "name.php",
method: "POST",
data: $('#add_name').serialize(),
success: function(data) {
alert(data);
$('#add_name')[0].reset();
}
});
});
});
</script>
<!-- container-scroller -->
<!-- plugins:js -->
<script src="assets/vendors/js/vendor.bundle.base.js"></script>
<!-- endinject -->
<!-- Plugin js for this page -->
<script src="assets/vendors/select2/select2.min.js"></script>
<script src="assets/vendors/typeahead.js/typeahead.bundle.min.js"></script>
<!-- End plugin js for this page -->
<!-- inject:js -->
<script src="assets/js/off-canvas.js"></script>
<script src="assets/js/hoverable-collapse.js"></script>
<script src="assets/js/misc.js"></script>
107
<!-- endinject -->
<!-- Custom js for this page -->
<script>
(function () {
'use strict'

window.addEventListener('load', function () {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName('needs-validation')

// Loop over them and prevent submission


Array.prototype.filter.call(forms, function (form) {
form.addEventListener('submit', function (event) {
if (form.checkValidity() === false) {
event.preventDefault()
event.stopPropagation()
}
form.classList.add('was-validated')
}, false)
})
}, false)
}())
</script>
<script src="assets/js/file-upload.js"></script>
<script src="assets/js/typeahead.js"></script>
<script src="assets/js/select2.js"></script>
<!-- End custom js for this page -->
</body>

</html>

108
7-TESTING
7.1 Introduction
Software testing serves as an investigative process aimed at providing stakeholders with insights into
the quality of the product or service being examined. It entails analyzing a software item to discern
disparities between its existing state and the desired conditions, thereby evaluating its functionalities.
Testing involves subjecting a system or application to controlled circumstances and analyzing the
outcomes. These controlled conditions encompass both typical and exceptional scenarios. Testing
intentionally seeks to uncover discrepancies or faults to determine how the system behaves under
various conditions. The primary focus is on detecting issues early in the development cycle.

Software testing has three main purposes:

➢ Verification ensures that the software aligns with its technical specifications, which are
descriptions of functions in terms of measurable outputs given specific inputs and preconditions.

➢ Validation confirms that the software satisfies business requirements.

➢ A defect is a discrepancy between expected and actual results, with its origin often found in
faults introduced during specification, design, or development. It's important to note that not all
defects lead to failures in the software.

There are two types of software testing:

➢ Black box testing focuses solely on the external behavior of the software, without considering its
internal system design. Tests are conducted based on requirements and functionality, with testers
having no knowledge of the internal workings of the application.

➢ White box testing, also known as glass box testing, involves examining the internal logic of an
application's code. Testers require knowledge of the software's internal workings and code
structure. Tests are based on achieving coverage of code statements, branches, paths, and
conditions within the application.

A test case serves as a crucial document in software testing, comprising various elements such as
events, actions, inputs, outputs, expected results, and actual results. Generally, a test case clinically
represents an input and its expected outcome. It can be as straightforward as "for condition x, the
expected result is y." However, some test cases provide detailed input scenarios and expected results.
Occasionally, a test case may involve a series of steps with corresponding expected outcomes. It's

109
imperative for a test case to include a section for recording the actual result observed during testing.

7.2 Testing Objectives


➢ Identifying defects introduced by programmers during software development.
➢ Building confidence in and providing insights into the software's quality level.
➢ Preventing defects by detecting and addressing issues early in the development process.
➢ Ensuring that the final product meets both business and user requirements.
➢ Verifying compliance with both Business Requirement Specification (BRS) and System Requirement
Specification (SRS).

7.3 Testing Method
System testing marks the implementation stage, crucial for ensuring the system functions
accurately and efficiently before going live. Testing plays a pivotal role in determining the system's
success. Various tests are conducted on the candidate system, including online response, volume,
stress, recovery, security, and usability tests. These tests are essential to verify the system's readiness
before proceeding to user acceptance testing.

7.4 Testing Steps

7.4.1 Unit Testing


Unit testing concentrates on verifying the functionality of the smallest units of software
design, often referred to as modules. Each module is tested independently to ensure it operates
as expected. These tests are conducted during the programming stage itself. The goal is to
confirm that each module produces the desired output, meeting the specified requirements.

7.4.2 Integration Testing


Data loss can occur across interfaces, and the interaction between modules can sometimes
have unintended consequences. Sub-functions may not always integrate seamlessly with
major functions as desired. Integration testing offers a systematic method for constructing the
program structure while simultaneously identifying and rectifying errors within interfaces.
The goal is to assemble unit-tested modules into the program structure and test them as a
cohesive whole.

110
7.4.3 Validation

Upon completion of integration testing, the software is fully assembled as a package, with
interfacing errors identified and rectified. Validation testing marks the beginning of a final
series of tests. Validation testing can be defined in various ways, but a straightforward
definition is that it succeeds when the software operates as expected by the customer.
Following validation testing, one of three possible conditions exists.The function or
performance characteristics confirm to specification and are accepted.

➢ A deviation from the specification is discovered, prompting the creation of a deficiency list.

➢ The proposed system undergoes validation testing and is found to be functioning satisfactorily.

7.4.4 Output Testing


Following validation testing, the subsequent step involves output testing of the proposed
system. This step is crucial because a system is only useful if it produces the required output
in a specific format. Upon examination, it is confirmed that the output format on the screen
aligns with the user's needs as designed during system design. Similarly, the hard copy output
meets the specified requirements set by the user. Consequently, no corrections are needed for
the system based on the output testing results.

7.4.5 User Acceptance Testing


The user acceptance of a system stands as a pivotal factor for its success. Throughout the
development process, the system in question is continuously tested for user acceptance by
maintaining regular communication with prospective system users. Any necessary
adjustments or changes are made based on user feedback to ensure that the system meets their
requirements and expectations.

This is done in regard to the following point:

➢ Design of input screens.


➢ Design of output screens.
➢ Provision of online messages to guide users.
➢ Formatting of reports and other outputs.
7.5 Test Cases

7.5.1 Admin Login Form


111
SI No Test Condition Expected Result Result
1 If the administrator clicks on the login button "Please check your username successful
without entering a username and password. and password."

2 If the username field is blank but the password "Please check your username Successful
is entered. and password."

k3 If the password field is blank but the username "Please check your username Successful
is entered. and password."

4 If the username or password is incorrect. "Please check your username Successful


and password."

5 If a valid username and password are entered. The system displays the Admin Successful
page.

7.5.2. User Register Form

SI No Test Condition Expected Result Result


1 When the user clicks “Submit” It adds new record to Successful
database.
2 If the full name field is blank and click Please fill out this field. successful
“Submit” button
3 If you enter invalid phone number with Please match the format Successful
characters requested. (10 numeric
character only)
4 If the Username is empty. Please fill out this field. Successful
5 If the Email is not in proper manner Please include an ‘@’ in Successful
the email address
6 If the Dob field is empty Please fill out this field. Successful
7 If the Password field is not in proper Please match the format Successful
manner requested. (at least one
number, one uppercase
letter, one lowercase letter
and at least 8 or more
characters)

112
7.5.3 User Login Form
SI No Test Condition Expected Result Result
1 If the user clicks on the Login button "Please check your email Successful
without entering an email and password. and password."

2 If the email field is blank but the "Please check your email Successful
password is entered. and password."

3 If the password field is blank but the "Please check your email Successful
email is entered. and password."

4 If the email or password is incorrect. "Please check your email Successful


and password."

5 If a valid email and password are "The system displays the Successful
entered. profile page."

7.5.4 User Profile Form


SI No Test Condition Expected Result Result
1 When the user clicks 'Register'. "It adds a new record to Successful
the database."
2 If the address field is blank and the user Address is required Successful
clicks the 'Register' button.
3 If invalid symbols are entered in the Use only @ symbols Successful
email section.
4 If the Address field is empty Address Required Successful

7.5.6 Payment Form

SI No Test Condition Expected Result Result


1 "When the user clicks ‘Place Order’. "It adds a new record to Successful
the database."
2 If the transaction ID field is empty. “Enter transaction id” Successful

113
7.5.7 Feedback Form
SI No Test Condition Expected Result Result
1 When the user clicks 'Submit'. "It adds a new record to Successful
the database."
2 If the feedback field is empty. Please Fill In This Field Successful
3 If the user enters feedback without Please Login Successful
logging in.

System Testing:

Absolutely, system testing is indeed the evaluation of a fully integrated software product within its larger
computer-based system environment. This testing phase ensures that the software operates as intended
when interfaced with other software or hardware components. System testing consists of various tests
designed to thoroughly exercise the entire computer-based system, ensuring its functionality and
performance meet the specified requirements.

System Testing Tables:

Sl. No Test condition Test report

1. System loading Successful

2. System startup procedure Successful

3. File input/output operations Successful

4. Database communication Successful

5. Server/client interaction Successful

6. Memory usage Normal

7. System processor usage Normal

8. Authentication and authorization Successful

114
8. USER INTERFACE
ScreenShots

Admin Login page:

Admin Dashboard:

115
Manage Product page:

Manage Product page:

116
Manage Customer:

Manage Order:

117
Manage Payment:

Report Page:

118
FeedBack Page:

Home Page:

119
Login Page:

Register Page:

120
Shop Page:

Order Status Page:

121
Feedback Page:

Order Tracking Page:

122
Cart Page:

Payment Page:

123
Shoping Interface :

Profile Page:

124
9. USER MANUAL

9.1 Introduction

The goal of our electronic e-commerce website is to provide customers with a seamless and convenient
platform to browse, purchase, and access electronic products and services. We aim to offer a wide range
of high-quality products, accompanied by comprehensive documentation and support, to meet the diverse
needs of our customers. Through user-friendly navigation, secure transactions, and reliable customer
service, we strive to enhance the online shopping experience and build lasting relationships with our
clientele. Our ultimate objective is to become the preferred destination for individuals and businesses
seeking electronic solutions, delivering value, innovation, and satisfaction with every interaction.

9.2 Hardware Requirement:

• Intel dual-core Processor or higher


• 2 GB RAM and above
• 40 GB hard disk space
• Mouse and Keyboard

9.3 Software Requirements:

• Language: PHP
• User Interface Design: HTML, CSS, Bootstrap
• Scripting Language: JavaScript
• Operating System: Windows
• Text Editor: Sublime Text
• Database (Back End): MySQL
• Web Server: Apache
• Supported Browsers: Firefox, Chrome, or any modern browser

125
10. CONCLUSION

In the ever-expanding digital landscape, “Smart Electricals” stands as a beacon of innovation and
convenience. Our electronic e-commerce platform embodies a commitment to excellence, offering a
diverse array of high-quality products and services tailored to meet the evolving needs of our discerning
customers. With a user-friendly interface and seamless integration of advanced technologies, we strive to
provide an unparalleled shopping experience. From cutting-edge smart devices to essential electrical
components, our extensive catalogue ensures that customers can find everything they need with ease.
Backed by robust customer support and comprehensive documentation, we prioritize customer
satisfaction at every turn. As we continue to push the boundaries of technological advancement, “Smart
Electricals” remains dedicated to empowering individuals and businesses alike, ushering them into a
future where innovation and connectivity go hand in hand. Join us on this journey towards a smarter,
more efficient world.

Future Scope:

• Global Expansion: Expand internationally for new markets.


• Tech Integration: Integrate AI, VR for better experience.
• Product Diversification: Add more electronic categories.
• Sustainability: Eco-friendly packaging, energy-efficient products.
• Mobile Optimization: Optimize for mobile users.
• Personalization: Offer personalized recommendations, promotions.

126
11.BIBLIOGRAPHY

11.1 Book References:

1. "E-commerce Website Optimization: Why 95% of Your Website Visitors Don't Buy, and What
You Can Do About It" by Dan Croxen-John and Johann Van Tonder.

2. "The Art of SEO: Mastering Search Engine Optimization" by Eric Enge, Stephan Spencer, Jessie
Stricchiola, and Rand Fishkin.

3. "E-commerce Essentials" by Kenneth C. Laudon and Carol Traver.

4. "E-commerce For Dummies" by Don Jones and Mark D. Scott.

5. "Designing E-commerce Websites: 25 Examples You Can Learn From" by Vailancio Rodrigues.

6. "Web Development and Design Foundations with HTML5" by Terry Felke-Morris.

7. "E-commerce Website Optimization: Why 95% of Your Website Visitors Don't Buy, and What
You Can Do About It" by Dan Croxen-John and Johann Van Tonder.

11.2 web references:


➢ https://www.shopify.com/university

➢ https://www.geeksforgeeks.org/java

➢ https://developers.google.com/web/fundamentals

➢ https://docs.woocommerce.com/

127
The Report is Generated by DrillBit Plagiarism Detection Software

Submission Information

Author Name Mufeed.M,Aswanth bb


Title Smart Electricals
Paper/Submission ID 1720175
Submitted by simslibrarianmng@gmail.com
Submission Date 2024-04-30 12:55:13
Total Pages 46
Document type Project Work

Result Information

Similarity 17 %
1 10 20 30 40 50 60 70 80 90

Sources Type Report Content


Student
Paper
3.83% Quotes
2.16%
Internet
8.93% Words <
Journal/ 14,
Publicatio 3.68%
n 4.24%

Exclude Information Database Selection

Quotes Not Excluded Language English


References/Bibliography Excluded Student Papers Yes
Sources: Less than 14 Words % Not Excluded Journals & publishers Yes
Excluded Source 0% Internet or Web Yes
Excluded Phrases Not Excluded Institution Repository Yes

A Unique QR Code use to View/Download/Share Pdf File


DrillBit Similarity Report

A-Satisfactory (0-10%)
B-Upgrade (11-40%)

17 31 B C-Poor (41-60%)
D-Unacceptable (61-100%)
SIMILARITY % MATCHED SOURCES GRADE

LOCATION MATCHED DOMAIN % SOURCE TYPE

1 uou.ac.in Publication
2

2 vdocuments.mx Internet Data


2

3 qdoc.tips Internet Data


2

4 Submitted to Visvesvaraya Technological University, Belagavi Student Paper


2

5 pt.slideshare.net Internet Data


1

6 mscw.ac.in Publication
1

7 Reverse Nearest Neighbors in Unsupervised Distance Based Outlier Student Paper


1
Detection -Submited to JNTUH,Telangana By '15L01D5814'

8 Submitted to Visvesvaraya Technological University, Belagavi Student Paper


1

9 ideasai.com Internet Data


1

10 Submitted to Visvesvaraya Technological University, Belagavi Student Paper


1

11 moam.info Internet Data


1

12 qdoc.tips Internet Data


<1

13 moam.info Internet Data


<1

14 omologist.com Internet Data


<1
15 Thesis Submitted to Shodhganga Repository Publication
<1

16 Integrated modeling of distributed object-oriented systems by Dori-1994 Publication


<1

17 index-of.es Publication
<1

18 docplayer.net Internet Data


<1

19 Submitted to Visvesvaraya Technological University, Belagavi Student Paper


<1

20 docplayer.net Internet Data


<1

21 pdf4pro.com Internet Data


<1

22 Can MOOCs reduce global inequality in education by Pollac-2018 Publication


<1

23 docplayer.net Internet Data


<1

24 moam.info Internet Data


<1

25 www.periyaruniversity.ac.in Publication
<1

26 www.qaonlinetraining.com Internet Data


<1

27 appliedmechanics.asmedigitalcollection.asme.org Internet Data


<1

28 cambridge.org Internet Data


<1

29 docplayer.gr Internet Data


<1

30 restcleanly.com.au Internet Data


<1

31 Submitted to Visvesvaraya Technological University, Belagavi Student Paper


<1

You might also like