Digital Marketing
Digital Marketing
APPLICATION
Abstract
Internet access and agent technology promises to revolutionize the landscape of agricultural
business. Already E-commerce is clearly beginning to have a major impact in the agricultural sector. The
way people go about sell and purchasing agricultural products is of great concern. Sometimes buyers
have to travel far distances to get agricultural products and getting the right quality is not guaranteed.
Also, various market prices cannot be compared because buyers do not have all the time and resources to
visit every agricultural farm. Hence, the need for an electronic means of trading called Virtual Market,
which would help farmers and other buyers, make their appropriate business transactions online. To
achieve this, a prototype Virtual Market site would be developed using web service technologies as the
communication infrastructure between the buyers and the farms server using PHP Server Side Scripting.
Virtual Market is a digital platform specialized in the promotion and marketing of agricultural products,
connecting farms to markets and promoting local products internationally. Web, mobile and SMS platform
(USSD) connecting local farmers and producers to potential buyers and end consumers on a digital market
and allowing crowd funding of projects in the agricultural and agri-food sector. Formers from various
places can Submit all information about their product (harvest), service or project evaluated in quantity,
quality, price and cost of the project on the online platform. Its grouped using kind clustering algorithm
depends upon the corporate need. Its drive agricultural transactions through our digital platform in
combination with our service partnership network. Virtual Marketplace accommodates online payments
between buyer and seller, product quality check options, and end-to-end logistic services. Virtual
Marketplace does not buy or sell crops and is not a broker. Instead, we offer you the ability to effortlessly
market your crop via our platform
INTRODUCTION
Objective
The online shopping is meant form farmer shopping that includes the purchasing and the selling
of the mobile on internet. The internet business of the farmer has been the great future due to globalization.
The online portal of the farmer shopping which will be available on Google search definitely seeks the
huge customer range all over the world. This system is internet based due to the vast demand of the internet.
The world is now a global village due to the internet.
Now a day’s people prefer to buy goods on the internet by browsing the websites of businesses
and not visiting the market to buy goods. The online shop owner revenue will definitely be enhanced due
to the great demand of the online shopping and made the person be happy of having great technical
business idea. The communication also got cheaper and economical to get into the network of the
optical fiber that uses in the broadband connections to browse internet. The web network gets richer and
gives the vast difference of the thoughts, look web logs and the blogs that makes it the online record.
The data retrieval is easy and by the help of internet one can get the information in a second. The user and
the service provider as well can get the information. The computer is required to get the information.
Problem Description
The agricultural sector has long faced significant challenges, including issues related to
accessing markets and obtaining fair prices for their products. Buyers often have to travel long distances
to purchase agricultural products, and it is difficult to guarantee the quality of the products they buy.
Moreover, comparing market prices can be time-consuming and challenging due to the vast number of
farms and products available. These issues highlight the need for an electronic means of trading, which
would help farmers and buyers make appropriate business transactions online. The Virtual Market is a
proposed digital platform that aims to connect farmers to markets and promote local agricultural
products internationally. The platform would use web, mobile, and SMS technology to connect local
farmers and producers to potential buyers and end consumers on a digital market, allowing for crowd
funding of projects in the agricultural and agri-food sector. The Virtual Market platform would enable
farmers to submit all information about their product, service, or project, evaluated in quantity, quality,
price, and cost. The platform would also utilize a clustering algorithm to group products based on
corporate needs, driving agricultural transactions through a digital platform in combination with a
service partnership network. By offering online payment options, product quality check services, and
end-to-end logistic services, the Virtual Market would help overcome the challenges faced by farmers
and buyers in the agricultural sector.
SYSTEM ANALYSIS
Existing System
In existing the system acquires more inefficient features that are more inconvenient to the users.
At the rushing time the users have to spend more time and work to acquire their needed products from the
cart. There may be chance for malfunction from the management side. More over the management
requires more work load to satisfy their customers up to the level.
Disadvantage
• Increased inefficiency.
Proposed System
The main objective is to provide a technology oriented, low-cost, easily scalable system for
shopping. In proposed the user can choose their desired product of their wish from their preferred location.
The price and details of every product are inbuilt as a predefined one that enables the customer to get a
clear view. The payment can be made through online which enhances the user preferences. Due to that
the management can also gain the clear view about the purchased product and as well as the stocks. The
user can get their desired product as of their wish without any hesitation.
Advantages
• The Intelligent online Shopping Cart is reliable, effective, inexpensive and above all, user
friendly.
• Reduces the traffic in the queue, in mean time that increases the efficiency.
Hardware Requirement
Software Requirement
10
Implementations
The only complete PHP implementation is the original, known simply as PHP. It is the most widely
used and is powered by the Zend Engine. To disambiguate it from other implementations, it is sometimes
unofficially called "Zend PHP". The Zend Engine compiles PHP source code on-the-fly into an internal
format that it can execute, thus it works as an interpreter. It is also the "reference implementation" of PHP,
as PHP has no formal specification, and so the semantics of Zend PHP define the semantics of PHP. Due
to the complex and nuanced semantics of PHP, defined by how Zend works, it is difficult for competing
implementations to offer complete compatibility.
Licensing
PHP is free software released under the PHP License, which stipulates that: Products derived from
this software may not be called "PHP", nor may "PHP" appear in their name, without prior written
permission from [email protected]. You may indicate that your software works in conjunction with PHP by
saying "Foo for PHP" instead of calling it "PHP Foo" or "phpfoo". This restriction on use of "PHP" makes
the PHP License incompatible with the General Public License (GPL), while the Zend License is
incompatible due to an advertising clause similar to that of the original BSD license.
Use
A broad overview of the LAMP software bundle, displayed here together with Squid
PHP is a general-purpose scripting language that is especially suited to server-side web development,
in which case PHP generally runs on a web server. Any PHP code in a requested file is executed by the
PHP runtime, usually to create dynamic web page content or dynamic images used on websites or
elsewhere. It can also be used for command-line scripting and client-side graphical user interface (GUI)
applications. PHP can be deployed on most web servers, many operating systems and platforms, and can be
used with many relational database management systems (RDBMS). Most web hosting providers support
PHP for use by their clients. It is available free of charge, and the PHP Groupprovides the complete
source code for users to build, customize and extend for their own use.
11
Dynamic web page: example of server-side scripting (PHP and MySQL)
PHP acts primarily as a filter taking input from a file or stream containing text and/or PHP
instructions and outputting another stream of data. Most commonly the output will be HTML, although
it could be JSON, XML or binary data such as image or audio formats. Since PHP 4, the PHP parser compiles
input to produce bytecode for processing by the Zend Engine, giving improved performance over its
interpreter predecessor.
As of April 2007, over 20 million Internet domains had web services hosted on servers with PHP
installed and mod_php was recorded as the most popular Apache HTTP Server module. As of August
2019, PHP was used as the server-side programming language on 79.1% of websites, down from83.5%
previously, where the language could be determined. Web content management systems written in PHP
include MediaWiki, Joomla, eZ Publish, eZ Platform, SilverStripe, WordPress, Drupal, and Moodle. Websites
written in PHP, in back-end and/or user-facing portion, include Facebook, Digg, Tumblr, Dailymotion,
12
For specific and more advanced usage scenarios, PHP offers a well-defined and documented wayfor writing
custom extensions in C or C++. Besides extending the language itself in form of additional libraries, extensions
are providing a way for improving execution speed where it is critical and there is room for improvements by
using a true compiled language. PHP also offers well defined ways for embedding itself into other software
projects. That way PHP can be easily used as an internal scripting language for another project, also providing
tight interfacing with the project's specific internal data structures. PHP received mixed reviews due to lacking
support for multithreading at the core language level, though using threads is made possible by the "pthreads"
PECL extension. As of January 2013, PHP was used in more than 240 million websites (39% of those sampled)
and was installed on 2.1 million web servers. A command line interface, php-cli, and two ActiveX Windows
Script Host scripting engines for PHP have been produced. As of 2019, PHP 5 is most used on the web; which
was last updated with security updates in January 2019, with PHP 5.6.40.
Security
In 2017, 3% of all vulnerabilities listed by the National Vulnerability Database were linked to
PHP; historically, about 30% of all vulnerabilities listed since 1996 in this database are linked to PHP.
Technical security flaws of the language itself or of its core libraries are not frequent (22 in 2009, about
1% of the total although PHP applies to about 20% of programs listed).Recognizing that programmers
make mistakes, some languages include taint checking to automatically detect the lack of input validation
which induces many issues. Such a feature is being developed for PHP, but its inclusion into a release has
been rejected several times in the past. There are advanced protection patches such as Suhosin and
Hardening-Patch, especially designed for web hosting environments. Historically, old versions of PHP had
some configuration parameters and default values for such runtime settings that made some PHP
applications prone to security issues. Among these, magic_quotes_gpc and register_globals configuration
directives were the best known; the latter made any URL parameters become PHP variables, opening a
path for serious security vulnerabilities by allowing an attacker to set the value of any uninitialized global
variable and interfere with the execution of a PHP script. Support for "magic quotes" and "register
globals" settings has been deprecated as of PHP 5.3.0, and removed as of PHP 5.4.0.
13
WAMP
WAMP is an acronym that stands for Windows, Apache, MySQL, and PHP. It’s a software stack
which means installing WAMP installs Apache, MySQL, and PHP on your operating system (Windows
in the case of WAMP). Even though you can install them separately, they are usually bundled up, and
for a good reason too.
What’s good to know is that WAMP derives from LAMP (the L stands for Linux). The only
difference between these two is that WAMP is used for Windows, while LAMP – for Linux based
operating systems.
Let’s quickly go over what each letter represents:
“W” stands for Windows, there’s also LAMP (for Linux) and MAMP (for Mac).
“A” stands for Apache. Apache is the server software that is responsible for serving web pages.
When you request a page to be seen by you, Apache grants your request over HTTP and shows you the
site.
“M” stands for MySQL. MySQL’s job is to be the database management system for your server.
It stores all of the relevant information like your site’s content, user profiles, etc.
“P” stands for PHP. It’s the programming language that was used to write WordPress. It acts like
glue for this whole software stack. PHP is running in conjunction with Apache and communicating with
MySQL.
Instead of installing and testing WordPress on your hosting account, you can do it on your
personal computer (localhost).
WAMP acts like a virtual server on your computer. It allows you to test all WordPress features
without any consequences since it’s localized on your machine and is not connected to the web.
First of all, this means that you don’t need to wait until files are uploaded to your site, and
secondly – this makes creating backups much easier.
WAMP speeds up the work process for both developers and theme designers alike. What is
more, you also get the benefit of playing around with your site to your heart’s content.
However, to actually make the website go live, you need to get some form of hosting service and
a Domain. See our beginner-friendly article about web hosting for more information.
Functionalities
• WampServer`s functionalities are very complete and easy to use so we won`t explain here how
to use them. With a left click on WampServer`s icon, you will be able to:
• Manage your Apache and MySQL services
14
• Switch online/offline (give access to everyone or only localhost)
• Install and switch Apache, MySQL and PHP releases
• Manage your servers settings
• Access your logs
• Access your settings files
• Create Alias
• Change WampServer`s menu language
• Access this Page
BACK END
What is MySQL? – An Introduction To Database Management Systems
Database Management is the most important part when you have humungous data around you.
MySQL is one of the most famous Relational Database to store & handle your data. In this What is
MySQL blog, you will be going through the following topics:
What are Data & Database?
Suppose a company needs to store the names of hundreds of employees working in the company
in such a way that all the employees can be individually identified. Then, the company collectsthe
data of all those employees. Now, when I say data, I mean that the company collects distinct pieces of
information about an object. So, that object could be a real-world entity such as people, or any object such
as a mouse, laptop etc.
Database Management System & Types of DBMS
A Database Management System (DBMS) is a software application that interacts with the user,
applications and the database itself to capture and analyze data. The data stored in the database can be
modified, retrieved and deleted, and can be of any type like strings, numbers, images etc.
Types of DBMS
There are mainly 4 types of DBMS, which are Hierarchical, Relational, Network, and Object-
Oriented DBMS.
• Hierarchical DBMS: As the name suggests, this type of DBMS has a style of predecessor-
successor type of relationship. So, it has a structure similar to that of a tree, wherein the nodes
represent records and the branches of the tree represent fields.
• Relational DBMS (RDBMS): This type of DBMS, uses a structure that allows the users to
identify and access data in relation to another piece of data in the database.
15
• Network DBMS: This type of DBMS supports many to many relations wherein multiple
member records can be linked.
• Object-oriented DBMS: This type of DBMS uses small individual software called objects.
Each object contains a piece of data, and the instructions for the actions to be done with the data.
Angular JS
AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template
language and lets you extend HTML's syntax to express your application's components clearly and
succinctly. AngularJS's data binding and dependency injection eliminate much of the code you would
otherwise have to write. And it all happens within the browser, making it an ideal partner withany
server technology.
AngularJS is what HTML would have been, had it been designed for applications. HTML is a
great declarative language for static documents. It does not contain much in the way of creating
applications, and as a result building web application is an exercise in what do I have to do to trick the
browser into doing what I want?
The impedance mismatch between dynamic applications and static documents is often solved
with:
• a library - a collection of functions which are useful when writing web apps. Your code is in
charge and it calls into the library when it sees fit. E.g., jQuery.
• frameworks - a particular implementation of a web application, where your code fills in the
details. The framework is in charge and it calls into your code when it needs something app
specific. E.g., durandal, ember, etc.
AngularJS takes another approach. It attempts to minimize the impedance mismatch between
document centric HTML and what an application needs by creating new HTML constructs. AngularJS
teaches the browser new syntax through a construct we call directives. Examples include:
• Data binding, as in {{}}.
• DOM control structures for repeating, showing and hiding DOM fragments.
• Support for forms and form validation.
• Attaching new behavior to DOM elements, such as DOM event handling.
• Grouping of HTML into reusable components.
16
A complete client-side solution
AngularJS is not a single piece in the overall puzzle of building the client-side of a webapplication.
It handles all of the DOM and AJAX glue code you once wrote by hand and puts it in a well-defined
structure. This makes AngularJS opinionated about how a CRUD (Create, Read, Update, Delete)
application should be built. But while it is opinionated, it also tries to make sure that its opinion is just a
starting point you can easily change. AngularJS comes with the following out-of-the-box:
• Everything you need to build a CRUD app in a cohesive set: Data-binding, basic templating
directives, form validation, routing, deep-linking, reusable components and dependency injection.
• Testability story: Unit-testing, end-to-end testing, mocks and test harnesses.
• Seed application with directory layout and test scripts as a starting point.
AngularJS's sweet spot
AngularJS simplifies application development by presenting a higher level of abstraction to the
developer. Like any abstraction, it comes at a cost of flexibility. In other words, not every app is a good
fit for AngularJS. AngularJS was built with the CRUD application in mind. Luckily CRUD applications
represent the majority of web applications. To understand what AngularJS is good at, though, it helps to
understand when an app is not a good fit for AngularJS.
Games and GUI editors are examples of applications with intensive and tricky DOM manipulation.
These kinds of apps are different from CRUD apps, and as a result are probably not agood fit for
AngularJS. In these cases, it may be better to use a library with a lower level of abstraction, such as jQuery.
Dreamweaver
Adobe Dreamweaver is a proprietary web development tool from Adobe Inc.. It was created by
Macromedia in 1997 and developed by them until Macromedia was acquired by Adobe Systems in 2005.
Adobe Dreamweaver is available for the macOS and Windows operating systems. Following
Adobe's acquisition of the Macromedia product suite, releases of Dreamweaver subsequent to version
8.0 have been more compliant with W3C standards. Recent versions have improved support for
Web technologies such as CSS, JavaScript, and various server-side
scripting languages and frameworks including ASP (ASP JavaScript, ASP VBScript, ASP.NET C#,
ASP.NET VB), ColdFusion, Scriptlet, and PHP.
Adobe Dreamweaver CC is a web design and development application that uses both a visual
design surface known as Live View and a code editor with standard features such as syntax
17
highlighting, code completion, and code collapsing as well as more advanced features such as real-time
syntax checking and code introspection for generating code hints to assist the user in writing code.
Combined with an array of site management tools, Dreamweaver allows for its users to design, code and
manage websites, as well as mobile content. Dreamweaver is an Integrated Development Environment
(IDE) tool. You can live preview of changes for the frontend. Dreamweaver is positioned as a versatile
web design and development tool that enables visualization of web content while coding. Dreamweaver,
like other HTML editors, edits files locally then uploads them to the remote web server using FTP, SFTP, or
WebDAV. Dreamweaver CS4 now supports the Subversion (SVN) version control syste
18
SYSTEM DESIGN
Design Overview
Modules List
Admin
• Login
• Add categorist farmer
• Manage farmer & customer details
Farmer
• login
• Add Product details
• Update Price Details
• Stock Maintenance
• Payment Process
• Report
User
• Registration
• Login
• Product purchase
• payment
19
MODULE DESCRIPTION
Admin Module
Admin login
Admin is the head for the entire system that controls the whole process under his guidance. The
Farming assistant web service system is based on farmer sales their product to customer directly through
online. All farming systems are controlled by admin.
Add categorist farmer
The admin can add multiple farmer to join the farming assistant web service system. Admin create
farming web service id for each farmer.
Manage farmer and customer details
The admin managed farmer and customer details in farming assistant web service system. all
details are controlled by admin. And also admin view farming strategy.
Farmer Module
Farmer login
Farmer login the farming assistance web service using user name and password. and updates all
product details in this website.
Add Product details
The farmer can add all products information. And also updated Company details, mobile no and
price details are in system.
Update price details
The farmer can manage and maintain all the product details like sales details, stock details are
maintained in this module and also the product price details are maintained.
Stock Maintenance
The farmer can monitor all the stock details are by this module. Product details are stored in
database.
Payment Process
The payment processes are maintained in that module. The farmer can monitor and maintain all
the payment details by using that module.
Report
20
The farmer can monitor and maintain the report details. This module is used to monitor and maintain
any reports or queries.
User Module
Registration
The user can register the online shopping system using customer name, address details, and
mobile number.
Login
The customer can access this website using username and password.
Product Purchase
The customer can purchase product using farming assistant web service. Select product name,
product quantity and etc. all details are stored in database.
Payment
The customer paid using online transaction or cash on delivery. All purchased product are direct
deliver through farming assistant web service
21
Input Design
INPUT FORM
Admin Login
Login
User Name
Password
Login Clear
22
User Registration
User Registration
Register ID
Name
Address
Pincode
Mobile Number
User Name
Password
Confirm Password
Register
23
Output Design
Admin Login
Login
Password *****
Login Clear
24
System Flow Diagram
25
Database Structure
Table structure for table admin
Field Type Null Default
varchar(25
username Yes NULL
)
varchar(50
password Yes NULL
)
secret_cod varchar(50
Yes NULL
e )
13
SYSTEM TESTING
Types of testing
SYSTEM TESTING
Testing is the stage of implementation of which aimed at ensuring that the system worksaccurately
and efficiently before live operation commences. Testing is vital to the success of the system. System
testing makes a logical assumption that if all the parts of the system are correct the goal will be achieved.
The candidates system subject to a variety of tests. Online response, volume, stress, recovery, security
and usability tests. A series of testing are performed for the proposed system before the system is ready
for user acceptance testing.
UNIT TESTING
The procedure level testing is made first. By giving improper inputs, the errors occurred are
noted and eliminated .Then the web form level is made.
INTEGRATION TESTING:
Testing is done for each module. After testing all the modules, the modules are integrated and
testing of the final system is done with the test data, specially designed to show that the system will operate
successfully in all its aspects conditions. Thus the system testing is a confirmation that all its correct and
an opportunity to show the user that the system works.
VALIDATION TESTING
Software Testing - Validation Testing. The process of evaluating software during the development
process or at the end of the development process to determine whether it satisfies specified business
requirements. Validation Testing ensures that the product actually meets the client's needs.
REGRESSION TESTING
Regression Testing is defined as a type of software testing to confirm that a recent program or
code change has not adversely affected existing features. Regression Testing is nothing but a full or partial
selection of already executed test cases which are re-executed to ensure existing functionalities work fine.
28
Test plan
Testing Approach
A test case is an asset of data that the system will process as normal input. The strategies that we have used
in our project are,
29
30
SYSTEM IMPLEMENTATION
MODULE DESCRIPTION
Admin Module
Admin login
Admin is the head for the entire system that controls the whole process under his guidance. The
Farming assistant web service system is based on farmer sales their product to customer directly through
online. All farming systems are controlled by admin.
Add categorist farmer
The admin can add multiple farmer to join the farming assistant web service system. Admin create
farming web service id for each farmer.
Manage farmer and customer details
The admin managed farmer and customer details in farming assistant web service system. all
details are controlled by admin. And also admin view farming strategy.
Farmer Module
Farmer login
Farmer login the farming assistance web service using user name and password. and updates all
product details in this website.
Add Product details
The farmer can add all products information. And also updated Company details, mobile no and
price details are in system.
Update price details
The farmer can manage and maintain all the product details like sales details, stock details are
maintained in this module and also the product price details are maintained.
Stock Maintenance
The farmer can monitor all the stock details are by this module. Product details are stored in
database.
Payment Process
The payment processes are maintained in that module. The farmer can monitor and maintain all
the payment details by using that module.
Report
31
The farmer can monitor and maintain the report details. This module is used to monitor and maintain
any reports or queries.
User Module
Registration
The user can register the online shopping system using customer name, address details, and
mobile number.
Login
The customer can access this website using username and password.
Product Purchase
The customer can purchase product using farming assistant web service. Select product name,
product quantity and etc. all details are stored in database.
Payment
The customer paid using online transaction or cash on delivery. All purchased product are direct
deliver through farming assistant web service
32
APPENDIX
SAMPLE CODE
Login
<?php
session_start();
include("include/dbconnect.php");
extract($_POST);
$msg="";
if(isset($btn))
{
if($uname=="admin")
{
$qry=mysql_query("select * from admin where username='$uname' && password='$pass'");
$num=mysql_num_rows($qry);
if($num==1)
{
$_SESSION['uname']=$uname;
header("location:admin.php");
}
else
{
$msg="Invalid User! ";
33
}
}
else
{
$qry=mysql_query("select * from register where username='$uname' && password='$pass'");
$num=mysql_num_rows($qry);
if($num==1)
{
$_SESSION['uname']=$uname;
header("location:userhome.php");
}
else
{
$msg="Invalid User! ";
}
}
}
?>
<div id="contents">
<div id="adbox">
<div><imgsrc="images/agri1.jpg" width="583" height="365">
<h1>Login</h1>
<form name="form1" method="post" action="">
<div style="padding:10px">Username</div>
<div style="padding:10px"><input name="uname" type="text" class="inp">
</div>
<div style="padding:10px">Password</div>
<div style="padding:10px"><input name="pass" type="password" class="inp">
</div>
<div style="padding:10px"><input name="btn" type="submit" class="inp" value="Login">
</div>
</form>
<p></p>
</div>
</div>
Farmer Registration
<?php
include("include/dbconnect.php");
extract($_REQUEST);
$msg="";
$month=date("m");
$year=date("Y");
$rdate=date("d-m-Y");
if(isset($btn))
{
34
if(trim($name)=="") { $msg="Enter the Name"; }
else if(trim($contact)=="") { $msg="Enter the Mobile No."; }
else if(trim($email)=="") { $msg="Enter the E-mail"; }
else if(trim($pass)=="") { $msg="Enter the Password"; }
else if(trim($cpass)=="") { $msg="Enter the Re-type Password"; }
else if(trim($pass)!=trim($cpass)) { $msg="Password not match!"; }
else
{
$mq=mysql_query("select max(id) from register");
$mr=mysql_fetch_array($mq);
$id=$mr['max(id)']+1;
$str=str_pad($id,4,"0",STR_PAD_LEFT);
$uname="1".$str;
}
}
?>
<form action="" method="post" enctype="multipart/form-data" name="form1">
<table width="553" border="0" align="center">
<tr>
<thcolspan="2" align="center" class="bg1">New Farmer </th>
</tr>
<tr>
<td width="174" align="left" class="bg2">Name</td>
<td width="363" align="left" class="bg2"><input type="text" name="name" value="<?php echo
$name; ?>"></td>
</tr>
<tr>
<td align="left" class="bg3">Address</td>
<td align="left" class="bg3"><input type="text" name="address" ></td>
</tr>
<tr>
<td align="left" class="bg2">Contact No.</td>
<td align="left" class="bg2"><input type="text" name="contact"></td>
35
</tr>
<tr>
<td align="left" class="bg3">E-mail</td>
<td align="left" class="bg3"><input type="text" name="email" ></td>
</tr>
<tr>
<td align="left" class="bg2">Land Cent </td>
<td align="left" class="bg2"><input type="text" name="land"></td>
</tr>
<tr>
<td align="left" class="bg3">Password</td>
<td align="left" class="bg3"><input type="password" name="pass"></td>
</tr>
<tr>
<td align="left" class="bg2">Re-type Password </td>
<td align="left" class="bg2"><input type="password" name="cpass" value="<?php echo $cpass; ?
>"></td>
</tr>
<tr>
<td align="left" class="bg3"> </td>
<td align="left" class="bg3"><input type="submit" name="btn" value="Submit"></td>
</tr>
</table>
<p align="center" class="msg"><?php echo $msg; ?></p>
</form>
User
<?php
include("include/protect.php");
include("include/dbconnect.php");
$uname=$_SESSION['uname'];
extract($_POST);
$msg="";
if(isset($btn))
{
$gqry=mysql_query("select * from product where location like '%$ltn' || product like '%$ltn' ||
description like '%$ltn'" );
$num=mysql_num_rows($gqry);
}
?>
<html>
<head>
<title><?php include("include/title.php"); ?></title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td align="center"><?php include("include/header.php"); ?></td>
36
</tr>
<tr>
<td align="left" class="subhead"><?php include("include/link_user.php"); ?></td>
</tr>
<tr>
<td align="center" valign="top"><p class="txt1"> </p>
<p class="txt1"><strong>Welcome <?php echo $uname; ?></strong></p>
<p class="style1"><?php echo $msg; ?></p>
<p>
Search the Location/ Agri Product
<input type="text" name="ltn" value="<?php echo $_REQUEST['ltn']; ?>">
<input type="submit" name="btn" value="Search">
</p>
<p> </p>
<?php
if($num!=0)
{
?>
<table width="75%" border="0">
<tr bgcolor="#999999">
<th width="6%">Sno</th>
<th width="11%">Seller</th>
<th width="11%">Product</th>
<th width="11%">Location</th>
<th width="11%">Soiltype</th>
<th width="8%">Price</th>
<th width="10%">Quantity</th>
<th width="17%">Product Image </th>
<th width="26%">update image </th>
</tr>
<?php $i=0;
while($grow=mysql_fetch_array($gqry))
{ $i++;
?>
<tr bgcolor="#99CCCC">
<td><?php echo $i; ?></td>
<td><?php echo $grow['Seller']; ?></td>
<td><?php echo $grow['product']; ?></td>
<td><?php echo $grow['location']; ?></td>
<td><?php echo $grow['stype']; ?></td>
<td><?php echo $grow['price']; ?></td>
<td><?php echo $grow['quantity']; ?></td>
<td align="center"><img src="product/<?php echo $grow['product_image']; ?>" alt="img" width="42"
height="42" /></td>
<td align="center"><a href="user_purchase_part.php?gid=<?php echo $grow['id']; ?>&sid=<?php echo
$grow['Seller']; ?>">Add to Cart</a></td>
</tr>
<?php
37
}
?>
</table>
<?php
}//num
?>
<p> </p>
<p> </p>
<p><a href="user_parchase_order.php">View All Products</a></p>
<p> </p>
<p></p></td>
</tr>
<tr>
<td align="center" class="subhead"> </td>
</tr>
</table>
</form>
</body>
</html>
Farmer Register
<?php
include("include/dbconnect.php");
extract($_REQUEST);
$msg="";
if(isset($btn))
{
if(trim($name)=="") { $msg = "Enter the Name..."; }
else if(trim($contact)=="") { $msg = "Enter the Contact No."; }
else if(trim($email)=="") { $msg = "Enter the E-mail..."; }
else if(trim($uname)=="") { $msg = "Enter the Username"; }
else if(trim($pwd)=="") { $msg = "Enter the Password"; }
else if(trim($cpass)=="") { $msg = "Enter the Confirm Password"; }
else if($pwd!=$cpass) { $msg = "Both Password are not equal!"; }
else
{
$max_qry = mysql_query("select max(id) maxid from register");
$max_row = mysql_fetch_array($max_qry);
38
$id=$max_row['maxid']+1;
$rdate=date("Y-m-d");
$uqry="insert into
register(id,utype,name,gender,address,pincode,contact,email,bank_name,acc_no,username,password,rda
te) values($id,'farmer','$name','$gender','$address','$pincode',
$contact,'$email','$bank_name','$acc_no','$uname','$pwd','$rdate')";
$res=mysql_query($uqry);
if($res)
{
?>
<script language="javascript">
window.location.href="reg_farmer.php?act=success";
</script>
<?php
//header("location:register.php");
}
else
{
$msg="Could not be stored!";
}
}
}
?>
<html>
<head>
<title><?php include("include/title.php"); ?></title>
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {
color: #990000
39
}
-->
</style>
<script language="javascript">
function validate()
{
if(isNaN(document.form1.pincode.value))
{
alert("Invalid Pincode!");
document.form1.pincode.select();
return false;
}
if(isNaN(document.form1.contact.value))
{
alert("Invalid Mobile No!");
document.form1.contact.select();
return false;
}
if(document.form1.contact.value.length!=10)
{
alert("Mobile No must be 10 digits!");
document.form1.contact.select();
return false;
}
if(isNaN(document.form1.acc_no.value))
{
alert("Invalid Account No!");
document.form1.acc_no.select();
return false;
}
return true;
}
</script>
40
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td align="center"><?php include("include/header.php"); ?></td>
</tr>
<tr>
<td><?php include("include/link_home.php"); ?></td>
</tr>
<tr>
<td align="center"><p> </p>
<?php
if($act=="success")
{
?><p style="color:#006600">Register Success..</p><?php
}
?>
<p class="style1 style2"><?php echo $msg; ?></p>
<table width="405" height="360" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" align="center"><strong>Farmer Registration </strong></td>
</tr>
<tr>
<td width="162">Name</td>
<td width="162"><input type="text" name="name" value="<?php echo $_POST['name']; ?>"></td>
</tr>
<tr>
<td>Gender</td>
<td><input name="gender" type="radio" value="Male">
Male
<input name="gender" type="radio" value="Female">
41
Female</td>
</tr>
<tr>
<td>Address</td>
<td><textarea name="address"><?php echo $_POST['address']; ?></textarea></td>
</tr>
<tr>
<td>Pincode</td>
<td><input type="text" name="pincode" value="<?php echo $_POST['pincode']; ?>"></td>
</tr>
<tr>
<td>Mobile No. </td>
<td><input name="contact" type="text" value="<?php echo $_POST['contact']; ?>"
maxlength="10"></td>
</tr>
<tr>
<td>E-mail</td>
<td><input type="text" name="email" value="<?php echo $_POST['email']; ?>"></td>
</tr>
<tr>
<td>Bank Name </td>
<td><input type="text" name="bank_name" value="<?php echo $_POST['bank_name']; ?>"></td>
</tr>
<tr>
<td>Account No. </td>
<td><input type="text" name="acc_no" value="<?php echo $_POST['acc_no']; ?>"></td>
</tr>
<tr>
<td>Username</td>
<td><input type="text" name="uname" value="<?php echo $_POST['uname']; ?>" /></td>
</tr>
<tr>
<td>Password</td>
42
<td><input type="password" name="pwd" value="<?php echo $_POST['pwd']; ?>" /></td>
</tr>
<tr>
<td>Confirm Password </td>
<td><input type="password" name="cpass" value="<?php echo $_POST['cpass']; ?>"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="btn" value="Register" onClick="return
validate()" /></td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
<tr>
<td align="center" class="subhead"> </td>
</tr>
</table>
</form>
</body>
</html>
Payment
<?php
session_start();
include("include/dbconnect.php");
extract($_POST);
$sess_user=$_SESSION['uname'];
$admin_qry=mysql_query("select * from admin where username='admin'");
$admin_row=mysql_fetch_array($admin_qry);
$admin_acc=$admin_row['acc_no'];
43
$pur_id=$_REQUEST['pur_id'];
$uname=$_REQUEST['user'];
if($sess_user==$_REQUEST['user'])
{
44
}
if(isset($btnBuy))
{
$up=mysql_query("update user_purchase set status=1 where pid=$pur_id");
$ukey=$_POST['ukey'];
//if($_POST['accno']==$accno)
if($accno==$acc)
{
//$aq=mysql_query("select * from myacct where acct='$accno'");
//$ar=mysql_fetch_array($aq);
//$bal_amt=$ar['depo'];
//if($bal_amt>$amount)
//{
//$bal=$bal_amt-$amount;
//$bal2=$bal_amt2+$amount;
//$up=mysql_query("update myacct set depo=$bal where acct='$accno'");
//$up2=mysql_query("update myacct set depo=$bal2 where acct='$admin_acc'");
}
else
{
$msg="Account No. is wrong!";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?php include("include/title.php"); ?></title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function validate()
{
46
if(document.form1.bank.value=="")
{
alert("Enter the Bank Name...");
document.form1.bank.focus();
return false;
}
if(document.form1.accno.value=="")
{
alert("Enter the Account No.");
document.form1.accno.focus();
return false;
}
if(isNaN(document.form1.accno.value))
{
alert("Invalid Account No!");
document.form1.accno.select();
return false;
}
if(document.form1.creditno.value=="")
{
alert("Enter the Credi Card No.");
document.form1.creditno.focus();
return false;
}
return true;
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table width="85%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
47
<td width="26%" align="center" bgcolor="#E6EEFB" class="heading"><br />
Online Payment </td>
<td width="37%" align="right" valign="top" bgcolor="#E6EEFB"><img
src="images/online_header.jpg" width="481" height="158" /></td>
<td width="37%" align="center" valign="top" bgcolor="#E6EEFB"><img src="images/img2.jpg"
width="240" height="158" /></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3" align="center"><p> </p>
<p class="txt1">Payment</p>
<p class="txt1"><?php echo $msg; ?></p>
<table width="460" height="377" border="0" cellpadding="10" cellspacing="0">
<tr>
<td width="149">Bank Name </td>
<td width="176"><input type="text" name="bank" /></td>
</tr>
<tr>
<td>Account No. </td>
<td><input type="text" name="accno" /></td>
</tr>
<tr>
<td>Credit Card No. </td>
<td><input type="text" name="creditno" /></td>
</tr>
<tr>
<td colspan="2" align="center"><img src="images/credit.jpg" width="268" height="188" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
48
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="btnBuy" value="Buy Online"
onClick="return validate()" /></td>
</tr>
</table>
<p> </p>
<p><a href="<?php echo 'user_purch_view.php?user='.$uname; ?>">Go to Shopping</a></p>
<p> </p>
<p> </p></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>
</form>
</body>
</html>
Add Products
49
SAMPLE CODE
HOME
CONSUMER LOGIN
50
FARMER LOGIN
FARMER REGISTRATION
51
ADD CATEGORY
52
ADD PRODUCTS
VIEW PRODUCTS
53
CUSTOMER INFORMATION
54
PURCHASE DETAILS
55
PRODUCT DETAILS
ADD TO CART
56
PURCHASE
FIG NO: 15
PAYMENT
FIG NO: 16
57
CONCLUSION AND FUTURE WORK
9.1 Conclusion
Intelligent shopping cart proves to be user friendly, time saving and economic. Reduces the
effort and time spent on shopping and to make it a memorable experience. The system eliminates the long
hard queues for billing after purchase. In this era where humans are investing more on technology for their
comfort, intelligent shopping cart is worth marketing. Additional features like on-line payment can be
incorporated with the cart by transferring the purchase details. The major constraint will be to build a cart
that suits different mall structures.
9.2 Future Work
The project has a very vast scope in future. In future our project can be done as app developing
that user can see their progress report on their friendly farmer. The project can be implemented on internet
in future of farmers. Project can be updated in near future as and when requirement for the same arises, as
it is very flexible in terms of expansion. With the proposed software of database Space Manager ready
and fully functional the client is now able to manage and hence run the entire work in a much better,
accurate and error free manner. The following are the future scope for the project.
Book Reference
1) “Beginning PHP and MySQL From Novice to Professional” by W Jason Gilmore
2) “PHP: A Beginner’s Guide” by Vikram Vaswani
3) “PHP Object – Oriented Solutions” by David Powers
4) “Learning PHP 5” by David Sklar
5) “Build Your Own Database Driven Web Site Using PHP & MySQL” by Kevin Yank
6) “Modern PHP: New Features and Good Practices” by Josh Lockhart
7) “PHP: Learn PHP in 24 Hours or Less – A Beginner’s Guide To Learning PHP Programming
Now” by Robert Dwight
Website Reference
https://www.w3schools.com/php/php_intro.asp
https://www.tutorialspoint.com/php/index.html
https://www.tutorialspoint.com/php/php_syntax_overview.html
59