Professional Documents
Culture Documents
Ghazala Final
Ghazala Final
A
DBMS Laboratory Mini Project Report On
SUBMITTED BY
GHAZALA JAMAL(1JB20CS032)
VINAYA CHOWDHARY(1JB20CS026)
We would also like to express our profound thanks to Revered Sri Sri Dr. .Prakashnath
Swamiji, Managing Director, SJB Institute of Technology, for his continuous support in providing
amenities to carry out this mini project in this admired institution.
We express our gratitude to Dr. K.V. Mahendra Prashanth, Principal, SJB Institute of
Technology, for providing us excellent facilities and academic ambience; which have helped us in
satisfactory completion of mini project work.
We extend our sincere thanks to Dr. Krishna A.N, Head of the Department, COMPUTER
SCIENCE AND ENGINEERING; for providing us invaluable support throughout the period of mini
project work.
We wish to express heartfelt gratitude to our guide, , Dr. Bindiya MK and Associate Professor ,
Mrs. Rajatha and Assistant Professor , for her valuable guidance, suggestions and
cheerful encouragement during the entire period of this work.
Finally, We take this opportunity to extend our earnest gratitude and respect to our parents,
Teaching & Non-teaching staff of the department, the library staff and all our friends, who have
directly or indirectly supported us during the period of this mini project work.
Regards,
Ghazala Jamal (1JB20CS032)
Vinaya Chaudhary(1JB20CS026)
i
ABSTRACT
The Project Supermarket Management System deals with the automation of supermarket. It
includes both sales and purchase of items. The project Supermarket Management System is
developed with the objective of making the system reliable, easier, fast, and more informative.
There is a lot of reason for the introduction of this project. In the manual System, there are
number of inefficiencies that a salesperson faces. Large records-books have to be maintained
where relevant and irrelevant information has to be stored which is very untidy and clumsy
process. But our System reduces paper works. On the other hand, there are many inherent
problems that exist in any manual system. Usually, they lack efficiency. Less efficiency has a
great impact on the productivity of any human being keeping the data up to date.
The different modules included in our project are administrative module, cart module, products
module, user info module and orders module. Each customer can login with the help of his/her
unique id and password. Products and Orders module contains all the purchase and sales
details. All the payment details will be shown in the Cart module.
II
TABLE OF CONTENTS
Acknowledgment I
Abstract II
List of Figures V
List of Tables VI
Chapter 1
Introduction
Chapter 2
Literature Survey
Chapter 3
System Requirements
III
Chapter 4
System Design
Chapter 5
Implementation
Chapter 6
Snapshots
Conclusion ..........................................................................................................................39
References ........................................................................................................................... 39
IV
LIST OF FIGURES
V
LIST OF TABLES
VI
CHAPTER-1
INTRODUCTION
1.1 Introduction
Supermarket billing System is the Simple grocery ordering solution. It's a full-featured website and
cart system that bends over backwards to give you the flexibility you need to run your online store.
The basic concept of the application is to allow the customer to grocery virtually using the Internet
and allow customers to buy the grocery items of their desire from the store. The details of the items
are brought forward from the database for the customer view based on the selection through the
menu and the database of all the products are updated at the end of each transaction.
1.3 Scope
Automation reduces the need for paper, which inevitably ends up taking up space that can be
occupied with technology. By using software that accelerates productivity up to 50%, online stores
or rather ecommerce stores can improve customer service since they will be able to resolve issues
at a faster pace. This also has led to few emerging forms of digital banking such as
1
CHAPTER-2
LITERATURE SURVEY
Simple
Matched existing business processes and functions
Companies were not as interested in funding complicated information systems
Initially low-cost
Early computing was not viewed as beneficial for large funding
Systems were designed to be cheap in order to save on cost
Cons:
2
SUPERMARKET DATABASE SYSTEM LITERARY SURVEY
Separated ownership
Business functions had a high sense of data ownership
Departments unwilling to share data for fear of minimizing their superiority
Unmanaged redundancy
Multiple instances of the same data appeared throughout various files, systems, and
Databases
Information updated in one place was not replicated to the other locations
Disk space was very expensive, and redundancy had a big impact on storage
Data inconsistency
Redundant data stored in various locations was usually never stored the same way
Formatting was not centrally managed
Lack of data sharing
Same data stored in multiple locations
Caused unnecessary doubling of efforts for processing and managing data
High costs in the long run
Hiring data processors for each department was very expensive, and each position was
typically working on the same thing just for a different area
Doubling of work as well as excessive maintenance costs.
For all of these reasons, traditional databases are. unable to deliver results in a rapidly growing
environment where the workload is geographically distributed across heterogeneous data centers.
Upgrading to a more distributed data model is costly and complicated and your DBAs cannot just
sit back and give up on this situation. Hence, due to these various reasons, the downfall of the
traditional system was inevitable.
• Users: Users may be of any kind, such as data base administrators, system developers or database
users.
Technologies Used:
Connection/Controller: PHP
7
CHAPTER 8
SYSTEM DESIGN
8
SUPERMARKET DATABASE SYSTEM SYSTEM DESIGN
IMPLEMENTATION
5.1 HTML 5
HTML5 is a mark up language used for structuring and presenting content on the World Wide
Web. It is the fifth and current major version of the HTML standard.
It was published in October 2014 by the World Wide Web Consortium (W3C) to improve the
language with support for the latest multimedia, while keeping it both easily readable by humans
and consistently understood by computers and devices such as web browsers, parsers, etc.HTML5
is intended to subsume not only HTML 4, but also XHTML 1 and DOM Level 2 HTML.
HTML5 includes detailed processing models to encourage more interoperable implementations; it
extends, improves and rationalizes the mark up available for documents, and introduces mark up
and application programming interfaces (APIs) for complex web applications. Many new syntactic
features are included. To natively include and handle multimedia and graphical content, the new
<video>, <audio> and <canvas> elements were added, and support for scalable vector graphics
(SVG) content and MathML for mathematical formulas. To enrich the semantic content of
documents, new page structure elements such as<main>, <section>, <article>, <header>, <footer>,
<aside>, <nav> and <figure>, are added. New attributes are introduced, some elements and
attributes have been removed, and others such as <a>, <cite> and<menu> have been changed,
redefined or standardized.
The APIs and Document Object Model (DOM) are now fundamental parts of the HTML5
specification and HTML5 also better defines the processing for, any invalid documents.
5.2 PHP
PHP is a servlet-side scripting language designed primarily for web development but also used as a
general-purpose programming language. Originally created by Rasmus Lerdorf in I994, the PHP
reference implementation is now produced by The PHP Development Team. PHP originally stood
for Personal Home Page, but it now stands for the recursive acronym PHP: Hypertext Pre-processor.
PHP code may be embedded into HTML or HTML5 markup, or it can be used in combination with
various web template systems, web content management systems and web frameworks. PHP code
is usually processed by a PHP interpreter implemented as a module in the web server or as a
Common Gateway interface (CGI) executable. PHP code may also be executed with a command-
line interface (CLI) and can be used to implement standalone graphical applications.
10
SUPERMARKET DATABASE SYSTEM IMPLEMENTATION
The standard PHP interpreter, powered by the Zend Engine, is free software released under the PHP
License. PHP has been widely ported and can be deployed on most web servers on almost every
operating system and platform, free of charge.
The PHP language evolved without a written formal specification or standard until 2014, leaving
the canonical PHP interpreter as a de facto standard. Since 2014 work has gone on to create a formal
PHP specification. PHP is a scripting language that helps people make web pages more interactive
by allowing them to do more things.
A website programmed with PHP can have pages that are password protected. A website with no
programming cannot do this without other complex things. Standard PHP file extensions are: php,
php3or, HTML, but a web server can be set up to use any extension.
$username = "root";
$password = "";
$db = "SUPERMARKET"
if (!$con) {
} ?>
include "db.php";
session_start();
#If user given credential matches successfully with the data available in database then we will echo
string login_success
$email = mysqli_real_escape_string($con,$_POST["email"]);
$password = md5($_POST["password"]);
password = '$password'";
$run_query = mysqli_query($con,$sql);
$count = mysqli_num_rows($run_query);
//if user record is available in database then $count will be equal to 1 if($count == 1){
$row = mysqli_fetch_array($run_query);
$_SESSION["uid"] = $row["user_id"];
V SEM, Dept. of CSE, 2022 – 23 12
SJBIT
SUPERMARKET DATABASE SYSTEM IMPLEMENTATION
$_SESSION["name"] = $row["first_name"];
$ip_add = getenv("REMOTE_ADDR");
if (isset($_COOKIE["product_list"])) {
$p_list = stripcslashes($_COOKIE["product_list"]);
$product_list = json_decode($p_list,true);
//After getting user id from database here we are checking user cart item if there is already product
is listed or not
p_id = ".$product_list[$i];
$result = mysqli_query($con,$verify_cart);
//if user is adding first time product into cart we will update user_id into database table with valid
id
$update_cart = "UPDATE cart SET user_id = '$_SESSION[uid]' WHERE ip_add = '$ip_add' AND
user_id = -1";
mysqli_query($con,$update_cart);
}else{
//if already that product is available into database table we will delete that record
mysqli_query($con,$delete_existing_product);
setcookie("product_list","",strtotime("-1 day"),"/");
//if user is logging from after cart page we will send cart_login echo "cart_login";
exit();
}
V SEM, Dept. of CSE, 2022 – 23 13
SJBIT
SUPERMARKET DATABASE SYSTEM IMPLEMENTATION
//if user is login from page we will send login_success echo "login_success";
exit();
}else{
exit();
?>
?>
<!DOCTYPE html>
<html>
<body>
<head>
</head>
<meta charset="UTF-8">
<title>SUPERMARKET</title>
<script src="js/jquery2.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="main.js"></script>
<div class="loader"></div>
</div>
<div class="container-fluid">
<div class="navbar-header">
brand">SUPERMARKET</a>
</div>
<li><a href="index.php"><span
class="glyphicon glyphicon-home"></span>Home</a></li>
</ul>
</div>
</div>
<p><br/></p>
<p><br/></p>
<p><br/></p>
<div class="container-fluid">
<div class="row">
<div class="col-md-2"></div>
</div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4">
<div class="panel-body">
<label for="email">Email</label>
</form></div>
</div></div>
<div class="col-md-4"></div>
</div>
</body>
</html>
if (isset($_POST["f_name"])) {
$f_name = $_POST["f_name"];
$l_name = $_POST["l_name"];
$email = $_POST['email'];
$password = $_POST['password'];
$repassword = $_POST['repassword'];
z]{2,4})$/";
$mobile = $_POST['mobile'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$emailValidation = "/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9]+(\.[a-
$number = "/^[0-9]+$/";
empty($repassword) ||
</div>";
exit();
</div>";
exit();
</div>";
exit();
</div>";exit();}
if(strlen($password) < 9 ){
<b>Password is weak</b>
</div>";exit();}
if(strlen($repassword) < 9 ){
<b>Password is weak</b></div>";exit();}
if(!(strlen($mobile) == 10)){
$check_query = mysqli_query($con,$sql);
$count_email = mysqli_num_rows($check_query);
} else {
$password = md5($password);
$run_query = mysqli_query($con,$sql);
$_SESSION["uid"] = mysqli_insert_id($con);
$_SESSION["name"] = $f_name;
$ip_add = getenv("REMOTE_ADDR");
if(mysqli_query($con,$sql)){
echo "register_success";
exit();}}}
}?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>SUPERMARKET</title>
<script src="js/jquery2.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="main.js"></script>
</head>
<body>
<div class="loader"></div>
</div>
<div class="container-fluid">
<div class="navbar-header">
<span class="sr-only">navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
</ul>
</div>
</div>
</div>
<p><br/></p>
<p><br/></p>
<p><br/></p>
<div class="container-fluid">
<div class="row">
<div class="col-md-2"></div>
<!--Cart Message-->
</div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<div class="panel-body">
<div class="row">
</div>
<div id="cart_checkout"></div>
<!--div class="row">
<div class="col-md-2">
<div class="btn-group">
</div>
</div>
</div> -->
<!--<div class="row">
<div class="col-md-8"></div>
<div class="col-md-4">
<b>Total Rs.500000</b>
</div-->
</div>
</div>
<div class="panel-footer"></div>
</div>
</div>
<div class="col-md-2"></div>
</div>
</body>
</html>
session_start();
include "db.php";
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>SUPERMARKET</title>
<script src="js/jquery2.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="main.js"></script>
<style>
#search{width:80%;}
#search_btn{width:30%;float:right;margin-top:-32px;margin-right:10px;}
</style>
</head>
<body>
<div class="container-fluid">
<div class="navbar-header">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<li style="width:300px;left:10px;top:10px;">
</form>
</ul>
<div class="panel-heading">
<div class="row">
</div>
</div>
<div class="panel-body">
<div id="cart_product">
</div>
</div>
<div class="panel-footer"></div>
</div>
</div>
</li>
<ul class="dropdown-menu">
<li class="divider"></li>
<li class="divider"></li>
<li class="divider"></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<p><br/></p>
<p><br/></p>
<p><br/></p>
<div class="container-fluid">
<div class="row">
<div class="col-md-1"></div>
<div class="col-md-2">
<div id="get_category">
</div>
<div id="get_brand">
</div>
</div>
<?php if (isset($_SESSION["uid"])) {
}else{
$query = mysqli_query($con,$sql);
if (mysqli_num_rows($query) > 0) {
//display user cart item with "Ready to checkout" button if user is not login
$n=0;$total=0;
while ($row=mysqli_fetch_array($query)) {
$n++;
$product_id = $row["product_id"];
$product_title = $row["product_title"];
$product_price = $row["product_price"];
$product_image = $row["product_image"];
$cart_item_id = $row["id"];
$qty = $row["qty"];
$uid=$_SESSION['uid'];
$sql=mysqli_query($con,$q);
if($sql)
$sql=mysqli_query($con,$q);
?>
$name=$_SESSION['eid'];
if($_REQUEST['log']=='out')
{ session_destroy(); header("location:index.php");
else if($name=="")
V SEM, Dept. of CSE, 2022 – 23 27
SJBIT
SUPERMARKET DATABASE SYSTEM IMPLEMENTATION
header("location:index.php");
?>
<head>
<style>
a{text-decoration:none}
a:hover{background-color:#FFFFFF}
</style>
</head>
<div style="width:100%;float:left">
<div style="width:86.25%;height:27%;float:right;background-color:#99CC00">
<div style="width:30%;height:10%;float:right">
<h5> </h5>
{this.value='search';}
"/>
<h5> </h5>
<!--</form>-->
</div>
<div style="width:50%;height:10%;float:right">
</div>
</div>
</div>
<div>
<div style="width:13.7%;height:100%;float:left;background-color:#99CC00">
<br />
Item</font></a><br/>
<br />
</a><br/><br/>
</div>
</div>
<?php switch($_REQUEST['con'])
case 'add':include("additem.php");
break;
case 'view':include("view.php");
break;
break;
break;
case 'ord':include("orders.php");
case 'fdbk':include("fdbk.php");
case 'hm':include("hm.php");
break;
</div>
</div>
</body>
</html>
if($_REQUEST['view'])
include("viewtable.php");
?>
SNAPSHOTS
32
SUPERMARKET DATABASE SYSTEM SNAPSHOTS
6.8 TABLES
39
REFERENCES
Database management systems, Ramakrishnan, and Gehrke, 3rd Edition, 2014, McGraw Hill.
https://www.w3schools.com/bootstrap/bootstrap_grid_examples.asp
https://www.w3schools.com/php/func_filesystem_link.asp
https://www.c-sharpcorner.com/UploadFile/63f5c2/triggers-in-sql-server/#:~:text=A%20SQL
%20trigger%20is%20a%20database%20object%20which%20fires%20when,insert%20in%20
a%20database%20table.
Wikipedia – https://www.wikipedia.org/triggers-database.
https://en.wikipedia.org/wiki/Database_trigger#:~:text=SQL%20allows%20triggers%20to%2
0fire,TABLE%20as%20the%20triggered%20action.
40