Вы находитесь на странице: 1из 29

A mini project on stock management system

Introduction:
 Stock Management System is software which is helpful for the
businesses operate stores, where store owner keeps the records of
purchase.
 This project eliminates the paperwork, human faults, manual delay and
speed up the process.
 Stock Management System will have the ability to track overall worth
and available stock.
 This is simple, fast and intelligent Stock management that can be used
by anyone who has a smartphone.
 Manual calculation of stock present in any store is time-consuming and
very risky.
 The workers cannot maintain the store when there is no owner as they
do not know the prices
 Overall worth of stock, products worth can be viewed by owner.
 Prices of stock present in the store can be seen so that worker can also
manage the stock without the presence of the owner.
 It doesn’t require manpower, so it is not expensive.
 Inventory management is an important aspect of any successful
business. It is the process of overseeing and controlling the flow of
inventory units a business uses in the production or manufacture of
goods for sale or distribution.
 Inventories are usually made up of a combination of goods, raw
materials and finished products, and effective management of these
items is essential to ensure optimal stock levels and to maximize the
earning potential of the company. It also allows a business to prevent
or mitigate any inventory-associated losses.
 Inventory management software is used by businesses for various
reasons: it can track the costs of inventory throughout the
manufacture and sales process, tell businesses when to replenish
stock, and allow them to track profits. It can also be used to forecast
inventory levels and prices, as well as expected product demand.
Modules:
 Dashboard
 Brand
 Category
 Product
 Order

Software/Hardware Requirement
Specification:

Server Side:

 512MB RAM or more.


 500MB free space in Hard Disk.
 Windows XP or higher version.
 Internet Connection

Minimum Client Requirement:

 512MB RAM or more


 Windows XP or any other Operating System
 Internet Connection
Coding:
Index.php:

?php

require_once 'php_action/db_connect.php';

session_start();

