Sunteți pe pagina 1din 91

A

Project Report
On
Share Market
Submitted to partial fulfillment
Of the requirements for the award of the degree of

Bachelor of Science -Information Technology


Amity Institute of Information Technology
Amity University Lucknow Campus
Batch: 2012-2015
(vi- semester)

Submitted to
Mrs.Pratibha Maurya
Guided By-

Ms.Monika Gupta
Anchal Alok

Submitted ByA7304912007

DECLARATION
Title of Project Report- Share Market
I declare thatA) The work submitted by me in partial fulfillment of the requirement
for the award of degree B.Sc-IT assessment in this Major ProjectShare Market is my own; it has not been previously presented by
another assessment.
B) I declare that this Major project-Share Market is my own work. I have
not use this work previously or produced by another student or any
other person to submit it as my own work.
C) I have not use this work previously or produced by another student
or any other person to submit it as my own work.
D) I will not permit anybody to copy my work with the purpose of
passing it off as his or her own work.
E) The works conform from the guidelines (for layout, content and
style) as set out in the Regulations and Guidelines.

Date: 21-april-2015

Anchal

Alok
Enroll No-A7304912007
B.Sc.IT
(VI Semester)

CERTIFICATE
I hereby certify that
a. Anchal alok, A7304912007 student of B.Sc.IT & Batch (2012-2015)
at Amity University Uttar Pradesh has completed the Project Report
on Share Market, after completing 3rd year Summer Break under
my supervision.
b. The presented work embodies original research work carried out by
the student as per the guidelines given in University Regulations.
c. The research and writing embodied in the thesis are those of the
candidate except where due reference is made in the text.
d. I am satisfied that the above candidates, is worthy of examination
both in terms of its content and its technical presentations relative
to the standards recognized by the university as appropriate for
examination.
e. I certify that in accordance with major project guidelines, the report
does not exceed the prescribed maximum word limit.
f. Wherever work form other source has been used, all debts(for words
,data ,arguments and ideas)have been appropriately acknowledged
and referenced in accordance with the requirements of major project
Regulations and Guidelines.

Signature of the
Faculty
Mrs.Pratibha Maurya

ACKNOWLEDGEMENT
It gives us a great sense of pleasure to present the report of the B.Sc.IT
Project undertaken during B.Sc.IT 3rd Year. We owe special debt of
gratitude

to

Mrs.Pratibha

Maurya,

Department

Technology, Amity Institute of Information Technology,

of

Information

Lucknow for his

constant support and guidance throughout the course of our work. His
sincerity, thoroughness and perseverance have been a constant source of
inspiration for us. It is only his cognizant
Efforts that our endeavors have seen light of the day.
We also do not like to miss the opportunity to acknowledge the
contribution of all faculty members of the department for their kind
assistance and cooperation during the development of our project. Last
but not the least, we acknowledge our friends for their contribution in the
completion of the project.

____________________
Mr Anchal alok
A7304912007
5th Semester
B.Sc-IT

TABLE OF CONTENTS
Contents
1. Introduction
Objective
Proposed system
2. Feasibility Study
3. System Analysis &Design
System Requirement Specification
4. System Design
DFD Diagram
ER Diagram
Snapshots
5. Implementation and Coding
6. System Testing
7. Report &
Conclusion
8. Plagrism report

INRODUCTI
ON AND
OBJECTIVE
6

INTRODUCTION
The Share Market helps in developing the administrator to manage, update and delete
the customers, suppliers and stocks. The PHP MySQL Share Market helps in
developing a website to sell, buy products from warehouse with computerized billing
feature.
Share Market helps user to select different products based on offers, categories and
availability of the product in the stock.
The major cause for generating this system is for tracking the records of the sold and
purchased goods.
Share Market is covering the disadvantages of the delay of the products to the
customer and a proper record of sales and purchase and track on all these transactions.
Share Market makes the buying easier and helps the vendors to reach wider market.
Main objective of developing such a system is it helps Admin to easily store records of
the products being sold or purchased and details of the customer and suppliers admin
also has all the records of bills and sales reports.

OBJECTIVE
The main objective of the project is to create an Share Market that allows users to sell
and purchase products directly from the inventory .The System provides security to all
the users. It provides functionalities for all the users as per their specific requirements
as admin has all the details of the customers and suppliers. The System maintains the
data in such a manner so as to provide flexibility to all the users. It has a user friendly
interface for the ease of the admin. The System is made to maintain all the records in
an efficient manner. Besides, the different users also get refined information as per
their requirements.

Functionalities
1. The Owner of the Company is the admin for the System.
2. Admin creates the suppliers.
3. Admin can update the suppliers details.
4. Admin is responsible for the activities.
5. Admin can update the customers details
6. Admin can create customer.
7. Admin can update the products
8. Admin can update the Category
9. Admin is responsible for the formation of bills.
10. Admin can see the report.
11. Admin can see the sales details.

PROBLEM DEFINITION
The problems with existing system are:
1. The main problem with existing system is that all the records are stored on papers.
2. Direct billing.
3. Problem in case of damage
4. Updating any record is a tedious process.
5. Probability of loss of data is very high.
6. Bills can be manipulated

PROPOSED SYSTEM
1) MODULE DESCRIPTION

USERS OF THE SYSTEM


1. Administrator

2) ADMINISTRATOR MODULE
1. The Developer of the website is Admin
2. Admin will create, update and delete account for Customer.
3. Admin will create, update and delete account for Supplier.
4. Admin will add, update, and delete repots.
5. Admin will be able to see customer details.
6. Admin can get the analysis of sales.
7. Admin can get the analysis of purchase.
8. Admin can see the pending payments of the customers.

NEED OF PROPOSED SYSTEM


Online : Organization Provide Online stock details which administrator can
see number of customers and suppliers.
Save Time : Share Market saves a lot of time because admin dont have to go
anywhere. By sitting at home admin can have a check on his inventory.
Effectiveness : Its effective in such a way that admin can use it according to
the requirement of the customers.
Flexibility : It can work very flexibly like wherever admin want .
Comfortable : Its a comfortable service.

FEASIBLITY
STUDY

10

FEASIBILITY STUDY
Feasibility study is done to analyze the potential of a proposed project and whether it
will be profitable in all respects to develop the project or not.
1. Economic feasibility:
This is done to evaluate the potential cost and revenues of the proposed project.
If the cost exceeds the potential revenue, then the proposed system is not
feasible. In case revenue is more than it is logically feasible to develop the
project. The Share Market is economically feasible as it is developed after
knowing the exact requirements of the user. It is developed using things which
are mostly free of cost.
2. Technical Feasibility
It refers to whether the proposed project could be developed with existing
technologies or not. If it requires new technology, then the estimation of the
expected cost is required. Again if the cost outweighs the revenues then the
project is not feasible. It concerns both hardware and the software. The Share
Market is technically feasible as it makes use of all the latest technologies. Most
of the requirements are available over the internet and are free of cost.

3. Operational Feasibility
It basically means that whether the proposed system would be able to solve the
existing problems. It means that whether the system would be utilized if it is
developed. It states how well the system fulfills the requirements that are at the
beginning. Operational Feasibility is the most important as it determines
whether the system will be useful in the way as it was required. The Share
Market is operationally feasible as only after gathering proper information this
system is developed.

11

SYSTEM
ANALYSIS
12

1. System Analysis
System analysis broadly refers to defining the problem and providing a structure for
the proposed system. Special Professionals called System Analyst perform system
analysis. This involves thorough understanding of the proposed system and solving the
arising problem. At the end of this phase, the layout for the proposed system is
available.

2. REQUIREMENT ANALYSIS
This refers to the thorough understanding of the user expectations from the proposed
system. This phase is essential for the development of a successful project. If we do
not know the exact demands of the user who is going to use the system then there is
the fear of system not being successful. Hence, this phase becomes extremely
important for the success of any system.

Techniques used for requirement analysis

Data Flow Diagram


Data Flow Diagrams are used to showcase the flow of data in the system.

Level 0 Diagram/Context Level Diagram


It is the basic conceptual design of the system. It shows the interfaces, the boundaries
of the system. The entire software is represented as a single bubble with the input and
output shown by incoming and outgoing arrows.

PROBLEM DEFINITION
13

The main Problem is in the existing system is that all the complaint get registered in
manual register.
Searching of records is a slow process.
More paper works and pile up of manual files.
Quick information is not available.
The problems with existing system are:
1. The main problem with existing system is that all the records are stored on papers.
2. Direct billing.
3. Problem in case of damage
4. Updating any record is a tedious process.
5. Probability of loss of data is very high.
6. Bills can be manipulated

REQUIREMENTS SPECIFICATION
Identification of the needs
Identification of need mainly concern with requirements of the project how much time
it would be taken and how much cost it would require to complete. The hardware
requirement of the project also concern, the member of the project team also is
decided in this phase.
Here we focus our point toward organization needs i.e. to organize the things which
are scattered here and there .Need to gather information about various aspects like
consumer information, bill calculation and reports.
Each and every level of entity that is involving in the management system needs to
communicate together.

14

REQUIREMENTS
The main requirement of website is to create a database that should be
manageable even if the database size grows into huge one.
Next important requirement is the generation of relevant information from the
database.
To keep the information of the customers.
One more requirement is that customers can print their receipt of booking.
The most important one is to save the time of our customers.

SOFTWARE REQUIREMENT SPECIFICATION (SRS)


For Requirement Documentation, we use the SRS Document. The following
characteristics must be met by a SRS Document1. Correctness: The SRS can be said correct, if and only if, all the requirements
stated in the Document are met by the system.
2. Unambiguous: The SRS is unambiguous if all the requirements stated in it
have only one interpretation.
3. Complete: The SRS is complete if all the requirements whether pertaining to
security or constraints is clearly defined as per the clients instructions.
4. Consistent: The SRS is consistent only if the there is no contradiction of any
requirement in one part of the SRS with any part of the SRS.

SYSTEM REQUIRMENTS
15

Functionality
The System is a simple web application. It basically focuses on different products in
cheaper rate. The functions may include generation of several reports.
Hardware Requirements
Processor: - Any
RAM: - 1GB
Hard Disk: - 40GB
Software Requirements
Development Software: - Adobe Dreamweaver
Platform: - PHp 5.5
Database: - Mysql

End Users
Operating System: - Any OS may be Windows family, Linux, Unix etc.
Database: - Mysql

16

SYSTEM DESIGN
AND
ARCHITECTURE

Bottom-Up Approach

17

The Approach followed for this System is Bottom-Up Approach. In this method, we
identify the different modules that would be needed by the system. These modules are
clubbed together. In this approach of designing, we combine small modules to make
the larger ones. The larger ones are again combined and this is repeated till the whole
system is obtained. The advantage of this approach is that each module is tested as
soon as it is coded. The Validations are done at modular level and hence the chances of
finding errors at higher levels become less.
The disadvantage with this approach is that since the modules are coded soon after the
design, the probability of recoding is higher. Besides, the functionality of the particular
module must be properly known at the time of coding. Otherwise, if some problem is
discovered at the higher level, the whole lower level needs to be redesigned. The
System uses the bottom-up approach of designing. The modules had been identified
and planned in advance as per the user requirement. The Administrator module was
first designed as the primary information addition was being done by this module. The
primary user accounts and the privileges of adding members and offers were placed in
this module. Then the user module was made as after the addition of the member and
the offers, any subsequent updation is done by the Admin. After all the major modules
were designed and coded, the report module was designed as per each Admins
requirement.
The Administrator had access to add products, add categories, add products, see Sales,
see reports.
The Bottom-Up Approach is beneficial in this system as the module details and
functionality is known properly at the beginning of development. The only problem
can arise if some last minute changes are suggested by the client.

