8/12/2019 Roby Bodypdf
1/50
8/12/2019 Roby Bodypdf
2/50
E-Mandi- Electronic Vegetable Market
intermediates between the farmer and consumer. $y using the E Mandi system
there will be direct communication between the farmer and government
recogni%ed fruit and vegetables agencies. ow a days in kerala price of
agricultural products increased vastly when comes to consumer. Even though,
most of the times farmers does not get the actual revenue for the products as
they e*peted. This problem is due to a number of factors. The number of
intermediate involved to e*change may cause the cost of the product to rise as it
reaches the consumers. +ue to the ineffective route informations the transport
service e*penses may increase. The lack of information between demand and
supply can result in lack of profits. The inade"uate market information also
makes it difficult for the farmers to keep up with the changing needs of
customers. These all are the problems faced by the farmers and agencies in now
days. !erala government provides some benefitable things for farmers through
e-krishi proect but this system is a new one for increasing efficiency of
agriculture in kerala
3. PROJECT DESCRIPTION
E-Mandi is mainly focused on improving the efficiency in
agricultural trade for farmers. The overnment agencies also benifit from this
through trade information. The main obectives it focuses on are
To build close relationship among farmers and government recogni%ed
fruits and vegetable agencies. #lso increase the number of contacts
between them.
To provide efficient way to sell #griculture products.
/et farmers to specify their own pricing rate depending on the ongoing
market rate and give a reasonable price to his0her product. 1armers get
price alerts using the SMS and also through referring website. 'hinmaya &nstitute (f Technology 2
8/12/2019 Roby Bodypdf
3/50
E-Mandi- Electronic Vegetable Market
To provide bidding facility for buying the products, this facility is for
government recogni%ed fruits and vegetable agencies and this leads to
advantage for farmers.
3rovide root map and distance facility.
3.1 PURPOSE
The purpose of E-Mandi system is to create a close
relationship between farmers and government recogni%ed fruits and vegetable
agencies to sell and buy agricultural products.The system is it can be useful for
vegco, horticorp and other government recogni%ed fruits and vegetable agencies
to collect products from different places with the root map and distance facility.
3.2 SCOPE OF THE PROJECT
The scope of E mandi system is solving the problems that
farmers facing at the time of selling products and the system is useful for
government recogni%ed fruits and vegetable agencies to collect products from
different places. The E- Mandi system is applicable for every government
recogni%ed fruits and vegetable agencies in kerala and also for farmers. 1armers
can also use the benefit of this system through #kshaya and other #griculture
office without money.
3.3 EXISTING AND PROPOSED SYSTEM
Exi!in" S#!$%&
&n !erala price of agricultural products increased vastly when
comes to consumer. Even though, most of the times farmers does not get the
actual revenue for the products as they e*pected. This problem is due to 'hinmaya &nstitute (f Technology 4
8/12/2019 Roby Bodypdf
4/50
E-Mandi- Electronic Vegetable Market
umber of intermediates involved to e*change.
5ighest transport service e*penses.
The contacts farmers have with market are less. Even the e*isting
contacts are based on telephone conversations.
/ack of market information.
+ifficulty in establishing an effective route to market.
/ack of knowledge on demand and supply.
P'()($d S#!$%&
The E Mandi 6Electronic Vegetable Market7 system is mainly
focused on establishing direct communication between farmers and government
recogni%ed fruits and vegetable agencies. This system reduces the price of
agricultural products for the end consumers by decreasing the intermediate. The
system is mainly a web based system . #ny registered user can get to know theprices of commodity via SMS or referring website. #ll the farmers can give
information about their products and government agencies can bid on that
product. The system also displays a route map and the distance to the respective
farmer involved in the bidding process. #fter completing the closing date of
bidding the system automatically generates a agreement certificate and send
through mail to both the parties. overnment agencies can also give their
re"uirements. The administrator is allowed to view the comments of the farmers
and agencies.
3.* SALIENT FEATURES OF THE SYSTEM
The salient features of the system are
The system gives route map information on farmers, based on which
agencies can bid for a particular product. 'hinmaya &nstitute (f Technology 8
8/12/2019 Roby Bodypdf
5/50
E-Mandi- Electronic Vegetable Market
#t the bidding time the farmers are sorted based on least distance and
ma*imum "uantity.
#fter the bidding system generates an agreement certificate and is mailed
to both parties involved in the process.
SMS alert facility is provided.
The comments by the farmers can be viewed by an agency and vice versa.
#dmin can view all the comments based on the bids as well as date and the
last comment will be visible on the top of the list.
*. SOFT+ARE RE,UIREMENT ANALYSIS
E Mandi is mainly focused on improving the efficiency in
agricultural trade for farmers. The overnment agencies also benifit from this
through trade information. The main obectives it focuses on are
To build close relationship among farmers and government recogni%ed fruits
and vegetable agencies. #lso increase the number of contacts between them.
To provide efficient way to sell #griculture products.
/et farmers to specify their own pricing rate depending on the ongoing
market rate and give a reasonable price to his0her product. 1armers get price
alerts using the SMS and also through referring website.
To provide bidding facility for buying the products, this facility is for
government recogni%ed fruits and vegetable agencies and this leads to
advantage for farmers.
*.1 PRO-LEM DEFINITION
&n kerala price of agricultural products increased vastly
when comes to consumer. Even though, most of the times farmers does not
get the actual revenue for the products as they e*peted. This problem is due 'hinmaya &nstitute (f Technology 9
8/12/2019 Roby Bodypdf
6/50
E-Mandi- Electronic Vegetable Market
to a number of factors. The number of intermediate involved to e*change
may cause the cost of the product to rise as it reaches the consumers. +ue to
the ineffective route informations the transport service e*penses may
increase. The lack of information between demand and supply can result in
lack of profits. The inade"uate market information also makes it difficult for
the farmers to keep up with the changing needs of customers. $y using the
e-mandi system, these problems can be solved.
*.2 FEASI-ILITY ANALYSIS
5aving understood the e*isting software and specified
obective of the proposed software the alternative software is investigated. #
feasibility analysis is performed to choose the software that meets the
performance at least cost. The main aim of feasibility study activity is to
determine whether it would be functionally and technically feasible to
develop the product. The feasibility study involves the analysis of theproblem and collection of relevant information relating to the product such
as different data items which would be the input to the system, the
processing re"uired to be carried out on these data, the output data re"uired
to be produced by the system. # feasibility study is a rest of the system
proposal according to its working, impact on the organi%ation, ability to meet
users, need and effective use of resources. The obective of the feasibility
study is ac"uiring the sense of the scope of the system.
Three essential considerations involved in the feasibility study are
: (perational feasibility
: Technical feasibility
: Economical feasibility
'hinmaya &nstitute (f Technology ;
8/12/2019 Roby Bodypdf
7/50
E-Mandi- Electronic Vegetable Market
O)$'a!i(na F$ai/ii!#
(perational feasibility is dependent on human resources available
for the proect and involves proecting whether the system will be used if it is
developed and implemented. (perational feasibility is a measure of how well
a proposed system solves the problems, and takes advantage of the
opportunities identified during scope definition and how it satisfies the
re"uirements identified during the re"uirements analysis phase carried out
earlier.
The E-Mandi system would provide end users with timely,
accurate and useful formatted information. $y using the E-Mandi, the
farmers and government agencies sell and buy product with reliable way.
T$0ni0a F$ai/ii!#
# large part of determining resources has to do with assessing
technical feasibility. &t considers the technical re"uirements of the proposedproect. The technical re"uirements are then compared to the technical
capability of the environment where it is to be deployed. The systems proect
is considered technically feasible if the environment technical capability is
sufficient to support the proect re"uirements.
The current technical resources can be upgraded or added to make
the proect feasible within the limits of current technology. The language
selected for coding is php. &t is feasible to develop a user-friendly interface
using 353, 'SS, / server. +ream=eaver provide technical
guarantee of accuracy, reliability is of access and data security. Thus since
both the hardware and the software re"uirement are satisfied, it is
'hinmaya &nstitute (f Technology ?
8/12/2019 Roby Bodypdf
8/50
E-Mandi- Electronic Vegetable Market
technically feasible.
E0(n(%i0 F$ai/ii!#
Economic analysis could also be referred to as cost0benefit
analysis. &t is the most fre"uently used method for evaluating the
effectiveness of a new system. &n economic analysis the procedure is to
determine the benefits and savings that are e*pected from a candidate system
and compare them with costs. &f benefits outweigh costs, then the decision is
made to design and implement the system. This E Mandi system is e*pected to give long term benefits as the
product delivery and farmer satisfaction will improve. &n the long run
farmers can be saved from the intermediaries who e*tract more profit from
them. The farmers can register through already e*isting governmental
agencies such as #!S5#@# and #grcultural +epartment. The already
e*isting staff can be utili%ed for this programme. The computer hardwareand internet connection is already available at centers, which can be utili%ed.
The additional cost would be incurred in the training of the staff and nothing
else. The cost of printing bulky registers can be saved. The proect does not
involve any special hardware other than standard specifications. So it is
economically feasible to implement the proect within the available budget.
*.3 METHODOLOGY
The &ncremental model is used to develop this proect
because the re"uirements could not completely be free%e at the proect start.
The system was to be designed from the currently known re"uirements and
then adaptations has to be made to the developed system. &n incremental
model the whole re"uirement is divided into various builds. Multiple
development cycles take place here, making the life cycle a Amulti-waterfallB 'hinmaya &nstitute (f Technology C
8/12/2019 Roby Bodypdf
9/50
E-Mandi- Electronic Vegetable Market
cycle. 'ycles are divided up into smaller, more easily managed modules.
Each module passes through the re"uirements, design, implementation and
testing phases. # working version of software is produced during the first
module, so you have working software early on during the software life
cycle. Each subse"uent release of the module adds function to the previous
release. The process continues till the complete system is achieved.
+$n !( $ !$ In0'$%$n!a %(d$&
De"uirements of the complete system are clearly defined and understood.
Maor re"uirements must be defined however, some details can evolve
with time.There are some high risk features and goals.
Adan!a"$ (4 In0'$%$n!a %(d$&
enerates working software "uickly and early during the software life
cycle.
More fle*ible F less costly to change scope and re"uirements.
Easier to test and debug during a smaller iteration.
'hinmaya &nstitute (f Technology G
8/12/2019 Roby Bodypdf
10/50
E-Mandi- Electronic Vegetable Market
'ustomer can respond to each built.
/owers initial delivery cost.
Easier to manage risk because risky pieces are identified and handled during
itHd iteration.
*.* SOFT+ARE AND HARD+ARE RE,UIREMENTS
Ha'd5a'$ R$6i'$%$n!
3rocessor &ntel 3rocessor 5igher Than &ntel 'ore2 +uo.
Dam Minimum (f 2 b Dam
5dd )9 b 1ree 5ard +isk Space
!eyboard )I8keys !eyboard.
Mouse /ogitech Mouse.
S(4!5a'$ R$6i'$%$n!
(perating System =indows (s 0 /inu* (s
1ront End php
$ack End Mys"l Server
3latform +ream=eaver
=eb Servers =#M3 Server
T$'% and T$'%in(("#
PHP
353 is a general-purpose scripting language that is especially suited to
server-side web development where 353 generally runs on a web server.
#ny 353 code in a re"uested file is e*ecuted by the 353 runtime, usually to
create dynamic web page content or dynamic images used on =eb sites or
'hinmaya &nstitute (f Technology )I
8/12/2019 Roby Bodypdf
11/50
E-Mandi- Electronic Vegetable Market
elsewhere. &t can also be used for command-line scripting and client-side
graphical user interface 6J&7 applications. 353 can be deployed on most
=eb servers, many operating systems and platforms, and can be used with
many relational database management systems 6D+$MS7. &t is available free
of charge, and the 353 roup provides the complete source code for users to
build, customi%e and e*tend for their own use.
M#S,L
The database server used for doing this proect is MyS>/. MyS>/ isthe worldKs most used open source relational database management system
that runs as a server providing multi-user access to a number of databases.
MyS>/ is a popular choice of database for use in web applications, and is a
central component of the widely used /#M3 open source web application
software stack 6and other K#M3K stacks7. /#M3 is an acronym for L/inu*,
#pache, MyS>/, and 3erl035303ython.L 1ree-software-open source proects
that re"uire a full-featured database management system often use MyS>/.
+AMP SERVER
The acronym =#M3 refers to a set of free 6open source7 applications,
combined with Microsoft =indows, which are commonly used in =eb server
environments. The =#M3 stack provides developers with the four key
elements of a =eb server an operating system, database, =eb server and
=eb scripting software. The combined usage of these programs is called a
server stack. &n this stack, Microsoft =indows is the operating system 6(S7,
#pache is the =eb server, MyS>/ handles the database components, while
353, 3ython, or 3ED/ represents the dynamic scripting languages.
'hinmaya &nstitute (f Technology ))
8/12/2019 Roby Bodypdf
12/50
E-Mandi- Electronic Vegetable Market
*.7 USECASE DIAGRAMS
The E-Mandi system is useful for both the farmers and
government recogni%ed fruits and vegetable agencies.
This system is used by three types of users. They are
#dministrator
1armers
overnment recogni%ed fruits and vegetable agencies.
Fa'%$'&
'hinmaya &nstitute (f Technology )2
8/12/2019 Roby Bodypdf
13/50
E-Mandi- Electronic Vegetable Market
A"$n0i$&
'hinmaya &nstitute (f Technology )4
8/12/2019 Roby Bodypdf
14/50
E-Mandi- Electronic Vegetable Market
Ad%ini!'a!('&
'hinmaya &nstitute (f Technology )8
8/12/2019 Roby Bodypdf
15/50
E-Mandi- Electronic Vegetable Market
7. SOFT+ARE DESIGN
Software design usually involves problem solving and
planning a software solution. This includes both low-level component and
algorithm design and high-level, architecture design.Software design is the
process of implementing software solutions to one or more set of problems. (ne
of the important parts of software design is the software re"uirements analysis
6SD#7. &t is a part of the software development process that lists specifications
used in software engineering.
7.1 UML DIAGRAMS
Jnified Modeling /anguage is a standardi%ed,
general-purpose modeling language in the field of software engineering. The
Jnified Modeling /anguage includes a set of graphic notation techni"ues to
create visual models of obect-oriented software-intensive systems.
7.1.1 DATA FLO+ DIAGRAMS
The +1+ is also known as the bubble chart. &t is a
simple graphical formalism that can be used to represent a system in terms of
the input data to the system, various processing carried out in these data and the
output data generated by the system. Starting with a set of high-level functions
that a system performance of +1+ model in hierarchically it represents various
sub functions. &n a normal convention, logical +1+ can be completed using
only four notations
Depresents source or destination of data
Depresents +ata 1low
Depresents a process that transforms incoming data into outgoing data
'hinmaya &nstitute (f Technology )9
8/12/2019 Roby Bodypdf
16/50
E-Mandi- Electronic Vegetable Market
Depresents +ata Source
Fn0!i(n S#%/(
# function is represented using a circle. This symbol is called a process
or a bubble. $ubbles are annotated with the names of corresponding functions.
Ex!$'na En!i!# S#%/(
#n e*ternal entity such as a librarian, library member etc is represented
by a rectangle. The e*ternal entities are essentially those physical entities
e*ternal to the software system, which interact with the system by inputting data
to the system or by consuming the data produced by the system.
Da!a F(5 S#%/(
# directed arc or an arrow is used as a +ata 1low Symbol. This
represents the data flow occurring between two processes or between an
e*ternal entity and a process in direction of the +ata 1low #rrow. +ata 1lowsymbols are annotated with corresponding data names.
Da!a S!('$ S#%/(
# +ata Store represents a logical file it is represented using two parallel
lines. # logical file can represent either +ata Store Symbol, which can represent
either data structure or a physical file on disk.
O!)! S#%/(
The output symbol is used when a hardcopy is produced and the user of
the copies cannot be clearly specified or there are several users of the output.
The +1+ at the simplest level is referred to as the 'onte*t #nalysis
+iagram. These are e*panded by level, each e*plaining in process in detail.
3rocesses are numbered for easy identification and are normally labeled in block
letters. Each data flow is labeled for easy understanding.
'hinmaya &nstitute (f Technology );
8/12/2019 Roby Bodypdf
17/50
E-Mandi- Electronic Vegetable Market
C(n!$x! Dia"'a%
The conte*t diagram is the most abstract data flow representation of a
system. &t represents the entire system as a single bubble. This bubble is labeled
according to the main function of the system. The various e*ternal entities with
the system interact and the data input to the system and the data output from the
system are represented as incoming and outgoing arrows. These data flow
arrows should be annotated with the corresponding data names.
L$$81 DFD
To develop the /EVE/-) +1+, e*amine the high level functional
re"uirements. &t is between three to seven high-level functional re"uirements
then these can be directly represented as bubbles as in the /EVE/-) +1+. =e
can e*amine the input data to these functions and the data output by these
functions, and represent them appropriately in the diagram.
P'(0$d'$ !( d$$() a DFD %(d$ (4 a #!$%&1. The SDS document is e*amined to determine
: +ifferent high-level functions that the system need to perform.
: +ata input to every high-level function
: +ata output from every high-level functions
: &nteractions among the identified high-level functions
These aspects of the high-level functions are then represented in a diagrammatic
form.This forms the top level +ata 1low +iagram, usually called +1+.
2. The high-level functions described in the SDS +ocuments, and then each
of the high-level functions can be represented in form of a bubble. Each
high-level function is decomposed into constituent subfunctions through the
following set of activities.
: +ifferent sub functions of the high-level functions are identified.
'hinmaya &nstitute (f Technology )?
8/12/2019 Roby Bodypdf
18/50
E-Mandi- Electronic Vegetable Market
: +ata input to each of these sub functions is identified.
: +ata output from each of these sub functions is identified.
: &nteractions among these sub functions are identified.
These aspects are then represented in a diagrammatic form using a +1+.
4. Step three is repeated recursively for each sub function until a simple
algorithm can represent a sub function.
Da!a 4(5 dia"'a% &
L$$ 9
'hinmaya &nstitute (f Technology )C
8/12/2019 Roby Bodypdf
19/50
E-Mandi- Electronic Vegetable Market
L$$ 1
'hinmaya &nstitute (f Technology )G
8/12/2019 Roby Bodypdf
20/50
E-Mandi- Electronic Vegetable Market
L$$ 2
'hinmaya &nstitute (f Technology 2I
8/12/2019 Roby Bodypdf
21/50
E-Mandi- Electronic Vegetable Market
7.2 DATA-ASE DESIGN
The system is implemented in such a way that all the valid
informationHs are stored in the database. +atabase design converts the data
model developed in logical designing to database definition. This is supported
by database software. The management of data involves baoh the definition of
structure of the storage of information and provision of mechanism for the
manipulation of information. &n addition database system must provide safety of
information handle, despite the system crashes due to attempts of unauthori%ed
access.
# database is a collection of interrelated data stored with minimum
redundancy to serve many users "uickly and efficiently. &n database design,
several views of data must be considered along with the person who users them.
The logical view is what the data look like, regardless of how they are stored.
The physical view is the way data e*ist in physical storage.
Tables are carefully designed aiming to achieve its main obectives
ie, to make information access easy, "uick, ine*pensive and fle*ible for
user.+atabase design is the process of producing a detailed data model of a
database. This logical data model contains all the needed logical and physical
design choices and physical storage parameters needed to generate a design in a
+ata +efinition /anguage, which can then be used to create a database. # fully
attributed data model contains detailed attributes for each entity.The term database design can be used to describe many different
parts of the design of an overall database system. 3rincipally, and most
correctly, it can be thought of as the logical design of the base data structures
used to store the data. &n the relational model these are the tables and views. &n
an obect database the entities and relationships map directly to obect classes
and named relationships. 5owever, the term database design could also be used
'hinmaya &nstitute (f Technology 2)
8/12/2019 Roby Bodypdf
22/50
E-Mandi- Electronic Vegetable Market
to apply to the overall process of designing, not ust the base data structures, but
also the forms and "ueries used as part of the overall database application within
the database management system.
7.2.1 E8R DIAGRAMS
#n ED diagram is a diagram that helps to design
databases in an efficient way. The E-D diagram for the E-Mandi system as
follows
'hinmaya &nstitute (f Technology 22
8/12/2019 Roby Bodypdf
23/50
E-Mandi- Electronic Vegetable Market
:. CODE TEMPLATE
:.1 CODING OR CODE OUTLINES
'(!$.))
html *mlnsNLhttp00www.w4.org0)GGG0*htmlLO
headO
scriptO
function call67P
document.form).submit67
Q
0scriptO
script srcNLhttp00maps.google.com0mapsR
fileNapivN2keyN#$>###?>-rshu=kcC5y1&8V25*>@3m-*tdIIhT>
('I(Up#M(8I15#*T2Gd$f*"M3"9%wdei+S5E3/CG#L
typeNLte*t0avascriptLO0scriptO
script srcNLhttp00maps.google.com0maps0api0sRsensorNtrueLO0scriptO
script
srcNLhttp00aa*.googleapis.com0aa*0libs0"uery0).C.40"uery.min.sLO0scriptO
scriptO
var g+ir
function initiali%e67 P
geocoder N new 'lienteocoder67
g+ir N new +irections67
Event.add/istener6g+ir, LloadL, function67 P
alert66LWfromL7.val677
var driving+istanceMiles N g+ir.get+istance67.meters 0 );IG.488 'hinmaya &nstitute (f Technology 24
8/12/2019 Roby Bodypdf
24/50
E-Mandi- Electronic Vegetable Market
var driving+istance!ilometers N g+ir.get+istance67.meters 0 )III
6LWresultsL7.te*t 6 driving+istanceMiles X K miles 6or K X
driving+istance!ilometers X K kilometers7K7
Q7
Q
function calculateDoute6from, to7 P
00 'enter initiali%ed to aples, &taly
var my(ptions N P
%oom )I,
center new google.maps./at/ng68I.C8, )8.297,
mapType&d google.maps.MapType&d.D(#+M#3
Q
00 +raw the map
var map(bect N new
google.maps.Map6document.getElement$y&d6LmapL7, my(ptions7
var directionsService N new google.maps.+irectionsService67
var directionsDe"uest N P
origin from,
destination to,
travelMode google.maps.+irectionsTravelMode.+D&V&,
unitSystem google.maps.JnitSystem.METD&' Q
directionsService.route6
directionsDe"uest,
function6response, status7
P
if 6status NN google.maps.+irectionsStatus.(!7
'hinmaya &nstitute (f Technology 28
8/12/2019 Roby Bodypdf
25/50
E-Mandi- Electronic Vegetable Market
P
new google.maps.+irectionsDenderer6P
map map(bect,
directions response
Q7
Q
else
6LWerrorL7.append6LJnable to retrieve your routebr 0OL7
Q
7
Q
6document7.ready6function67 P
00 &f the browser supports the eolocation #3&
if 6typeof navigator.geolocation NN LundefinedL7 P
6LWerrorL7.te*t6L@our browser doesnKt support the eolocation #3&L7
return
Q
6LWfrom-link, Wto-linkL7.click6function6event7 P
event.prevent+efault67
var address&d N this.id.substring6I, this.id.inde*(f6L-L77
navigator.geolocation.get'urrent3osition6function6position7 P var geocoder N new google.maps.eocoder67
geocoder.geocode6P
LlocationL new google.maps./at/ng6position.coords.latitude,
position.coords.longitude7
Q,
function6results, status7 P
'hinmaya &nstitute (f Technology 29
8/12/2019 Roby Bodypdf
26/50
E-Mandi- Electronic Vegetable Market
if 6status NN google.maps.eocoderStatus.(!7
6LWL X address&d7.val6resultsYIZ.formattedaddress7
else
6LWerrorL7.append6LJnable to retrieve your addressbr 0OL7
Q7
Q,
function6positionError7P
6LWerrorL7.append6LError L X positionError.message X Lbr 0OL7
Q,
P
enable5igh#ccuracy true,
timeout )I [ )III 00 )I seconds
Q7
Q7
6LWcalculate-routeL7.submit6function6event7 P
event.prevent+efault67
calculateDoute66LWfromL7.val67, 6LWtoL7.val677
show/ocation67
Q7
Q7 function show/ocation67 P
geocoder.get/ocations66LWfromL7.val67, function 6response7 P
if 6\response ]] response.Status.code \N 2II7
P
alert6LSorry, we were unable to geocode the first addressL7
Q
'hinmaya &nstitute (f Technology 2;
8/12/2019 Roby Bodypdf
27/50
E-Mandi- Electronic Vegetable Market
else
P
location) N Plat response.3lacemarkYIZ.3oint.coordinatesY)Z, lon
response.3lacemarkYIZ.3oint.coordinatesYIZ, address
response.3lacemarkYIZ.addressQ
geocoder.get/ocations66LWtoL7.val67, function 6response7 P
if 6\response ]] response.Status.code \N 2II7
P
alert6LSorry, we were unable to geocode the second addressL7
Q
else
P
location2 N Plat response.3lacemarkYIZ.3oint.coordinatesY)Z,
lon response.3lacemarkYIZ.3oint.coordinatesYIZ, address
response.3lacemarkYIZ.addressQ
g+ir.load6Kfrom K X location).address X K to K X
location2.address7
Q
Q7
Q
Q7 Q
0scriptO
0headO
body on/oadNLinitiali%e67LO
0headO
body onloadNLinitiali%e67LO
'hinmaya &nstitute (f Technology 2?
8/12/2019 Roby Bodypdf
28/50
E-Mandi- Electronic Vegetable Market
div idNLcontainerLO
div idNLbannerLO
div idNLbannernameLO0divO
div idNLlogoutLOa hrefNLLO'ontact us ] #bout us 0aO bO]0bO a
hrefNLlogout.phpLO/ogout0aO0divO
div idNLbannerimagesL classNLblueberryLO
ul classNLslidesLO
liOimg srcNL..0images0banner).pgL 0O0liO
liOimg srcNL..0images0banner2.pgL 0O0liO
liOimg srcNL..0images0banner4.pgL 0O0liO
0ulO
0divO
div idNLmenuLO
Rphp
includeonce6Lagencysess.phpL7
RO
a hrefNLbidding.phpLO $idding0aO
]
a hrefNLroute.phpRrouteN)LO 1armer route0aO
]
a hrefNLroute.phpRrouteNILO1armer distance0aO ]
a hrefNLbuy.phpLO$uy product0aO
]
a hrefNLlogout.phpLO/ogout0aO
0divO
0divO
'hinmaya &nstitute (f Technology 2C
8/12/2019 Roby Bodypdf
29/50
E-Mandi- Electronic Vegetable Market
div idNLcontentLO
div classNLtitlewrapperLO
span classNLtitlebo*LOstrongODoute \0strongO0spanO 0divO
div classNLspacer9ILO0divO
\--@our content goes here --O
div alignNLcenterLO
Rphp
includeonce6Lagencysess.phpL7
RO
Rphp
if6isset6DE>JESTYKrouteKZ77P
if6DE>JESTYKrouteKZNN)7P
RO
form nameNLform)L methodNLpostLO
pOSelect 1armer
select nameNLfarmidL on'hangeNLcall67LO
optionOselect0optionO
Rphp
resNmys"l"uery6Lselect [ from farmerL7
while6rowNmys"lfetcharray6res77P
RO option valueNLRphp echo rowYIZ ROLORphp echo rowY)Z.L L.
rowY4Z RO0optionO
Rphp
Q
RO
0selectO
'hinmaya &nstitute (f Technology 2G
8/12/2019 Roby Bodypdf
30/50
E-Mandi- Electronic Vegetable Market
Rphp
if6isset6DE>JESTYKfarmidKZ77P
farmidNDE>JESTYKfarmidKZ
toNIfromNI
resNmys"l"uery6Lselect location from farmer where farmeridNfarmidL7
if6rowNmys"lfetcharray6res77P
global to
toNrowYIZ
Q
resNmys"l"uery6Lselect location from agency where loginidNlogidL7
if6rowNmys"lfetcharray6res77P
global from
fromNrowYIZ
Q
routesNsondecode6filegetcontents6Khttp00maps.googleapis.com0maps0api0di
rections0sonRoriginNK.strreplace6L L,L^2IL,
from7.KdestinationNK.strreplace6L L,L^2IL,
to7.KalternativesNtruesensorNfalseK77-Oroutes
usort6routes,createfunction6Ka,bK,Kreturn
intval6a-OlegsYIZ-Odistance-Ovalue7 - intval6b-OlegsYIZ-Odistance-Ovalue7K77
00print the shortest distance RO
0pO
pOnbsp0pO
pOnbsp 0pO
0formO
form idNLcalculate-routeL nameNLcalculate-routeL actionNLWL
'hinmaya &nstitute (f Technology 4I
8/12/2019 Roby Bodypdf
31/50
E-Mandi- Electronic Vegetable Market
methodNLgetLO
pO
input typeNLhiddenL nameNLrouteL valueNL)L0O
input typeNLhiddenL idNLfromL nameNLfromL valueNLRphp echo from R
OL si%eNL4IL 0O
input typeNLhiddenL idNLtoL nameNLtoL valueNLRphp echo to ROL
si%eNL4IL 0O
input nameNLsubL typeNLsubmitL valueNLView DouteL 0O
Rphp echo L+istance isL.routesYIZ-OlegsYIZ-Odistance-Ote*t RO 0pO
pOnbsp 0pO
0formO
div idNLmapLO0divO
p idNLerrorLO0pO
Rphp
Q
Q
elseP
header6Llocationmap.phpRrouteNIL7Q
Q
RO
0divO
0bodyO
0htmlO
'hinmaya &nstitute (f Technology 4)
8/12/2019 Roby Bodypdf
32/50
E-Mandi- Electronic Vegetable Market
Fn0!i(n& 0a ;