MYSQL Server As The Database
MYSQL Server As The Database
This is also a clumsy and untidy process that disturbs the smooth flow of work. But this system
introduced by us will reduce the huge number of paper works while on the other side there are
many more problems that persist in the manual system. They reduce efficiency as well as the
productivity level of human. Administrative module, purchase module, employee module, sales
module and billing module are some of the various modules that make up our project.
The administrators consist of a unique password and names of the employees. It helps the
employees to make secure login. The ids and passwords are kept secret from others. The
modules of sales and purchase include all the details of selling and purchasing. In the billing
module the details of payments are clearly shown.
This is one of the best system that can be introduced in the supermarket for efficient
management. It will also reduce the cumbersome job of finding the most accurate data from the
huge log books. It also helps the management to keep efficient records of all the purchases and
sales. The introduction of ID and password will further reduce the manipulation and thus
providing the accurate and transparent data. This system will increase the productivity and
reduce the need of manual system to a large extent.
Modules:
Administrative module: This module is handled by an admin who has full control
over the system. Admin is required to log in to the system with a unique user id and
password. They have control over all the modules and features of the system. Admin
can allocate unique user id (username and password) to the employees and staffs.
o Login: Admin need to login using valid login credentials in order to access the
system.
o Add / View Products: Admin can add new product with its details into the system.
o View Transactions: System allows admin to view all the transactions done by the
registered users.
User
o Registration: Here, user first need to registration themselves with details to access
the system.
o Login: After a successful registration, user then need to login into the system by
inputting their credentials into the system.
Employee module: Employee can use this module with their user id. They can keep
track of items in the supermarket, and are responsible for recording details of
purchases and sales.
Purchase module: This module stores all the purchase details of the supermarket.
Sales module: This module stores all the sales details of the supermarket.
Billing module: With the help of this module, all the payment details based on
purchases and sales can be shown.
II-SYSTEM STUDY
2.1 Existing System:
The existing system is very paper based in small as well as medium supermarkets. Even though
the paper work and manpower requirement is less, the existing system is not very economical for
these markets. Relevant and irrelevant information are entered and stored in the same place,
which is very clumsy and untidy process.In case of big supermarkets, the existing system is
computerized to some extent, but it is not fully automated to cover all the aspects of the
supermarket. The data entry, storing, and retrieval procedure is very inefficient. Further, there are
chances of data misplacement and wrong data entry. The system is still very insecure and
inflexible to adapt to user requirements.
Proposed System:
The proposed supermarket management system aims at full automation of big, medium, and mini
supermarkets by making the system reliable, fast, user-friendly, and informative. It reduces
paperwork, manpower requirement, and increases the productivity of the supermarket. Using this
application, one can add, modify, update, save, delete, and print details. There’s also a search
feature to find products available in the supermarket. The drawback of the existing system is
that it is very difficult to retrieve data from case files. The manual system is so time-consuming.
The proposed system is very easy to operate. Speed and accuracy are the main advantages of
proposed system. There is no redundancy of data. The data are stored in the computer’s
secondary memories like hard disk, etc. The proposed system will easily handle all the data and
the work done by the existing systems. The proposed systems eliminate the drawbacks of the
existing system to a great extent and it provides tight security to data.
Features:
It reduces the time and manpower required for management and maintenance of
different tasks.
It reduces the paper work in existing system, hence it is economical and efficient.
With this system, customers get quality of service; customers can even give feedback
which can be stored in the database.
As the entire system is fully computerized, records of daily and monthly purchases
and sales can be recorded and analyzed.
This system is very secure, user-friendly, and reliable.
2.3 SOFTWARE REQUIREMENTS
OS : MS WINDOWS 7
PHP started out as a small open source project that evolved as more and more people found out
how useful it was. RasmusLerdorf unleashed the first version of PHP way back in 1994.
Characteristics of PHP
Five important characteristics make PHP's practical nature possible −
Simplicity
Efficiency
Security
To create databases.
To maintain databases.
To carry out ETL operations through SQL Server Integration Services (SSIS).
SQL Server works in client-server architecture, hence it supports two types of components − (a)
Workstation and (b) Server.
Advantages of Instances
To reduce cost.
Data Flow Diagram (DFD) is a two-dimensional diagram that describes how data is processed
and transmitted in a system. The graphical depiction recognizes each source of data and how it
interacts with other data sources to reach a mutual output. In order to draft a data flow diagram
one must
Identify external inputs and outputs
Explain with graphics how these connections relate and what they result in.
Role of DFD:
It is a documentation support which is understood by both programmers and non-
programmers. As DFD postulates only what processes are accomplished not how they are
performed.
A physical DFD postulates where the data flows and who processes the data.
It permits analyst to isolate areas of interest in the organization and study them by
examining the data that enter the process and viewing how they are altered when they
leave.
Level 0:
Admin
Super mrket
Management process supermarket management
Process Database
Staff
DFD Level 1:
Add staff
Entry
Super market Add Product
Admin Management process Details
login
Add stock
Information
Add sales
Allotment
the integration testing begins. In this project each service is a module like Login, Forms etc.
Each module has to be tested by giving different sets of inputs. The inputs are validated when
accepting from user.
Integration Testing:
After the unit testing the integration of modules has to be done and then integration
testing can be done. The goal here is to see if modules can be integrated properly, the emphasis
being on testing interfaces between different modules.
System Testing:
In the system testing the entire web portal is tested according the software requirement
specifications document.
Acceptance Testing:
The acceptance testing is performed with realistic data of the client, which focus on the
external behaviour of the system; the internal logic of the program is emphasized. Software
testing is a critical element of software quality assurance and represents the ultimate review of
specification, design and coding. Testing is the exposure of the system to trial input to see
whether it produces correct output.
TESTING PHASES:
Software testing phases include the following:
Test activities are determined and test data selected.
The test is conducted and test results are compared with the expected results.
TESTING METHODS:
Testing is a process of executing a program to find out errors. If testing is conducted
successfully, it will uncover all the errors in the software.
By black box testing we derive a set of test cases that satisfy the following criteria:
Test cases that reduce by a count that is greater than one
The number of additional test cases that must be designed to achieve reasonable testing.
TESTING PLANS:
Testing can be done in two ways:
Bottom up approach
Top down approach
BOOK REFERENCES
Doyle, Matt. Beginning PHP 5.3 (Wrox Programmer to Programmer), 2009.
Lerdorf, Rasmus. PHP Pocket Reference, O'Reilly, 2000.
Nixon, Robin. Learning PHP, MySQL, JavaScript, and CSS: A Step-by-Step Guide
to Creating Dynamic Websites, O'Reilly, 2012.
Nixon, Robin. Robin Nixon's PHP Crash Course: Learn PHP in 14 easy lectures,
O'Reilly, 2012.
Ullman, Larry. PHP Advanced and Object-Oriented Programming: Visual QuickPro
Guide (3rd Edition), 2012.
Ullman, Larry. PHP for the Web: Visual QuickStart Guide, 2011.
Welling, Luke and Thomson, Laura. PHP and MySQL Web Development, Third
Edition, Sams, 2008.
WEBSITE REFERENCES
● www.codecademy.com/learn/PHP
● www.tutorialspoint.com/PHP
● www.learnonline.com
● www.w3.school.com
APPENDICES:
Database Design:
Table name: Login Table
B.SOURCE CODE:
<?php
session_start();
if ($_SESSION['first_name'] === null || $_SESSION['last_name'] === null ||
$_SESSION['email'] === null) {
header("Location: ../login_and_register/index.php");
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['firstname']) && isset($_POST['lastname']) && isset($_POST['email'])) {
$_id = $_POST['_id'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$email = $_POST['email'];
$position = $_POST['position'];
if (isset($_POST['available'])) {
$available = true;
} else {
$available = false;
}
switch ($position) {
case 'professor':
$noa = 1;
break;
case 'associateProfessor':
$noa = 2;
break;
case 'assistantProfessor':
$noa = 4;
break;
case 'lecturer':
$noa = 6;
break;
default:
$noa = 0;
break;
}
if ($db->query($sql)) {
header("Location: viewStaff.php");
} else {
$sql = "SELECT * from staff where _id = '$_id'";
$res = $db->query($sql);
$row = $res->fetch_assoc();
}
} else {
$_id = $_POST['update_id'];
$sql = "SELECT * from staff where _id = '$_id'";
$res = $db->query($sql);
$row = $res->fetch_assoc();
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>VES-ESAS</title>
<link rel="stylesheet" type="text/css" href="addStaff.css" />
<link href="https://fonts.googleapis.com/css?
family=Lato:100,100i,300,300i,400,400i,700,700i,900,900i" rel="stylesheet">
<script type="text/javascript" src="addStaff.js"></script>
</head>
<body>
<div class="header_img">
<img src="../login_and_register/ves-logo.png" />
</div>
<div class="header_title">
<a href="../home/index.php">VESIT - ESAS</a>
<hr>
<div class="header_subtitle">VESIT Examination Staff Allotment System</div>
<div class="header_info">Welcome <?php echo $_SESSION['first_name']." ".
$_SESSION['last_name']."!"; ?></div>
</div>
<div class="logout">
<button onclick="location.href='../login_and_register/logout.php'">LOGOUT</button>
</div>
</div>
<div class="home_navigator">
<div class="link"><a href="viewStaff.php">🡨 Go Back</a></div>
</div>
<div class="exam_form_header">
<div class="title">Update Staff Member!</div>
<div class="subtitle">Update staff member details: </div>
</div>
<div class="exam_form">
if ($row['position'] == 'associateProfessor') {
echo '<option value="associateProfessor" selected>Associate Professor</option>';
} else {
echo '<option value="associateProfessor">Associate Professor</option>';
}
if ($row['position'] == 'assistantProfessor') {
echo '<option value="assistantProfessor" selected>Assistant Professor</option>';
} else {
echo '<option value="assistantProfessor">Assistant Professor</option>';
}
if ($row['position'] == 'lecturer') {
echo '<option value="lecturer" selected>Lecturer</option>';
} else {
echo '<option value="lecturer">Lecturer</option>';
}
?>
</select>
</div>
<div>
<div class="form_title">Available: </div>
<div style="height: 15px;"><input type="checkbox" name="available" value="yes"
<?php if ($row['available']) {echo "checked";} ?>></div>
</div>
<br />
<div class="update_button">
<button type="submit">UPDATE</button>
</div>
</form>
</div>
</div>
</div>
</div>
</body>
</html>
<?php
session_start();
if ($_SESSION['first_name'] === null || $_SESSION['last_name'] === null ||
$_SESSION['email'] === null) {
header("Location: ../login_and_register/index.php");
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['delete'])) {
if ($_POST['delete'] == 'yes') {
$_id = $_POST['_id'];
$sql = "DELETE FROM staff WHERE _id = '$_id'";
if ($db->query($sql)) {
header("Location: viewStaff.php");
}
} else {
header("Location: viewStaff.php");
}
} else {
$_id = $_POST['delete_id'];
$sql = "SELECT * from staff where _id = '$_id'";
$res = $db->query($sql);
$row = $res->fetch_assoc();
}
} else {
$_id = $_POST['delete_id'];
$sql = "SELECT * from staff where _id = '$_id'";
$res = $db->query($sql);
$row = $res->fetch_assoc();
}
?>
<div class="gen_header">
<div class="header_img">
<img src="../login_and_register/ves-logo.png" />
</div>
<div class="header_title">
<a href="../home/index.php">VESIT - ESAS</a>
<hr>
<div class="header_subtitle">VESIT Examination Staff Allotment System</div>
<div class="header_info">Welcome <?php echo $_SESSION['first_name']." ".
$_SESSION['last_name']."!"; ?></div>
</div>
<div class="logout">
<button onclick="location.href='../login_and_register/logout.php'">LOGOUT</button>
</div>
</div>
<div class="home_navigator">
<div class="link"><a href="viewStaff.php">🡨 Go Back</a></div>
</div>
<div class="exam_form_header">
<div class="title">Delete Staff Member!</div>
<div class="subtitle">Confirm your request: </div>
</div>
<div class="exam_form">
<div class="delete_details">
</div>
<div class="delete_yes">
<button type="submit" name="delete" value="yes">YES</button>
</div>
<div class="delete_no">
<button type="submit" name="delete" value="no">NO</button>
</div>
</form>
</div>
</div>
</div>
</div>
</body>
</html>
<?php
session_start();
if ($_SESSION['first_name'] === null || $_SESSION['last_name'] === null ||
$_SESSION['email'] === null) {
header("Location: ../login_and_register/index.php");
}
$_SESSION['message'] = 'Please enter your details!';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['firstname']) && isset($_POST['lastname']) && isset($_POST['email'])) {
if (isset($_POST['available'])) {
$available = true;
} else {
$available = false;
}
switch ($position) {
case 'professor':
$noa = 1;
break;
case 'associateProfessor':
$noa = 2;
break;
case 'assistantProfessor':
$noa = 4;
break;
case 'lecturer':
$noa = 6;
break;
default:
$noa = 0;
break;
}
$sql = "INSERT INTO staff (firstname, lastname, email, position, noa, available)"
."VALUES ('$firstname', '$lastname', '$email', '$position', '$noa', '$available')";
} else {
$_SESSION['message'] = "Error: Fields not set!";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>ESAS</title>
<link rel="stylesheet" type="text/css" href="addStaff.css" />
<link href="https://fonts.googleapis.com/css?
family=Lato:100,100i,300,300i,400,400i,700,700i,900,900i" rel="stylesheet">
<script type="text/javascript" src="addStaff.js"></script>
</head>
<body>
<div class="header_img">
<img src="../login_and_register/ves-logo.png" />
</div>
<div class="header_title">
<a href="../home/index.php">VESIT - ESAS</a>
<hr>
<div class="header_subtitle">VESIT Examination Staff Allotment System</div>
<div class="header_info">Welcome <?php echo $_SESSION['first_name']." ".
$_SESSION['last_name']."!"; ?></div>
</div>
<div class="logout">
<button onclick="location.href='../login_and_register/logout.php'">LOGOUT</button>
</div>
</div>
<div class="home_navigator">
<div class="link"><a href="../home/index.php">🡨 Go Back</a></div>
</div>
<!-- content body -->
<div class="container_body">
<div class="container">
<table width="100%">
<tr>
<td>
<div class="exam_form_header">
<div class="title">Add Staff Member!</div>
<div class="subtitle">Enter staff member details: </div>
</div>
</td>
<td>
<div class="staff_list_header">
<div class="title">Staff Member List</div>
<div class="subtitle"><a href="addStaff.php">Refresh</a></div>
</div>
</td>
</tr>
<tr>
<td width="40%">
<div class="exam_form">
<div class="form_content">
<div>
<div class="form_title">Available: </div>
<div style="height: 15px;"><input type="checkbox" name="available" value="yes"></div>
</div>
<br />
<div class="submit">
<button type="submit">Submit</button>
</div>
</form>
</div>
</div>
</td>
<td width="60%">
<div class="staff_list">
<table width="100%">
<tr>
<th>Sr. No.</th>
<th>First Name</th>
<th>Last Name</th>
<th>E-Mail</th>
<th>Position</th>
<th>Times Available</th>
<th>Available</th>
</tr>
<?php
$db = new mysqli('localhost', 'root', '', 'esas')
or die("Error connecting to database!");
$results = $db->query($sql);
$i = 1;
while($row = $results->fetch_assoc()) {
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo $row['firstname']; ?></td>
<td><?php echo $row['lastname']; ?></td>
<td><?php echo $row['email']; ?></td>
<td>
<?php
switch ($row['position']) {
case 'professor':
echo "Professor";
break;
case 'associateProfessor':
echo "Associate Professor";
break;
case 'assistantProfessor':
echo "Assistant Professor";
break;
case 'lecturer':
echo "Lecturer";
break;
default:
<!DOCTYPE html>
<html>
<head>
<title>VES-ESAS</title>
<link rel="stylesheet" type="text/css" href="addStaff.css" />
<link href="https://fonts.googleapis.com/css?
family=Lato:100,100i,300,300i,400,400i,700,700i,900,900i" rel="stylesheet">
</head>
<body>