if(isset($_SESSION['userId'])) {

header('location: http://localhost/stock/dashboard.php');

$errors = array();

if($_POST) {

$username = $_POST['username'];

$password = $_POST['password'];

if(empty($username) || empty($password)) {

if($username == "") {

$errors[] = "Username is required";

}
if($password == "") {

$errors[] = "Password is required";

} else {

$sql = "SELECT * FROM users WHERE username =


'$username'";

$result = $connect->query($sql);

if($result->num_rows == 1) {

$password = md5($password);

// exists

$mainSql = "SELECT * FROM users WHERE username =


'$username' AND password = '$password'";

$mainResult = $connect->query($mainSql);

if($mainResult->num_rows == 1) {

$value = $mainResult->fetch_assoc();

$user_id = $value['user_id'];

// set session

$_SESSION['userId'] = $user_id;

header('location:
http://localhost/stock/dashboard.php');

} else{
$errors[] = "Incorrect username/password
combination";

} // /else

} else {

$errors[] = "Username doesnot exists";

} // /else

} // /else not empty username // password

} // /if $_POST

?>

<!DOCTYPE html>

<html>

<head>

<title>Stock Management System</title>

<!-- bootstrap -->

<link rel="stylesheet"
href="assests/bootstrap/css/bootstrap.min.css">

<!-- bootstrap theme-->

<link rel="stylesheet" href="assests/bootstrap/css/bootstrap-


theme.min.css">

<!-- font awesome -->


<link rel="stylesheet" href="assests/font-awesome/css/font-
awesome.min.css">

<!-- custom css -->

<link rel="stylesheet" href="custom/css/custom.css">

<!-- jquery -->

<script src="assests/jquery/jquery.min.js"></script>

<!-- jquery ui -->

<link rel="stylesheet" href="assests/jquery-ui/jquery-ui.min.css">

<script src="assests/jquery-ui/jquery-ui.min.js"></script>

<!-- bootstrap js -->

<script src="assests/bootstrap/js/bootstrap.min.js"></script>

</head>

<body>

<div class="container">

<div class="row vertical">

<div class="col-md-5 col-md-offset-4">

<div class="panel panel-info">

<div class="panel-heading">

<h3 class="panel-title">Please Sign


in</h3>

</div>
<div class="panel-body">

<div class="messages">

<?php if($errors) {

foreach ($errors as $key


=> $value) {

echo '<div
class="alert alert-warning" role="alert">

<i class="glyphicon
glyphicon-exclamation-sign"></i>

'.$value.'</div>';

} ?>

</div>

<form class="form-horizontal"
action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post"
id="loginForm">

<fieldset>

<div class="form-group">

<label
for="username" class="col-sm-2 control-label">Username</label>

<div class="col-sm-
10">

<input type="text"
class="form-control" id="username" name="username"
placeholder="Username" autocomplete="off" />

</div>
</div>

<div class="form-group">

<label
for="password" class="col-sm-2 control-label">Password</label>

<div class="col-sm-
10">

<input
type="password" class="form-control" id="password" name="password"
placeholder="Password" autocomplete="off" />

</div>

</div>

<div class="form-group">

<div class="col-sm-
offset-2 col-sm-10">

<button
type="submit" class="btn btn-default"> <i class="glyphicon glyphicon-
log-in"></i> Sign in</button>

</div>

</div>

</fieldset>

</form>

</div>

<!-- panel-body -->

</div>

<!-- /panel -->

</div>

<!-- /col-md-4 -->


</div>

<!-- /row -->

</div>

<!-- container -->

</body>

</html>

Dashboard.php:

<?php require_once 'includes/header.php'; ?>

<?php

$sql = "SELECT * FROM product WHERE status = 1";

$query = $connect->query($sql);

$countProduct = $query->num_rows;

$orderSql = "SELECT * FROM orders WHERE order_status = 1";

$orderQuery = $connect->query($orderSql);

$countOrder = $orderQuery->num_rows;

$totalRevenue = "";

while ($orderResult = $orderQuery->fetch_assoc()) {

$totalRevenue += $orderResult['paid'];
}

$lowStockSql = "SELECT * FROM product WHERE quantity <= 3 AND


status = 1";

$lowStockQuery = $connect->query($lowStockSql);

$countLowStock = $lowStockQuery->num_rows;

$connect->close();

?>

<style type="text/css">

.ui-datepicker-calendar {

display: none;

</style>

<!-- fullCalendar 2.2.5-->

<link rel="stylesheet"
href="assests/plugins/fullcalendar/fullcalendar.min.css">

<link rel="stylesheet"
href="assests/plugins/fullcalendar/fullcalendar.print.css" media="print">
<div class="row">

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

<div class="panel panel-success">

<div class="panel-heading">

<a href="product.php" style="text-


decoration:none;color:black;">

Total Product

<span class="badge pull pull-right"><?php


echo $countProduct; ?></span>

</a>

</div> <!--/panel-hdeaing-->

</div> <!--/panel-->

</div> <!--/col-md-4-->

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

<div class="panel panel-info">

<div class="panel-heading">

<a href="orders.php?o=manord" style="text-


decoration:none;color:black;">

Total Orders

<span class="badge pull pull-right"><?php


echo $countOrder; ?></span>
</a>

</div> <!--/panel-hdeaing-->

</div> <!--/panel-->

</div> <!--/col-md-4-->

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

<div class="panel panel-danger">

<div class="panel-heading">

<a href="product.php" style="text-


decoration:none;color:black;">

Low Stock

<span class="badge pull pull-right"><?php


echo $countLowStock; ?></span>

</a>

</div> <!--/panel-hdeaing-->

</div> <!--/panel-->

</div> <!--/col-md-4-->

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

<div class="card">

<div class="cardHeader">

<h1><?php echo date('d'); ?></h1>


</div>

<div class="cardContainer">

<p><?php echo date('l') .' '.date('d').', '.date('Y'); ?></p>

</div>

</div>

<br/>

<div class="card">

<div class="cardHeader" style="background-


color:#245580;">

<h1><?php if($totalRevenue) {

echo $totalRevenue;

} else {

echo '0';

} ?></h1>

</div>

<div class="cardContainer">

<p> <i class="glyphicon glyphicon-usd"></i> Total


Revenue</p>

</div>

</div>
</div>

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

<div class="panel panel-default">

<div class="panel-heading"> <i class="glyphicon


glyphicon-calendar"></i> Calendar</div>

<div class="panel-body">

<div id="calendar"></div>

</div>

</div>

</div>

</div> <!--/row-->

<!-- fullCalendar 2.2.5 -->

<script src="assests/plugins/moment/moment.min.js"></script>

<script src="assests/plugins/fullcalendar/fullcalendar.min.js"></script>

<script type="text/javascript">

$(function () {

// top bar active


$('#navDashboard').addClass('active');

//Date for the calendar events (dummy data)

var date = new Date();

var d = date.getDate(),

m = date.getMonth(),

y = date.getFullYear();

$('#calendar').fullCalendar({

header: {

left: '',

center: 'title'

},

buttonText: {

today: 'today',

month: 'month'

});

});

</script>
<?php require_once 'includes/footer.php'; ?>

Brand.php:

<?php require_once 'includes/header.php'; ?>

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

<ol class="breadcrumb">
<li><a href="dashboard.php">Home</a></li>
<li class="active">Brand</li>
</ol>

<div class="panel panel-default">


<div class="panel-heading">
<div class="page-heading"> <i class="glyphicon
glyphicon-edit"></i> Manage Brand</div>
</div> <!-- /panel-heading -->
<div class="panel-body">

<div class="remove-messages"></div>

<div class="div-action pull pull-right"


style="padding-bottom:20px;">
<button class="btn btn-default button1"
data-toggle="modal" data-target="#addBrandModel"> <i
class="glyphicon glyphicon-plus-sign"></i> Add Brand </button>
</div> <!-- /div-action -->

<table class="table" id="manageBrandTable">


<thead>
<tr>

<th>Brand Name</th>
<th>Status</th>
<th
style="width:15%;">Options</th>
</tr>
</thead>
</table>
<!-- /table -->

</div> <!-- /panel-body -->


</div> <!-- /panel -->
</div> <!-- /col-md-12 -->
</div> <!-- /row -->

<div class="modal fade" id="addBrandModel" tabindex="-1"


role="dialog">
<div class="modal-dialog">
<div class="modal-content">

<form class="form-horizontal" id="submitBrandForm"


action="php_action/createBrand.php" method="POST">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close"><span aria-
hidden="true">&times;</span></button>
<h4 class="modal-title"><i class="fa fa-plus"></i> Add
Brand</h4>
</div>
<div class="modal-body">

<div id="add-brand-messages"></div>

<div class="form-group">
<label for="brandName" class="col-sm-3 control-
label">Brand Name: </label>
<label class="col-sm-1 control-label">: </label>
<div class="col-sm-8">
<input type="text" class="form-control"
id="brandName" placeholder="Brand Name" name="brandName"
autocomplete="off">
</div>
</div> <!-- /form-group-->
<div class="form-group">
<label for="brandStatus" class="col-sm-3 control-
label">Status: </label>
<label class="col-sm-1 control-label">: </label>
<div class="col-sm-8">
<select class="form-control"
id="brandStatus" name="brandStatus">
<option value="">~~SELECT~~</option>
<option value="1">Available</option>
<option value="2">Not Available</option>
</select>
</div>
</div> <!-- /form-group-->

</div> <!-- /modal-body -->

<div class="modal-footer">
<button type="button" class="btn btn-default" data-
dismiss="modal">Close</button>

<button type="submit" class="btn btn-primary"


id="createBrandBtn" data-loading-text="Loading..."
autocomplete="off">Save Changes</button>
</div>
<!-- /modal-footer -->
</form>
<!-- /.form -->
</div>
<!-- /modal-content -->
</div>
<!-- /modal-dailog -->
</div>
<!-- / add modal -->

<!-- edit brand -->


<div class="modal fade" id="editBrandModel" tabindex="-1"
role="dialog">
<div class="modal-dialog">
<div class="modal-content">

<form class="form-horizontal" id="editBrandForm"


action="php_action/editBrand.php" method="POST">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close"><span aria-
hidden="true">&times;</span></button>
<h4 class="modal-title"><i class="fa fa-edit"></i> Edit
Brand</h4>
</div>
<div class="modal-body">

<div id="edit-brand-messages"></div>

<div class="modal-loading div-hide" style="width:50px;


margin:auto;padding-top:50px; padding-bottom:50px;">
<i class="fa fa-spinner fa-pulse fa-3x
fa-fw"></i>
<span class="sr-
only">Loading...</span>
</div>

<div class="edit-brand-result">
<div class="form-group">
<label for="editBrandName" class="col-sm-3 control-
label">Brand Name: </label>
<label class="col-sm-1 control-label">: </label>
<div class="col-sm-8">
<input type="text" class="form-control"
id="editBrandName" placeholder="Brand Name" name="editBrandName"
autocomplete="off">
</div>
</div> <!-- /form-group-->
<div class="form-group">
<label for="editBrandStatus" class="col-sm-3 control-
label">Status: </label>
<label class="col-sm-1 control-label">: </label>
<div class="col-sm-8">
<select class="form-control"
id="editBrandStatus" name="editBrandStatus">
<option
value="">~~SELECT~~</option>
<option
value="1">Available</option>
<option value="2">Not
Available</option>
</select>
</div>
</div> <!-- /form-group-->
</div>
<!-- /edit brand result -->

</div> <!-- /modal-body -->


<div class="modal-footer editBrandFooter">
<button type="button" class="btn btn-default" data-
dismiss="modal"> <i class="glyphicon glyphicon-remove-sign"></i>
Close</button>

<button type="submit" class="btn btn-success"


id="editBrandBtn" data-loading-text="Loading..." autocomplete="off"> <i
class="glyphicon glyphicon-ok-sign"></i> Save Changes</button>
</div>
<!-- /modal-footer -->
</form>
<!-- /.form -->
</div>
<!-- /modal-content -->
</div>
<!-- /modal-dailog -->
</div>
<!-- / add modal -->
<!-- /edit brand -->

<!-- remove brand -->


<div class="modal fade" tabindex="-1" role="dialog"
id="removeMemberModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-
label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"><i class="glyphicon glyphicon-trash"></i>
Remove Brand</h4>
</div>
<div class="modal-body">
<p>Do you really want to remove ?</p>
</div>
<div class="modal-footer removeBrandFooter">
<button type="button" class="btn btn-default" data-
dismiss="modal"> <i class="glyphicon glyphicon-remove-sign"></i>
Close</button>
<button type="button" class="btn btn-primary"
id="removeBrandBtn" data-loading-text="Loading..."> <i
class="glyphicon glyphicon-ok-sign"></i> Save changes</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- /remove brand -->

<script src="custom/js/brand.js"></script>

<?php require_once 'includes/footer.php'; ?>


Login Page:
Home Page:
Brands Page:
Categories page:
Product page:
Orders page:
Report page:
Conclusion:
Nothing is perfect in this world. So, we are also no exception. Although,
we have tried our best to present the information effectively, yet, there
can be further enhancement in the Application. We have taken care of all
the critical aspects, which need to take care of during the development
of the Project. Like the things this project also has some limitations and
can further be enhances by someone, because there are certain
drawbacks that do not permit the system to be 100% accurate.

Вам также может понравиться