18

ER-Diagram

19

Snapshots

Home page
20

Admin panel

Add Stock
21

Add Supplier

Help
22

New Purchase entry

Purchase
23

Report

Sales entry
24

Stock details

Supplier
25

Customer

Database snapshots
26

27

28

29

30

31

IMPLEMENTATION
AND
CODING

32

CODING
Once the design is complete most of the major decisions about the system have
been made. The goal of the coding phase is to translate the design of the system
into the code in a given programming language. For a given design the aim of this
phase is to implement the design in best possible manner.
An important concept that helps the understandability of the program is structured
programming. The goal of structured programming is to arrange the control flow in
the program, that is program should be organized on the sequence of the statement

ADD CATEGORY
<?php
session_start();
if(!isset($_SESSION['username']) || $_SESSION['usertype'] !='admin'){ header("location:index.php?
msg=Please%20login%20to%20access%20admin%20area%20!"); // Re-direct to index.php
}
else
{
include_once "db.php";
error_reporting (E_ALL ^ E_NOTICE);
<html>
<head>
<title>Welcome to Share Market !</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen"
title="no title" charset="utf-8" />
<link rel="stylesheet" href="css/template.css" type="text/css" media="screen"
title="no title" charset="utf-8" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/jquery.validationEngine-en.js" type="text/javascript"></script>
<script src="js/jquery.validationEngine.js" type="text/javascript"></script>
<script src="js/jquery.hotkeys-0.7.9.js"></script>
<!-- AJAX SUCCESS TEST FONCTION
<script>function callSuccessFunction(){alert("success executed")}
function callFailFunction(){alert("fail executed")}
</script>
-->
<script>
$(document).ready(function() {
// SUCCESS AJAX CALL, replace "success: false," by: success : function()
{ callSuccessFunction() },
$("#category").focus();
33

$("#form1").validationEngine(),
jQuery(document).bind('keydown', 'Ctrl+s',function() {
$('#form1').submit();
return false;
});
jQuery(document).bind('keydown', 'Ctrl+r',function() {
$('#form1').reset();
return false;
});
jQuery(document).bind('keydown', 'Ctrl+a',function() {
window.location = "add_category.php";
return false;
});
jQuery(document).bind('keydown', 'Ctrl+0',function() {
window.location = "admin.php";
return false;
});
jQuery(document).bind('keydown', 'Ctrl+1',function() {
window.location = "add_purchase.php";
return false;
});
jQuery(document).bind('keydown', 'Ctrl+2',function() {
window.location = "add_stock_sales.php";
return false;
});
jQuery(document).bind('keydown', 'Ctrl+3',function() {
window.location = "add_stock_details.php";
return false;
});
jQuery(document).bind('keydown', 'Ctrl+4',function() {
window.location = "add_category.php";
return false;
});
jQuery(document).bind('keydown', 'Ctrl+5',function() {
window.location = "add_supplier_details.php";
return false;
});
jQuery(document).bind('keydown', 'Ctrl+6',function() {
window.location = "add_customer_details.php";
return false;
});
jQuery(document).bind('keydown', 'Ctrl+7',function() {
window.location = "view_stock_entries.php";
return false;
});
jQuery(document).bind('keydown', 'Ctrl+8',function() {
window.location = "view_stock_sales.php";
return false;
});
jQuery(document).bind('keydown', 'Ctrl+9',function() {
34

window.location = "view_stock_details.php";
return false;
});
//$.validationEngine.loadValidation("#date")
//alert($("#formID").validationEngine({returnIsValid:true}))
//$.validationEngine.buildPrompt("#date","This is an example","error")
// Exterior prompt build example
// input prompt close example
//$.validationEngine.closePrompt(".formError",true)
// CLOSE ALL OPEN PROMPTS
});
</script>
<style type="text/css">
<!-body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #FFFFFF;
}
*{
padding: 0px;
margin: 0px;
}
#vertmenu {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 100%;
width: 160px;
padding: 0px;
margin: 0px;
}
#vertmenu h1 {
display: block;
background-color:#FF9900;
font-size: 90%;
padding: 3px 0 5px 3px;
border: 1px solid #000000;
color: #333333;
margin: 0px;
width:159px;
}
#vertmenu ul {
list-style: none;
margin: 0px;
padding: 0px;
border: none;
}
#vertmenu ul li {
margin: 0px;
35

