Professional Documents
Culture Documents
Final For Aswanth
Final For Aswanth
Smart Electricals
Submitted to Srinivas University on partial Completion of Sixth Semester
VI Semester BCA
CERTIFICATE
This is to certify that the project work entitled
“……………………………………………………………………………………………
.……..…………………………………………………………….” carried out by
Mr./Ms………………………………………………...……………
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 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
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
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
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
SMART ELECTRICALS
1.2 Introduction
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.
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.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.
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
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
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.
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.
● 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.
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
• 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.
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
10
Fig 3.2: DFD for Admin
3.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
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.
13
3.4.1 ER Diagram
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.
15
Table Name: Product
Description: This table is used to store product details
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
17
Table Name: Customer(user)
Description: This table is used to store the customer(user) details.
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.
• Admin
• Customer
19
5.3.1 STRUCTURE CHART FOR ADMIN
4.4.1 ADMIN
4.4.2
a) LOGIN:
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:
c) MANAGE PRODUCTS
• Input: `pid`, `pname`, `pimage`, `pprice`, `pdesc`, `postdate`, `poststatus`,
`uid`, `cid`
• Procedural details:
d) MANAGE CUSTOMER
• Input: `uid`, `uname`, `uemail`, `upassword`, `ugender`, `uaddress`
• Procedural details:
22
Figure 4.7 procedural details of View Customer
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:
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:
b) LOGIN
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
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:
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;
$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);
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'];
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"> -->
<body style="overflow:hidden">
</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"> -->
<body>
</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"> -->
<body>
<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 -->
</div>
</div>
</div>
<!-- End Product Section -->
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 & 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>
.</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 -->
</div>
</div>
</div>
</div>
</div>
<!-- End Popular Product -->
46
<!-- Start Testimonial Slider -->
<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"> -->
<body>
47
<!-- Start Header/Navigation -->
<?php include 'navbar.php' ?>
<!-- End Header/Navigation -->
.</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 -->
<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"> -->
<body>
</div>
</div>
</div>
</div>
<!-- End Hero Section -->
<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">−</button>
<?php }else{ ?>
<button class="btn btn-outline-black decrease" id="myButton"
style="cursor: not-allowed" type="button">−</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">+</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">
<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>
<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"> -->
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 .icon {
display: inline-block;
width: 40px;
height: 40px;
line-height: 40px;
position: relative;
border-radius: 100%;
background: #ddd
57
}
.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>
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`");
</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)) {
?>
<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') {
?>
<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 -->
}
</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"> -->
/* 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>
</div>
</div>
</div>
</div>
<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="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 -->
<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"> -->
<body style="overflow:hidden">
<div class="block">
<div class="row justify-content-center">
<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>
<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')
</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"> -->
<body>
</div>
</div>
72
</div>
</div>
<!-- End Hero Section -->
<?php
$stmt=$admin->ret("SELECT * FROM `product`");
while($row=$stmt->fetch(PDO::FETCH_ASSOC)){
?>
<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>
<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"> -->
<body>
</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">
<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>
</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']);
?></td>
<?php } ?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- content-wrapper ends -->
<!-- partial:partials/_footer.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>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- content-wrapper ends -->
<!-- partial:partials/_footer.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>
</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>
<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 -->
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>
</div>
</div>
<!-- content-wrapper ends -->
<!-- partial:partials/_footer.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-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="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 -->
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'];
<?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">−</button>
<?php }else{ ?>
<button class="btn btn-outline-black decrease" id="myButton"
style="cursor: not-allowed" type="button">−</button>
<?php } ?>
</div>
</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">
<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 -->
</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>
</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>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- content-wrapper ends -->
<!-- partial:partials/_footer.html -->
window.addEventListener('load', function () {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName('needs-validation')
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>
<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>
</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 -->
$('#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>');
});
$('#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')
</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.
➢ 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.
➢ 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.
➢ 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.
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.
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."
5 If a valid username and password are entered. The system displays the Admin Successful
page.
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."
5 If a valid email and password are "The system displays the Successful
entered. profile page."
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.
114
8. USER INTERFACE
ScreenShots
Admin Dashboard:
115
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:
121
Feedback 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.
• 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:
126
11.BIBLIOGRAPHY
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.
5. "Designing E-commerce Websites: 25 Examples You Can Learn From" by Vailancio Rodrigues.
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.
➢ 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
Result Information
Similarity 17 %
1 10 20 30 40 50 60 70 80 90
A-Satisfactory (0-10%)
B-Upgrade (11-40%)
17 31 B C-Poor (41-60%)
D-Unacceptable (61-100%)
SIMILARITY % MATCHED SOURCES GRADE
1 uou.ac.in Publication
2
6 mscw.ac.in Publication
1
17 index-of.es Publication
<1
25 www.periyaruniversity.ac.in Publication
<1