Principles of Management
Supermarket Management System
Name
Institutional Affiliation
Course code
Date
Supermarket Management System
Home Page
The homepage will be the central hub for the supermarket Management System. It will provide a comprehensive view of the available data as well as a quick and vital access to all essential system functionalities. Since it will specifically be tailored for supermarket's needs, it will offer a user interface that is designed to streamline day to day operations. The home page will as well facilitate an efficient management. Key features will include;
a. Real-time sales overview: In this case, the home page will feature a real time overview of current sales metrics, popular items, and what is still available in the supermarket.
b. Admin Login: This module will provide an interface from which the system admin will be able to log into the system and perform numerous functions.
c. Home: This module will give an overall overview of the total earnings and profits for a specified period.
d. Settings: The admin will be able to change his/her password using this module. Unwanted accounts will also be deleted through this module.
e. Transactions: This module will provide details of the products that have been transacted over a certain period.
f. +Product: The admin can view all products available through this module. It also allows the admin to add new products into the database
g. +Employee: New employee details are added through this module. The module also offers room to edit the employee details and view all the available employees.
h. +Supplier: This module ensures that new supplier details are added into the system. Supplier details can also be edited through the same module. A list of the available suppliers can also be availed through this module.
i. +Customer: This module ensures that new customer details are added into the system. Customer's details can also be edited through the same module. A list of the available customers can also be availed through this module.
j. +promo: Any available promotion is added through this module. It specifically shows the discounted products.
k. +Dept: New departments as well as their managers and names are added into the system through this module.
Introduction
The system in question will be a web-based Supermarket Management System that specifically uses php as the main programing language. The project has a number of features which will ensure that supermarkets interact with their customers and employees in a more efficient manner. The system will also ensure that supermarkets deal with product related operations and other transactions.
In a nutshell, the Supermarket Management System is a software that will focus on streamlining and optimizing intricate operations for a modern supermarket. Therefore, this documentation will serve as a guide for understanding, implementation, and utilization of the features and functionalities of the system. The primary goal of the system will be addressing the challenges that are prevalent in the traditional supermarket design. Such challenges will be addressed by amalgamating various system features into a user-friendly and unified platform.
Since the system seeks to enhance employee management and customer interactions, it ultimately leads to operational efficiency and customer satisfaction.
Problem Statement.
In their operations, supermarkets are characterized with frequent deliveries and supply. Operations in this type of setting are associated with high customer and employee turnover and large amounts of orders. Some supermarkets have been managing large amounts of data manually. However, it’s usually difficult to adapt to new trends as such data and requirements evolve with time. Basically, owing to the realization of standardized data, supermarkets have been adopting automatic management systems that can better manage their operations. Therefore, the proposed system, which realizes classification of goods and services, order or transaction information, and the recording of customers and employees, will ensure that transition from manual operations to an automated system is achieved. Besides analysing orders to aid in decision making, there is also need to significantly reduce the workload for supermarket attendants.
Moreover, with the rapid development in data science, computer technology has become evident in all business fields. As a result, modern technology has become a necessary tool for these fields.
As earlier mentioned, there are huge amounts of data in supermarkets that awaits processing. Therefore, the use of a database in a supermarket setting is inevitably urgent. According to research, supermarkets that rely on manual processing are falling behind those which have automated their operations.
Lastly, disparate and inefficient management of sales, employees, products, and customer data within the supermarket setting has resulted to numerous challenges. Such challenges include incomplete employee records, poor inventory control, and lack of personalized customer service. Such challenges have necessitated the need for an integrated supermarket management system to enhance employee management, streamline sales transactions, and optimize customer interactions.
Within the current supermarket setting, the absence of a centralized and cohesive system for managing operations and other vital functions has resulted to significant inefficiencies. Furthermore, sales and other supermarket operations are managed using disconnected systems which can only be addressed by an automated system.
Technologies Used for Implementation
The Supermarket Management System will be implemented using a number of technologies. These technologies will work together to create a functional and cohesive system.
a. PHP (Hypertext Pre-processor). This technology will serve as the primary server-side scripting language. It will be responsible for handling the overall server-side logic, dynamic content generation, and database interactions.
b. HTML (Hypertext Mark-up Language) and JavaScript: Html will form the backbone for structuring the web pages. On the other hand, JavaScript will provide system interactivity thus improving user experience.
c. Database: The system will integrate an SQL (Structured query Language) database that will store and manage product, employee, supplier, customer, transaction, promotion, and department details.
d. Xampp Server: This server will serve as the local host (development environment) thus providing a handful services such as managing the database, running the PHP server, and testing the supermarket Management System.
e. CSS (Cascading Style Sheets): Css will enhance the visual layout of the web application.
Code
Add customer.php
<?php
require_once("include/header.php");
?>
<div id="body">
<?php include_once("include/left_content.php"); ?>
<div class="rcontent">
<h1><span>Customer Details:</span></h1>
<div id="data">To view list of customers <a style="text-decoration:none" href="viewlist.php?list=customer">Click Here</a><br /><br />
<?php
if(isset($_GET['success'])){
$result=mysql_query("INSERT INTO customer VALUES(NULL,'{$_POST['fname']}','{$_POST['lname']}','{$_POST['cjoindate']}',{$_POST['cmoneyspent']},'{$_POST['caddress']}',{$_POST['cmoney_spent_reset']},{$_POST['cphone']})");
if(!$result)echo "Addition not successful";
else echo"Addition of customer data successful";
}
else{
$time = date("Y-m-d");
echo "<form method='post' action='addcustomer.php?success=1'>
<table>
<tr><td style='padding:5px'>First Name: </td><td><input name='fname' type='text' /></td></tr>
<tr><td style='padding:5px'>Last Name: </td><td><input name='lname' type='text' /></td></tr>
<tr><td style='padding:5px'>Address: </td><td><input name='caddress' type='text' /></td></tr>
<input name='cjoindate' type='hidden' value='{$time}' />
<input name='cmoneyspent' type='hidden' value='0'/>
<input type='hidden' name='cmoney_spent_reset' value='0' />
<tr><td style='padding:5px'>Phone no.</td><td><input type='text' placeholder='+91..' name='cphone' /></td></tr>
<tr><td colspan='2'><input type='submit' value='submit' /></td></tr>
</table></form>";
}
?>
</div>
</div>
</div>
<!-- body ends -->
<?php
require_once("include/footer.php");
?>
Adddept.php
<?php
require_once("include/header.php");
?>
<div id="body">
<?php include_once("include/left_content.php"); ?>
<div class="rcontent">
<h1><span>Add Department:</span></h1>
<div id="data">To view list of departments <a style="text-decoration:none" href="viewlist.php?list=dept">Click Here</a><br /><br />
<?php
if(isset($_GET['success'])){
$result=mysql_query("INSERT INTO department VALUES('{$_POST['mid']}',NULL,'{$_POST['dname']}','{$_POST['doj']}')");
if(!$result)echo "Addition not successful";
else echo"Addition of Department data successful";
}
else{
$time = date("Y-m-d");
echo "<form method='post' action='adddept.php?success=1'>
<table>
<tr><td style='padding:5px'>Dept Name: </td><td><input name='dname' type='text' /></td></tr>
<tr><td style='padding:5px'>Manager: </td>
<td><select name='mid'><option value='NULL'>NULL</option>";
$manager_set = mysql_query("select id, first_name, last_name from employee where admin='1' and dept_id='0'");
while($row = mysql_fetch_array($manager_set))
echo "<option value='{$row['id']}'>{$row['first_name']} {$row['last_name']}</option>";
echo"</select></td>
</tr>
<tr><td style='padding:5px' colspan='2'><input type='hidden' name='doj' value='{$time}' />
<input type='submit' value='submit' /></td></tr>
</table></form>";
}
?>
</div>
</div>
</div>
<!-- body ends -->
<?php
require_once("include/footer.php");
?>
addemp.php
<?php
require_once("include/header.php");
?>
<div id="body">
<?php include_once("include/left_content.php"); ?>
<div class="rcontent">
<h1><span>Add Employee:</span></h1>
<div id="data">To view list of employees <a style="text-decoration:none" href="viewlist.php?list=employee">Click Here</a><br /><br />
<?php
if(isset($_GET['third'])&&isset($_POST['user'])){
$user_result=mysql_query("INSERT INTO login VALUES('{$_POST['user']}',md5('{$_POST['password']}'),NULL,{$_POST['admin']})");
if(!$user_result){
echo "Addition not successful".mysql_error();
//header("Location:addemp.php");
}
else echo"Addition of employee user data successful";
}
else if(isset($_GET['third'])) echo "You are not supposed to visit this page. Please go <a href='addemp.php'>back</a>";
//second page
if(isset($_GET['second'])&&isset($_POST['fname'])){
$result = mysql_query("INSERT INTO employee VALUES('{$_POST['fname']}','{$_POST['lname']}',NULL,'{$_POST['dept_id']}',{$_POST['salary']},{$_POST['pnum']},'{$_POST['address']}',{$_POST['uid']},'{$_POST['jdate']}','{$_POST['bdate']}','{$_POST['edate']}',{$_POST['perks']},{$_POST['admin']})");
//page 2 form
$empidset = mysql_query("SELECT id FROM employee where uid='{$_POST['uid']}'");
$empid=mysql_fetch_array($empidset);
echo"<form method='post' action='addemp.php?third=1'>
<table>
<tr><td style='padding:5px'>Username:</td>
<td><input type='text' name='user' /></td></tr>
<tr><td style='padding:5px'>Password:</td>
<td><input type='password' name='password' /></td></tr>
<input type='hidden' name='admin' value='{$_POST['admin']}' />
<input type='hidden' name='id' value='{$empid[0]}' />
<tr><td colspan='2' style='padding:5px'><input type='submit' value='submit' /></td></tr>
</table>
</form>";
if(!$result)echo "Addition not successful";
else echo"Addition of employee data successful";
}
else if(isset($_GET['second'])) echo "You are not supposed to visit this page. Please go <a href='addemp.php'>back</a>";
else {
$time = date("Y-m-d");
echo"<form method='post' action='addemp.php?second=1'>
<table>
<tr><td style='padding:5px'>First Name:</td>
<td><input type='text' name='fname' /></td></tr>
<tr><td style='padding:5px'>Last Name:</td>
<td><input type='text' name='lname' /></td></tr>
<tr><td style='padding:5px'>Dept: </td>
<td><input list='depts' name='dept_id' placeholder='0' value='NULL'><datalist id='depts'>";
$dept_set = mysql_query("select dept_id, dept_name from department where manager_id='0'");
while($row = mysql_fetch_array($dept_set))
echo "<option value='{$row['dept_id']}'>{$row['dept_name']}</option>";
echo"</datalist>
</td></tr>
<tr><td style='padding:5px'>Salary</td>
<td><input type='text' name='salary' /></td></tr>
<tr><td style='padding:5px'>Phone No.</td>
<td><input type='text' placeholder='+91..' name='pnum' /></td></tr>
<tr><td style='padding:5px'>Address</td>
<td><input type='text' name='address' /></td></tr>
<tr><td style='padding:5px'>Uid</td>
<td><input type='text' name='uid' /></td></tr>
<tr><td style='padding:5px'>Dob</td>
<td><input type='text' name='bdate' placeholder='YYYY-MM-DD' /></td></tr>
<input type='hidden' name='jdate' value='{$time}' />
<input type='hidden' name='edate' value='0000-00-00' />
<input type='hidden' name='perks' value='0'/>
<tr><td style='padding:5px'>Admin</td><td><select name='admin'>
<option value='1'>Admin</option>
<option value='0'>Not Admin</option>
</select></td></tr>
<tr><td colspan='2'><input type='submit' name='submit' value='Submit' /></td></tr>
</table></form>";
}
?>
</div>
</div>
</div>
<!-- body ends -->
<?php
require_once("include/footer.php");
?>
addproduct.php
<?php
require_once("include/header.php");
?>
<div id="body">
<?php include_once("include/left_content.php"); ?>
<div class="rcontent">
<h1><span>Add Product</span></h1>
<div id="data">To view list of products <a style="text-decoration:none" href="viewlist.php?list=product">Click Here</a><br /><br />
<?php
if(isset($_GET['success'])){
$result=mysql_query("INSERT INTO product VALUES(NULL,{$_POST['cprice']},{$_POST['supplier']},'{$_POST['product_name']}',{$_POST['quantity']},'{$_POST['product_type']}',{$_POST['mprice']})");
if(!$result)echo "Addition not successful ".mysql_error();
else echo"Addition of product data successful";
}
else{
echo "<form method='post' action='addproduct.php?success=1'>
<table>
<tr><td style='padding:5px'>Product Name: </td><td><input name='product_name' type='text' /></td></tr>
<tr><td style='padding:5px'>Product type: </td>
<td><select name='product_type'>";
$dept_set = mysql_query("select dept_id, dept_name from department");
while($row = mysql_fetch_array($dept_set))
echo "<option value='{$row['dept_id']}'>{$row['dept_name']}</option>";
echo"</select>
</td></tr>
<tr><td style='padding:5px'>Supplier ID: </td>
<td><select name='supplier'>";
$supplier_set = mysql_query("select sid, sname from supplier");
while($row = mysql_fetch_array($supplier_set))
echo "<option value='{$row['sid']}'>{$row['sname']}</option>";
echo"</select></td></tr>
<tr><td style='padding:5px'>Quantity: </td><td><input name='quantity' type='text' /></td></tr>
<tr><td style='padding:5px'>Market Price: </td><td><input name='mprice' type='text' /></td></tr>
<tr><td style='padding:5px'>Cost Price: </td><td><input name='cprice' type='text' /></td></tr>
<tr><td style='padding:5px' colspan='2'><input type='submit' value='submit' /></td></tr>
</table></form>";
}
?>
</div>
</div>
</div>
<!-- body ends -->
<?php
require_once("include/footer.php");
?>
addpromo.php
<?php
require_once("include/header.php");
?>
<div id="body">
<?php include_once("include/left_content.php"); ?>
<div class="rcontent">
<h1><span>Add Promo:</span></h1>
<div id="data">To view list of promos <a style="text-decoration:none" href="viewlist.php?list=promo">Click Here</a><br /><br />
<?php
if(isset($_GET['success'])){
$date = date($_POST['valid']);
$time = date("y-m-d");
if($date>$time){
$result=mysql_query("INSERT INTO promotion VALUES({$_POST['discount']},'{$_POST['valid']}',NULL,'')");
if(!$result)echo "Addition not successful ".mysql_error();
else echo"Addition of promo data successful";
}else echo "date error";
}
else{
echo "<form method='post' action='addpromo.php?success=1'><table>
<tr><td style='padding:5px'>Discount:</td><td><input type='text' placeholder='%' name='discount' /></td></tr>
<tr><td style='padding:5px'>Valid Upto:</td><td><input type='text' name='valid' /></td></tr>
<tr><td style='padding:5px' colspan='2'><input type='submit' value='submit' /></td></tr>
</table></form>";
}
?>
</div>
</div>
</div>
<!-- body ends -->
<?php
require_once("include/footer.php");
?>
addsupplier.php
<?php
require_once("include/header.php");
?>
<div id="body">
<?php include_once("include/left_content.php"); ?>
<div class="rcontent">
<h1><span>Add Promo:</span></h1>
<div id="data">To view list of promos <a style="text-decoration:none" href="viewlist.php?list=promo">Click Here</a><br /><br />
<?php
if(isset($_GET['success'])){
$date = date($_POST['valid']);
$time = date("y-m-d");
if($date>$time){
$result=mysql_query("INSERT INTO promotion VALUES({$_POST['discount']},'{$_POST['valid']}',NULL,'')");
if(!$result)echo "Addition not successful ".mysql_error();
else echo"Addition of promo data successful";
}else echo "date error";
}
else{
echo "<form method='post' action='addpromo.php?success=1'><table>
<tr><td style='padding:5px'>Discount:</td><td><input type='text' placeholder='%' name='discount' /></td></tr>
<tr><td style='padding:5px'>Valid Upto:</td><td><input type='text' name='valid' /></td></tr>
<tr><td style='padding:5px' colspan='2'><input type='submit' value='submit' /></td></tr>
</table></form>";
}
?>
</div>
</div>
</div>
<!-- body ends -->
<?php
require_once("include/footer.php");
?>
Input and output Screens
There are several input and output screens which include the following:
Admin login:
Accepts admin credentials and logs him in after authentication.
Transaction:
Allows input for product details (product id, product Name, quantity.
Product:
Allows input for product (name, type, supplier id, quantity, marked price, and cost price)
Employee:
Allows admin to input employee first name, last name, department, salary, phone number, address, and user Id.
Supplier:
The input required in this case include supplier (name, Address, phone, email, and department.
Customer:
Accepts inputs for (first name, last name, address, and phone)
Input screen
Output screen
Promo:
Inputs the discount rate and validity date and shows an output of the same.
Department:
Allows input and outputs the department name and manager.