padding: 0px;
}
#vertmenu ul li a {
font-size: 80%;
display: block;
border-bottom: 1px dashed #C39C4E;
padding: 5px 0px 2px 4px;
text-decoration: none;
color: #666666;
width:160px;
}
#vertmenu ul li a:hover, #vertmenu ul li a:focus {
color: #000000;
background-color: #eeeeee;
}
.style1 {color: #000000
-->
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top"><table width="960" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td><table width="960" border="0" cellpadding="0" cellspacing="0" bgcolor="red">
<tr>
<td height="90" align="left" valign="top"><img src="images/topbanner.jpg" width="960"
height="82"></td>
</tr>
<tr>
<td height="800" align="left" valign="top"><table width="960" border="0" cellpadding="0"
cellspacing="0" bgcolor="#EAE7A1">
<tr>
<td width="130" align="left" valign="top">
<br>
<strong>Welcome <font color="#3399FF"><?php echo
$_SESSION['username']; ?> !</font></strong><br> <br>
<table width="100%" border="1" cellspacing="1" cellpadding="1">
<tr>
<a href="add_stock_details.php">Add Stock </a>
</td>
</tr>
<tr>
<td align="center"><a href="add_supplier_details.php">Add Supplier</a>
</td>
</tr>
<tr>
36

<td align="center"><a href="view_supplier_details.php"> Supplier</a></td>


</tr>
<tr>
<a href="add_customer_details.php">Add customer details</a>
</tr>
<tr>
<td align="center"><a href="view_customer_details.php">Customer Details</a></td>
</tr>
<tr>
<td align="center"><a href="add_category.php">Add Category </a></td>
</tr>
<tr>
<td align="center"><!--<a href="add_stock_sales.php"><img src="images/sales.png"
width="146" height="111" border="0"></a></td>-->
<a href="view_stock_sales.php">Stock Sales </a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_entries.php">Stock entry </a></td>
</tr>
<tr>
<a href="view_stock_details.php">Stock Details </a>
</tr>
<tr>
<td align="center"><a href="view_stock_availability.php">Stock Availability </a></td>
</tr>
<tr>
<td align="center"><a href="add_purchase.php">Purchase Stock</a></td>
</tr>
<tr>
<td align="center"><a href="view_payments.php">Payment</a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_sales_payments.php">Return</a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_entries_payments.php">pending payments</a></td>
</tr>
<tr>
<td align="center"><a href="help.php" target="_blank" height="900" width="800"
onclick="window.open('help.php', 'newwindow', 'width=500, height=500'); return
false;">Help</a></td>
</tr>
</table>
</td> <td height="500" align="center" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<a href="admin.php"><img src="images/home.png" width="91" height="62"
border="0"></a></td>
<a href="add_purchase.php"><img src="images/purchase.png" width="91" height="62"
border="0"></a></td>
37

<a href="add_stock_sales.php"><img src="images/sales.png" width="91" height="62"


border="0"></a></td>
<a href="report.php"><img src="images/reports.png" width="91" height="62"
border="0"></a></td>
<td width="17%" align="left" valign="top"><a href="view_customer_details.php"><img
src="images/customers.png" width="94" height="22" border="0"></a><br>
<a href="view_supplier_details.php"><img src="images/suppliers.png" width="94" height="22"
border="0"></a><br>
<a href="view_payments.php"><img src="images/payments.png" width="94" height="22"
border="0"></a></td>
<td width="18%" align="left" valign="top"><a href="view_stock_sales_payments.php"><img
src="images/outstanding.png" width="94" height="22" border="0"></a><br>
<a href="view_stock_entries_payments.php"><img src="images/pendings.png" width="94"
height="22" border="0"></a><br>
<a href="logout.php"><img src="images/logout.png" width="94" height="22"
border="0"></a></td>
</tr>
</table>
<?php
if(isset($_POST['category']))
{
$category=mysql_real_escape_string($_POST['category']);
$count = $db->countOf("category_details", "category_name='$category'");
if($count==1)
{
echo "<font color=red> Dublicat Entry. Please Verify</font>";
}
else
{
if($db->query("insert into
category_details(category_name,category_description) values('$category','')"))
echo "<br><font color=green size=+1 >[ $category ] Category Added !
</font>" ;
else
echo "<br><font color=red size=+1 >Problem in Adding !</font>" ;
}
?>
<br>
<br>
<form name="form1" method="post" id="form1" action="">
<p align="center"><strong>Add New Category </strong> </p>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
</tr>
<tr>
<td width="150">&nbsp;</td>
38

<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
</tr>
<tr>
<td width="150">Category</td>
<td width="150"><input name="category" type="text" id="category"
class="validate[required,length[0,100]] text-input" ></td>
<td width="150"><input type="submit" name="Submit" value="Add"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</form></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="30" align="center" bgcolor="#72C9F4"><span class="style1">Developed by
Ara Associates </span></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<?php
}
?>

39

ADD CUSTOMER DETAIL


<?php
session_start(); // Use session variable on this page. This function must put on the top of page.
if(!isset($_SESSION['username']) || $_SESSION['usertype'] !='admin'){ // if session variable
"username" does not exist.
header("location:index.php?msg=Please%20login%20to%20access%20admin%20area%20!"); // Redirect to index.php
}
else
{
include_once "db.php";
error_reporting (E_ALL ^ E_NOTICE);
<html>
<head>
<title>Welcome to Share Market !</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen"
title="no title" charset="utf-8" />
<link rel="stylesheet" href="css/template.css" type="text/css" media="screen"
title="no title" charset="utf-8" />
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top"><table width="960" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td><table width="960" border="0" cellpadding="0" cellspacing="0" bgcolor="red">
<tr>
<td height="90" align="left" valign="top"><img src="images/topbanner.jpg" width="960"
height="82"></td>
</tr>
<tr>
<td height="800" align="left" valign="top"><table width="960" border="0" cellpadding="0"
cellspacing="0" bgcolor="#EAE7A1">
<tr>
<td width="130" align="left" valign="top">
<br>
<strong>Welcome <font color="#3399FF"><?php echo
$_SESSION['username']; ?> !</font></strong><br> <br>
<table width="100%" border="1" cellspacing="1" cellpadding="1">
<tr>
<a href="add_stock_details.php">Add Stock </a>
40

</td>
</tr>
<tr>
<td align="center"><a href="add_supplier_details.php">Add Supplier</a>
</td>
</tr>
<tr>
<td align="center"><a href="view_supplier_details.php"> Supplier</a></td>
</tr>
<tr>
<a href="add_customer_details.php">Add customer details</a>
</tr>
<tr>
<td align="center"><a href="view_customer_details.php">Customer Details</a></td>
</tr>
<tr>
<td align="center"><a href="add_category.php">Add Category </a></td>
</tr>
<tr>
<a href="view_stock_sales.php">Stock Sales </a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_entries.php">Stock entry </a></td>
</tr>
<tr>
<a href="view_stock_details.php">Stock Details </a>
</tr>
<tr>
<td align="center"><a href="view_stock_availability.php">Stock Availability </a></td>
</tr>
<tr>
<td align="center"><a href="add_purchase.php">Purchase Stock</a></td>
</tr>
<tr>
<td align="center"><a href="view_payments.php">Payment</a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_sales_payments.php">Return</a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_entries_payments.php">pending payments</a></td>
</tr>
<tr>
<td align="center"><a href="help.php" target="_blank" height="900" width="800"
onclick="window.open('help.php', 'newwindow', 'width=500, height=500'); return
false;">Help</a></td>
</tr>
</table>
</td> <td height="500" align="center" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
41

<tr>
<a href="admin.php"><img src="images/home.png" width="91" height="62"
border="0"></a></td>
<a href="add_purchase.php"><img src="images/purchase.png" width="91" height="62"
border="0"></a></td>
<a href="add_stock_sales.php"><img src="images/sales.png" width="91" height="62"
border="0"></a></td>
<a href="report.php"><img src="images/reports.png" width="91" height="62"
border="0"></a></td>
<td width="17%" align="left" valign="top"><a href="view_customer_details.php"><img
src="images/customers.png" width="94" height="22" border="0"></a><br>
<a href="view_supplier_details.php"><img src="images/suppliers.png" width="94" height="22"
border="0"></a><br>
<a href="view_payments.php"><img src="images/payments.png" width="94" height="22"
border="0"></a></td>
<td width="18%" align="left" valign="top"><a href="view_stock_sales_payments.php"><img
src="images/outstanding.png" width="94" height="22" border="0"></a><br>
<a href="view_stock_entries_payments.php"><img src="images/pendings.png" width="94"
height="22" border="0"></a><br>
<a href="logout.php"><img src="images/logout.png" width="94" height="22"
border="0"></a></td>
</tr>
</table>
<?php
if(isset($_POST['name']))
{
$name=mysql_real_escape_string($_POST['name']);
$address=mysql_real_escape_string($_POST['address']);
$contact1=mysql_real_escape_string($_POST['contact1']);
$contact2=mysql_real_escape_string($_POST['contact2']);
$count = $db->countOf("customer_details", "customer_name='$name'");
if($count==1)
{
echo "<font color=red> Dublicat Entry. Please Verify</font>";
}
else
{
if($db->query("insert into customer_details
values(NULL,'$name','$address','$contact1','$contact2',0)"))
echo "<br><font color=green size=+1 > [ $name ] Customer Details Added !
</font>" ;
else
echo "<br><font color=red size=+1 >Problem in Adding !</font>"
}
}
?>
<br>
<br>
<form name="form1" method="post" id="form1" action="">

42

<p align="center"><strong>Add Customer Details </strong> - Add New ( Control


+A)</p>
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
</tr>
<tr>
<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
</tr>
<tr>
<td width="150">Name:</td>
<td width="150"><input name="name" type="text" id="name"
class="validate[required,length[0,100]] text-input"></td>
</tr>
<tr>
<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
</tr>
<tr>
<td width="150">Address</td>
<td width="150"><textarea name="address" cols="15"></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Contact 1 </td>
<td><input name="contact1" type="text" id="buyingrate"
class="validate[optional,custom[onlyNumber],length[6,15]] text-input" ></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Contact 2 </td>
<td><input name="contact2" type="text" id="sellingrate"
class="validate[optional,custom[onlyNumber],length[6,15]] text-input" ></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="right"><input type="reset" name="Reset" value="Reset">
&nbsp;&nbsp;&nbsp;</td>
<td>
&nbsp;&nbsp;&nbsp;
43

<input type="submit" name="Submit" value="Save"></td>


</tr>
<tr>
<td
align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;&nbsp;&nbsp;(Control + R) </td>
<td align="left"> &nbsp;&nbsp;( Control + S ) </td>
</tr>
</table>
</form></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="30" align="center" bgcolor="#72C9F4"><span class="style1">Developed by
Ara Associates </span></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<?php
}
?>

ADD PURCHASE
<?php
session_start();
if(!isset($_SESSION['username']) || $_SESSION['usertype'] !='admin'){ // if
session variable "username" does not exist.
header("location:index.php?msg=Please%20login%20to%20access%20admin
%20area%20!"); }
else
{
include_once "db.php";
error_reporting (E_ALL ^ E_NOTICE);
44

<html>
<head>
<title>Welcome to Share Market !</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META Http-Equiv="Cache-Control" Content="no-cache">
<META Http-Equiv="Pragma" Content="no-cache">
<META Http-Equiv="Expires" Content="0">
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"
media="screen" title="no title" charset="utf-8" />
<link rel="stylesheet" href="css/template.css" type="text/css"
media="screen" title="no title" charset="utf-8" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="jquery.date_input.js"></script>
<link rel="stylesheet" href="date_input.css" type="text/css">
<script type="text/javascript">$(function() {
$("#datefield").date_input();
$("#due").date_input();
});</script>
<script
<script
<script
<script

type='text/javascript'
type='text/javascript'
type='text/javascript'
type='text/javascript'

src='lib/jquery.bgiframe.min.js'></script>
src='lib/jquery.ajaxQueue.js'></script>
src='lib/thickbox-compressed.js'></script>
src='jquery.autocomplete.js'></script>

<script type='text/javascript' src='localdata.js'></script>


<link rel="stylesheet" type="text/css" href="jquery.autocomplete.css" />
<link rel="stylesheet" type="text/css" href="lib/thickbox.css" />
<script type="text/javascript">
$().ready(function() {
function log(event, data, formatted) {
$("<li>").html( !data ? "No match!" : "Selected: " +
formatted).appendTo("#result");
}
function formatItem(row) {
return row[0] + " (<strong>id: " + row[1] + "</strong>)";
}
function formatResult(row) {
return row[0].replace(/(<.+?>)/gi, '');
}
$("#supplier").autocomplete("supplier1.php", {
width: 160,
autoFill: true,
selectFirst: false
});
</script>
45

</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top"><table width="960" border="0"
cellspacing="0" cellpadding="0">
<tr>
<td><table width="960" border="0" cellpadding="0" cellspacing="0"
bgcolor="red">
<tr>
<td height="90" align="left" valign="top"><img
src="images/topbanner.jpg" width="960" height="82"></td>
</tr>
<tr>
<td height="500" align="left" valign="top"><table width="960"
border="0" cellpadding="0" cellspacing="0" bgcolor="#EAE7A1">
<tr>
<td width="130" align="left" valign="top">
<br>
<strong>Welcome <font color="#3399FF"><?php echo
$_SESSION['username']; ?> !</font></strong><br> <br>
<table width="100%" border="1" cellspacing="1" cellpadding="1">
<tr>
<a href="add_stock_details.php">Add Stock </a>
</td>
</tr>
<tr>
<td align="center"><a href="add_supplier_details.php">Add Supplier</a>
</td>
</tr>
<tr>
<td align="center"><a href="view_supplier_details.php">
Supplier</a></td>
</tr>
<tr
<a href="add_customer_details.php">Add customer details</a>
</tr>
<tr>
<td align="center"><a href="view_customer_details.php">Customer
Details</a></td>
</tr>
<tr>
<td align="center"><a href="add_category.php">Add Category </a></td>
</tr>
<tr>
<a href="view_stock_sales.php">Stock Sales </a></td>
</tr>
<tr>

46

<td align="center"><a href="view_stock_entries.php">Stock entry


</a></td>
</tr>
<tr>
<a href="view_stock_details.php">Stock Details </a>
</tr>
<tr>
<td align="center"><a href="view_stock_availability.php">Stock Availability
</a></td>
</tr>
<tr>
<td align="center"><a href="add_purchase.php">Purchase Stock</a></td>
</tr>
<tr>
<td align="center"><a href="view_payments.php">Payment</a></td>
</tr>
<tr>
<td align="center"><a
href="view_stock_sales_payments.php">Return</a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_entries_payments.php">pending
payments</a></td>
</tr>
<tr>
<td align="center"><a href="help.php" target="_blank" height="900"
width="800" onclick="window.open('help.php', 'newwindow', 'width=500,
height=500'); return false;">Help</a></td>
</tr>
</table>
</td> <td height="500" align="center" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<a href="admin.php"><img src="images/home.png" width="91"
height="62" border="0"></a></td>
<a href="add_purchase.php"><img src="images/purchase.png"
width="91" height="62" border="0"></a></td>
<a href="add_stock_sales.php"><img src="images/sales.png"
width="91" height="62" border="0"></a></td>
<a href="report.php"><img src="images/reports.png" width="91"
height="62" border="0"></a></td>
<td width="17%" align="left" valign="top"><a
href="view_customer_details.php"><img src="images/customers.png"
width="94" height="22" border="0"></a><br>
<a href="view_supplier_details.php"><img src="images/suppliers.png"
width="94" height="22" border="0"></a><br>
<a href="view_payments.php"><img src="images/payments.png"
width="94" height="22" border="0"></a></td>

47

<td width="18%" align="left" valign="top"><a


href="view_stock_sales_payments.php"><img src="images/outstanding.png"
width="94" height="22" border="0"></a><br>
<a href="view_stock_entries_payments.php"><img
src="images/pendings.png" width="94" height="22" border="0"></a><br>
<a href="logout.php"><img src="images/logout.png" width="94"
height="22" border="0"></a></td>
</tr>
</table>
<?php
if(isset($_POST['name'])
{
$billnumber=mysql_real_escape_string($_POST['billnumber']);
$autoid=mysql_real_escape_string($_POST['id']);
$supplier=mysql_real_escape_string($_POST['supplier']);
$address=mysql_real_escape_string($_POST['address1']);
$contact1=mysql_real_escape_string($_POST['contact1']);
$contact2=mysql_real_escape_string($_POST['contact2']);
$payment=mysql_real_escape_string($_POST['payment']);
$balance=mysql_real_escape_string($_POST['balance']);
$temp_balance = $db->queryUniqueValue("SELECT
balance FROM supplier_details WHERE supplier_name='$supplier'");
$temp_balance = (int) $temp_balance + (int) $balance;
$db->execute("UPDATE supplier_details SET
balance=$temp_balance WHERE supplier_name='$supplier'");
$selected_date=$_POST['due'];
$selected_date=strtotime( $selected_date );
$mysqldate = date( 'Y-m-d H:i:s', $selected_date );
$due=$mysqldate;
$mode=mysql_real_escape_string($_POST['mode']);
$description=mysql_real_escape_string($_POST['description']);
$namet=$_POST['name'];
$quantityt=$_POST['quanitity'];
$bratet=$_POST['brate'];
$sratet=$_POST['srate'];
$totalt=$_POST['total'];
$subtotal=mysql_real_escape_string($_POST['subtotal']);
$username=$_SESSION['username'];
$i=0;
$j=1;
$username = $_SESSION['username'];
$max = $db->maxOfAll("id", "stock_details");
$max=$max+1;
$autoid="SD".$max."";
$max1 = $db->maxOfAll("id", "stock_entries");
$max1=$max1+1;
$autoid1="SE".$max1."";
$selected_date=$_POST['date'];
48

$selected_date=strtotime( $selected_date );
$mysqldate = date( 'Y-m-d H:i:s', $selected_date );
foreach($namet as $name1)
{
$quantity=$_POST['quantity'][$i];
$brate=$_POST['brate'][$i];
$srate=$_POST['srate'][$i];
$total=$_POST['total'][$i];
$count = $db->countOf("stock_avail", "name='$name1'");
if($count == 0)
{
$db->query("insert into stock_avail(name,quantity)
values('$name1',$quantity)");
echo "<br><font color=green size=+1 >New Stock Entry
Inserted !</font>" ;
$db->query("insert into
stock_details(stock_id,stock_name,stock_quatity,supplier_id,company_price,selli
ng_price) values('$autoid','$name1',0,'$suplier',$brate,$srate)");
$db->query("INSERT INTO stock_entries(stock_id,stock_name,
stock_supplier_name, quantity, company_price, selling_price, opening_stock,
closing_stock, date, username, type, total, payment, balance, mode,
description, due, subtotal,count1,billnumber) VALUES
( '$autoid1','$name1','$supplier',$quantity,$brate,
$srate,0,$quantity,'$mysqldate','$username','entry',$total,$payment,
$balance,'$mode','$description','$due',$subtotal,$j,'$billnumber')");
}
else if($count==1)
{
$amount = $db->queryUniqueValue("SELECT quantity
FROM stock_avail WHERE name='$name1'");
$amount1 = $amount + $quantity;
$db->execute("UPDATE stock_avail SET
quantity=$amount1 WHERE name='$name1'");
$db->query("INSERT INTO
stock_entries(stock_id,stock_name,stock_supplier_name,quantity,company_price
,selling_price,opening_stock,closing_stock,date,username,type,total,payment,ba
lance,mode,description,due,subtotal,count1,billnumber) VALUES
('$autoid1','$name1','$supplier',$quantity,$brate,$srate,$amount,
$amount1,'$mysqldate','$username','entry',$total,$payment,
$balance,'$mode','$description','$due',$subtotal,$j,'$billnumber')");
//INSERT INTO `stock`.`stock_entries` (`id`, `stock_id`,
`stock_name`, `stock_supplier_name`, `category`, `quantity`, `company_price`,
`selling_price`, `opening_stock`, `closing_stock`, `date`, `username`, `type`,
`salesid`, `total`, `payment`, `balance`, `mode`, `description`, `due`,
`subtotal`, `count1`)
//VALUES (NULL, '$autoid1', '$name1', '$supplier', '',
'$quantity', '$brate', '$srate', '$amount', '$amount1', '$mysqldate', 'sdd', 'entry',
'Sa45', '432.90', '2342.90', '24.34', 'cash', 'sdflj', '2010-03-25 12:32:02', '45645',
'1');
49

}
$i++;
$j++;
}
echo "<br><font color=green size=+1 >Parchase order
placed successfully Ref: [ $autoid1] !</font>" ;
}
?>
<br>
<br>
<form name="salesform" method="post" id="form1"
action="" onSubmit="updateSubtotal()" >
<p align="center"><strong>Add New Purchase Entry </strong> Add New ( Control +A)</p>
<table width="800" border="0" cellspacing="0" cellpadding="0"
id="dynamictable">
<tr>
<td width="61">&nbsp;</td>
<td width="110">&nbsp;</td>
<td width="15">&nbsp;</td>
<td width="76">&nbsp;</td>
<td width="171">&nbsp;</td>
<td width="74">&nbsp;</td>
<td width="111">&nbsp;</td>
<td width="77">&nbsp;</td>
<td width="105">&nbsp;</td>
</tr>
<tr>
<td width="61">&nbsp;</td>
<td width="110">&nbsp;</td>
<td width="15">&nbsp;</td>
<td width="76">&nbsp;</td>
<td width="171">&nbsp;</td>
<td width="74">&nbsp;</td>
<td width="111">&nbsp;</td>
<td width="77">&nbsp;</td>
<td width="105">&nbsp;</td>
</tr>
<tr>
<td width="61">&nbsp;</td>
<td width="110">&nbsp;</td>
<td>&nbsp;</td>
<td><div align="left"><strong>ID</strong>
<?php
50

$max = $db->maxOfAll("id","stock_sales");
$max=$max+1;
$autoid="PR".$max."";
?>
</div></td>
<td><input name="id" type="text" id="id"
readonly="" value="<?php echo $autoid; ?>" style="width:50px;"></td>
<td><div
align="left"><strong>Date</strong></div></td>
<td><input type="text" id="datefield"
name="date" class="date_input" value="<?php echo date('d-m-Y');?>"
style="width:70px;"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="61">&nbsp;</td>
<td width="110">&nbsp;</td>
<td width="15"><div align="left"></div></td>
<td width="76">&nbsp;</td>
<td width="171"><div align="left"></div></td>
<td width="74">&nbsp;</td>
<td width="111"><div align="left"></div></td>
<td width="77">&nbsp;</td>
<td width="105">&nbsp;</td>
</tr>
<tr>
<td><div align="center"><strong>Bill No</strong></div></td>
<td><input type="text" name="billnumber"
style="width:100px;" id="billnumber" class="validate[required,length[0,100]]
text-input"></td>
<td>&nbsp;</td>
<td><div align="left"><strong>Supplier</strong></div></td>
<td><input name="supplier" type="text" id="supplier" value=""
style="width:100px;" autocomplete="off" ></td>
<td><div align="left">Address</div></td>
<td><textarea name="address1" id="address"
style="width:100px;"></textarea></td>
<td><div align="left">Contact1<br>
<br>
Contact2</div></td>
<td><input name="contact1" type="text" id="contact1"
value="" style="width:80px;">
<br>
<br>
<input name="contact2" type="text" id="contact2" value=""
style="width:80px;" ></td>
</tr>
<tr>
51

<td>&nbsp;</td>
<td>&nbsp;</td>
<td><div align="left"></div></td>
<td>&nbsp;</td>
<td><div align="left"></div></td>
<td>&nbsp;</td>
<td><div align="left"></div></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<br>
<table width="800" border="0" cellspacing="0"
cellpadding="0" id="duplicate" style="margin-left:20px;">
<tr>
<td ><div align="center"><strong>Name</strong></div></td>
<td ><input name="name[]" type="text"
class="validate[required,length[0,100]] text-input" id="0"
style="width:100px;" onFocus="callAutoComplete(this.id)"
onBlur="callAutoAsignValue(this.id)" autocomplete="off"></td>
<td><div align="left"><strong>Qty</strong></div></td>
<td><input name="quantity[]" type="text" id="00"
class="validate[required,custom[onlyFloat],lengthCheck[6]] text-input"
style="width:50px;" onKeyUp="callQKeyUp(this.id)"></td>
<td><div align="left"><strong>Buy Rate:</strong></div></td>
<td><input name="brate[]" type="text" id="000"
class="validate[required,custom[onlyFloat],lengthCheck[6]] text-input"
style="width:50px;" onKeyUp="callRKeyUp(this.id)" ></td>
<td>Sales Rate </td>
<td><input name="srate[]" type="text"
id="0000" class="validate[optional,custom[onlyFloat],lengthCheck[6]] textinput" style="width:50px;" ></td>
<td>Avail Qty</td>
<td><input name="avail[]" type="text"
id="00000" readonly="" value="" style="width:50px;" ></td>
<td><div align="left"><strong>Total:</strong></div></td>
<td><input name="total[]" type="text" id="000000"
readonly="" value="" style="width:100px;text-align:right;" > </td>
<td width="50"><p><span><a id="minus" href="" >[-]</a>
<a id="plus" href="">[+]</a></span></p></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>

52

<table width="800" border="0" align="center"


cellpadding="0" cellspacing="0" id="duplicate" style="margin-left:20px;">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td width="13">&nbsp;</td>
</tr>
<tr>
<td>Payment:</td>
<td><input type="text" name="payment"
style="width:100px; " id="payment"
class="validate[required,custom[onlyFloat],lengthCheck[6]] text-input"
onKeyUp="balanceCalc()"></td>
<td><div
align="left">Description</div></td>
<td rowspan="2"><textarea
name="description" style="width:150px; height:40px; "></textarea></td>
<td>&nbsp;</td>
<td><div align="center"><strong>Sub
Total </strong></div></td>
<td><input name="subtotal" id="subtotal"
type="text" readonly="" style="width:100px; text-align:right; color:#333333;
font-weight:bold; font-size:16px;"><img src="images/refresh.png"
alt="Refresh" align="absmiddle" onClick="updateSubtotal()"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Balance:</td>
<td><input name="balance" type="text"
id="balance" style="width:100px; " value="0.00" readonly=""></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><div align="center"></div></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="55">Mode:</td>
<td width="125"><select name="mode">
<option value="cheque">Cheque</option>
<option value="ash"
selected>Cash</option>
53

<option value="others">others</option>
</select></td>
<td width="77">Due Date </td>
<td width="195"><input type="text"
id="due" name="due" class="date_input" value="<?php echo date('d-m-Y');?>"
style="width:70px;"></td>
<td width="77">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><div align="center">
<input type="button" name="Reset" value="Reset">
</div></td>
<td><input type="submit" name="Submit"
value="Save" onClick="updateSubtotal()" ></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</form>
<br>
<br>
<br>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="30" align="center" bgcolor="#72C9F4">
</div><span class="style1">Developed by Ara associates </span></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<?php
}
?>

54

ADD STOCK ENTRY


<?php
session_start(); // Use session variable on this page. This function must put on the top of page.
if(!isset($_SESSION['username']) || $_SESSION['usertype'] !='admin'){ // if session variable
"username" does not exist.
header("location:index.php?msg=Please%20login%20to%20access%20admin%20area%20!"); // Redirect to index.php
}
else
{
include_once "db.php";
error_reporting (E_ALL ^ E_NOTICE);
<html>
<head>
<title>Welcome to Share Market !</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen"
title="no title" charset="utf-8" />
<link rel="stylesheet" href="css/template.css" type="text/css" media="screen"
title="no title" charset="utf-8" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="jquery.date_input.js"></script>
<link rel="stylesheet" href="date_input.css" type="text/css">
<script type="text/javascript">$(function() {
$("#datefield").date_input();
});</script>
<script type='text/javascript' src='lib/jquery.bgiframe.min.js'></script>
<script type='text/javascript' src='lib/jquery.ajaxQueue.js'></script>
<script type='text/javascript' src='lib/thickbox-compressed.js'></script>
<script type='text/javascript' src='jquery.autocomplete.js'></script>
<script type='text/javascript' src='localdata.js'></script>
<link rel="stylesheet" type="text/css" href="jquery.autocomplete.css" />
<link rel="stylesheet" type="text/css" href="lib/thickbox.css" />
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top"><table width="960" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td><table width="960" border="0" cellpadding="0" cellspacing="0" bgcolor="red">
<tr>
<td height="90" align="left" valign="top"><img src="images/topbanner.jpg" width="960"
height="82"></td>
</tr>
<tr>
<td height="800" align="left" valign="top"><table width="960" border="0" cellpadding="0"
cellspacing="0" bgcolor="#EAE7A1">
<tr>
55

<td width="130" align="left" valign="top">


<br>
<strong>Welcome <font color="#3399FF"><?php echo
$_SESSION['username']; ?> !</font></strong><br> <br>
<table width="100%" border="1" cellspacing="1" cellpadding="1">
<tr>
<a href="add_stock_details.php">Add Stock </a>
</td>
</tr>
<tr>
<td align="center"><a href="add_supplier_details.php">Add Supplier</a>
</td>
</tr>
<tr>
<td align="center"><a href="view_supplier_details.php"> Supplier</a></td>
</tr>
<tr>
<a href="add_customer_details.php">Add customer details</a>
</tr>
<tr>
<td align="center"><a href="view_customer_details.php">Customer Details</a></td>
</tr>
<tr>
<td align="center"><a href="add_category.php">Add Category </a></td>
</tr>
<tr>
<a href="view_stock_sales.php">Stock Sales </a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_entries.php">Stock entry </a></td>
</tr>
<tr>
<a href="view_stock_details.php">Stock Details </a>
</tr>
<tr>
<td align="center"><a href="view_stock_availability.php">Stock Availability </a></td>
</tr>
<tr>
<td align="center"><a href="add_purchase.php">Purchase Stock</a></td>
</tr>
<tr>
<td align="center"><a href="view_payments.php">Payment</a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_sales_payments.php">Return</a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_entries_payments.php">pending payments</a></td>
</tr>
56

<tr>
<td align="center"><a href="help.php" target="_blank" height="900" width="800"
onclick="window.open('help.php', 'newwindow', 'width=500, height=500'); return
false;">Help</a></td>
</tr>
</table>
</td> <td height="500" align="center" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<a href="admin.php"><img src="images/home.png" width="91" height="62"
border="0"></a></td>
<a href="add_purchase.php"><img src="images/purchase.png" width="91" height="62"
border="0"></a></td>
<a href="add_stock_sales.php"><img src="images/sales.png" width="91" height="62"
border="0"></a></td>
<a href="report.php"><img src="images/reports.png" width="91" height="62"
border="0"></a></td>
<td width="17%" align="left" valign="top"><a href="view_customer_details.php"><img
src="images/customers.png" width="94" height="22" border="0"></a><br>
<a href="view_supplier_details.php"><img src="images/suppliers.png" width="94" height="22"
border="0"></a><br>
<a href="view_payments.php"><img src="images/payments.png" width="94" height="22"
border="0"></a></td>
<td width="18%" align="left" valign="top"><a href="view_stock_sales_payments.php"><img
src="images/outstanding.png" width="94" height="22" border="0"></a><br>
<a href="view_stock_entries_payments.php"><img src="images/pendings.png" width="94"
height="22" border="0"></a><br>
<a href="logout.php"><img src="images/logout.png" width="94" height="22"
border="0"></a></td>
</tr>
</table>
<?php
if(isset($_POST['name']))
{
$name=mysql_real_escape_string($_POST['name']);
$category=mysql_real_escape_string($_POST['category']);
$buyingrate=mysql_real_escape_string($_POST['buyingrate']);
$sellingrate=mysql_real_escape_string($_POST['sellingrate']);
$suplier=mysql_real_escape_string($_POST['suplier']);
//$uom=mysql_real_escape_string($_POST['uom']);
$quantity=mysql_real_escape_string($_POST['quantity']);
$count = $db->countOf("stock_avail", "name='$name'");
$selected_date=$_POST['date'];
$selected_date=strtotime( $selected_date );
$mysqldate = date( 'Y-m-d H:i:s', $selected_date );
$username = $_SESSION['username'];
$max = $db->maxOfAll("id", "stock_details");
57

$max=$max+1;
$autoid="SD".$max."";
$max1 = $db->maxOfAll("id", "stock_details");
$max1=$max1+1;
$autoid1="SD".$max1."";
if($count==0)
{
$db->query("insert into stock_avail(name,quantity) values('$name',
$quantity)");
echo "<br><font color=green size=+1 >New Stock Entry Inserted !</font>" ;
$db->query("insert into
stock_details(stock_id,stock_name,stock_quatity,supplier_id,company_price,selling_price,category)
values(' $autoid','$name',0,'$suplier',$buyingrate,$sellingrate,'$category')");
$db->query("insert into stock_entries
(stock_id,stock_name,stock_supplier_name,category,quantity,company_price,selling_price,opening_
stock,closing_stock,date,username,type) values('$autoid1','$name','$suplier','$category',$quantity,
$buyingrate,$sellingrate,0,$quantity,'$mysqldate','$username','entry')");
}
else if($count==1)
{
$amount = $db->queryUniqueValue("SELECT quantity FROM
stock_avail WHERE name='$name'");
$amount1 = $amount + $quantity;
$db->execute("UPDATE stock_avail SET quantity=$amount1
WHERE name='$name'");
$db->query("insert into stock_entries
(stock_id,stock_name,stock_supplier_name,category,quantity,company_price,selling_price,opening_
stock,closing_stock,date,username,type) values('$autoid1','$name','$suplier','$category',$quantity,
$buyingrate,$sellingrate,$amount,$amount1,'$mysqldate','$username','entry')");
echo "<br><font color=green size=+1 >$quantity Quantity Added in
$name !</font>" ;
}
}
?>
<br>
<br>
<form name="form1" method="post" id="form1" action="">
<p align="center"><strong>Add New Stock Entry </strong> - Add New ( Control
+A)</p>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
58

<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
</tr>
<tr>
<td width="150">ID <?php
$max = $db->maxOfAll("id","stock_entries");
$max=$max+1;
$autoid="SE".$max."";
?></td>
<td width="150"><input name="id" type="text" id="id"
readonly="" value="<?php echo $autoid; ?>"></td>
<td width="150">Date</td>
<td width="150"> <input type="text" id="datefield" name="date" class="date_input"
value="<?php echo date('d-m-Y');?>"></td>
</tr>
<tr>
<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
</tr>
<tr>
<td width="150"><strong>Name</strong></td>
<td width="150"><input name="name" type="text" id="singleBirdRemote"
class="validate[required,length[0,100]] text-input"></td>
<td width="150">Category</td>
<td width="150"><input name="category" id="category" type="text" value="" ></td>
</tr>
<tr>
<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
</tr>
<tr>
<td width="150">Supplier</td>
<td width="150"><input name="suplier" type="text" id="supplier"
class="validate[optional,length[0,100]] text-input"></td>
<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Buying Rate</td>

59

<td><input name="buyingrate" type="text" id="buyingrate"


class="validate[required,custom[onlyNumber],lengthCheck[6]] text-input" ></td>
<td>Selling Rate </td>
<td><input name="sellingrate" type="text" id="sellingrate"
class="validate[required,custom[onlyNumber],lengthCheck[6]] text-input" ></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><strong>Quantity</strong></td>
<td><input name="quantity" type="text" id="quantity"
class="validate[required,custom[onlyNumber],lengthCheck[6]] text-input" ></td>
<td>Available Quantity </td>
<td><input name="available" type="text" id="available" value="" readonly=""></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="right">&nbsp;</td>
<td align="right"><input type="reset" name="Reset" value="Reset">
&nbsp;&nbsp;&nbsp;</td>
<td> &nbsp;&nbsp;&nbsp;
<input type="submit" name="Submit" value="Save"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="center">&nbsp;</td>
<td
align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;&nbsp;&nbsp;(Control + R) </td>
<td align="left"> &nbsp;&nbsp;( Control + S ) </td>
<td align="left">&nbsp;</td>
</tr>
</table>
</form></td>
60

</tr>
</table
</td>
</tr>
<tr>
<td height="30" align="center" bgcolor="#72C9F4"><span class="style1">Developed by
Ara Associates </span></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<?php
}
?>

ADD STOCK SALES


<?php
session_start();.
if(!isset($_SESSION['username']) || $_SESSION['usertype'] !='admin'){ // if session variable
"username" does not exist.
header("location:index.php?msg=Please%20login%20to%20access%20admin%20area%20!"); // Redirect to index.php
}
else
{
include_once "db.php";
error_reporting (E_ALL ^ E_NOTICE);
<html>
<head>
<title>Welcome to Share Market !</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META Http-Equiv="Cache-Control" Content="no-cache">
<META Http-Equiv="Pragma" Content="no-cache">
<META Http-Equiv="Expires" Content="0">
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen"
title="no title" charset="utf-8" />
61

<link rel="stylesheet" href="css/template.css" type="text/css" media="screen"


title="no title" charset="utf-8" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="jquery.date_input.js"></script>
<link rel="stylesheet" href="date_input.css" type="text/css">
<script type="text/javascript">$(function() {
$("#datefield").date_input();
$("#due").date_input();
});</script>
<script type='text/javascript' src='lib/jquery.bgiframe.min.js'></script>
<script type='text/javascript' src='lib/jquery.ajaxQueue.js'></script>
<script type='text/javascript' src='lib/thickbox-compressed.js'></script>
<script type='text/javascript' src='jquery.autocomplete.js'></script>
<script type='text/javascript' src='localdata.js'></script>
<link rel="stylesheet" type="text/css" href="jquery.autocomplete.css" />
<link rel="stylesheet" type="text/css" href="lib/thickbox.css" />
<script type="text/javascript">
$().ready(function() {
function log(event, data, formatted) {
$("<li>").html( !data ? "No match!" : "Selected: " + formatted).appendTo("#result");
}
function formatItem(row) {
return row[0] + " (<strong>id: " + row[1] + "</strong>)";
}
function formatResult(row) {
return row[0].replace(/(<.+?>)/gi, '');
}
$("#customer").autocomplete("customer.php", {
width: 160,
autoFill: true,
selectFirst: false
});
});
</script>
<script type="text/javascript" src="lib/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="jquery-dynamic-form.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#duplicate").dynamicForm("#plus", "#minus", {limit:50,
createColor: 'yellow',removeColor: 'red'});
});
<script>
function callAutoComplete(idname)
{
$("#"+idname).autocomplete("stock.php", {
width: 160,
autoFill: true,
mustMatch: true,
62

selectFirst: false
});
}
function checkDublicateName()
{
var k=0;
for (i=0;i<=400;i=i+5)
{
if($("#0"+i).length>0)
{
$k=0;
for (j=0;j<=400;j=j+5)
{
if($("#0"+j).length>0 && $("#0"+i).val()==$
("#0"+j).val())
{
$k++;
}
}
if($k>1)
{
alert("Dublicate stock Entry. please remove new and add stock
in existing one !");
}
}
}
function callAutoAsignValue(idname)
{
var name1 = parseInt(idname,10);
var quantity1 = name1+1;
var rate1 = quantity1+1;
var avail1 = rate1+1;
var total1 = avail1+1;
if(parseInt(idname)>0)
{
quantity1="00"+quantity1;
rate1="000"+rate1;
avail1="0000"+avail1;
total1="00000"+total1;
}
else
{
quantity1="00";
rate1="000";
avail1="0000";
63

total1="00000";
}
$.post('check_sales_details.php', {stock_name: $("#"+idname).val() },
function(data){
$("#"+rate1).val(data.rate);
$("#"+avail1).val(data.availstock);
$("#"+quantity1).focus();
}, 'json');
checkDublicateName();
}
function callQKeyUp(Qidname)
{

var quantity = parseInt(Qidname,10);


var rate = quantity+1;
var avail = rate+1;
var total = avail+1;
var rowcount = parseInt((total+1)/5);
if(rowcount==0)
rowcount=1;
if(parseInt(Qidname)>0)
{
quantity="00"+quantity;
rate="000"+rate;
avail="0000"+avail;
total="00000"+total
}
else
{
quantity="00";
rate="000";
avail="0000";
total="00000";
}
var result= parseFloat($("#"+quantity).val()) * parseFloat( $("#"+rate).val() );
result=result.toFixed(2);
$("#"+total).val(result);
if(parseFloat($("#"+quantity).val()) > parseFloat($("#"+avail).val()))
64

$("#"+quantity).val(parseFloat($("#"+avail).val()));
updateSubtotal();
}
function balanceCalc()
{
if(parseFloat($("#payment").val()) > parseFloat($("#subtotal").val()))
$("#payment").val(parseFloat($("#subtotal").val()));
var result= parseFloat($("#subtotal").val()) - parseFloat( $
("#payment").val() );
result=result.toFixed(2);
$("#balance").val(result);
}
function updateSubtotal()
{
var temp=0;
for (i=4;i<=400;i=i+5)
{
if($("#00000"+i).length>0)
{
temp=parseFloat(temp)+parseFloat($("#00000"+i).val());
}
}
var subtotal=parseFloat(temp);
if($("#00000").length>0)
{
var firstrowvalue=$("#00000").val();
subtotal=parseFloat(subtotal)+parseFloat(firstrowvalue);
}
subtotal=subtotal.toFixed(2);
$("#subtotal").val(subtotal);
}
function callRKeyUp(Ridname)
{
var rate = parseInt(Ridname,10);
var quantity = rate-1;
var avail = rate+1;
var total = avail+1;
if(parseInt(Ridname)>0)
65

{
quantity="00"+quantity;
rate="000"+rate;
avail="0000"+avail;
total="00000"+total
}
else
{
quantity="00";
rate="000";
avail="0000";
total="00000";
}
var result= parseFloat($("#"+quantity).val()) * parseFloat( $("#"+rate).val() );
result=result.toFixed(2);
$("#"+total).val(result);
if(parseFloat($("#"+quantity).val()) > parseFloat($("#"+avail).val()))
$("#"+quantity).val(parseFloat($("#"+avail).val()));
updateSubtotal();
}
$(document).ready(function() {
// SUCCESS AJAX CALL, replace "success: false," by:
{ callSuccessFunction() },
$("#billnumber").focus();

success : function()

/*$("#"+quantity).keyup(function (e) {
$("#"+total).val( parseInt( $("#"+qunatity).val()) * parseInt( $
("#"+rate).val() ));
if(parseInt($("#"+quantity).val()) > parseInt($("#"+avail).val()))
$("#"+quantity).val(parseInt($("#"+avail).val()));
});
$("#"+rate).keyup(function (e) {
$("#"+total).val( parseInt($("#"+quantity).val()) * parseInt($
("#"+rate).val()) );
if(parseInt($("#"+quantity).val()) > parseInt($("#"+avail).val()))
$("#"+quatity).val(parseInt($("#"+avail).val()));
});
*/
66

$("#customer").blur(function()
{
$.post('check_customer_details.php', {stock_name1: $(this).val() },
function(data){
$("#address").val(data.address);
$("#contact1").val(data.contact1);
$("#contact2").val(data.contact2);
if(data.address!=undefined)
$("#0").focus();
}, 'json');
});
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top"><table width="960" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td><table width="960" border="0" cellpadding="0" cellspacing="0" bgcolor="red">
<tr>
<td height="90" align="left" valign="top"><img src="images/topbanner.jpg" width="960"
height="82"></td>
</tr>
<tr>
<td height="800" align="left" valign="top"><table width="960" border="0" cellpadding="0"
cellspacing="0" bgcolor="#EAE7A1">
<tr>
<td width="130" align="left" valign="top">
<br>
<strong>Welcome <font color="#3399FF"><?php echo
$_SESSION['username']; ?> !</font></strong><br> <br>
<table width="100%" border="1" cellspacing="1" cellpadding="1">
<tr>
<a href="add_stock_details.php">Add Stock </a>
</td>
</tr>
<tr>
<td align="center"><a href="add_supplier_details.php">Add Supplier</a>
</td>
</tr>
<tr>
<td align="center"><a href="view_supplier_details.php"> Supplier</a></td>
</tr>
<tr>
<a href="add_customer_details.php">Add customer details</a>
</tr>
67

<tr>
<td align="center"><a href="view_customer_details.php">Customer Details</a></td>
</tr>
<tr>
<td align="center"><a href="add_category.php">Add Category </a></td>
</tr>
<tr>
<a href="view_stock_sales.php">Stock Sales </a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_entries.php">Stock entry </a></td>
</tr>
<tr>
<td align="center"><!--<a href="report.php"><img src="images/reports.png" width="131"
height="142" border="0"></a></td>-->
<a href="view_stock_details.php">Stock Details </a>
</tr>
<tr>
<td align="center"><a href="view_stock_availability.php">Stock Availability </a></td>
</tr>
<tr>
<td align="center"><a href="add_purchase.php">Purchase Stock</a></td>
</tr>
<tr>
<td align="center"><a href="view_payments.php">Payment</a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_sales_payments.php">Return</a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_entries_payments.php">pending payments</a></td>
</tr>
<tr>
<td align="center"><a href="help.php" target="_blank" height="900" width="800"
onclick="window.open('help.php', 'newwindow', 'width=500, height=500'); return
false;">Help</a></td>
</tr>
</table>
</td> <td height="500" align="center" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<a href="admin.php"><img src="images/home.png" width="91" height="62"
border="0"></a></td>
<a href="add_purchase.php"><img src="images/purchase.png" width="91" height="62"
border="0"></a></td>
<a href="add_stock_sales.php"><img src="images/sales.png" width="91" height="62"
border="0"></a></td>
<a href="report.php"><img src="images/reports.png" width="91" height="62"
border="0"></a></td>

68

<td width="17%" align="left" valign="top"><a href="view_customer_details.php"><img


src="images/customers.png" width="94" height="22" border="0"></a><br>
<a href="view_supplier_details.php"><img src="images/suppliers.png" width="94" height="22"
border="0"></a><br>
<a href="view_payments.php"><img src="images/payments.png" width="94" height="22"
border="0"></a></td>
<td width="18%" align="left" valign="top"><a href="view_stock_sales_payments.php"><img
src="images/outstanding.png" width="94" height="22" border="0"></a><br>
<a href="view_stock_entries_payments.php"><img src="images/pendings.png" width="94"
height="22" border="0"></a><br>
<a href="logout.php"><img src="images/logout.png" width="94" height="22"
border="0"></a></td>
</tr>
</table>
<?php
if(isset($_POST['billnumber']))
{
$billnumber=mysql_real_escape_string($_POST['billnumber']);
$autoid=mysql_real_escape_string($_POST['id']);
$customer=mysql_real_escape_string($_POST['customer1']);
$address=mysql_real_escape_string($_POST['address1']);
$contact1=mysql_real_escape_string($_POST['contact1']);
$contact2=mysql_real_escape_string($_POST['contact2']);
$payment=mysql_real_escape_string($_POST['payment']);
$balance=mysql_real_escape_string($_POST['balance']);
$temp_balance = $db->queryUniqueValue("SELECT balance FROM
customer_details WHERE customer_name='$customer'");
$temp_balance = (int) $temp_balance + (int) $balance;
$db->execute("UPDATE customer_details SET
balance=$temp_balance WHERE customer_name='$customer'");
$selected_date=$_POST['due'];
$selected_date=strtotime( $selected_date );
$mysqldate = date( 'Y-m-d H:i:s', $selected_date );
$due=$mysqldate;
$mode=mysql_real_escape_string($_POST['mode']);
$description=mysql_real_escape_string($_POST['description']);
$namet=$_POST['name'];
$quantityt=$_POST['quanitity'];
$ratet=$_POST['rate'];
$totalt=$_POST['total'];
$subtotal=mysql_real_escape_string($_POST['subtotal']);
$username=$_SESSION['username'];
$i=0;
$j=1;
foreach($namet as $name1)
{
$quantity=$_POST['quantity'][$i];
$rate=$_POST['rate'][$i];
$total=$_POST['total'][$i];
69

$selected_date=$_POST['date'];
$selected_date=strtotime( $selected_date );
$mysqldate = date( 'Y-m-d H:i:s', $selected_date );
$username = $_SESSION['username'];
$count = $db->queryUniqueValue("SELECT count(*) FROM stock_avail
WHERE name='$name1' and quantity >=$quantity");
if($count == 1)
{

$db->query("insert into stock_sales


(transactionid,stock_name,selling_price,quantity,amount,date,username,customer_id,subtotal,payme
nt,balance,due,mode,description,count1,billnumber) values('$autoid','$name1',$rate,$quantity,
$total,'$mysqldate','$username','$customer',$subtotal,$payment,
$balance,'$due','$mode','$description',$j,'$billnumber')");
$amount = $db->queryUniqueValue("SELECT quantity FROM stock_avail
WHERE name='$name1'");
$amount1 = $amount - $quantity;
$db->query("insert into stock_entries
(stock_id,stock_name,quantity,opening_stock,closing_stock,date,username,type,salesid,total,selling_
price,billnumber) values('$autoid','$name1',$quantity,$amount,
$amount1,'$mysqldate','$username','sales','$autoid',$total,$rate,'$billnumber')");
$amount = $db->queryUniqueValue("SELECT quantity FROM
stock_avail WHERE name='$name1'");
$amount1 = $amount - $quantity;
$db->execute("UPDATE stock_avail SET quantity=$amount1
WHERE name='$name1'");
$j++;
}
else
{
echo "<br><font color=green size=+1 >There is no enough stock
deliver for $name1! Please add stock !</font>" ;
}
$i++;
}
echo "<div style='background-color:yellow;'><br><font color=green size=+1
>New Sales Added ! Transaction ID [ $autoid ]</font></div> ";
echo "<script>window.open('add_sales_print.php?
sid=$autoid','myNewWinsr','width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,l
ocation=no,directories=no');</script>";
$count1 = $db->queryUniqueValue("SELECT count(*) FROM
customer_details WHERE customer_name='$customer'");
if($count1!=1)
{
if($db->query("insert into customer_details
values(NULL,'$customer','$address','$contact1','$contact2')"))
echo "<br><font color=green size=+1 > [ $name ] Customer Details Updated !
</font>" ;
70

}
}
?>
<br>
<br>
<form name="salesform" method="post" id="form1" action=""
onSubmit="updateSubtotal()" >
<p align="center"><strong>Add New Sales Entry </strong> - Add New ( Control
+A)</p>
<table width="800" border="0" cellspacing="0" cellpadding="0" id="dynamictable">
<tr>
<td width="61">&nbsp;</td>
<td width="110">&nbsp;</td>
<td width="15">&nbsp;</td>
<td width="76">&nbsp;</td>
<td width="171">&nbsp;</td>
<td width="74">&nbsp;</td>
<td width="111">&nbsp;</td>
<td width="77">&nbsp;</td>
<td width="105">&nbsp;</td>
</tr>
<tr>
<td width="61">&nbsp;</td>
<td width="110">&nbsp;</td>
<td width="15">&nbsp;</td>
<td width="76">&nbsp;</td>
<td width="171">&nbsp;</td>
<td width="74">&nbsp;</td>
<td width="111">&nbsp;</td>
<td width="77">&nbsp;</td>
<td width="105">&nbsp;</td>
</tr>
<tr>
<td width="61">&nbsp;</td>
<td width="110">&nbsp;</td>
<td>&nbsp;</td>
<td><div align="left"><strong>ID</strong>
<?php
$max = $db->maxOfAll("id","stock_sales");
$max=$max+1;
$autoid="SA".$max."";
?>
</div></td>
<td><input name="id" type="text" id="id" readonly=""
value="<?php echo $autoid; ?>" style="width:50px;"></td>
71

<td><div align="left"><strong>Date</strong></div></td>
<td><input type="text" id="datefield" name="date"
class="date_input" value="<?php echo date('d-m-Y');?>" style="width:70px;"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="61">&nbsp;</td>
<td width="110">&nbsp;</td>
<td width="15"><div align="left"></div></td>
<td width="76">&nbsp;</td>
<td width="171"><div align="left"></div></td>
<td width="74">&nbsp;</td>
<td width="111"><div align="left"></div></td>
<td width="77">&nbsp;</td>
<td width="105">&nbsp;</td>
</tr>
<tr>
<td><div align="center"><strong>Bill No</strong></div></td>
<td><input type="text" name="billnumber" style="width:100px;" id="billnumber"
class="validate[required,length[0,100]] text-input"></td>
<td>&nbsp;</td>
<td><div align="left"><strong>Customer</strong></div></td>
<td><input name="customer1" type="text" id="customer" value=""
style="width:100px;" autocomplete="off" ></td>
<td><div align="left">Address</div></td>
<td><textarea name="address1" id="address" style="width:100px;"></textarea></td>
<td><div align="left">Contact1<br>
<br>
Contact2</div></td>
<td><input name="contact1" type="text" id="contact1" value=""
style="width:80px;">
<br>
<br>
<input name="contact2" type="text" id="contact2" value="" style="width:80px;"
></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><div align="left"></div></td>
<td>&nbsp;</td>
<td><div align="left"></div></td>
<td>&nbsp;</td>
<td><div align="left"></div></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<br>
72

<table width="800" border="0" cellspacing="0"


cellpadding="0" id="duplicate" style="margin-left:20px;">
<tr>
<td ><div align="center"><strong>Name</strong></div></td>
<td ><input name="name[]" type="text" class="validate[required,length[0,100]] textinput" id="0" style="width:100px;" onFocus="callAutoComplete(this.id)"
onBlur="callAutoAsignValue(this.id)" autocomplete="off"></td>
<td><div align="left"><strong>Quantity</strong></div></td>
<td><input name="quantity[]" type="text" id="00"
class="validate[required,custom[onlyFloat],lengthCheck[6]] text-input" style="width:50px;"
onKeyUp="callQKeyUp(this.id)"></td>
<td><div align="left"><strong>Rate:</strong></div></td>
<td><input name="rate[]" type="text" id="000"
class="validate[required,custom[onlyFloat],lengthCheck[6]] text-input" style="width:50px;"
onKeyUp="callRKeyUp(this.id)" ></td>
<td>Avail Qty</td>
<td><input name="avail[]" type="text" id="0000"
readonly="" value="" style="width:50px;" ></td>
<td><div align="left"><strong>Total:</strong></div></td>
<td><input name="total[]" type="text" id="00000" readonly="" value=""
style="width:100px;text-align:right;" > </td>
<td width="50"><p><span><a id="minus" href="" >[-]</a> <a id="plus"
href="">[+]</a></span></p></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<table width="800" border="0" align="center"
cellpadding="0" cellspacing="0" id="duplicate" style="margin-left:20px;">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td width="103">&nbsp;</td>
<td width="140">&nbsp;</td>
<td width="5">&nbsp;</td>
<td width="5">&nbsp;</td>
<td width="5">&nbsp;</td>
<td width="13">&nbsp;</td>
</tr>
<tr>
<td>Payment:</td>
73

<td><input type="text" name="payment"


style="width:100px; " id="payment" class="validate[required,custom[onlyFloat],lengthCheck[6]]
text-input" onKeyUp="balanceCalc()"></td>
<td><div align="left">Description</div></td>
<td rowspan="2"><textarea name="description"
style="width:150px; height:40px; "></textarea></td>
<td>&nbsp;</td>
<td><div align="center"><strong>Sub Total
</strong></div></td>
<td><input name="subtotal" id="subtotal" type="text"
readonly="" style="width:100px; text-align:right; color:#333333; font-weight:bold; fontsize:16px;"><img src="images/refresh.png" alt="Refresh" align="absmiddle"
onClick="updateSubtotal()"></td>
<tr>
<td>Balance:</td>
<td><input name="balance" type="text" id="balance"
style="width:100px; " value="0.00" readonly=""></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><div align="center"></div></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="55">Mode:</td>
<td width="125"><select name="mode">
<option value="cheque">Cheque</option>
<option value="cash" selected>Cash</option>
<option value="others">others</option>
</select></td>
<td width="77">Due Date </td>
<td width="195"><input type="text" id="due"
name="due" class="date_input" value="<?php echo date('d-m-Y');?>" style="width:70px;"></td>
<td width="77">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><div align="center">
74

<input type="button" name="Reset" value="Reset" >


</div></td>
<td><input type="submit" name="Submit" value="Save"
onClick="updateSubtotal()" ></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</form></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="30" align="center" bgcolor="#72C9F4"><span class="style1"> Developed by
Ara Associates </span></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<?php
}
?>

75

ADD STOCK SALES


<?php
session_start();if(!isset($_SESSION['username']) || $_SESSION['usertype'] !='admin'){ // if session
variable "username" does not exist.
header("location:index.php?msg=Please%20login%20to%20access%20admin%20area%20!"); // Redirect to index.php
}
else
{
include_once "db.php";
error_reporting (E_ALL ^ E_NOTICE);
<html>
<head>
<title>Welcome to Share Market !</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen"
title="no title" charset="utf-8" />
<link rel="stylesheet" href="css/template.css" type="text/css" media="screen"
title="no title" charset="utf-8" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="jquery.date_input.js"></script>
<link rel="stylesheet" href="date_input.css" type="text/css">
<script type="text/javascript">$(function() {
$("#due").date_input();
});</script>
<script>
function balanceCalc()
{
if(parseFloat($("#newpayment").val()) > parseFloat($("#balance").val()))
$("#newpayment").val(parseFloat($("#balance").val()));
}
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top"><table width="960" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td><table width="960" border="0" cellpadding="0" cellspacing="0" bgcolor="red">
<tr>
<td height="90" align="left" valign="top"><img src="images/topbanner.jpg" width="960"
height="82"></td>
</tr>
<tr>
76

<td height="800" align="left" valign="top"><table width="960" border="0" cellpadding="0"


cellspacing="0" bgcolor="#EAE7A1">
<tr>
<td width="130" align="left" valign="top">
<br>
<strong>Welcome <font color="#3399FF"><?php echo
$_SESSION['username']; ?> !</font></strong><br> <br>
<table width="100%" border="1" cellspacing="1" cellpadding="1">
<tr>
<a href="add_stock_details.php">Add Stock </a>
</td>
</tr>
<tr>
<td align="center"><a href="add_supplier_details.php">Add Supplier</a>
</td>
</tr>
<tr>
<td align="center"><a href="view_supplier_details.php"> Supplier</a></td>
</tr>
<tr>
<a href="add_customer_details.php">Add customer details</a>
</tr>
<tr>
<td align="center"><a href="view_customer_details.php">Customer Details</a></td>
</tr>
<tr>
<td align="center"><a href="add_category.php">Add Category </a></td>
</tr>
<tr>
<a href="view_stock_sales.php">Stock Sales </a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_entries.php">Stock entry </a></td>
</tr>
<tr>
<td align="center"><!--<a href="report.php"><img src="images/reports.png" width="131"
height="142" border="0"></a></td>-->
<a href="view_stock_details.php">Stock Details </a>
</tr>
<tr>
<td align="center"><a href="view_stock_availability.php">Stock Availability </a></td>
</tr>
<tr>
<td align="center"><a href="add_purchase.php">Purchase Stock</a></td>
</tr>
<tr>
<td align="center"><a href="view_payments.php">Payment</a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_sales_payments.php">Return</a></td>
77

</tr>
<tr>
<td align="center"><a href="view_stock_entries_payments.php">pending payments</a></td>
</tr>
<tr>
<td align="center"><a href="help.php" target="_blank" height="900" width="800"
onclick="window.open('help.php', 'newwindow', 'width=500, height=500'); return
false;">Help</a></td>
</tr>
</table>
</td> <td height="500" align="center" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<a href="admin.php"><img src="images/home.png" width="91" height="62"
border="0"></a></td>
<a href="add_purchase.php"><img src="images/purchase.png" width="91" height="62"
border="0"></a></td>
<a href="add_stock_sales.php"><img src="images/sales.png" width="91"
height="62" border="0"></a></td>
<a href="report.php"><img src="images/reports.png" width="91" height="62"
border="0"></a></td>
<td width="17%" align="left" valign="top"><a href="view_customer_details.php"><img
src="images/customers.png" width="94" height="22" border="0"></a><br>
<a href="view_supplier_details.php"><img src="images/suppliers.png" width="94" height="22"
border="0"></a><br>
<a href="view_payments.php"><img src="images/payments.png" width="94" height="22"
border="0"></a></td>
<td width="18%" align="left" valign="top"><a href="view_stock_sales_payments.php"><img
src="images/outstanding.png" width="94" height="22" border="0"></a><br>
<a href="view_stock_entries_payments.php"><img src="images/pendings.png" width="94"
height="22" border="0"></a><br>
<a href="logout.php"><img src="images/logout.png" width="94" height="22"
border="0"></a></td>
</tr>
</table>
<?php
if(isset($_POST['id']))
{
$id=mysql_real_escape_string($_POST['id']);
$balance=mysql_real_escape_string($_POST['balance']);
$payment=mysql_real_escape_string($_POST['payment']);
$customer=mysql_real_escape_string($_POST['customer']);
$subtotal=mysql_real_escape_string($_POST['subtotal']);
$newpayment=mysql_real_escape_string($_POST['newpayment']);
$selected_date=$_POST['due'];
$selected_date=strtotime( $selected_date );
$mysqldate = date( 'Y-m-d H:i:s', $selected_date );
$due=$mysqldate;
$balance= (int) $balance - (int) $newpayment;
$payment= (int) $payment + (int) $newpayment;
78

$max = $db->maxOfAll("id", "transactions");


$receiptid="RCPT".$max;
if($db->query("UPDATE stock_sales SET
balance=$balance,payment=$payment,due='$due' where transactionid='$id'"))
{
$db->query("INSERT INTO
transactions(type,customer,payment,balance,rid,due,subtotal,receiptid) values('sales','$customer',
$newpayment,$balance,'$id','$due',$subtotal,'$receiptid')");
$max = $db->maxOfAll("id", "transactions");
echo "<br><font color=green size=+1 > [ $id ] Customer Details Updated!
</font>" ;
echo "<script>window.open('payment_receipt_print.php?
sid=$max','myNewWinsr','width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,lo
cation=no,directories=no');</script>";
}
else
echo "<br><font color=red size=+1 >Problem in Updation !</font>" ;
?>
<br>
<br>
<?php
if(isset($_GET['eid']))
$id=$_GET['eid'];
$line = $db->queryUniqueObject("SELECT * FROM stock_sales
WHERE transactionid='$id'");
?>
<form name="form1" method="post" id="form1" action="">
<input name="id" type="hidden" value="<?php echo $_GET['eid']; ?>">
<input name="subtotal" type="hidden" value="<?php echo $line>subtotal; ?>">
<p align="center"><strong>Add Stock Sales Customer Payment </strong></p>
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
</tr>
<tr>
<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
</tr>
<tr>
<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
</tr>
<tr>
<td width="150"> Sales ID :</td>
<td width="150"><input name="eid" type="text" id="eid" value="<?php echo $line>transactionid; ?>" readonly=""></td>
79

</tr>
<tr>
<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
</tr>
<tr>
<td width="150">Supplier:</td>
<td width="150"><input name="customer" type="text" id="customer" value="<?php
echo $line->customer_id; ?>" readonly=""></td>
</tr>
<tr>
<td width="150">&nbsp;</td>
<td width="150">&nbsp;</td>
</tr>
<tr>
<td width="150">Total</td>
<td width="150"><input name="total" type="text" id="total" value="<?php echo
$line->subtotal; ?>" readonly=""></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Paid</td>
<td><input name="payment" type="text" id="payment" c value="<?php echo $line>payment;?>" readonly=""></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Balance</td>
<td><input name="balance" type="text" id="balance" value="<?php echo $line>balance;?>" readonly=""></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Next Due</td>
<td><input name="due" type="text" id="due" value="<?php
$phpdate = strtotime( $line->due );
$phpdate = date("d-m-Y",$phpdate);
echo $phpdate;
?>" ></td>
</tr>
<tr>
80

<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>New Payment </td>
<td><input name="newpayment" type="text" id="newpayment"
class="validate[optional,custom[onlyNumber],length[0,100]] text-input" value=""
onKeyUp="balanceCalc()" ></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="right"><input type="reset" name="Reset" value="Reset">
&nbsp;&nbsp;&nbsp;</td>
<td>
&nbsp;&nbsp;&nbsp;
<input type="submit" name="Submit" value="Save"></td>
</tr>
<tr>
<td
align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;&nbsp;&nbsp;(Control + R) </td>
<td align="left"> &nbsp;&nbsp;( Control + S ) </td>
</tr>
</table>
</form>
<br>
<br>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="30" align="center" bgcolor="#72C9F4"><span class="style1">Developed by
Ara Associates </span></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<?php
}
?>

81

ADMIN
<?php
session_start();
if(!isset($_SESSION['username']) || $_SESSION['usertype'] !='admin'){ // if session variable
"username" does not exist.
header("location:index.php?msg=Please%20login%20to%20access%20admin%20area%20!"); // Redirect to index.php
}
else
{
include_once "db.php";
error_reporting (E_ALL ^ E_NOTICE);
<html>
<head>
<title>Welcome to Share Market !</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen"
title="no title" charset="utf-8" />
<link rel="stylesheet" href="css/template.css" type="text/css" media="screen"
title="no title" charset="utf-8" />
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top"><table width="960" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td><table width="960" border="0" cellpadding="0" cellspacing="0" bgcolor="red">
<tr>
<td height="90" align="left" valign="top"><img src="images/topbanner.jpg" width="960"
height="82"></td>
</tr>
<tr>
<td height="500" align="left" valign="top"><table width="960" border="0" cellpadding="0"
cellspacing="0" bgcolor="#EAE7A1">
<tr>
<td width="130" align="left" valign="top">
<br>
<strong>Welcome <font color="#3399FF"><?php echo
$_SESSION['username']; ?> !</font></strong><br> <br>
<table width="100%" border="1" cellspacing="1" cellpadding="1">
<tr>
<a href="add_stock_details.php">Add Stock </a>
</td>
82

</tr>
<tr>
<td align="center"><a href="add_supplier_details.php">Add Supplier</a>
</td>
</tr>
<tr>
<td align="center"><a href="view_supplier_details.php"> Supplier</a></td>
</tr>
<tr>
<a href="add_customer_details.php">Add customer details</a>
</tr>
<tr>
<td align="center"><a href="view_customer_details.php">Customer Details</a></td>
</tr>
<tr>
<td align="center"><a href="add_category.php">Add Category </a></td>
</tr>
<tr>
<td align="center"><!--<a href="add_stock_sales.php"><img src="images/sales.png"
width="146" height="111" border="0"></a></td>-->
<a href="view_stock_sales.php">Stock Sales </a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_entries.php">Stock entry </a></td>
</tr>
<tr>
<td align="center"><!--<a href="report.php"><img src="images/reports.png" width="131"
height="142" border="0"></a></td>-->
<a href="view_stock_details.php">Stock Details </a>
</tr>
<tr>
<td align="center"><a href="view_stock_availability.php">Stock Availability </a></td>
</tr>
<tr>
<td align="center"><a href="add_purchase.php">Purchase Stock</a></td>
</tr>
<tr>
<td align="center"><a href="view_payments.php">Payment</a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_sales_payments.php">Return</a></td>
</tr>
<tr>
<td align="center"><a href="view_stock_entries_payments.php">pending payments</a></td>
</tr>
<tr>
<td align="center"><a href="help.php" target="_blank" height="900" width="800"
onclick="window.open('help.php', 'newwindow', 'width=500, height=500'); return
false;">Help</a></td>
</tr>
83

</table>
</td>
<td height="414" align="center" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<a href="admin.php"><img src="images/home.png" width="91" height="62"
border="0"></a></td>
<a href="add_purchase.php"><img src="images/purchase.png" width="91" height="62"
border="0"></a></td>
<a href="add_stock_sales.php"><img src="images/sales.png" width="91" height="62"
border="0"></a></td>
<a href="report.php"><img src="images/reports.png" width="91" height="62"
border="0"></a></td>
<td width="17%" align="left" valign="top"><a href="view_customer_details.php"><img
src="images/customers.png" width="94" height="22" border="0"></a><br>
<a href="view_supplier_details.php"><img src="images/suppliers.png" width="94" height="22"
border="0"></a><br>
<a href="view_payments.php"><img src="images/payments.png" width="94" height="22"
border="0"></a></td>
<td width="18%" align="left" valign="top"><a href="view_stock_sales_payments.php"><img
src="images/outstanding.png" width="94" height="22" border="0"></a><br>
<a href="view_stock_entries_payments.php"><img src="images/pendings.png" width="94"
height="22" border="0"></a><br>
<a href="logout.php"><img src="images/logout.png" width="94" height="22"
border="0"></a></td>
</tr>
</table>
Welcome to Admin Panel<br>
<br>
<br>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="167">&nbsp;</td>
<td width="133">&nbsp;</td>
</tr>
<tr>
<td>Total Sales Transactions </td>
<td><?php echo $count = $db->countOfAll("stock_sales");?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Total Number of Stocks </td>
<td><?php echo $count = $db->countOfAll("stock_avail");?>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
84

</tr>
<tr>
<td>Total number of Suppliers </td>
<td><?php echo $count = $db->countOfAll("supplier_details");?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Total Number of Customers </td>
<td><?php echo $count = $db->countOfAll("customer_details");?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="30" align="center" bgcolor="#72C9F4"><span class="style1">Developed by
Ara Associates </span></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<?php
}
?>
85

SYSTEM
TESTING

86

What is testing?

Testing could be defined as the process of executing a Program so that potential errors
could be found. The more a system is error free, the more reliable it would be. If the
software is released without testing, the potential risks associated with the software
increases. Testing is an expensive activity, but software launched without testing
would result in huge losses and increased cost. Testing cannot be performed by the
developer because it is quite difficult to identify errors in ones own creation. In this, a
group of different people is identified and then testing is performed. Testing is also
done by the client. Complete testing is not possible. But errors to the maximum extent
are identified during the testing process.

Functional Testing
This type of testing means that the code is tested for the output on certain inputs. No
analysis of the internal code is done. This type of testing is also called Black Box
Testing. In the System, the functional testing is used only to an extent.
The validation checking for fields is done with this method. The technique widely
used for this testing is Equivalence Class Testing. Here, the input domain is partitioned
into a number of classes and the output for both valid and invalid classes are tested.
Like, in case of the email field, the validation was that the Email string should contain
at least one . And one @ Sign. In this case, the test cases were inputs with no .
And @ sign (invalid class) and input with one and more than one . Sign and one
@ sign (valid class) and input with one and more than one . And @ sign (invalid
class).

Structural Testing
In this, the whole code is analyzed line by line to detect errors. Even the minute errors
that were not detected during functional testing are detected at this stage. This is also
called White Box Testing. The Advantage of this type of testing is that code that was
not executed while functional testing is checked for errors now. Many times some
unwanted code is present that can be removed with structural testing only as it violates
87

the requirements. In the Share Market, the modules and analyzed line by line and
errors are searched for.

Levels of Testing
1) Unit Testing :- At this level, each module is tested individually. In the Share
Market, the unit testing is done by both structural and functional testing. Each
module is tested with a set of inputs for the outputs as well as each and every
line is analyzed with the intent of finding error.

2) Integration Testing :- At this level, the modules are clubbed together and then
tested so that functionality of each independent module can be tested. It ensures
that the interface between the modules is working properly. At this point in our
system, we move away from structural testing to functional testing.

3) System Testing :-It is closest to practical experience. Here, the system


performance is tested. Here, in our system, we completely move towards
functional testing

4) White Box Testing:-This is a unit testing method where a unit will be taken at a
time and tested thoroughly at a statement level to find the maximum possible
errors. I tested step wise every piece of code, taking care that every statement in
the code is executed at least once. The white box testing is also called Glass
Box Testing. I have generated a list of test cases, sample data. This is used to
check all possible combinations of execution paths though the code at every
module level.
5) Black Box Testing:-This testing method considers a module as a single unit and
checks the unit at interface and communication with other module rather getting
into details at statement level. Here the module will be treated as a black box
that will take some input and generate output. Output for a given set of input
combination is forwarded to other modules

88

Report &
conclusion

89

Future Scope
The project has great scope in future because in todays word scenario people are
moving toward internet for fulfilling their small needs. The project gives the admin to
get entire detail of the firm admin can directly visit the system and get the details of
the suppliers, customers, and get all the transactions details being done and the amount
of pending payments being done .

LIMITATION OF PROJECT
The limitation of share market is that there is no emergency facility available in our
project and customers interferences is not being allowed in the firm as only admin can
only see the transaction and supplier and customer details

CONCLUSION
Indians are becoming more quality conscious. In the same way online facilities are
increasing day by day. If we talking about online shopping , reservation , examination
are increasing day by day , in the same way SHARE MARKET is a facility by which
owner can have easily have a track of record of its firm and all the transactions being
done.
Some Reasons are:
It is easy to use, since it uses the GUI provided in the user dialog.
User friendly seems are provided.
The usage of software increases the efficiency, decrease the effort.
It has been thoroughly tested.

90

PLAGIARISM
REPORT

91

S-ar putea să vă placă și