SlideShare a Scribd company logo
1 of 81
1
CHAPTER 1
INTRODUCTION
1.1 Description:
A Web project to help farmers ensure greater profitability through direct farmer to supplier
and farmer to farmer communication. This service boosts business communication and
brings transparency in the system. Separate login areas with appropriated functionality for
farmers, suppliers and authorities. A separate page where only farmers can post complaints
and only assigned administrators can read and edit this page.
This innovative site allows for good farmer, retailer and supplier communication. It allows
farmers to login and communicate to respective dealers. When dealers publish an
advertisement or offer, the respective farmers get notified via SMS message. The farmers
may also submit their grievances and complaints to respective dealers or authorities using
their farmer login on a separate complaints page and authorities will get access to that page
regularly using their login id and passwords.
This web project provides following features:
 Separate login areas with appropriated functionality for farmers, administrators
and dealers/ retailers.
 A separate page where only farmers can post complaints and only assigned
administrators can read and edit this page.
 Pages where dealers and retailers may post their ads and notifications.
 Farmers are notified of these notifications via SMS whenever new ads are
published.
 An effective GUI so that rural people may easily use the service.
 Can be over for multiple villages to communicate and deal with each other.
2
1.2 An Overview of Farming Assistant Web Service:
Although most people can see the benefits of using a more precise approach to manage
crops with additional information, the tool provided by precision farming and other
information technologies have not yet moved into mainstream agricultural management.
The increased complexity of the systems inhibits easy adoption and makes calculations as
to the financial benefits uncertain. These issues can be resolved by improving the decision
making process though better Management Information Systems, improved data
interchange standards and clear management methods. The starting point has been the
identification of the current and future data, information and knowledge management
needs on the farms, as well as on the way that these needs will evolve in the future and that
will influence farm data, farm information and farm knowledge management systems.
At the moment, the utilization of scientific models together with the large amounts of data
in different formats produced by modern Farm machinery, sensors located within the farm,
remote sensing, etc. is still an open area of research and new methods are developed
continuously. The seamless incorporation of new functionality and assisting features into
an existing system is of paramount importance.
1.2.1 Supplier:
 Register-The supplier first need to be registered himself to login.
 Login- The supplier need to login in to get access to the system.
 Post Advertisement- Pages where dealers and retailers may post their ads and
notifications. The post consists of crop id, crop name, crop image and quantity required.
Farmers are notified of these notifications via SMS.
 Crop Received-It is result of post that notified that the crop is accepted or not to the
farmers.
1.2.2 Farmer:
 Register-The farmer first need to be registered to login.
 Login-The farmer need to login in to get access to the system.
 Complaint Page-The page where farmers can post their complaints and only assigned
administrators can read and edit this page.
3
 View Complaint Status-In this page farmers can view the complaints details by viewing
the status of complaints is read or unread.
 Crop Advertisement Details-This page consist of crop advertisement details post by the
supplier and the status of the sell crop accepted by the supplier or not.
 Sell Product-This page is for sailing the crop to the supplier. This includes crop id,
Supplier name, crop name, quantity and prices.
 Sell product Details-This page consist of crop details sold by the farmer.
1.2.3 Admin:
 View Complaints-This page contains the complaints of the farmers.
 Farming Tips-The admin gives the farming tips to the farmers.
Farming Assistant Web Service Home
4
1.3 Resource Allocation:
This includes three main research areas. Firstly, it traces the agricultural problems,
technology adoption role and issues through extension services particularly in India and in
the world in general. Secondly, by finding the factors that are affecting the extension
services through proper use of ICTs or determining the factors of transfer of technologies.
By doing so, this chapter helps build the fundamental concepts of ICT and decision making
at all levels of agricultural decision making process. Lastly, it presents a comprehensive
review of various models used by previous researchers in facilitating the information
content concerned with farmers in retrieving the information needed in their decision
making process.
1.4 Motivation:
Role of middleman in the marketing of agricultural commodities which leads continuous
loss to farmers.
Figure 1.1. Role of middlemen
Usually traders are the middlemen, who link the farmer’s produce with the consumers.
Sometimes they also build linkages with the different market far away from the production
area. Many times, they are neglected and tried to sell directly in the market. Actually, the
profit margins for the farmers are more than 60 per cent but due to low quantity of
transaction, farmers are not benefited.
5
1.5 Problem Statement:
New government mandates and regulations. Stability, development and fluctuations in
global financial markets Agricultural marketing continues to be in a bad shape in rural
India. In the absence of sound marketing facilities, the farmers must depend upon local
traders and middlemen for the disposal of their farm produce which is sold at throw-away
price.
Storage facilities in the rural areas are either totally absent or grossly inadequate. Under
such conditions the farmers are compelled to sell their produce immediately after the
harvest at the prevailing market prices which are bound to be low. Such distress sale
deprives the farmers of their legitimate income.
1.6 Scope:
Scope of the project includes:
 Through this project farmers ensure greater profitability.
 This service boosts business communication and brings transparency in the system.
 Can be over for multiple villages to communicate and deal with each other.
 Farming tips is given to farmer easily and their compliant can be solved.
Commodities
6
CHAPTER 2
MATERIAL AND METHODS
2.1 Methodology
The objective was to create a Web Application that could perform the following:
• Connecting to an HTTPS site (Farming Assistant Web Service) through GPRS/Wi-Fi.
• Opening the relevant html pages using HTTP POST & GET.
• Parsing the farmers, supplier info/corps/problems data logically.
• Creating a local database for offline view.
2.2Implementation and Technology Used:
2.2.1 HTML
HTML is a document layout and hyperlink specification language. It defines the syntax
and placement of special, embedded directions that aren’t displayed by the browser, but
tell it how to display the contents of the document, including text, graphics, and other
support media. The language also specifies how to make a document interactive through
special hypertext links.
2.2.2 Java
Java [DEI97, JEP97, and LAU96] is an object-oriented language. It allows the user to
write robust and reliable programs, build applications that will run on any platform without
recompiling your code and distribute applications over a network in a secure fashion.
2.2.3 CSS
7
CSS [11] is a style sheet language used for describing the presentation of a document
written in a mark-up language. Although most often used to set the visual style of web
pages and user interfaces written in HTML and XHTML, the language can be applied to
any XML document, including plain XML, SVG and XUL, and is applicable to rendering
in speech, or on other media. Along with HTML and JavaScript, CSS is a cornerstone
technology used by most websites to create visually engaging webpages, user interfaces for
web applications, and user interfaces for many mobile applications.
2.2.4 JavaScript
JavaScript HTML and CSS, JavaScript is one of the three core technologies of World
Wide Web content production. It is used to make webpages interactive and provide online
programs, including video games. The majority of websites employ it, and all modern web
browsers support it without the need for plug-ins by means of a built-in JavaScript engine.
Each of the many JavaScript engines represent a different implementation of JavaScript, all
based on the ECMA Script specification, with some engines not supporting the spec fully,
and with many engines supporting additional features beyond ECMA. It has an API for
working with text, arrays, dates, regular expressions, and basic manipulation of the DOM,
but does not include any I/O, such as networking, storage, or graphics facilities, relying for
these upon the host environment in which it is embedded.
2.2.4 MySQL
MySQL is the world’s most popular open source database, enabling the cost-effective
delivery of reliable, high-performance and scalable Web-based and embedded database
applications. It is an integrated transaction safe, ACID-compliant database with full
commit, rollback, crash recovery, and row-level locking capabilities. MySQL delivers the
ease of use, scalability, and high performance, as well as a full suite of database drivers
and visual tools to help developers and DBAs build and manage their business-critical
MySQL applications. MySQL is developed, distributed, and supported by Oracle, and the
latest information about MySQL software can be found on the MySQL Web site.
2.2.5 Editor (NetBeans IDE 8.0.1):
8
NetBeans IDE [10] is the web development tool that lets you efficiently design, quickly &
easily develop and maintain standards-based websites and applications. NetBeans IDE
provides a powerful combination of visual layout tools, application development features,
and code editing support.
Figure 2.1 Technologies Used
2.3 Software and Hardware Requirements
2.3.1 Software Requirements:
 Windows 7 or higher.
 SQL server
 Java/ net beans IDE.
2.3.2Hardware Components:
FARMING ASSISTANT WEB SERVICE
Java
 HTML
 CSS
 BOOTSTRAP
MySQL
9
 Processor – i3 or high
 Hard Disk – 5 GB
 Memory – 1GB RAM
2.3.3 HTTPS POST & GET
The application uses HTTPS POST and HTTPS GET to extract html code of the required
pages. The HTTPS POST is used for the login into the farmer’s, suppliers and admin account
while the HTTP GET is used for retrieving the source code from specific pages.
Figure 2.2 HTTP POST
Using these methods, the html codes of the following pages are retrieved: Farmer details,
Supplier details, Post add, Crop sell Details and other information. In the HTTPs POST,
certain parameters should be sent. Besides the username and password, there were hidden
parameters as well.
2.4 Design
10
Identifying the main entities, their attributes, relationships and constraints, commences the
design of a database application. The entities of an agricultural information system
represent different information on crops. This include crops and intercrops, production and
export, crop and inter-crop diseases, soil suitability, fertilizer, research institutes. These
entities are inter-related by crop, product or institute. Characteristics of some of the entities
are given in table 2.1. The table and attribute names Used for these entities and their
characteristics are given within brackets in italics font Style.
Entity Characteristics
Crops Specialization
(Crops Specialization)
Name of the crop (Crop_Name)
Unique code of the crop (Crop_No)
Farmers details Name of the farmer(Farmer_ Name)
Unique code of the farmer (farmer_id)
Suppliers details Name of the Supplier(Supplier _Name)
Unique code of the Supplier(Supplier_id)
Post Advertisement Name of the Crop(Crop_Name)
Unique code of the advertisement (post_id)
Sell crop details Name of the Crop(Crop_Name)
Unique code of the sold crop (sell_id)
Farming Tips Unique code of the Tips (id)
Complaints of Farmers Unique code of the farmer (farmer_id)
Unique code of the Complaint(complt_id)
Table 2.1: Selected Entity / Characteristics of a farming assistant web service
2.5 Implementation
11
The set of tables is created using the relational database for the identified entities at the
design stage. The uniqueness of the data fields in these tables are established using primary
keys, while the relationships are maintained using foreign keys [ELM94, FER98]. The web
pages of this farming assistant web service will guide the use and operation of this system.
Figure 1 illustrates the index page for our farming assistant web service Respective
modules there and is chosen through a hyperlink of this page. For instance information on
research done on rubber by institutes can be viewed through respective the hyperlinks.
Index page of Farming assistant web service
The system will be having only one User-name and Password section on the front page, as
per the user-name and password the system will know whether user is
Farmer/Customer/Dealer. We follow the MVC design pattern for developing our system.
Model–view–controller (MVC) is a software design pattern for implementing user
interfaces on computers. It divides a given software application into three interconnected
parts, so as to separate internal representations of information from the ways that
information is presented to or accepted from the user.
2. 6 Database Implementation:
12
After getting the requirement of a logical design and structural design of our database, we
can move to the implementation stage. In general, implementing our structural design
involves defining the various objects and enforcing the constraints on the data
relationships. The implementation phase is where you install the DBMS on the required
hardware, optimize the database to run best on that hardware and software platform, and
create the database and load the data.
2.6.1 Database of Supplier:
In database, supplier database gather into user table. When supplier create an account then
all information of user store into supplier table. In user table store supplier password,
email, name, mobile number,address, gender and profile image. If user wants to login
website then need that information.
Database of supplier
2.6.2 Database of Admin:
Admin database store admin login info into admin table. This table store id and
password. This table also store access label which type of admin login into admin panel.
Our website has two type admin so we use two access label.
13
Database of admin
2.6.3 Database of farmer:
In database, farmer database gather into user table. When farmer create an account then all
information of user store into supplier table. In user table store farmer password, email,
name, mobile number,address, gender and profile image. If user wants to login website
then need that information.
Database of farmer
14
CHAPTER 3
LITERATURE SURVEY
This chapter reviews three main research areas. Firstly, it traces the agricultural problems,
technology adoption role and issues through extension services particularly in India and in
the world in general. Secondly, by finding the factors that are affecting the extension
services through proper use of ICTs or determining the factors of transfer of technologies.
By doing so, this chapter helps build the fundamental concepts of ICT and decision making
at all levels of agricultural decision making process. Lastly, it presents a comprehensive
review of various models used by previous researchers in facilitating the information
content concerned with farmers in retrieving the information needed in their decision
making process.
3.1 Resource Allocation
Much of the project scheduling literature treats task durations as deterministic. In reality,
however, task durations are subject to considerable uncertainty and that uncertainty can be
influenced by the resources assigned. The purpose of this paper is to provide the means for
program managers (who may have responsibility for multiple projects) to optimally
allocate resources from common resource pools to individual tasks on several competing
projects. Instead of the traditional use of schedules, we develop control policies in the form
of planned resource allocation to tasks that capture the uncertainty associated with task
durations and the impact of resource allocation on those durations. We develop a solution
procedure for the model and illustrate the ideas in an example.
3.2 Multipurpose Farming Assistant Web Service
The farming web service is multipurpose site which not only provide direct communication
between farmer and supplier but also provide communication with admin. The Supplier
post the crop advertisement and the farmer will get this add it on his account and sell crop
to supplier according to add. The supplier also has the crop received page in his module
that updates the status when crop is received by supplier. These will not only provide the
farmer to sell their crop but also help them to solve their problems and complaints. The
admin also give the farming tips to the farmer help farmers ensure greater profitability
15
through direct farmer to supplier and farmer to farmer communication. This service boosts
business communication and brings transparency in the system.
 Through this project farmers ensure greater profitability.
 This service boosts business communication and brings transparency in the system.
 Can be over for multiple villages to communicate and deal with each other.
 Farming tips is given to farmer easily and their compliant can be solved.
3.3 Application:
This system can be used in developing countries to enhance farmer, manufacturer, and
retailer communication thus eliminating unnecessary intermediaries.
3.4 Our Product:
 The farming assistant web server brings farmer and supplier close.
 Farmer can sell their product directly to supplier without any middlemen.
 Farmer can post complaint that will handle by the administration.
 The supplier adds the crop as advertisement that is needed by the supplier.
3.5 System Analysis:
The architecture of the whole project is analysed. System analysis is the process of
defining the architecture, components, and data of a system to satisfy specified
requirements. Design is a method of studying a system by examining its component parts
and their interactions. Before implementation began the system was analysed and
designed. In this section, use cases, requirement analysis, and other part are described in
details.
3.6 Requirement Analysis:
Web service of farmer product required the following requirements. This has mainly four
actors. Those are Admin, Farmer and Dealer. This website give service of farmer product
to sell holder is known as dealer.
16
3.6.1 Data Requirement
During requirement analysis the following data have been identified for a web service of
farmer product system: At first each person need to register (without admin)
himself/herself as a customer or a farmer or a dealer for accessing the user’s necessary
information. Each user requires an unique username or email Id and password to register in
the website. Admin/Farmer need to login to the system to operate the system.
Admin/Farmer has an individual or unique login user id and password. Through this user
id and password admin/farmer can login to the system. A supplier can select a product for
buying and post add. Supplier also can pay cash on delivery.
3.6.2 Process Requirement
The following process requirements are identified for system:
 A valid login is required for all process to be performed. A valid login is required for every
registered users and admin. All of them have a valid user id and password. System will
authenticate their valid login.
 After valid login Dealer can check his information, can see personal information and can
check product history and buy product.
 Admin can login to the system. Admin can view complaint and provide Tips too. Admin
can also enter new category in the list and insert new product.
 Farmer can login to the system. Farmer can view, delete, publish and update product info.
Farmer can also enter new product in the list and insert new info.
3.7 Features:
 Separate login areas with appropriated functionality for farmers, administrators
and dealers/ retailers.
 A separate page where only farmers can post complaints and only assigned
administrators can read and edit this page.
 Pages where dealers and retailers may post their ads and notifications.
 Farmers are notified of these notifications via SMS whenever new ads are
published.
17
 An effective GUI so that rural people may easily use the service.
 Can be over for multiple villages to communicate and deal with each other
18
CHAPTER 4
OVERALL DESCRIPITION OF PROJECT
4.1 Data flow diagram:
Figure 4.1 DFD
Supplier Login
Farmer Login
Complaint
page
Compliant
status
Crop
advertisement
details
Sell
product
LoginAdmin
View
complain
t
Farming tips
Logout
Accepted
19
4.2 Module Description:
4.2.1 Supplier:
Supplier module contains:
 Supplier details
 Post Advertisements
 Crop Received
 Edit Supplier Details
Supplier details
Post advertisement
20
4.2.2 Farmer:
Farmer module contains:
 Complaint Page
 Complaint Status
 Farming Tips
 Crop Advertisement Details
 Sell Crop
 Sell Crop Details
 Edit Farmer Details
Complaint Page
View Complaint Status
21
Crop Advertisement Details
Sell Crop
22
Sell Crop Details
Edit Details
23
4.2.3 Admin
Admin module contains:
 View Complaint
 Farming Tips
Admin Home
View Complaint
24
Update status
Select Status
25
Farming Tips
26
CHAPTER 5
CONCLUSION AND FUTURE WORK
5.1 Conclusion
The “Farming Assistant Web Service” is successfully designed and developed to fulfill the
necessary requirements, as identified in the requirements analysis phase, such as the
system is very much user friendly, form level validation and field level validation are
performing very good. The old manual system was suffering from a series of drawbacks.
The present project has been developed to meet the aspirations indicated in the modern
age. Through the developed project, anyone can visualize the effectiveness and efficiency
in the real life. It is very helpful for computerization or doing automation of a personal
information management system. This program helps reduce the manual method and stress
which is done by a person and that is time consuming and lengthy process. With this
application user’s information are stored very efficiently in a secured database. Trend of
information improvement in the generation has improved the quality and services of
human operation just as the case of this application for job services has reduce the mobility
rate of human and improve their standard of database storage.
5.2 Future Work
The future plan of this project is to improved design; implementation and documentation in
such a way that anyone can use this project for better perform. I will develop the site more
dynamically. In future I will add the few modules for better improvement of the project
such as, real-time chat bot option for user and farmer, so that user can directly enquiry
theirs problem on any time through the chat bot. Video conversation option for supplier
and farmer and admin and barcode generation for membership card and using online buy
and sell product. Online account verification and notification for user for specific job
category they searching for jobs. In future I will also add mobile version app of this
website.
27
APPENDIX
Index.html
<!-- Login -->
<div id="login" class="login">
<div class="container">
<div class="row">
<div class="col-md-4 col-md-offset-4 text-center">
<h2 style="color:white">Login</h2>
<hr>
</div>
</div>
<div class="row">
<div class="col-md-4 text-center">
<div class="service-item">
<a href="farmer.jsp">
<img src="img/farmer.jpg">
<h3 style="color:white">Farmer</h3>
</div>
</div>
<div class="col-md-4 text-center">
<div class="service-item">
<a href="admin.jsp">
<img src="img/admin.jpg">
<h3 style="color:white">Admin</h3>
</div>
</div>
<div class="col-md-4 text-center">
<div class="service-item">
<a href="supplier.jsp">
28
<img src="img/supplier.png" >
<h3 style="color:white">Supplier</h3>
</div>
</div>
</div>
</div>
</div>
<!-- /Login-->
Supplier.jsp
<div id="nav">
<h5 style="color:red" align="center"> <%
if (request.getParameter("msg") == null) {
//out.println("");
} else {
out.println("<b>"+request. getParameter("msg")+"</b>!");
}
if (request.getParameter("msg1") == null) {
//out.println("");
} else {
out.println("<b>"+request. getParameter("msg1")+"</b>!");
}
%></h5>
<div id="Supplier">
<div class="container">
<div class="row">
<div class="col-md-4 col-md-offset-4 text-center">
<h2 style="color:white">Supplier Login</h2>
<hr>
</div>
<div class="col-md-5 col-md-offset-3">
29
<!-- supplier form starts -->
<form action="supplierlogin.jsp" id="admin-form" class="form-horizontal">
<fieldset>
<div class="form-group">
<label class="col-sm-4 control-label"
for="s_id" style="color:white">ID</label>
<div class="col-sm-8">
<input type="text" placeholder="Id" class="form-
control" name="s_id" id="name" required="">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="password" style="color:white">PASSWORD</label>
<div class="col-sm-8">
<input type="password" placeholder="********"
class="form-control" name="password" id="password" required="">
</div>
</div>
<div class="col-sm-offset-4 col-sm-8">
<button type="submit" class="btn btn-
success">Login</button>
<a href="supplierRegister.jsp">New User</a>
</div>
</fieldset>
</form>
<!-- supplier form ends -->
</div>
</div>
30
Supplier registration:
<%@page import="java.sql.*;" %>
<%
String s_id,password;
s_id=request.getParameter("s_id");
password=request.getParameter("password");
String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web
service";
Connection con = null;
ResultSet rs;
PreparedStatement pstatement = null;
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection(connectionURL, "root", "");
String queryString = "SELECT * FROM `supplier` WHERE s_id=? and
password=?";
/* createStatement() is used for create statement
object that is used for
sending sql statements to the specified database. */
pstatement = con.prepareStatement(queryString);
pstatement.setString(1, s_id);
pstatement.setString(2, password);
rs= pstatement.executeQuery();
if(rs.next())
{
31
session.setAttribute("Sid", s_id);
response.sendRedirect("suppliermenu.jsp");
}
else
{
response.sendRedirect("supplier.jsp?msg=Invalid username or
password");
}
}
catch(Exception e)
{
out.println(e.getMessage());
}
%>
Saving.jsp
<%@page import="java.sql.*;" %>
<%
String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web
service";
Connection con = null;
PreparedStatement pstatement = null;
String s_id,suppliername,password,address,phone;
s_id=request.getParameter("s_id");
suppliername=request.getParameter("suppliername");
password=request.getParameter("password");
address=request.getParameter("address");
phone=request.getParameter("phone");
32
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection(connectionURL, "root", "");
String queryString = "INSERT INTO
supplier(s_id,suppliername,password,address,phone) VALUES (?, ?, ?, ?, ?)";
/* createStatement() is used for create statement
object that is used for
sending sql statements to the specified database. */
pstatement = con.prepareStatement(queryString);
pstatement.setString(1, s_id);
pstatement.setString(2, suppliername);
pstatement.setString(3, password);
pstatement.setString(4, address);
pstatement.setString(5, phone);
pstatement.executeUpdate();
//out.println("successfully saved");
response.sendRedirect("supplier.jsp?msg1=Successfully Registered");
}
catch(Exception e)
{
out.println(e.getMessage());
}
%>
Suppliermenu.jsp:
<h2><em>Farming Assistant Web Service</em></h2><br><br>
33
<nav class="navbar navbar-new" role="navigation">
<div class="container"></div>
<div class="collapse navbar-collapse" id="mobilemenu">
<ul class="nav navbar-nav navbar-right text-center">
<li><a href="postadvertisement.jsp"><i class="service-icon fa fa-
upload"></i>&nbsp;Post Advertisement</a></li>
<li><a href="cropreceived.jsp"><i class="service-icon fa fa-leaf"></i>&nbsp;Crop
Received</a></li>
<li><a href="sppedit.jsp"><i class="service-icon fa fa-
edit"></i>&nbsp;Edit</a></li>
<li><a href="supplier.jsp"><i class="service-icon fa fa-sign-
out"></i>&nbsp;Logout</a></li>
</ul></div>
<%@page import="java.sql.*"%>
<h3 align="center"><em>
<%
String s_id=(String)session.getAttribute("Sid");
out.println("welcome "+s_id);
%></em></h3>
<%
try{
//out.println(id);
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/farming
assistance web service","root","");
Statement st=con.createStatement();
String sql="select * from supplier where s_id='"+s_id+"'";
34
//out.println(sql);
ResultSet rs=st.executeQuery(sql);
int count=0;
while(rs.next())
{
count++;
} if(count>0)
{
Statement s=con.createStatement();
ResultSet rst=s.executeQuery("select * from supplier where s_id='"+s_id+"'");
while(rst.next()){
System.out.println(rst.getString("s_id"));
%>
<h2 style="color:white"><em>Supplier Details</em></h2>
<table align="center" cellpadding="10">
<tr><th rowspan="4"> <img src="upload/<%=rst.getString("profile")%>"
width="150" height="150"></th>
<td>Id:</td><td><%=rst.getString("s_id")%></td></tr>
<tr><td>Name:</td><td><%=rst.getString("suppliername")%></td></tr>
<tr><td>Address:</td><td><%=rst.getString("address")%></td></tr>
<tr><td>Contact No:</td><td><%=rst.getString("phone")%></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
</table>
<%
}
}
else
{
response.sendRedirect("supplier.jsp");
}
35
}
catch(Exception e){
System.out.println(e);
}
%>
Post advertisement:
Postadvertisement.jsp
<%
String s_id=(String)session.getAttribute("Sid");
//out.println("welcome "+s_id);
%>
<form action="post_save.jsp" id="postadd" class="form-horizontal">
<fieldset>
<h5 style="color:red"> <%
if (request.getParameter("msg") == null) {
//out.println("");
} else {
out.println("<b>"+request. getParameter("msg")+"</b>!");
}
%></h5> <div class="form-group">
<label class="col-sm-4 control-label"
for="id" style="color:white">POST ID</label>
<div class="col-sm-8">
<input type="text" placeholder="" class="form-
control" name="pid" value="<%=n%>" readonly="">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="s_id" style="color:white">SUPPLIER ID</label>
<div class="col-sm-8">
36
<input type="text" placeholder="supplier_id"
class="form-control" name="s_id" value="<%=s_id%>" readonly="">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="cropname" style="color:white">CROP NAME</label>
<div class="col-sm-8">
<input type="text" placeholder="cropname"
class="form-control" id="cropname" name="cropname" required="" onkeydown="return
alphaOnly(event);">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="requiredquantity" style="color:white">REQUIRED QUANTITY</label>
<div class="col-sm-8">
<input type="number"
oninput="javascript: if(this.value.length>this.maxLength)
this.value=this.value.slice(0,this.maxLength);" placeholder="in kgs" class="form-control"
name="requiredquantity" maxlength="10" required="">
</div>
</div>
<div class="col-sm-offset-4 col-sm-8">
<button type="submit" class="btn btn-
success">Post</button>
<button type="reset" class="btn btn-primary ">Cancel</button>
</div>
</fieldset>
</form>
post_save.jsp
<%@page import="java.sql.*;" %>
37
<%
String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web
service";
Connection con = null;
PreparedStatement pstatement = null;
String pid,s_id,cropname,requiredquantity;
pid=request.getParameter("pid");
s_id=request.getParameter("s_id");
cropname=request.getParameter("cropname");
requiredquantity=request.getParameter("requiredquantity");
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection(connectionURL, "root", "");
String queryString = "INSERT INTO
post_addvertisement(pid,s_id,cropname,requiredquantity) VALUES (?, ?, ?, ?)";
/* createStatement() is used for create statement
object that is used for
sending sql statements to the specified database. */
pstatement = con.prepareStatement(queryString);
pstatement.setString(1, pid);
pstatement.setString(2, s_id);
pstatement.setString(3, cropname);
pstatement.setString(4, requiredquanti; pstatement.executeUpdate();
session.setAttribute("Sid",s_id);
session.setAttribute("Pid",pid);
response.sendRedirect("imageupload.jsp");
}
catch(Exception e)
{
out.println(e.getMessage());
}
%>
38
Imageuplod.jsp
<form action="demoprocess.jsp" id="postaddimg" class="form-horizontal"
enctype="multipart/form-data" method="POST">
<fieldset>
<div class="form-group">
<label class="col-sm-4 control-label"
for="cropname" style="color:white">CROP IMAGE</label>
<div class="col-sm-8">
<input type="file" class="form-control"
id="file" name="file" required=""> </div>
</div>
<div class="col-sm-offset-4 col-sm-8">
<button type="submit" class="btn btn-
success">Post</button>
</div>
demoprocess.jsp
<%@ page import="java.io.*,java.util.*, javax.servlet.*" %>
<%@ page import="javax.servlet.http.*" %>
<%@ page import="org.apache.commons.fileupload.*" %>
<%@ page import="org.apache.commons.fileupload.disk.*" %>
<%@ page import="org.apache.commons.fileupload.servlet.*" %>
<%@ page import="org.apache.commons.io.output.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Guru File Upload</title>
</head>
<body>
<%@page import="java.sql.*;" %>
39
<%
String pid=(String)session.getAttribute("Pid");
String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service";
Connection con = null;
PreparedStatement pstatement = null;
File file ;
int maxFileSize = 5000 * 1024;
int maxMemSize = 5000 * 1024;
String filePath =
"C:/Users/dell/Documents/NetBeansProjects/Farming_Assistant_web_service/web/slidefol
io/uploString contentType = request.getContentType();
if ((contentType.indexOf("multipart/form-data") DiskFileItemFactory factory = new
DiskFileItemFactory();
factory.setSizeThreshold(maxMemSize);
factory.setRepository(new File("c:temp"));
ServletFileUpload upload = new ServletFileUpload(factory);
upload.setSizeMax( maxFileSize );
try{
List fileItems = upload.parseRequest(request);
Iterator i = fileItems.iterator();
out.println("<html>");
out.println("<body>");
while ( i.hasNext () )
{
FileItem fi = (FileItem)i.next();
if ( !fi.isFormField () ) {
String fieldName = fi.getFieldName();
String fileName = fi.getName();
boolean isInMemory = fi.isInMemory();
long sizeInBytes = fi.getSize();
40
String filePart=fi.getName().substring(fi.getName().lastIndexOf("")+1);
fi.write(new File(filePath + filePart )) ;
Class.forName("com.mysql.jdbc.Driver").newInstance(); con =
DriverManager.getConnection(connectionURL, "root", "");
String queryString = "UPDATE post_addvertisement SET file=? WHERE
pid=?";
/* createStatement() is used for create statement
object that is used for
sending sql statements to the specified database. */
pstatement = con.prepareStatement(queryString);
pstatement.setString(1, filePart);
pstatement.setString(2,pid);
pstatement.executeUpdate();
response.sendRedirect("postadvertisement.jsp?msg=Successfully Posted");
}
}
out.println("</body>");
out.println("</html>");
}catch(Exception ex) {
System.out.println(ex);
}
}
else{
out.println("<html>");
out.println("<body>");
out.println("<p>No file uploaded</p>");
out.println("</body>");
out.println("</html>");
}
%>
</body>
41
</html>
Cropreceived.jsp
<%
String s_id=(String)session.getAttribute("Sid");
%>
<%
try {
/* Create string of connection url within specified format with machine
name, port number and database name. Here machine name id localhost and
database name is student. */
String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service";
// declare a connection by using Connection interface
Connection connection = null;
/* declare object of Statement interface that is used for executing sql
statements. */
Statement statement = null;
// declare a resultset that uses as a table for output data from tha table.
ResultSet rs = null;
// Load JBBC driver "com.mysql.jdbc.Driver"
Class.forName("com.mysql.jdbc.Driver").newInstance();
/* Create a connection by using getConnection() method that takes parameters
of string type connection url, user name and password to connect to database.*/
connection = DriverManager.getConnection(connectionURL, "root", "");/*
createStatement() is used for create statement object that is used for
sending sql statements to the specified database. */
statement = connection.createStatement();
// sql query to retrieve values from the secified table.String QueryString = "SELECT
*FROM sell_crop join farmer on sell_crop.id=farmer.id where sell_crop.s_id="+s_id;
//out.println(QueryString);
rs = statement.executeQuery(QueryString);
%>
<style>
42
table, td, th {
border: 0px solid black;
}
table {
border-collapse: separate;
width: 100%;
}th {
text-align: left;
}
</style><h5 style="color:red"> <%
if (request.getParameter("msg") == null) {
//out.println("");
} else {
out.println("<b>"+request. getParameter("msg")+"</b>!");
}
%></h5>
<TABLE cellpadding="10"table border="0" align="center">
<tr><td>Sell Id</td>
<td>Crop Name</td>
<td>Quantity (in kg)</td>
<td>Rupees</td>
<td>Farmer Id</td>
<td>Farmer Name</td>
<td>Contact</td>
<td>Status</td></tr>
<%
while (rs.next()) {
%>
<TR>
<TD style="color:blueviolet"><%=rs.getInt(1)%></TD>
<TD style="color:blueviolet"><%=rs.getString(5)%></TD>
<TD style="color:blueviolet"><%=rs.getString(6)%></TD>
43
<TD style="color:blueviolet"><%=rs.getInt(7)%></TD>
<TD style="color:blueviolet"><%=rs.getInt("id")%></TD>
<TD style="color:blueviolet"><%=rs.getString("farmername")%></TD>
<TD style="color:blueviolet"><%=rs.getString("phone")%></TD>
<TD><button type="submit" class="btn btn-primary"
onclick="window:location='updatecrpstatus.jsp?sell_id=<%=rs.getInt(1)%>&status=Acce
pted'">Accepted</button></TD</TD></TR><% } %>
<%
// close all the connections.
rs.close();
statement.close();
connection.close();
} catch (Exception ex) {
%>
<%
out.println("Unable to connect to database.");
}
%>
Update profile:
sppedit.jsp
<%@page import="java.sql.*"%>
<%
try{
String s_id=(String)session.getAttribute("Sid");
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/farming
assistance web service","root","");
Statement st=con.createStatement();
String sql="select * from supplier where s_id='"+s_id+"'";
//out.println(sql);
44
ResultSet rs=st.executeQuery(sql);
int count=0;
while(rs.next())
{
count++;
}
if(count>0){
Statement s=con.createStatement();
ResultSet rst=s.executeQuery("select * from supplier where s_id='"+s_id+"'");
while(rst.next()){
System.out.println(rst.getString("s_id"));
%>
<h3>Edit Profile</h3>
<form action="updatesp.jsp" method="post">
<table align="center">
<tr><td>Id:</td><td><input type="text" name="name"
value="<%=rst.getInt("s_id")%>"></td></tr>
<tr><td>Name:</td><td><input type="text" name="suppliername"
value="<%=rst.getString("suppliername")%>"></td></tr>
<tr><td>Password:</td><td><input type="text" name="password"
value="<%=rst.getString("password")%>"></td></tr>
<tr><td>Address:</td><td><input type="text" name="address"
value="<%=rst.getString("address")%>"></td></tr>
<tr><td>Contact No:</td><td><input type="text" name="phone"
value="<%=rst.getString("phone")%>"></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td><button type="submit" class="btn btn-
success">Update</button></td></tr>
</table>
</form>
45
<%
}
}
else
{ response.sendRedirect("suppliermenu.jsp");
}
}catch(Exception e){
System.out.println(e);
}
%>
Upload Image:
Sppupload.jsp
<%@page import="java.sql.*"%>
<%
try{
String s_id=(String)session.getAttribute("Sid");
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/farming
assistance web service","root","");
Statement st=con.createStatement();
String sql="select * from supplier where s_id='"+s_id+"'";
//out.println(sql);
ResultSet rs=st.executeQuery(sql);
int count=0;
while(rs.next())
{
count++;
}
if(count>0){
Statement s=con.createStatement();
ResultSet rst=s.executeQuery("select * from supplier where s_id='"+s_id+"'");
46
while(rst.next()){
System.out.println(rst.getString("s_id"));
%>
<h3>Edit Profile</h3>
<form action="updatesp.jsp" method="post">
<table align="center">
<tr><td>Id:</td><td><input type="text" name="name"
value="<%=rst.getInt("s_id")%>"></td></tr>
<tr><td>Name:</td><td><input type="text" name="suppliername"
value="<%=rst.getString("suppliername")%>"></td></tr>
<tr><td>Password:</td><td><input type="text" name="password"
value="<%=rst.getString("password")%>"></td></tr>
<tr><td>Address:</td><td><input type="text" name="address"
value="<%=rst.getString("address")%>"></td></tr>
<tr><td>Contact No:</td><td><input type="text" name="phone"
value="<%=rst.getString("phone")%>"></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
<tr><td></td><td><button type="submit" class="btn btn-
success">Update</button></td></tr>
</table>
</form>
<%
}
}
else
{ response.sendRedirect("suppliermenu.jsp");
}
}catch(Exception e){
System.out.println(e);
}%>
47
Farmer:
Farmer registration:
<form action="saving.jsp" id="Registration" class="form-horizontal" method="Post"
onsubmit="return myFunction()">
<fieldset>
<div class="form-group">
<label class="col-sm-4 control-label"
for="id" style="color:white">FARMER ID</label>
<div class="col-sm-8">
<input type="text" placeholder="Id"
class="form-control" name="id" id="name" value="<%=n%>" readonly="">
</div>
</div><div class="form-group">
<label class="col-sm-4 control-label"
for="farmername" style="color:white">FARMER NAME</label>
<div class="col-sm-8">
<input type="text" placeholder="Enter
your name" class="form-control" name="farmername" id="farmername" required=""
onkeydown="return alphaOnly(event);"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="password" style="color:white">PASSWORD</label>
<div class="col-sm-8">
<input type="password"
placeholder="********" class="form-control" name="password" id="password"
maxlength="8" required="">
</div>
</div><div class="form-group">
<label class="col-sm-4 control-label"
for="re-password" style="color:white">RE-PASSWORD</label>
48
<div class="col-sm-8">
<input type="password"
placeholder="********" class="form-control" name="repassword" id="repassword"
maxlength="8" required="">
</div>
</div><div class="form-group">
<label class="col-sm-4 control-label"
for="address" style="color:white">ADDRESS</label>
<div class="col-sm-8">
<textarea placeholder="Enter your
address" class="form-control" name="address" id="address" rows="2"
required=""></textarea>
</div>
</div><div class="form-group">
<label class="col-sm-4 control-label"
for="phone" style="color:white">PHONE</label>
<div class="col-sm-8">
<input type="number" oninput="javascript:
if(this.value.length>this.maxLength) this.value=this.value.slice(0,this.maxLength);"
placeholder="phone" class="form-control" name="phone" id="phone" maxlength="10"
required>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="crproduction" style="color:white">Crop Production</label>
<div class="col-sm-8">
<input type="text" placeholder="Enter your name"
class="form-control" name="crp" id="crp" required="" onkeydown="return
alphaOnly(event);"/>
</div>
</div> <div class="col-sm-offset-4 col-sm-
8">
49
<button type="submit" class="btn btn-success">Submit</button>
<button type="reset" class="btn btn-primary">Cancel</button>
</div>
</fieldset>
</form>
saving.jsp
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Arrays"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%@page import="java.sql.*;" %>
<%
String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web
service";
Connection con = null;
PreparedStatement pstatement = null;
String id,farmername,password,address,phone;
id=request.getParameter("id");
farmername=request.getParameter("farmername");
password=request.getParameter("password");
address=request.getParameter("address");
phone=request.getParameter("phone");
String crp=request.getParameter("crp");
// out.println(m);
// for(int i=0;i<=crop.length;i++)
50
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection(connectionURL, "root", "");
String queryString = "INSERT INTO
farmer(id,farmername,password,address,phone,crop) VALUES (?, ?, ?, ?, ?,?)";
/* createStatement() is used for create statement
object that is used for
sending sql statements to the specified database. */
pstatement = con.prepareStatement(queryString);
pstatement.setString(1, id);
pstatement.setString(2, farmername);
pstatement.setString(3, password);
pstatement.setString(4, address);
pstatement.setString(5, phone);
pstatement.setString(6, crp);
pstatement.executeUpdate();
response.sendRedirect("farmer.jsp?msg1=Successfully Registered");
//out.println("successfully saved");
}
catch(Exception e)
{
out.println(e.getMessage());
%>
</body>
</html>
farmer.jsp
<div id="nav">
<h5 style="color:red">
<%
if (request.getParameter("msg") == null) {
51
//out.println("");
} else {
out.println("<b>"+request. getParameter("msg")+"</b>!");
}
if (request.getParameter("msg1") == null) {
//out.println("");
} else {
out.println("<b>"+request. getParameter("msg1")+"</b>!");
}
%></h5><div id="Farmer">
<div class="container">
<div class="row">
<div class="col-md-4 col-md-offset-4 text-center">
<h2 style="color:white">Farmer Login</h2>
<hr>
</div>
<div class="col-md-5 col-md-offset-3">
<!-- farmer form starts -->
<form action="farmerlogin.jsp" id="farmer-form" class="form-
horizontal"><fields><div class="form-group">
<label class="col-sm-4 control-label"
for="id" style="color:white">ID</label>
<div class="col-sm-8">
<input type="text" placeholder="Id" class="form-
control" name="lid" required="" />
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="password" style="color:white">PASSWORD</label>
<div class="col-sm-8">
<input type="password" placeholder="********"
class="form-control" name="password" required=""/>
52
</div>
</div>
<div class="col-sm-offset-4 col-sm-8">
<button type="submit" class="btn btn-
success">Login</button>
<a href="farmerRegister.jsp">New User</a>
</div>
</fieldset>
</form>
<!-- farmer form ends -->
</div>
</div>
</div>
</div>
farmerlogin.jsp
<%@page import="java.sql.*;" %>
<%
String id,password;
id=request.getParameter("lid");
password=request.getParameter("password");
String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web
service";
Connection con = null;
PreparedStatement pstatement = null;
ResultSet rs;
int croppartsLength;
int i;
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection(connectionURL, "root", "");
53
String queryString = "SELECT * FROM farmer WHERE id=? and
password=?";
/* createStatement() is used for create statement
object that is used for
sending sql statements to the specified database. */
pstatement = con.prepareStatement(queryString);
pstatement.setString(1, id);
pstatement.setString(2, password);
rs= pstatement.executeQuery();
if(rs.next())
{
String crop=rs.getString("crop");
//out.println(crop);
session.setAttribute("Sid",id);
session.setAttribute("crop",crop);
response.sendRedirect("farmermenu.jsp");
}
else
{
response.sendRedirect("farmer.jsp?msg=Invalid username or password");
}
}
catch(Exception e)
{
out.println(e.getMessage());
54
}
%>
</body>
</html>
Complaintpage.jsp
<div id="nav">
<h5 style="color:red"> <%
if (request.getParameter("msg") == null) {
//out.println("");
} else {
out.println("<b>"+request. getParameter("msg")+"</b>!");
}
%></h5>
<div id="complaint">
<div class="container">
<div class="row">
<div class="col-md-4 col-md-offset-4 text-center">
<h2 style="color:white">Complaint Page</h2>
<hr>
</div>
<div class="col-md-5 col-md-offset-3">
<!-- complaint form starts -->
<form action="compltsave.jsp" id="complaint" class="form-horizontal">
<fieldset>
<div class="form-group">
<label class="col-sm-4 control-label"
for="complaintid" style="color:white">COMPLAINT ID</label>
<div class="col-sm-8">
<input type="text" placeholder=""
class="form-control" name="complaintid" value="<%=n%>" readonly="">
</div>
55
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="id" style="color:white">FARMER ID</label>
<div class="col-sm-8">
<input type="text" placeholder="" class="form-
control" name="id" value="<%=id%>" readonly="">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="complaint" style="color:white">COMPLAINT</label>
<div class="col-sm-8">
<textarea type="text" placeholder="Enter your
complaint" class="form-control" name="complaint" rows="3" required=""></textarea>
</div>
</div>
<div class="col-sm-offset-4 col-sm-8">
<button type="submit" class="btn btn-
success">Post</button>
<button type="reset" class="btn btn-primary">Cancel</button>
</div>
</fieldset>
</form>
<!-- post add form ends -->
</div>
</div>
</div>
</div>
56
compltsave.jsp
<%@page import="java.sql.*;" %>
<%
String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web
service";
Connection con = null;
PreparedStatement pstatement = null;
String complaintid,id,complaint;
complaintid=request.getParameter("complaintid");
id=request.getParameter("id");
complaint=request.getParameter("complaint");
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection(connectionURL, "root", "");
String queryString = "INSERT INTO complaint_page(complaintid, id,
complaint) VALUES (?, ?, ?)";
/* createStatement() is used for create statement
object that is used for
sending sql statements to the specified database. */
pstatement = con.prepareStatement(queryString);
pstatement.setString(1, complaintid);
pstatement.setString(2, id);
pstatement.setString(3, complaint);
pstatement.executeUpdate();
response.sendRedirect("Complaint_page.jsp?msg=Complaint Send");
}
catch(Exception e)
{
out.println(e.getMessage());
}
%>
farmingtips.jsp
57
<%
String id=(String)session.getAttribute("Sid");
String crop=(String)session.getAttribute("crop");
//out.println(id);
try {
/* Create string of connection url within specified format with machine
name, port number and database name. Here machine name id localhost and
database name is student. */
String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service";
// declare a connection by using Connection interface
Connection connection = null;
/* declare object of Statement interface that is used for executing sql
statements. */
Statement statement = null;
// declare a resultset that uses as a table for output data from tha table.
ResultSet rs = null;
// Load JBBC driver "com.mysql.jdbc.Driver"
Class.forName("com.mysql.jdbc.Driver").newInstance();
/* Create a connection by using getConnection() method that takes parameters
of string type connection url, user name and password to connect to database.*/
connection = DriverManager.getConnection(connectionURL, "root", "");
/* createStatement() is used for create statement object that is used for
sending sql statements to the specified database. */
statement = connection.createStatement();
// sql query to retrieve values from the secified table.
String QueryString = "SELECT * FROM tips WHERE id="+id+"";
rs = statement.executeQuery(QueryString);
%>
<style>
table, td, th {
border: 0px solid black;
}
table {
58
border-collapse: collapse;
width: 100%;
}
th {
text-align: left;
}
</style>
<TABLE cellpadding="10"table border="0" align="center">
<tr><td>Tip Id</td>
<td>Tip</td>
<%
while (rs.next()) {
%>
<TR>
<TD style="color:blueviolet"><%=rs.getInt(1)%></TD>
<TD style="color:blueviolet"><%=rs.getString(3)%></TD>
</TD>
</TR>
<% } %>
<%
// close all the connections.
rs.close();
statement.close();
connection.close();
} catch (Exception ex) {
%>
<%
out.println("Unable to connect to database.");
}
%> </div>
<div class="col-md-5 col-md-offset-3">
</div>
</div>
59
</div>
</div>
Cropadddetails.jsp
<%@page import="java.util.Iterator"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%
String id=(String)session.getAttribute("Sid");
String crop=(String)session.getAttribute("crop");
///out.println(crop);
%>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>Farming Assistant Web service</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.css" rel="stylesheet">
<!-- Add custom CSS here -->
<link href="css/slidefolio.css" rel="stylesheet">
<!-- Font Awesome -->
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet">
</head>
<body>
<!-- Header Area -->
<div id="top" class="header">
<div class="vert-text">
60
<nav class="navbar navbar-new" role="navigation">
<div class="container"></div>
<div class="collapse navbar-collapse" id="mobilemenu">
<ul class="nav navbar-nav navbar-right text-center">
<li><a href="farmermenu.jsp"><i class="service-icon fa fa-
user"></i>&nbsp;Profile</a></li>
<li><a href="Complaint_page.jsp"><i class="service-icon fa fa-question-
circle"></i>&nbsp;Complaint Page</a></li>
<li><a href="vcompltstatus.jsp"><i class="service-icon fa fa-
eye"></i>&nbsp;View Complaint Status</a></li>
<li><a href="farmingtips.jsp"><i class="service-icon fa fa-comments-
o"></i>&nbsp;Farming Tips</a></li>
<li><a href="sellcrpdtls.jsp"><i class="service-icon fa fa-info-
circle"></i>&nbsp;Sell Crops Details</a></li>
<li><a href="farmer.jsp"><i class="service-icon fa fa-sign-
out"></i>&nbsp;Logout</a></li>
</ul></div>
<div id="nav">
<h5 style="color:red"> <%
if (request.getParameter("msg") == null) {
//out.println("");
} else {
out.println("<b>"+request. getParameter("msg")+"</b>!");
}
%></h5>
<div id="crop_ad_details">
<div class="container">
<div class="row">
<div class="col-md-4 col-md-offset-4 text-center">
<h3 style="color:white">Crop Advertisement Details</h3>
<hr>
</div>
<div class="col-md-5 col-md-offset-3">
61
<%
try {
/* Create string of connection url within specified format with machine
name, port number and database name. Here machine name id localhost and
database name is student. */
String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service";
// declare a connection by using Connection interface
Connection connection = null;
/* declare object of Statement interface that is used for executing sql
statements. */
Statement statement = null;
// declare a resultset that uses as a table for output data from tha table.
ResultSet rs = null;
// Load JBBC driver "com.mysql.jdbc.Driver"
Class.forName("com.mysql.jdbc.Driver").newInstance();
/* Create a connection by using getConnection() method that takes parameters
of string type connection url, user name and password to connect to database.*/
connection = DriverManager.getConnection(connectionURL, "root", "");
/* createStatement() is used for create statement object that is used for
sending sql statements to the specified database. */
statement = connection.createStatement();
// sql query to retrieve values from the secified table.
String QueryString = "SELECT * FROM post_addvertisement, supplier WHERE
"+"post_addvertisement.s_id=supplier.s_id AND status='notsold'AND
cropname='"+crop+"'";
rs = statement.executeQuery(QueryString);
%>
<style>
table, td, th {
border: 0px solid black;
}
table {
62
border-collapse: collapse;
width: 100%;
}
th {
text-align: left;
}
</style>
<TABLE cellpadding="10"table border="0" align="center">
<tr><td>Post Id</td>
<td>Supplier Id</td>
<td>Crop Name</td>
<td>Crop Image</td>
<td>Required Quantity (in kg)</td>
<td>Supplier Name</td>
<td>Contact</td></tr>
<%
while (rs.next()) {
%>
<TR>
<TD style="color:blueviolet"><%=rs.getInt("pid")%></TD>
<TD style="color:blueviolet"><%=rs.getInt("s_id")%></TD>
<TD style="color:blueviolet"><%=rs.getString("cropname")%></TD>
<TD style="color:blueviolet"><img src="upload/<%=rs.getString("file")%>" width="70"
height="70"></TD>
<TD style="color:blueviolet"><%=rs.getInt("requiredquantity")%></TD>
<TD style="color:blueviolet"><%=rs.getString("suppliername")%></TD>
<TD style="color:blueviolet"><%=rs.getString("phone")%></TD>
<TD><button type="submit" class="btn btn-primary"
onclick="window.location='sell_crop.jsp?s_id=<%=rs.getInt("s_id")%>&cropname=<%=r
s.getString("cropname")%>&suppliername=<%=rs.getString("suppliername")%>&requant
ity=<%=rs.getInt("requiredquantity")%>&pid=<%=rs.getInt("pid")%>'">Sell
Crop</button></TD>
</TD>
63
</TR>
<% } %>
<%
// close all the connections.
rs.close();
statement.close();
connection.close();
} catch (Exception ex) {
%>
<%
out.println("Unable to connect to database.");
}
</div>
</div>
</div>
</div> <!-- Header Area -->
<!-- /post add-->
<!-- Bootstrap core JavaScript -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery.js"></script>
<script src="js/jquery-scrolltofixed-min.js"></script>
<script src="js/jquery.vegas.js"></script>
<script src="js/jquery.mixitup.min.js"></script>
<script src="js/jquery.validate.min.js"></script>
<script src="js/script.js"></script>
<script src="js/bootstrap.js"></script>
<!-- Slideshow Background -->
<script>
$.vegas('slideshow', {
delay:5000,
backgrounds:[
{ src:'./img/portrait-sm.jpg', fade:2000 },
{ src:'./img/bw2.jpg', fade:2000 },
64
{ src:'./img/nature.jpg', fade:2000 },
{ src:'./img/portrait.jpg', fade:2000 },
{ src:'./img/portrait4.jpg', fade:2000 },
{ src:'./img/portrait6.jpg', fade:2000 },
{ src:'./img/portrait7.jpg', fade:2000 },
{ src:'./img/forest1.jpg', fade:2000 }
]})('overlay', {
src:'./img/overlay.png'
});</script>
<!-- /Slideshow Background -->
<!-- Mixitup : Grid -->
<script>
$(function(){
$('#Grid').mixitup();
});
</script>
<!-- /Mixitup : Grid -->
<!-- Custom JavaScript for Smooth Scrolling - Put in a custom JavaScript file to clean
this up -->
<script>
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^//,'') == this.pathname.replace(/^//,'')
|| location.hostname == this.hostname) { var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
65
});
</script>
<!-- Navbar -->
<script type="text/javascript">
$(document).ready(function() {
$('#nav').scrollToFixed();
});
</script>
<!-- /Navbar-->
</body></html>
sell_crop.jsp
<%
Random rand = new Random();
int n = rand.nextInt(900) + 100;
%>
<script>
function alphaOnly(event) {
var key = event.keyCode;
return ((key >= 65 && key <= 90) || key == 8);
};
</script>
<%
float p=0;
String id=(String)session.getAttribute("Sid");
String s_id=request.getParameter("s_id");
String cropname=request.getParameter("cropname");
String suppliername=request.getParameter("suppliername");
Float requantity=Float.parseFloat(request.getParameter("requantity"));
String pid=request.getParameter("pid");
//out.println(s_id);
%> <%
try {
66
/* Create string of connection url within specified format with machine
name, port number and database name. Here machine name id localhost and
database name is student. */
String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service";
// declare a connection by using Connection interface
Connection connection = null;
/* declare object of Statement interface that is used for executing sql
statements. */
Statement statement = null;// declare a resultset that uses as a table for output data from tha
table.
ResultSet rs = null;
// Load JBBC driver "com.mysql.jdbc.Driver"
Class.forName("com.mysql.jdbc.Driver").newInstance();
/* Create a connection by using getConnection() method that takes parameters
of string type connection url, user name and password to connect to database.*/
connection = DriverManager.getConnection(connectionURL, "root", "")/*
createStatement() is used for create statement object that is used for
sending sql statements to the specified database. */
statement = connection.createStatement();
// sql query to retrieve values from the secified table.
String QueryString = "SELECT * FROM crop_price WHERE
cropname='"+cropname+"'";
rs = statement.executeQuery(QueryString);
if(rs.next()){
Float price=Float.parseFloat(rs.getString("price"));
//out.println(requantity);
//out.println(price);
p=p+(price*requantity);
}
%>
<!-- sell_crop form starts -->
<form action="sellsave.jsp" id="sellcrop" class="form-horizontal">
67
<fieldset>
<div class="form-group">
<label class="col-sm-4 control-label"
for="sell_id" style="color:white">SELL ID</label>
<div class="col-sm-8">
<input type="text" placeholder="sell_id"
class="form-control" name="sell_id" id="sell_id" value="<%=n%>" readonly="">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="id" style="color:white">Farmer ID</label>
<div class="col-sm-8">
<input type="text" placeholder="id"
class="form-control" name="id" id="id" value="<%=id%>" readonly="">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="s_id" style="color:white">SUPPLIER ID</label>
<div class="col-sm-8">
<input type="number" placeholder="s_id"
class="form-control" name="s_id" id="s_id" maxlength="10" value="<%=s_id%>"
readonly="">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="suppliername" style="color:white">SUPPLIER NAME</label>
<div class="col-sm-8">
<input type="text" placeholder="suppliername"
class="form-control" name="suppliername" id="suppliername"
value="<%=suppliername%>" readonly="">
68
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="cropname" style="color:white">CROP NAME</label>
<div class="col-sm-8">
<input type="text" placeholder="cropname"
class="form-control" name="cropname" id="cropname" value="<%=cropname%>"
readonly="">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="quantity" style="color:white">QUANTITY</label>
<div class="col-sm-8">
<input type="number" class="form-control"
name="quantity" id="quantity" maxlength="10" value="<%=requantity%>" readonly="">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="rupees" style="color:white">RUPEES</label>
<div class="col-sm-8">
<input type="number" placeholder="rupees"
class="form-control" name="rupees" id="rupees" value="<%=p%>" readonly="">
</div>
</div>
<div class="col-sm-offset-4 col-sm-8">
<input type="hidden" name="status" value="sold"/>
<input type="hidden" name="pid" value="<%=pid%>"/>
<button type="submit" class="btn btn-
success">Sell</button>
<button type="reset" class="btn btn-primary">Cancel</button>
69
</div>
</fieldset>
</form>
<!-- sell_crop form ends -->
</div>
</div>
</div>
</div>
sell_save.jsp
<%
String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web
service";
Connection con = null;
Connection con1 = null;
Connection con2 = null;
Connection con3 = null;
Connection con4 = null; PreparedStatement pstatement = null;
PreparedStatement pstatement1 = null;
PreparedStatement pstatement2 = null;
PreparedStatement pstatement3 = null;
PreparedStatement pstatement4 = null;
String sell_id,id,s_id,suppliername,cropname,quantity,rupees,pid;
sell_id=request.getParameter("sell_id");
id=request.getParameter("id");
s_id=request.getParameter("s_id");
suppliername=request.getParameter("suppliername");
cropname=request.getParameter("cropname");
quantity=request.getParameter("quantity");
rupees=request.getParameter("rupees");
String status=request.getParameter("status");
pid=request.getParameter("pid");
70
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection(connectionURL, "root", "");
con1 = DriverManager.getConnection(connectionURL, "root", "");
con2 = DriverManager.getConnection(connectionURL, "root", "");
con3 = DriverManager.getConnection(connectionURL, "root", "");
con4 = DriverManager.getConnection(connectionURL, "root", "");
String queryString ="INSERT INTO
sell_crop(sell_id,id,s_id,suppliername,cropname,quantity,rupees) VALUES (? ,? ,? , ?, ? ,
?, ?)";
/* createStatement() is used for create statement
object that is used for
sending sql statements to the specified database. */
pstatement = con.prepareStatement(queryString);
pstatement.setString(1, sell_id);
pstatement.setString(2, id);
pstatement.setString(3, s_id);
pstatement.setString(4, suppliername);
pstatement.setString(5, cropname);
pstatement.setString(6, quantity);
pstatement.setString(7, rupees);
int i= pstatement.executeUpdate();
if(i>0)
{
String queryString1 ="UPDATE post_addvertisement SET id=? where s_id=?";
out.println(queryString1);
pstatement1 = con.prepareStatement(queryString1);
pstatement1.setString(1, id);
pstatement1.setString(2, s_id); int j= pstatement1.executeUpdate();
if (j>0)
{
String queryString2 ="UPDATE supplier SET id=? where s_id=?";
71
pstatement2 = con.prepareStatement(queryString2);
pstatement2.setString(1, id);
pstatement2.setString(2, s_id);
int k= pstatement2.executeUpdate();
if (k>0)
{
String queryString3 ="UPDATE farmer SET s_id=? where id=?";
pstatement3 = con.prepareStatement(queryString3);
pstatement3.setString(1, s_id);
pstatement3.setString(2, id);
int l= pstatement3.executeUpdate();
if ( ){
String queryString4 ="UPDATE post_addvertisement SET status=? where pid=?";
out.println(queryString4);
pstatement4 = con.prepareStatement(queryString4);
pstatement4.setString(1, status);
pstatement4.setString(2, pid);
pstatement4.executeUpdate();
}
}
}
}
//out.println("successfully saved");
response.sendRedirect("crpaddetails.jsp?msg=Successfully sold");
}
catch(Exception e)
{
out.println(e.getMessage());
}
%>
sellcrpdtls.jsp
<%
72
String id=(String)session.getAttribute("Sid");%>
<%
try {
/* Create string of connection url within specified format with machine
name, port number and database name. Here machine name id localhost and
database name is student. */String connectionURL = "jdbc:mysql://localhost:3306/farming
assistance web service";
// declare a connection by using Connection interface
Connection connection = null;
/* declare object of Statement interface that is used for executing sql
statements. */
Statement statement = null;
// declare a resultset that uses as a table for output data from tha table.
ResultSet rs = null;
// Load JBBC driver "com.mysql.jdbc.Driver"
Class.forName("com.mysql.jdbc.Driver").newInstance();
/* Create a connection by using getConnection() method that takes parameters
of string type connection url, user name and password to connect to database.*/
connection = DriverManager.getConnection(connectionURL, "root", "");
/* createStatement() is used for create statement object that is used for
sending sql statements to the specified database. */
statement = connection.createStatement();
// sql query to retrieve values from the secified table.
String QueryString = "SELECT DISTINCT
post_addvertisement.cropname,sell_crop.suppliername,supplier.id,sell_crop.sell_id,sell_cr
op.s_id,sell_crop.quantity,sell_crop.status,post_addvertisement.file FROM
post_addvertisement join sell_crop on post_addvertisement.s_id=sell_crop.s_id join
supplier on post_addvertisement.id=supplier.id where supplier.id='"+id+"' GROUP by
sell_crop.sell_id ";//out.println(QueryString);
rs = statement.executeQuery(QueryString);
%>
<style>
table, td, th {
73
border: 0px solid black;
}table {
border-collapse: separate;
width: 100%;
}th {
text-align: left;
}
</style>
<TABLE cellpadding="10"table border="0" align="center">
<tr><td>Sell Id</td>
<td>Crop Name</td>
<td>Crop Image</td>
<td>Supplier Id</td>
<td>Quantity (in kg)</td>
<td>Supplier Name</td>
<td>Status</td>
<%
while(rs.next()) {%>
<TR>
<TD style="color:blueviolet"><%=rs.getInt("sell_id")%></TD>
<TD style="color:blueviolet"><%=rs.getString("cropname")%></TD>
<TD style="color:blueviolet"><img src="upload/<%=rs.getString("file")%>" width="70"
height="70"></TD>
<TD style="color:blueviolet"><%=rs.getString("s_id")%></TD>
<TD style="color:blueviolet"><%=rs.getInt("quantity")%></TD>
<TD style="color:blueviolet"><%=rs.getString("suppliername")%></TD>
<TD style="color:blueviolet"><%=rs.getString("status")%></TD>
</TR>
<% } %>
<%
// close all the connections.
rs.close();
statement.close();
74
connection.close();
} catch (Exception ex) {
%>
<%
out.println("Unable to connect to database.");
}
%> </div>
</div>
</div>
</div>
Admin:
admin.jsp
<!-- admin form starts -->
<form action="login.jsp" id="admin-form" class="form-horizontal">
<fieldset>
<div class="form-group">
<label class="col-sm-4 control-label"
for="id" style="color:white">ID</label>
<div class="col-sm-8">
<input type="text" placeholder="Id"
class="form-control" name="id" id="name">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="password" style="color:white">PASSWORD</label>
<div class="col-sm-8">
<input type="password"
placeholder="********" class="form-control" name="password" id="password">
</div>
</div>
75
<div class="col-sm-offset-4 col-sm-8">
<button type="submit" class="btn btn-
success">Login</button></div>
</fieldset>
</form>
<!-- admin form ends -->
adminmenu.jsp
<li><a href="vcmplt.jsp"><i class="service-icon fa fa-eye"></i>&nbsp;View Complaint
</a></li>
<li><a href="farmtip.jsp"><i class="service-icon fa fa-comments-
o"></i>&nbsp;Farming Tips</a></li>
<li><a href="logout.jsp"><i class="service-icon fa fa-sign-
out"></i>&nbsp;Logout</a></li>
</ul></div>
<img src="img/adminicon.jpg" align="top">
<table>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
</table>
<h2 style="color:white"><em> <%
String id=(String)session.getAttribute("Sid");
if(id==null) id="";
out.print("Hello "+id); %> </em> </h2>
vcmplt.jsp
<li><a href="vcmplt.jsp"><i class="service-icon fa fa-eye"></i>&nbsp;View Complaint
</a></li> <li><a href="farmtip.jsp"><i class="service-icon fa fa-comments-
o"></i>&nbsp;Farming Tips</a></li>
76
<li><a href="logout.jsp"><i class="service-icon fa fa-sign-
out"></i>&nbsp;Logout</a></li>
</ul></div>
<img src="img/adminicon.jpg" align="top">
<table>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
</table>
<h2 style="color:white"><em> <%
String id=(String)session.getAttribute("Sid");
if(id==null) id="";
out.print("Hello "+id);
%> </em> </h2>
vcmpltstatus.jsp
<%
String id=(String)session.getAttribute("Sid");
String crop=(String)session.getAttribute("crop");
//out.println(id);
try {
/* Create string of connection url within specified format with machine
name, port number and database name. Here machine name id localhost and
database name is student. */
String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service";
// declare a connection by using Connection interface
77
Connection connection = null;
/* declare object of Statement interface that is used for executing sql
statements. */
Statement statement = null;
// declare a resultset that uses as a table for output data from tha table.
ResultSet rs = null;
// Load JBBC driver "com.mysql.jdbc.Driver"
Class.forName("com.mysql.jdbc.Driver").newInstance();
/* Create a connection by using getConnection() method that takes parameters
of string type connection url, user name and password to connect to database.*/
connection = DriverManager.getConnection(connectionURL, "root", "");
/* createStatement() is used for create statement object that is used for
sending sql statements to the specified database. */
statement = connection.createStatement();
// sql query to retrieve values from the secified table.
String QueryString = "SELECT * FROM complaint_page WHERE id="+id+"";
rs = statement.executeQuery(QueryString);
%>
<style>
table, td, th {
border: 0px solid black;
}
table {
border-collapse: collapse;
width: 100%;
}
th {
text-align: left;
}</style>
<TABLE cellpadding="10"table border="0" align="center">
<tr><td>Complaint Id</td>
<td>Id</td>
<td>Complaint</td>
78
<td>Status</td><%
while (rs.next()) {
%>
<TR><TD style="color:blueviolet"><%=rs.getInt(1)%></TD>
<TD style="color:blueviolet"><%=rs.getInt(2)%></TD>
<TD style="color:blueviolet"><%=rs.getString(3)%></TD>
<TD style="color:blueviolet"><%=rs.getString(4)%></TD>
</TD>
</TR>
<% } %>
<%
// close all the connections.
rs.close();
statement.close();
connection.close();
} catch (Exception ex) {
%>
<%
out.println("Unable to connect to database.");
}
%>
childclose.jsp
<body onload="child_close()">
<script type="text/javascript">
var popupWindow=null;
function child_close()
{ popupWindow =window.close();
}
</script>
farmtip.jsp
<%
if ((session.getAttribute("Sid") == null) || (session.getAttribute("Sid") == "")) {
79
%>
You are not logged in<br/>
<a href="admin.jsp">Please Login</a>
<%} else {
%>
Welcome <%=session.getAttribute("Sid")%>
<%
}
%><!-- admin form starts -->
<form action="tipsave.jsp" id="admin-form" class="form-horizontal">
<fieldset>
<div class="form-group">
<label class="col-sm-4 control-label"
for="id" style="color:white">TIP ID</label>
<div class="col-sm-8">
<input type="text" placeholder="Id" class="form-
control" name="tipid" value="<%=n%>" readonly="">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="id" style="color:white">FARMER ID</label>
<div class="col-sm-8">
<input type="number" oninput="javascript:
if(this.value.length>this.maxLength) this.value=this.value.slice(0,this.maxLength);"
placeholder=" Enter Farmer id" class="form-control" name="id" maxlength="10"
required=""> </div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"
for="tips" style="color:white">TIPS</label>
<div class="col-sm-8">
80
<textarea placeholder="" class="form-control"
name="tips" size="4" required=""></textarea>
</div>
</div>
<div class="col-sm-offset-4 col-sm-8">
<button type="submit" class="btn btn-
success">Submit</button>
</div>
</fieldset>
</form>
81
REFERENCES
[1]Introduction to Android: http://developer.android.com/guide/index.html
[2] Android API:
[3] http://developer.android.com/reference/packages.htmlJava 6 API:
[4]http://docs.oracle.com/javase/6/docs/api/Android
Fundamentals: http://developer.android.com/guide/components/fundamentals.html
[5] The Java Tutorials: http://docs.oracle.com/javase/tutorial/
[6] Android User Interfaces:
[7] http://developer.android.com/guide/topics/ui/index.htmlLayout:
[8] http://developer.android.com/guide/topics/ui/declaring-layout.htmlCommon Tasks:
[9] http://developer.android.com/guide/appendix/faq/commontasks.htmlGoogle Maps:
[10]http://code.google.com/android/add-ons/google-apis/maps-overview.htmlIconography:
[11]http://developer.android.com/guide/practices/ui_guidelines/icon_design.htmlSample
Source Code:
[12]http://developer.android.com/resources/samples/get.htmlAndroid
Training: http://developer.android.com/training/index.html
[13] Android Developer's Blog:http://android-developers.blogspot.com/
[14] Developer FAQ:
[15] http://developer.android.com/resources/faq/Developer Forums:
[16] http://developer.android.com/resources/community-groups.htmlAndroid Developer's
Group:
[17] http://groups.google.com/group/android-developers?lnk=XDA-Developers
Forums: http://forum.xda-developers.com/
[18] http://nevonprojects.com/farming-assistant-web-service/
[19]http://projectideas.co.in/farming-assistance-web-service-project-ideas/

More Related Content

What's hot

SRS For Online Store
SRS For Online StoreSRS For Online Store
SRS For Online StoreAhsan Rizwan
 
Online Quiz System Project Report
Online Quiz System Project Report Online Quiz System Project Report
Online Quiz System Project Report Kishan Maurya
 
04.project billing system
04.project billing system04.project billing system
04.project billing systemgirivaishali
 
CSE Final Year Project Presentation on Android Application
CSE Final Year Project Presentation on Android ApplicationCSE Final Year Project Presentation on Android Application
CSE Final Year Project Presentation on Android ApplicationAhammad Karim
 
Online Shop Project Report
Online Shop Project ReportOnline Shop Project Report
Online Shop Project ReportJayed Imran
 
2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software conceptsPrajakta Rane
 
Internship Presentation 1 Web Developer
Internship Presentation 1 Web DeveloperInternship Presentation 1 Web Developer
Internship Presentation 1 Web DeveloperHemant Sarthak
 
Synopsis on billing system
Synopsis on billing systemSynopsis on billing system
Synopsis on billing systemAlok Sharma
 
NIST Cloud Computing Reference Architecture
NIST Cloud Computing Reference ArchitectureNIST Cloud Computing Reference Architecture
NIST Cloud Computing Reference ArchitectureThanakrit Lersmethasakul
 
Front end web development
Front end web developmentFront end web development
Front end web developmentviveksewa
 
online-shopping-documentation-srs for TYBSCIT sem 6
 online-shopping-documentation-srs for TYBSCIT sem 6 online-shopping-documentation-srs for TYBSCIT sem 6
online-shopping-documentation-srs for TYBSCIT sem 6YogeshDhamke2
 
SRS for Online Medicine Ordering System
SRS for Online Medicine Ordering SystemSRS for Online Medicine Ordering System
SRS for Online Medicine Ordering SystemUmmeKalsoom11
 
Library Management System.powerpoint.pptx
Library Management System.powerpoint.pptxLibrary Management System.powerpoint.pptx
Library Management System.powerpoint.pptxKaiumShuvo1
 

What's hot (20)

SRS For Online Store
SRS For Online StoreSRS For Online Store
SRS For Online Store
 
Food donation project report II
Food donation project report IIFood donation project report II
Food donation project report II
 
Report on web development
Report on web developmentReport on web development
Report on web development
 
tour management system
tour management systemtour management system
tour management system
 
HOSPITAL MANAGEMENT SYSTEM project report
HOSPITAL MANAGEMENT SYSTEM project reportHOSPITAL MANAGEMENT SYSTEM project report
HOSPITAL MANAGEMENT SYSTEM project report
 
Online Quiz System Project Report
Online Quiz System Project Report Online Quiz System Project Report
Online Quiz System Project Report
 
04.project billing system
04.project billing system04.project billing system
04.project billing system
 
Dbms lab questions
Dbms lab questionsDbms lab questions
Dbms lab questions
 
CSE Final Year Project Presentation on Android Application
CSE Final Year Project Presentation on Android ApplicationCSE Final Year Project Presentation on Android Application
CSE Final Year Project Presentation on Android Application
 
Online Shop Project Report
Online Shop Project ReportOnline Shop Project Report
Online Shop Project Report
 
2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts
 
Internship Presentation 1 Web Developer
Internship Presentation 1 Web DeveloperInternship Presentation 1 Web Developer
Internship Presentation 1 Web Developer
 
Synopsis on billing system
Synopsis on billing systemSynopsis on billing system
Synopsis on billing system
 
Online Restaurant Management System
Online Restaurant Management SystemOnline Restaurant Management System
Online Restaurant Management System
 
NIST Cloud Computing Reference Architecture
NIST Cloud Computing Reference ArchitectureNIST Cloud Computing Reference Architecture
NIST Cloud Computing Reference Architecture
 
Front end web development
Front end web developmentFront end web development
Front end web development
 
Online event management system
Online event management systemOnline event management system
Online event management system
 
online-shopping-documentation-srs for TYBSCIT sem 6
 online-shopping-documentation-srs for TYBSCIT sem 6 online-shopping-documentation-srs for TYBSCIT sem 6
online-shopping-documentation-srs for TYBSCIT sem 6
 
SRS for Online Medicine Ordering System
SRS for Online Medicine Ordering SystemSRS for Online Medicine Ordering System
SRS for Online Medicine Ordering System
 
Library Management System.powerpoint.pptx
Library Management System.powerpoint.pptxLibrary Management System.powerpoint.pptx
Library Management System.powerpoint.pptx
 

Similar to farming assistant web service

IRJET- Survey Paper on E-Mandi a Market Exhange between Farmers and Enduser
IRJET-  	  Survey Paper on E-Mandi a Market Exhange between Farmers and EnduserIRJET-  	  Survey Paper on E-Mandi a Market Exhange between Farmers and Enduser
IRJET- Survey Paper on E-Mandi a Market Exhange between Farmers and EnduserIRJET Journal
 
E-Trading of Agricultural Products from Farm to Customer Application
E-Trading of Agricultural Products from Farm to Customer ApplicationE-Trading of Agricultural Products from Farm to Customer Application
E-Trading of Agricultural Products from Farm to Customer ApplicationIRJET Journal
 
Agri shop management system for diploma students PPT.pptx
Agri shop management  system for diploma students PPT.pptxAgri shop management  system for diploma students PPT.pptx
Agri shop management system for diploma students PPT.pptxPoojaAbhang6
 
dbms project orginann jhvjhvjhvjhvl 3[1].pptx
dbms project orginann jhvjhvjhvjhvl 3[1].pptxdbms project orginann jhvjhvjhvjhvl 3[1].pptx
dbms project orginann jhvjhvjhvjhvl 3[1].pptxBharathNS10
 
project ppt ...pptx
project ppt ...pptxproject ppt ...pptx
project ppt ...pptxSaqibHabib11
 
IRJET - Farm Direct Marketing
IRJET - Farm Direct MarketingIRJET - Farm Direct Marketing
IRJET - Farm Direct MarketingIRJET Journal
 
Farmer’s Plaza: A Cloud-Enabled Mobile and Web Based Application For Farmers
Farmer’s Plaza: A Cloud-Enabled Mobile and Web Based Application For FarmersFarmer’s Plaza: A Cloud-Enabled Mobile and Web Based Application For Farmers
Farmer’s Plaza: A Cloud-Enabled Mobile and Web Based Application For FarmersIRJET Journal
 
IRJET- Food Supply Chain Management using Blockchain
IRJET- Food Supply Chain Management using BlockchainIRJET- Food Supply Chain Management using Blockchain
IRJET- Food Supply Chain Management using BlockchainIRJET Journal
 
Online Auction System for Vehicles SRS
Online Auction System for Vehicles SRSOnline Auction System for Vehicles SRS
Online Auction System for Vehicles SRSKrishnaMaurya44
 
IRJET- SMART KRISHI- A Proposed System for Farmers
IRJET-  	  SMART KRISHI- A Proposed System for FarmersIRJET-  	  SMART KRISHI- A Proposed System for Farmers
IRJET- SMART KRISHI- A Proposed System for FarmersIRJET Journal
 
Kisan Monitoring System Focused on Android based Application
Kisan Monitoring System Focused on Android based ApplicationKisan Monitoring System Focused on Android based Application
Kisan Monitoring System Focused on Android based ApplicationIRJET Journal
 
KRISHI BAZAR - APPLICATION USING ML
KRISHI BAZAR - APPLICATION USING MLKRISHI BAZAR - APPLICATION USING ML
KRISHI BAZAR - APPLICATION USING MLIRJET Journal
 
AJAY _ Synopsis-1(1).pdf for project report for bca
AJAY _ Synopsis-1(1).pdf for project report for bcaAJAY _ Synopsis-1(1).pdf for project report for bca
AJAY _ Synopsis-1(1).pdf for project report for bcachauhanajay68136
 
IRJET- Farmer Fest Online Tool based on Service-Oriented Architecture
IRJET- Farmer Fest Online Tool based on Service-Oriented ArchitectureIRJET- Farmer Fest Online Tool based on Service-Oriented Architecture
IRJET- Farmer Fest Online Tool based on Service-Oriented ArchitectureIRJET Journal
 
Project Report_Food Bazar_Ver1
Project Report_Food Bazar_Ver1Project Report_Food Bazar_Ver1
Project Report_Food Bazar_Ver1MEGHA JAIN
 
AGRO TRADE: A BLOCKCHAIN BASED DECENTRALIZED PLATFORM FOR TRADING AND AGRICUL...
AGRO TRADE: A BLOCKCHAIN BASED DECENTRALIZED PLATFORM FOR TRADING AND AGRICUL...AGRO TRADE: A BLOCKCHAIN BASED DECENTRALIZED PLATFORM FOR TRADING AND AGRICUL...
AGRO TRADE: A BLOCKCHAIN BASED DECENTRALIZED PLATFORM FOR TRADING AND AGRICUL...IRJET Journal
 
IRJET- Agriculture Business to Business Website
IRJET- Agriculture Business to Business WebsiteIRJET- Agriculture Business to Business Website
IRJET- Agriculture Business to Business WebsiteIRJET Journal
 

Similar to farming assistant web service (20)

smart farmer ppt
smart farmer pptsmart farmer ppt
smart farmer ppt
 
IRJET- Survey Paper on E-Mandi a Market Exhange between Farmers and Enduser
IRJET-  	  Survey Paper on E-Mandi a Market Exhange between Farmers and EnduserIRJET-  	  Survey Paper on E-Mandi a Market Exhange between Farmers and Enduser
IRJET- Survey Paper on E-Mandi a Market Exhange between Farmers and Enduser
 
E-Trading of Agricultural Products from Farm to Customer Application
E-Trading of Agricultural Products from Farm to Customer ApplicationE-Trading of Agricultural Products from Farm to Customer Application
E-Trading of Agricultural Products from Farm to Customer Application
 
Agri shop management system for diploma students PPT.pptx
Agri shop management  system for diploma students PPT.pptxAgri shop management  system for diploma students PPT.pptx
Agri shop management system for diploma students PPT.pptx
 
dbms project orginann jhvjhvjhvjhvl 3[1].pptx
dbms project orginann jhvjhvjhvjhvl 3[1].pptxdbms project orginann jhvjhvjhvjhvl 3[1].pptx
dbms project orginann jhvjhvjhvjhvl 3[1].pptx
 
project ppt ...pptx
project ppt ...pptxproject ppt ...pptx
project ppt ...pptx
 
IRJET - Farm Direct Marketing
IRJET - Farm Direct MarketingIRJET - Farm Direct Marketing
IRJET - Farm Direct Marketing
 
Farmer’s Plaza: A Cloud-Enabled Mobile and Web Based Application For Farmers
Farmer’s Plaza: A Cloud-Enabled Mobile and Web Based Application For FarmersFarmer’s Plaza: A Cloud-Enabled Mobile and Web Based Application For Farmers
Farmer’s Plaza: A Cloud-Enabled Mobile and Web Based Application For Farmers
 
Innovation through Technology
Innovation through TechnologyInnovation through Technology
Innovation through Technology
 
IRJET- Food Supply Chain Management using Blockchain
IRJET- Food Supply Chain Management using BlockchainIRJET- Food Supply Chain Management using Blockchain
IRJET- Food Supply Chain Management using Blockchain
 
Online Auction System for Vehicles SRS
Online Auction System for Vehicles SRSOnline Auction System for Vehicles SRS
Online Auction System for Vehicles SRS
 
IRJET- SMART KRISHI- A Proposed System for Farmers
IRJET-  	  SMART KRISHI- A Proposed System for FarmersIRJET-  	  SMART KRISHI- A Proposed System for Farmers
IRJET- SMART KRISHI- A Proposed System for Farmers
 
Kisan Monitoring System Focused on Android based Application
Kisan Monitoring System Focused on Android based ApplicationKisan Monitoring System Focused on Android based Application
Kisan Monitoring System Focused on Android based Application
 
KRISHI BAZAR - APPLICATION USING ML
KRISHI BAZAR - APPLICATION USING MLKRISHI BAZAR - APPLICATION USING ML
KRISHI BAZAR - APPLICATION USING ML
 
AJAY _ Synopsis-1(1).pdf for project report for bca
AJAY _ Synopsis-1(1).pdf for project report for bcaAJAY _ Synopsis-1(1).pdf for project report for bca
AJAY _ Synopsis-1(1).pdf for project report for bca
 
IRJET- Farmer Fest Online Tool based on Service-Oriented Architecture
IRJET- Farmer Fest Online Tool based on Service-Oriented ArchitectureIRJET- Farmer Fest Online Tool based on Service-Oriented Architecture
IRJET- Farmer Fest Online Tool based on Service-Oriented Architecture
 
Project Report_Food Bazar_Ver1
Project Report_Food Bazar_Ver1Project Report_Food Bazar_Ver1
Project Report_Food Bazar_Ver1
 
Vikray sahyog func
Vikray sahyog funcVikray sahyog func
Vikray sahyog func
 
AGRO TRADE: A BLOCKCHAIN BASED DECENTRALIZED PLATFORM FOR TRADING AND AGRICUL...
AGRO TRADE: A BLOCKCHAIN BASED DECENTRALIZED PLATFORM FOR TRADING AND AGRICUL...AGRO TRADE: A BLOCKCHAIN BASED DECENTRALIZED PLATFORM FOR TRADING AND AGRICUL...
AGRO TRADE: A BLOCKCHAIN BASED DECENTRALIZED PLATFORM FOR TRADING AND AGRICUL...
 
IRJET- Agriculture Business to Business Website
IRJET- Agriculture Business to Business WebsiteIRJET- Agriculture Business to Business Website
IRJET- Agriculture Business to Business Website
 

Recently uploaded

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 

Recently uploaded (20)

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 

farming assistant web service

  • 1. 1 CHAPTER 1 INTRODUCTION 1.1 Description: A Web project to help farmers ensure greater profitability through direct farmer to supplier and farmer to farmer communication. This service boosts business communication and brings transparency in the system. Separate login areas with appropriated functionality for farmers, suppliers and authorities. A separate page where only farmers can post complaints and only assigned administrators can read and edit this page. This innovative site allows for good farmer, retailer and supplier communication. It allows farmers to login and communicate to respective dealers. When dealers publish an advertisement or offer, the respective farmers get notified via SMS message. The farmers may also submit their grievances and complaints to respective dealers or authorities using their farmer login on a separate complaints page and authorities will get access to that page regularly using their login id and passwords. This web project provides following features:  Separate login areas with appropriated functionality for farmers, administrators and dealers/ retailers.  A separate page where only farmers can post complaints and only assigned administrators can read and edit this page.  Pages where dealers and retailers may post their ads and notifications.  Farmers are notified of these notifications via SMS whenever new ads are published.  An effective GUI so that rural people may easily use the service.  Can be over for multiple villages to communicate and deal with each other.
  • 2. 2 1.2 An Overview of Farming Assistant Web Service: Although most people can see the benefits of using a more precise approach to manage crops with additional information, the tool provided by precision farming and other information technologies have not yet moved into mainstream agricultural management. The increased complexity of the systems inhibits easy adoption and makes calculations as to the financial benefits uncertain. These issues can be resolved by improving the decision making process though better Management Information Systems, improved data interchange standards and clear management methods. The starting point has been the identification of the current and future data, information and knowledge management needs on the farms, as well as on the way that these needs will evolve in the future and that will influence farm data, farm information and farm knowledge management systems. At the moment, the utilization of scientific models together with the large amounts of data in different formats produced by modern Farm machinery, sensors located within the farm, remote sensing, etc. is still an open area of research and new methods are developed continuously. The seamless incorporation of new functionality and assisting features into an existing system is of paramount importance. 1.2.1 Supplier:  Register-The supplier first need to be registered himself to login.  Login- The supplier need to login in to get access to the system.  Post Advertisement- Pages where dealers and retailers may post their ads and notifications. The post consists of crop id, crop name, crop image and quantity required. Farmers are notified of these notifications via SMS.  Crop Received-It is result of post that notified that the crop is accepted or not to the farmers. 1.2.2 Farmer:  Register-The farmer first need to be registered to login.  Login-The farmer need to login in to get access to the system.  Complaint Page-The page where farmers can post their complaints and only assigned administrators can read and edit this page.
  • 3. 3  View Complaint Status-In this page farmers can view the complaints details by viewing the status of complaints is read or unread.  Crop Advertisement Details-This page consist of crop advertisement details post by the supplier and the status of the sell crop accepted by the supplier or not.  Sell Product-This page is for sailing the crop to the supplier. This includes crop id, Supplier name, crop name, quantity and prices.  Sell product Details-This page consist of crop details sold by the farmer. 1.2.3 Admin:  View Complaints-This page contains the complaints of the farmers.  Farming Tips-The admin gives the farming tips to the farmers. Farming Assistant Web Service Home
  • 4. 4 1.3 Resource Allocation: This includes three main research areas. Firstly, it traces the agricultural problems, technology adoption role and issues through extension services particularly in India and in the world in general. Secondly, by finding the factors that are affecting the extension services through proper use of ICTs or determining the factors of transfer of technologies. By doing so, this chapter helps build the fundamental concepts of ICT and decision making at all levels of agricultural decision making process. Lastly, it presents a comprehensive review of various models used by previous researchers in facilitating the information content concerned with farmers in retrieving the information needed in their decision making process. 1.4 Motivation: Role of middleman in the marketing of agricultural commodities which leads continuous loss to farmers. Figure 1.1. Role of middlemen Usually traders are the middlemen, who link the farmer’s produce with the consumers. Sometimes they also build linkages with the different market far away from the production area. Many times, they are neglected and tried to sell directly in the market. Actually, the profit margins for the farmers are more than 60 per cent but due to low quantity of transaction, farmers are not benefited.
  • 5. 5 1.5 Problem Statement: New government mandates and regulations. Stability, development and fluctuations in global financial markets Agricultural marketing continues to be in a bad shape in rural India. In the absence of sound marketing facilities, the farmers must depend upon local traders and middlemen for the disposal of their farm produce which is sold at throw-away price. Storage facilities in the rural areas are either totally absent or grossly inadequate. Under such conditions the farmers are compelled to sell their produce immediately after the harvest at the prevailing market prices which are bound to be low. Such distress sale deprives the farmers of their legitimate income. 1.6 Scope: Scope of the project includes:  Through this project farmers ensure greater profitability.  This service boosts business communication and brings transparency in the system.  Can be over for multiple villages to communicate and deal with each other.  Farming tips is given to farmer easily and their compliant can be solved. Commodities
  • 6. 6 CHAPTER 2 MATERIAL AND METHODS 2.1 Methodology The objective was to create a Web Application that could perform the following: • Connecting to an HTTPS site (Farming Assistant Web Service) through GPRS/Wi-Fi. • Opening the relevant html pages using HTTP POST & GET. • Parsing the farmers, supplier info/corps/problems data logically. • Creating a local database for offline view. 2.2Implementation and Technology Used: 2.2.1 HTML HTML is a document layout and hyperlink specification language. It defines the syntax and placement of special, embedded directions that aren’t displayed by the browser, but tell it how to display the contents of the document, including text, graphics, and other support media. The language also specifies how to make a document interactive through special hypertext links. 2.2.2 Java Java [DEI97, JEP97, and LAU96] is an object-oriented language. It allows the user to write robust and reliable programs, build applications that will run on any platform without recompiling your code and distribute applications over a network in a secure fashion. 2.2.3 CSS
  • 7. 7 CSS [11] is a style sheet language used for describing the presentation of a document written in a mark-up language. Although most often used to set the visual style of web pages and user interfaces written in HTML and XHTML, the language can be applied to any XML document, including plain XML, SVG and XUL, and is applicable to rendering in speech, or on other media. Along with HTML and JavaScript, CSS is a cornerstone technology used by most websites to create visually engaging webpages, user interfaces for web applications, and user interfaces for many mobile applications. 2.2.4 JavaScript JavaScript HTML and CSS, JavaScript is one of the three core technologies of World Wide Web content production. It is used to make webpages interactive and provide online programs, including video games. The majority of websites employ it, and all modern web browsers support it without the need for plug-ins by means of a built-in JavaScript engine. Each of the many JavaScript engines represent a different implementation of JavaScript, all based on the ECMA Script specification, with some engines not supporting the spec fully, and with many engines supporting additional features beyond ECMA. It has an API for working with text, arrays, dates, regular expressions, and basic manipulation of the DOM, but does not include any I/O, such as networking, storage, or graphics facilities, relying for these upon the host environment in which it is embedded. 2.2.4 MySQL MySQL is the world’s most popular open source database, enabling the cost-effective delivery of reliable, high-performance and scalable Web-based and embedded database applications. It is an integrated transaction safe, ACID-compliant database with full commit, rollback, crash recovery, and row-level locking capabilities. MySQL delivers the ease of use, scalability, and high performance, as well as a full suite of database drivers and visual tools to help developers and DBAs build and manage their business-critical MySQL applications. MySQL is developed, distributed, and supported by Oracle, and the latest information about MySQL software can be found on the MySQL Web site. 2.2.5 Editor (NetBeans IDE 8.0.1):
  • 8. 8 NetBeans IDE [10] is the web development tool that lets you efficiently design, quickly & easily develop and maintain standards-based websites and applications. NetBeans IDE provides a powerful combination of visual layout tools, application development features, and code editing support. Figure 2.1 Technologies Used 2.3 Software and Hardware Requirements 2.3.1 Software Requirements:  Windows 7 or higher.  SQL server  Java/ net beans IDE. 2.3.2Hardware Components: FARMING ASSISTANT WEB SERVICE Java  HTML  CSS  BOOTSTRAP MySQL
  • 9. 9  Processor – i3 or high  Hard Disk – 5 GB  Memory – 1GB RAM 2.3.3 HTTPS POST & GET The application uses HTTPS POST and HTTPS GET to extract html code of the required pages. The HTTPS POST is used for the login into the farmer’s, suppliers and admin account while the HTTP GET is used for retrieving the source code from specific pages. Figure 2.2 HTTP POST Using these methods, the html codes of the following pages are retrieved: Farmer details, Supplier details, Post add, Crop sell Details and other information. In the HTTPs POST, certain parameters should be sent. Besides the username and password, there were hidden parameters as well. 2.4 Design
  • 10. 10 Identifying the main entities, their attributes, relationships and constraints, commences the design of a database application. The entities of an agricultural information system represent different information on crops. This include crops and intercrops, production and export, crop and inter-crop diseases, soil suitability, fertilizer, research institutes. These entities are inter-related by crop, product or institute. Characteristics of some of the entities are given in table 2.1. The table and attribute names Used for these entities and their characteristics are given within brackets in italics font Style. Entity Characteristics Crops Specialization (Crops Specialization) Name of the crop (Crop_Name) Unique code of the crop (Crop_No) Farmers details Name of the farmer(Farmer_ Name) Unique code of the farmer (farmer_id) Suppliers details Name of the Supplier(Supplier _Name) Unique code of the Supplier(Supplier_id) Post Advertisement Name of the Crop(Crop_Name) Unique code of the advertisement (post_id) Sell crop details Name of the Crop(Crop_Name) Unique code of the sold crop (sell_id) Farming Tips Unique code of the Tips (id) Complaints of Farmers Unique code of the farmer (farmer_id) Unique code of the Complaint(complt_id) Table 2.1: Selected Entity / Characteristics of a farming assistant web service 2.5 Implementation
  • 11. 11 The set of tables is created using the relational database for the identified entities at the design stage. The uniqueness of the data fields in these tables are established using primary keys, while the relationships are maintained using foreign keys [ELM94, FER98]. The web pages of this farming assistant web service will guide the use and operation of this system. Figure 1 illustrates the index page for our farming assistant web service Respective modules there and is chosen through a hyperlink of this page. For instance information on research done on rubber by institutes can be viewed through respective the hyperlinks. Index page of Farming assistant web service The system will be having only one User-name and Password section on the front page, as per the user-name and password the system will know whether user is Farmer/Customer/Dealer. We follow the MVC design pattern for developing our system. Model–view–controller (MVC) is a software design pattern for implementing user interfaces on computers. It divides a given software application into three interconnected parts, so as to separate internal representations of information from the ways that information is presented to or accepted from the user. 2. 6 Database Implementation:
  • 12. 12 After getting the requirement of a logical design and structural design of our database, we can move to the implementation stage. In general, implementing our structural design involves defining the various objects and enforcing the constraints on the data relationships. The implementation phase is where you install the DBMS on the required hardware, optimize the database to run best on that hardware and software platform, and create the database and load the data. 2.6.1 Database of Supplier: In database, supplier database gather into user table. When supplier create an account then all information of user store into supplier table. In user table store supplier password, email, name, mobile number,address, gender and profile image. If user wants to login website then need that information. Database of supplier 2.6.2 Database of Admin: Admin database store admin login info into admin table. This table store id and password. This table also store access label which type of admin login into admin panel. Our website has two type admin so we use two access label.
  • 13. 13 Database of admin 2.6.3 Database of farmer: In database, farmer database gather into user table. When farmer create an account then all information of user store into supplier table. In user table store farmer password, email, name, mobile number,address, gender and profile image. If user wants to login website then need that information. Database of farmer
  • 14. 14 CHAPTER 3 LITERATURE SURVEY This chapter reviews three main research areas. Firstly, it traces the agricultural problems, technology adoption role and issues through extension services particularly in India and in the world in general. Secondly, by finding the factors that are affecting the extension services through proper use of ICTs or determining the factors of transfer of technologies. By doing so, this chapter helps build the fundamental concepts of ICT and decision making at all levels of agricultural decision making process. Lastly, it presents a comprehensive review of various models used by previous researchers in facilitating the information content concerned with farmers in retrieving the information needed in their decision making process. 3.1 Resource Allocation Much of the project scheduling literature treats task durations as deterministic. In reality, however, task durations are subject to considerable uncertainty and that uncertainty can be influenced by the resources assigned. The purpose of this paper is to provide the means for program managers (who may have responsibility for multiple projects) to optimally allocate resources from common resource pools to individual tasks on several competing projects. Instead of the traditional use of schedules, we develop control policies in the form of planned resource allocation to tasks that capture the uncertainty associated with task durations and the impact of resource allocation on those durations. We develop a solution procedure for the model and illustrate the ideas in an example. 3.2 Multipurpose Farming Assistant Web Service The farming web service is multipurpose site which not only provide direct communication between farmer and supplier but also provide communication with admin. The Supplier post the crop advertisement and the farmer will get this add it on his account and sell crop to supplier according to add. The supplier also has the crop received page in his module that updates the status when crop is received by supplier. These will not only provide the farmer to sell their crop but also help them to solve their problems and complaints. The admin also give the farming tips to the farmer help farmers ensure greater profitability
  • 15. 15 through direct farmer to supplier and farmer to farmer communication. This service boosts business communication and brings transparency in the system.  Through this project farmers ensure greater profitability.  This service boosts business communication and brings transparency in the system.  Can be over for multiple villages to communicate and deal with each other.  Farming tips is given to farmer easily and their compliant can be solved. 3.3 Application: This system can be used in developing countries to enhance farmer, manufacturer, and retailer communication thus eliminating unnecessary intermediaries. 3.4 Our Product:  The farming assistant web server brings farmer and supplier close.  Farmer can sell their product directly to supplier without any middlemen.  Farmer can post complaint that will handle by the administration.  The supplier adds the crop as advertisement that is needed by the supplier. 3.5 System Analysis: The architecture of the whole project is analysed. System analysis is the process of defining the architecture, components, and data of a system to satisfy specified requirements. Design is a method of studying a system by examining its component parts and their interactions. Before implementation began the system was analysed and designed. In this section, use cases, requirement analysis, and other part are described in details. 3.6 Requirement Analysis: Web service of farmer product required the following requirements. This has mainly four actors. Those are Admin, Farmer and Dealer. This website give service of farmer product to sell holder is known as dealer.
  • 16. 16 3.6.1 Data Requirement During requirement analysis the following data have been identified for a web service of farmer product system: At first each person need to register (without admin) himself/herself as a customer or a farmer or a dealer for accessing the user’s necessary information. Each user requires an unique username or email Id and password to register in the website. Admin/Farmer need to login to the system to operate the system. Admin/Farmer has an individual or unique login user id and password. Through this user id and password admin/farmer can login to the system. A supplier can select a product for buying and post add. Supplier also can pay cash on delivery. 3.6.2 Process Requirement The following process requirements are identified for system:  A valid login is required for all process to be performed. A valid login is required for every registered users and admin. All of them have a valid user id and password. System will authenticate their valid login.  After valid login Dealer can check his information, can see personal information and can check product history and buy product.  Admin can login to the system. Admin can view complaint and provide Tips too. Admin can also enter new category in the list and insert new product.  Farmer can login to the system. Farmer can view, delete, publish and update product info. Farmer can also enter new product in the list and insert new info. 3.7 Features:  Separate login areas with appropriated functionality for farmers, administrators and dealers/ retailers.  A separate page where only farmers can post complaints and only assigned administrators can read and edit this page.  Pages where dealers and retailers may post their ads and notifications.  Farmers are notified of these notifications via SMS whenever new ads are published.
  • 17. 17  An effective GUI so that rural people may easily use the service.  Can be over for multiple villages to communicate and deal with each other
  • 18. 18 CHAPTER 4 OVERALL DESCRIPITION OF PROJECT 4.1 Data flow diagram: Figure 4.1 DFD Supplier Login Farmer Login Complaint page Compliant status Crop advertisement details Sell product LoginAdmin View complain t Farming tips Logout Accepted
  • 19. 19 4.2 Module Description: 4.2.1 Supplier: Supplier module contains:  Supplier details  Post Advertisements  Crop Received  Edit Supplier Details Supplier details Post advertisement
  • 20. 20 4.2.2 Farmer: Farmer module contains:  Complaint Page  Complaint Status  Farming Tips  Crop Advertisement Details  Sell Crop  Sell Crop Details  Edit Farmer Details Complaint Page View Complaint Status
  • 23. 23 4.2.3 Admin Admin module contains:  View Complaint  Farming Tips Admin Home View Complaint
  • 26. 26 CHAPTER 5 CONCLUSION AND FUTURE WORK 5.1 Conclusion The “Farming Assistant Web Service” is successfully designed and developed to fulfill the necessary requirements, as identified in the requirements analysis phase, such as the system is very much user friendly, form level validation and field level validation are performing very good. The old manual system was suffering from a series of drawbacks. The present project has been developed to meet the aspirations indicated in the modern age. Through the developed project, anyone can visualize the effectiveness and efficiency in the real life. It is very helpful for computerization or doing automation of a personal information management system. This program helps reduce the manual method and stress which is done by a person and that is time consuming and lengthy process. With this application user’s information are stored very efficiently in a secured database. Trend of information improvement in the generation has improved the quality and services of human operation just as the case of this application for job services has reduce the mobility rate of human and improve their standard of database storage. 5.2 Future Work The future plan of this project is to improved design; implementation and documentation in such a way that anyone can use this project for better perform. I will develop the site more dynamically. In future I will add the few modules for better improvement of the project such as, real-time chat bot option for user and farmer, so that user can directly enquiry theirs problem on any time through the chat bot. Video conversation option for supplier and farmer and admin and barcode generation for membership card and using online buy and sell product. Online account verification and notification for user for specific job category they searching for jobs. In future I will also add mobile version app of this website.
  • 27. 27 APPENDIX Index.html <!-- Login --> <div id="login" class="login"> <div class="container"> <div class="row"> <div class="col-md-4 col-md-offset-4 text-center"> <h2 style="color:white">Login</h2> <hr> </div> </div> <div class="row"> <div class="col-md-4 text-center"> <div class="service-item"> <a href="farmer.jsp"> <img src="img/farmer.jpg"> <h3 style="color:white">Farmer</h3> </div> </div> <div class="col-md-4 text-center"> <div class="service-item"> <a href="admin.jsp"> <img src="img/admin.jpg"> <h3 style="color:white">Admin</h3> </div> </div> <div class="col-md-4 text-center"> <div class="service-item"> <a href="supplier.jsp">
  • 28. 28 <img src="img/supplier.png" > <h3 style="color:white">Supplier</h3> </div> </div> </div> </div> </div> <!-- /Login--> Supplier.jsp <div id="nav"> <h5 style="color:red" align="center"> <% if (request.getParameter("msg") == null) { //out.println(""); } else { out.println("<b>"+request. getParameter("msg")+"</b>!"); } if (request.getParameter("msg1") == null) { //out.println(""); } else { out.println("<b>"+request. getParameter("msg1")+"</b>!"); } %></h5> <div id="Supplier"> <div class="container"> <div class="row"> <div class="col-md-4 col-md-offset-4 text-center"> <h2 style="color:white">Supplier Login</h2> <hr> </div> <div class="col-md-5 col-md-offset-3">
  • 29. 29 <!-- supplier form starts --> <form action="supplierlogin.jsp" id="admin-form" class="form-horizontal"> <fieldset> <div class="form-group"> <label class="col-sm-4 control-label" for="s_id" style="color:white">ID</label> <div class="col-sm-8"> <input type="text" placeholder="Id" class="form- control" name="s_id" id="name" required=""> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="password" style="color:white">PASSWORD</label> <div class="col-sm-8"> <input type="password" placeholder="********" class="form-control" name="password" id="password" required=""> </div> </div> <div class="col-sm-offset-4 col-sm-8"> <button type="submit" class="btn btn- success">Login</button> <a href="supplierRegister.jsp">New User</a> </div> </fieldset> </form> <!-- supplier form ends --> </div> </div>
  • 30. 30 Supplier registration: <%@page import="java.sql.*;" %> <% String s_id,password; s_id=request.getParameter("s_id"); password=request.getParameter("password"); String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service"; Connection con = null; ResultSet rs; PreparedStatement pstatement = null; try { Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection(connectionURL, "root", ""); String queryString = "SELECT * FROM `supplier` WHERE s_id=? and password=?"; /* createStatement() is used for create statement object that is used for sending sql statements to the specified database. */ pstatement = con.prepareStatement(queryString); pstatement.setString(1, s_id); pstatement.setString(2, password); rs= pstatement.executeQuery(); if(rs.next()) {
  • 31. 31 session.setAttribute("Sid", s_id); response.sendRedirect("suppliermenu.jsp"); } else { response.sendRedirect("supplier.jsp?msg=Invalid username or password"); } } catch(Exception e) { out.println(e.getMessage()); } %> Saving.jsp <%@page import="java.sql.*;" %> <% String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service"; Connection con = null; PreparedStatement pstatement = null; String s_id,suppliername,password,address,phone; s_id=request.getParameter("s_id"); suppliername=request.getParameter("suppliername"); password=request.getParameter("password"); address=request.getParameter("address"); phone=request.getParameter("phone");
  • 32. 32 try { Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection(connectionURL, "root", ""); String queryString = "INSERT INTO supplier(s_id,suppliername,password,address,phone) VALUES (?, ?, ?, ?, ?)"; /* createStatement() is used for create statement object that is used for sending sql statements to the specified database. */ pstatement = con.prepareStatement(queryString); pstatement.setString(1, s_id); pstatement.setString(2, suppliername); pstatement.setString(3, password); pstatement.setString(4, address); pstatement.setString(5, phone); pstatement.executeUpdate(); //out.println("successfully saved"); response.sendRedirect("supplier.jsp?msg1=Successfully Registered"); } catch(Exception e) { out.println(e.getMessage()); } %> Suppliermenu.jsp: <h2><em>Farming Assistant Web Service</em></h2><br><br>
  • 33. 33 <nav class="navbar navbar-new" role="navigation"> <div class="container"></div> <div class="collapse navbar-collapse" id="mobilemenu"> <ul class="nav navbar-nav navbar-right text-center"> <li><a href="postadvertisement.jsp"><i class="service-icon fa fa- upload"></i>&nbsp;Post Advertisement</a></li> <li><a href="cropreceived.jsp"><i class="service-icon fa fa-leaf"></i>&nbsp;Crop Received</a></li> <li><a href="sppedit.jsp"><i class="service-icon fa fa- edit"></i>&nbsp;Edit</a></li> <li><a href="supplier.jsp"><i class="service-icon fa fa-sign- out"></i>&nbsp;Logout</a></li> </ul></div> <%@page import="java.sql.*"%> <h3 align="center"><em> <% String s_id=(String)session.getAttribute("Sid"); out.println("welcome "+s_id); %></em></h3> <% try{ //out.println(id); Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/farming assistance web service","root",""); Statement st=con.createStatement(); String sql="select * from supplier where s_id='"+s_id+"'";
  • 34. 34 //out.println(sql); ResultSet rs=st.executeQuery(sql); int count=0; while(rs.next()) { count++; } if(count>0) { Statement s=con.createStatement(); ResultSet rst=s.executeQuery("select * from supplier where s_id='"+s_id+"'"); while(rst.next()){ System.out.println(rst.getString("s_id")); %> <h2 style="color:white"><em>Supplier Details</em></h2> <table align="center" cellpadding="10"> <tr><th rowspan="4"> <img src="upload/<%=rst.getString("profile")%>" width="150" height="150"></th> <td>Id:</td><td><%=rst.getString("s_id")%></td></tr> <tr><td>Name:</td><td><%=rst.getString("suppliername")%></td></tr> <tr><td>Address:</td><td><%=rst.getString("address")%></td></tr> <tr><td>Contact No:</td><td><%=rst.getString("phone")%></td></tr> <tr><td></td></tr> <tr><td></td></tr> <tr><td></td></tr> </table> <% } } else { response.sendRedirect("supplier.jsp"); }
  • 35. 35 } catch(Exception e){ System.out.println(e); } %> Post advertisement: Postadvertisement.jsp <% String s_id=(String)session.getAttribute("Sid"); //out.println("welcome "+s_id); %> <form action="post_save.jsp" id="postadd" class="form-horizontal"> <fieldset> <h5 style="color:red"> <% if (request.getParameter("msg") == null) { //out.println(""); } else { out.println("<b>"+request. getParameter("msg")+"</b>!"); } %></h5> <div class="form-group"> <label class="col-sm-4 control-label" for="id" style="color:white">POST ID</label> <div class="col-sm-8"> <input type="text" placeholder="" class="form- control" name="pid" value="<%=n%>" readonly=""> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="s_id" style="color:white">SUPPLIER ID</label> <div class="col-sm-8">
  • 36. 36 <input type="text" placeholder="supplier_id" class="form-control" name="s_id" value="<%=s_id%>" readonly=""> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="cropname" style="color:white">CROP NAME</label> <div class="col-sm-8"> <input type="text" placeholder="cropname" class="form-control" id="cropname" name="cropname" required="" onkeydown="return alphaOnly(event);"> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="requiredquantity" style="color:white">REQUIRED QUANTITY</label> <div class="col-sm-8"> <input type="number" oninput="javascript: if(this.value.length>this.maxLength) this.value=this.value.slice(0,this.maxLength);" placeholder="in kgs" class="form-control" name="requiredquantity" maxlength="10" required=""> </div> </div> <div class="col-sm-offset-4 col-sm-8"> <button type="submit" class="btn btn- success">Post</button> <button type="reset" class="btn btn-primary ">Cancel</button> </div> </fieldset> </form> post_save.jsp <%@page import="java.sql.*;" %>
  • 37. 37 <% String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service"; Connection con = null; PreparedStatement pstatement = null; String pid,s_id,cropname,requiredquantity; pid=request.getParameter("pid"); s_id=request.getParameter("s_id"); cropname=request.getParameter("cropname"); requiredquantity=request.getParameter("requiredquantity"); try { Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection(connectionURL, "root", ""); String queryString = "INSERT INTO post_addvertisement(pid,s_id,cropname,requiredquantity) VALUES (?, ?, ?, ?)"; /* createStatement() is used for create statement object that is used for sending sql statements to the specified database. */ pstatement = con.prepareStatement(queryString); pstatement.setString(1, pid); pstatement.setString(2, s_id); pstatement.setString(3, cropname); pstatement.setString(4, requiredquanti; pstatement.executeUpdate(); session.setAttribute("Sid",s_id); session.setAttribute("Pid",pid); response.sendRedirect("imageupload.jsp"); } catch(Exception e) { out.println(e.getMessage()); } %>
  • 38. 38 Imageuplod.jsp <form action="demoprocess.jsp" id="postaddimg" class="form-horizontal" enctype="multipart/form-data" method="POST"> <fieldset> <div class="form-group"> <label class="col-sm-4 control-label" for="cropname" style="color:white">CROP IMAGE</label> <div class="col-sm-8"> <input type="file" class="form-control" id="file" name="file" required=""> </div> </div> <div class="col-sm-offset-4 col-sm-8"> <button type="submit" class="btn btn- success">Post</button> </div> demoprocess.jsp <%@ page import="java.io.*,java.util.*, javax.servlet.*" %> <%@ page import="javax.servlet.http.*" %> <%@ page import="org.apache.commons.fileupload.*" %> <%@ page import="org.apache.commons.fileupload.disk.*" %> <%@ page import="org.apache.commons.fileupload.servlet.*" %> <%@ page import="org.apache.commons.io.output.*" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Guru File Upload</title> </head> <body> <%@page import="java.sql.*;" %>
  • 39. 39 <% String pid=(String)session.getAttribute("Pid"); String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service"; Connection con = null; PreparedStatement pstatement = null; File file ; int maxFileSize = 5000 * 1024; int maxMemSize = 5000 * 1024; String filePath = "C:/Users/dell/Documents/NetBeansProjects/Farming_Assistant_web_service/web/slidefol io/uploString contentType = request.getContentType(); if ((contentType.indexOf("multipart/form-data") DiskFileItemFactory factory = new DiskFileItemFactory(); factory.setSizeThreshold(maxMemSize); factory.setRepository(new File("c:temp")); ServletFileUpload upload = new ServletFileUpload(factory); upload.setSizeMax( maxFileSize ); try{ List fileItems = upload.parseRequest(request); Iterator i = fileItems.iterator(); out.println("<html>"); out.println("<body>"); while ( i.hasNext () ) { FileItem fi = (FileItem)i.next(); if ( !fi.isFormField () ) { String fieldName = fi.getFieldName(); String fileName = fi.getName(); boolean isInMemory = fi.isInMemory(); long sizeInBytes = fi.getSize();
  • 40. 40 String filePart=fi.getName().substring(fi.getName().lastIndexOf("")+1); fi.write(new File(filePath + filePart )) ; Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection(connectionURL, "root", ""); String queryString = "UPDATE post_addvertisement SET file=? WHERE pid=?"; /* createStatement() is used for create statement object that is used for sending sql statements to the specified database. */ pstatement = con.prepareStatement(queryString); pstatement.setString(1, filePart); pstatement.setString(2,pid); pstatement.executeUpdate(); response.sendRedirect("postadvertisement.jsp?msg=Successfully Posted"); } } out.println("</body>"); out.println("</html>"); }catch(Exception ex) { System.out.println(ex); } } else{ out.println("<html>"); out.println("<body>"); out.println("<p>No file uploaded</p>"); out.println("</body>"); out.println("</html>"); } %> </body>
  • 41. 41 </html> Cropreceived.jsp <% String s_id=(String)session.getAttribute("Sid"); %> <% try { /* Create string of connection url within specified format with machine name, port number and database name. Here machine name id localhost and database name is student. */ String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service"; // declare a connection by using Connection interface Connection connection = null; /* declare object of Statement interface that is used for executing sql statements. */ Statement statement = null; // declare a resultset that uses as a table for output data from tha table. ResultSet rs = null; // Load JBBC driver "com.mysql.jdbc.Driver" Class.forName("com.mysql.jdbc.Driver").newInstance(); /* Create a connection by using getConnection() method that takes parameters of string type connection url, user name and password to connect to database.*/ connection = DriverManager.getConnection(connectionURL, "root", "");/* createStatement() is used for create statement object that is used for sending sql statements to the specified database. */ statement = connection.createStatement(); // sql query to retrieve values from the secified table.String QueryString = "SELECT *FROM sell_crop join farmer on sell_crop.id=farmer.id where sell_crop.s_id="+s_id; //out.println(QueryString); rs = statement.executeQuery(QueryString); %> <style>
  • 42. 42 table, td, th { border: 0px solid black; } table { border-collapse: separate; width: 100%; }th { text-align: left; } </style><h5 style="color:red"> <% if (request.getParameter("msg") == null) { //out.println(""); } else { out.println("<b>"+request. getParameter("msg")+"</b>!"); } %></h5> <TABLE cellpadding="10"table border="0" align="center"> <tr><td>Sell Id</td> <td>Crop Name</td> <td>Quantity (in kg)</td> <td>Rupees</td> <td>Farmer Id</td> <td>Farmer Name</td> <td>Contact</td> <td>Status</td></tr> <% while (rs.next()) { %> <TR> <TD style="color:blueviolet"><%=rs.getInt(1)%></TD> <TD style="color:blueviolet"><%=rs.getString(5)%></TD> <TD style="color:blueviolet"><%=rs.getString(6)%></TD>
  • 43. 43 <TD style="color:blueviolet"><%=rs.getInt(7)%></TD> <TD style="color:blueviolet"><%=rs.getInt("id")%></TD> <TD style="color:blueviolet"><%=rs.getString("farmername")%></TD> <TD style="color:blueviolet"><%=rs.getString("phone")%></TD> <TD><button type="submit" class="btn btn-primary" onclick="window:location='updatecrpstatus.jsp?sell_id=<%=rs.getInt(1)%>&status=Acce pted'">Accepted</button></TD</TD></TR><% } %> <% // close all the connections. rs.close(); statement.close(); connection.close(); } catch (Exception ex) { %> <% out.println("Unable to connect to database."); } %> Update profile: sppedit.jsp <%@page import="java.sql.*"%> <% try{ String s_id=(String)session.getAttribute("Sid"); Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/farming assistance web service","root",""); Statement st=con.createStatement(); String sql="select * from supplier where s_id='"+s_id+"'"; //out.println(sql);
  • 44. 44 ResultSet rs=st.executeQuery(sql); int count=0; while(rs.next()) { count++; } if(count>0){ Statement s=con.createStatement(); ResultSet rst=s.executeQuery("select * from supplier where s_id='"+s_id+"'"); while(rst.next()){ System.out.println(rst.getString("s_id")); %> <h3>Edit Profile</h3> <form action="updatesp.jsp" method="post"> <table align="center"> <tr><td>Id:</td><td><input type="text" name="name" value="<%=rst.getInt("s_id")%>"></td></tr> <tr><td>Name:</td><td><input type="text" name="suppliername" value="<%=rst.getString("suppliername")%>"></td></tr> <tr><td>Password:</td><td><input type="text" name="password" value="<%=rst.getString("password")%>"></td></tr> <tr><td>Address:</td><td><input type="text" name="address" value="<%=rst.getString("address")%>"></td></tr> <tr><td>Contact No:</td><td><input type="text" name="phone" value="<%=rst.getString("phone")%>"></td></tr> <tr><td></td><td></td></tr> <tr><td></td><td></td></tr> <tr><td></td><td></td></tr> <tr><td></td><td><button type="submit" class="btn btn- success">Update</button></td></tr> </table> </form>
  • 45. 45 <% } } else { response.sendRedirect("suppliermenu.jsp"); } }catch(Exception e){ System.out.println(e); } %> Upload Image: Sppupload.jsp <%@page import="java.sql.*"%> <% try{ String s_id=(String)session.getAttribute("Sid"); Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/farming assistance web service","root",""); Statement st=con.createStatement(); String sql="select * from supplier where s_id='"+s_id+"'"; //out.println(sql); ResultSet rs=st.executeQuery(sql); int count=0; while(rs.next()) { count++; } if(count>0){ Statement s=con.createStatement(); ResultSet rst=s.executeQuery("select * from supplier where s_id='"+s_id+"'");
  • 46. 46 while(rst.next()){ System.out.println(rst.getString("s_id")); %> <h3>Edit Profile</h3> <form action="updatesp.jsp" method="post"> <table align="center"> <tr><td>Id:</td><td><input type="text" name="name" value="<%=rst.getInt("s_id")%>"></td></tr> <tr><td>Name:</td><td><input type="text" name="suppliername" value="<%=rst.getString("suppliername")%>"></td></tr> <tr><td>Password:</td><td><input type="text" name="password" value="<%=rst.getString("password")%>"></td></tr> <tr><td>Address:</td><td><input type="text" name="address" value="<%=rst.getString("address")%>"></td></tr> <tr><td>Contact No:</td><td><input type="text" name="phone" value="<%=rst.getString("phone")%>"></td></tr> <tr><td></td><td></td></tr> <tr><td></td><td></td></tr> <tr><td></td><td></td></tr> <tr><td></td><td><button type="submit" class="btn btn- success">Update</button></td></tr> </table> </form> <% } } else { response.sendRedirect("suppliermenu.jsp"); } }catch(Exception e){ System.out.println(e); }%>
  • 47. 47 Farmer: Farmer registration: <form action="saving.jsp" id="Registration" class="form-horizontal" method="Post" onsubmit="return myFunction()"> <fieldset> <div class="form-group"> <label class="col-sm-4 control-label" for="id" style="color:white">FARMER ID</label> <div class="col-sm-8"> <input type="text" placeholder="Id" class="form-control" name="id" id="name" value="<%=n%>" readonly=""> </div> </div><div class="form-group"> <label class="col-sm-4 control-label" for="farmername" style="color:white">FARMER NAME</label> <div class="col-sm-8"> <input type="text" placeholder="Enter your name" class="form-control" name="farmername" id="farmername" required="" onkeydown="return alphaOnly(event);"/> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="password" style="color:white">PASSWORD</label> <div class="col-sm-8"> <input type="password" placeholder="********" class="form-control" name="password" id="password" maxlength="8" required=""> </div> </div><div class="form-group"> <label class="col-sm-4 control-label" for="re-password" style="color:white">RE-PASSWORD</label>
  • 48. 48 <div class="col-sm-8"> <input type="password" placeholder="********" class="form-control" name="repassword" id="repassword" maxlength="8" required=""> </div> </div><div class="form-group"> <label class="col-sm-4 control-label" for="address" style="color:white">ADDRESS</label> <div class="col-sm-8"> <textarea placeholder="Enter your address" class="form-control" name="address" id="address" rows="2" required=""></textarea> </div> </div><div class="form-group"> <label class="col-sm-4 control-label" for="phone" style="color:white">PHONE</label> <div class="col-sm-8"> <input type="number" oninput="javascript: if(this.value.length>this.maxLength) this.value=this.value.slice(0,this.maxLength);" placeholder="phone" class="form-control" name="phone" id="phone" maxlength="10" required> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="crproduction" style="color:white">Crop Production</label> <div class="col-sm-8"> <input type="text" placeholder="Enter your name" class="form-control" name="crp" id="crp" required="" onkeydown="return alphaOnly(event);"/> </div> </div> <div class="col-sm-offset-4 col-sm- 8">
  • 49. 49 <button type="submit" class="btn btn-success">Submit</button> <button type="reset" class="btn btn-primary">Cancel</button> </div> </fieldset> </form> saving.jsp <%@page import="java.util.Iterator"%> <%@page import="java.util.Arrays"%> <%@page import="java.util.ArrayList"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <%@page import="java.sql.*;" %> <% String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service"; Connection con = null; PreparedStatement pstatement = null; String id,farmername,password,address,phone; id=request.getParameter("id"); farmername=request.getParameter("farmername"); password=request.getParameter("password"); address=request.getParameter("address"); phone=request.getParameter("phone"); String crp=request.getParameter("crp"); // out.println(m); // for(int i=0;i<=crop.length;i++)
  • 50. 50 try { Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection(connectionURL, "root", ""); String queryString = "INSERT INTO farmer(id,farmername,password,address,phone,crop) VALUES (?, ?, ?, ?, ?,?)"; /* createStatement() is used for create statement object that is used for sending sql statements to the specified database. */ pstatement = con.prepareStatement(queryString); pstatement.setString(1, id); pstatement.setString(2, farmername); pstatement.setString(3, password); pstatement.setString(4, address); pstatement.setString(5, phone); pstatement.setString(6, crp); pstatement.executeUpdate(); response.sendRedirect("farmer.jsp?msg1=Successfully Registered"); //out.println("successfully saved"); } catch(Exception e) { out.println(e.getMessage()); %> </body> </html> farmer.jsp <div id="nav"> <h5 style="color:red"> <% if (request.getParameter("msg") == null) {
  • 51. 51 //out.println(""); } else { out.println("<b>"+request. getParameter("msg")+"</b>!"); } if (request.getParameter("msg1") == null) { //out.println(""); } else { out.println("<b>"+request. getParameter("msg1")+"</b>!"); } %></h5><div id="Farmer"> <div class="container"> <div class="row"> <div class="col-md-4 col-md-offset-4 text-center"> <h2 style="color:white">Farmer Login</h2> <hr> </div> <div class="col-md-5 col-md-offset-3"> <!-- farmer form starts --> <form action="farmerlogin.jsp" id="farmer-form" class="form- horizontal"><fields><div class="form-group"> <label class="col-sm-4 control-label" for="id" style="color:white">ID</label> <div class="col-sm-8"> <input type="text" placeholder="Id" class="form- control" name="lid" required="" /> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="password" style="color:white">PASSWORD</label> <div class="col-sm-8"> <input type="password" placeholder="********" class="form-control" name="password" required=""/>
  • 52. 52 </div> </div> <div class="col-sm-offset-4 col-sm-8"> <button type="submit" class="btn btn- success">Login</button> <a href="farmerRegister.jsp">New User</a> </div> </fieldset> </form> <!-- farmer form ends --> </div> </div> </div> </div> farmerlogin.jsp <%@page import="java.sql.*;" %> <% String id,password; id=request.getParameter("lid"); password=request.getParameter("password"); String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service"; Connection con = null; PreparedStatement pstatement = null; ResultSet rs; int croppartsLength; int i; try { Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection(connectionURL, "root", "");
  • 53. 53 String queryString = "SELECT * FROM farmer WHERE id=? and password=?"; /* createStatement() is used for create statement object that is used for sending sql statements to the specified database. */ pstatement = con.prepareStatement(queryString); pstatement.setString(1, id); pstatement.setString(2, password); rs= pstatement.executeQuery(); if(rs.next()) { String crop=rs.getString("crop"); //out.println(crop); session.setAttribute("Sid",id); session.setAttribute("crop",crop); response.sendRedirect("farmermenu.jsp"); } else { response.sendRedirect("farmer.jsp?msg=Invalid username or password"); } } catch(Exception e) { out.println(e.getMessage());
  • 54. 54 } %> </body> </html> Complaintpage.jsp <div id="nav"> <h5 style="color:red"> <% if (request.getParameter("msg") == null) { //out.println(""); } else { out.println("<b>"+request. getParameter("msg")+"</b>!"); } %></h5> <div id="complaint"> <div class="container"> <div class="row"> <div class="col-md-4 col-md-offset-4 text-center"> <h2 style="color:white">Complaint Page</h2> <hr> </div> <div class="col-md-5 col-md-offset-3"> <!-- complaint form starts --> <form action="compltsave.jsp" id="complaint" class="form-horizontal"> <fieldset> <div class="form-group"> <label class="col-sm-4 control-label" for="complaintid" style="color:white">COMPLAINT ID</label> <div class="col-sm-8"> <input type="text" placeholder="" class="form-control" name="complaintid" value="<%=n%>" readonly=""> </div>
  • 55. 55 </div> <div class="form-group"> <label class="col-sm-4 control-label" for="id" style="color:white">FARMER ID</label> <div class="col-sm-8"> <input type="text" placeholder="" class="form- control" name="id" value="<%=id%>" readonly=""> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="complaint" style="color:white">COMPLAINT</label> <div class="col-sm-8"> <textarea type="text" placeholder="Enter your complaint" class="form-control" name="complaint" rows="3" required=""></textarea> </div> </div> <div class="col-sm-offset-4 col-sm-8"> <button type="submit" class="btn btn- success">Post</button> <button type="reset" class="btn btn-primary">Cancel</button> </div> </fieldset> </form> <!-- post add form ends --> </div> </div> </div> </div>
  • 56. 56 compltsave.jsp <%@page import="java.sql.*;" %> <% String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service"; Connection con = null; PreparedStatement pstatement = null; String complaintid,id,complaint; complaintid=request.getParameter("complaintid"); id=request.getParameter("id"); complaint=request.getParameter("complaint"); try { Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection(connectionURL, "root", ""); String queryString = "INSERT INTO complaint_page(complaintid, id, complaint) VALUES (?, ?, ?)"; /* createStatement() is used for create statement object that is used for sending sql statements to the specified database. */ pstatement = con.prepareStatement(queryString); pstatement.setString(1, complaintid); pstatement.setString(2, id); pstatement.setString(3, complaint); pstatement.executeUpdate(); response.sendRedirect("Complaint_page.jsp?msg=Complaint Send"); } catch(Exception e) { out.println(e.getMessage()); } %> farmingtips.jsp
  • 57. 57 <% String id=(String)session.getAttribute("Sid"); String crop=(String)session.getAttribute("crop"); //out.println(id); try { /* Create string of connection url within specified format with machine name, port number and database name. Here machine name id localhost and database name is student. */ String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service"; // declare a connection by using Connection interface Connection connection = null; /* declare object of Statement interface that is used for executing sql statements. */ Statement statement = null; // declare a resultset that uses as a table for output data from tha table. ResultSet rs = null; // Load JBBC driver "com.mysql.jdbc.Driver" Class.forName("com.mysql.jdbc.Driver").newInstance(); /* Create a connection by using getConnection() method that takes parameters of string type connection url, user name and password to connect to database.*/ connection = DriverManager.getConnection(connectionURL, "root", ""); /* createStatement() is used for create statement object that is used for sending sql statements to the specified database. */ statement = connection.createStatement(); // sql query to retrieve values from the secified table. String QueryString = "SELECT * FROM tips WHERE id="+id+""; rs = statement.executeQuery(QueryString); %> <style> table, td, th { border: 0px solid black; } table {
  • 58. 58 border-collapse: collapse; width: 100%; } th { text-align: left; } </style> <TABLE cellpadding="10"table border="0" align="center"> <tr><td>Tip Id</td> <td>Tip</td> <% while (rs.next()) { %> <TR> <TD style="color:blueviolet"><%=rs.getInt(1)%></TD> <TD style="color:blueviolet"><%=rs.getString(3)%></TD> </TD> </TR> <% } %> <% // close all the connections. rs.close(); statement.close(); connection.close(); } catch (Exception ex) { %> <% out.println("Unable to connect to database."); } %> </div> <div class="col-md-5 col-md-offset-3"> </div> </div>
  • 59. 59 </div> </div> Cropadddetails.jsp <%@page import="java.util.Iterator"%> <%@page import="java.util.ArrayList"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <%@ page import="java.sql.*" %> <%@ page import="java.io.*" %> <% String id=(String)session.getAttribute("Sid"); String crop=(String)session.getAttribute("crop"); ///out.println(crop); %> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <title>Farming Assistant Web service</title> <!-- Bootstrap core CSS --> <link href="css/bootstrap.css" rel="stylesheet"> <!-- Add custom CSS here --> <link href="css/slidefolio.css" rel="stylesheet"> <!-- Font Awesome --> <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet"> </head> <body> <!-- Header Area --> <div id="top" class="header"> <div class="vert-text">
  • 60. 60 <nav class="navbar navbar-new" role="navigation"> <div class="container"></div> <div class="collapse navbar-collapse" id="mobilemenu"> <ul class="nav navbar-nav navbar-right text-center"> <li><a href="farmermenu.jsp"><i class="service-icon fa fa- user"></i>&nbsp;Profile</a></li> <li><a href="Complaint_page.jsp"><i class="service-icon fa fa-question- circle"></i>&nbsp;Complaint Page</a></li> <li><a href="vcompltstatus.jsp"><i class="service-icon fa fa- eye"></i>&nbsp;View Complaint Status</a></li> <li><a href="farmingtips.jsp"><i class="service-icon fa fa-comments- o"></i>&nbsp;Farming Tips</a></li> <li><a href="sellcrpdtls.jsp"><i class="service-icon fa fa-info- circle"></i>&nbsp;Sell Crops Details</a></li> <li><a href="farmer.jsp"><i class="service-icon fa fa-sign- out"></i>&nbsp;Logout</a></li> </ul></div> <div id="nav"> <h5 style="color:red"> <% if (request.getParameter("msg") == null) { //out.println(""); } else { out.println("<b>"+request. getParameter("msg")+"</b>!"); } %></h5> <div id="crop_ad_details"> <div class="container"> <div class="row"> <div class="col-md-4 col-md-offset-4 text-center"> <h3 style="color:white">Crop Advertisement Details</h3> <hr> </div> <div class="col-md-5 col-md-offset-3">
  • 61. 61 <% try { /* Create string of connection url within specified format with machine name, port number and database name. Here machine name id localhost and database name is student. */ String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service"; // declare a connection by using Connection interface Connection connection = null; /* declare object of Statement interface that is used for executing sql statements. */ Statement statement = null; // declare a resultset that uses as a table for output data from tha table. ResultSet rs = null; // Load JBBC driver "com.mysql.jdbc.Driver" Class.forName("com.mysql.jdbc.Driver").newInstance(); /* Create a connection by using getConnection() method that takes parameters of string type connection url, user name and password to connect to database.*/ connection = DriverManager.getConnection(connectionURL, "root", ""); /* createStatement() is used for create statement object that is used for sending sql statements to the specified database. */ statement = connection.createStatement(); // sql query to retrieve values from the secified table. String QueryString = "SELECT * FROM post_addvertisement, supplier WHERE "+"post_addvertisement.s_id=supplier.s_id AND status='notsold'AND cropname='"+crop+"'"; rs = statement.executeQuery(QueryString); %> <style> table, td, th { border: 0px solid black; } table {
  • 62. 62 border-collapse: collapse; width: 100%; } th { text-align: left; } </style> <TABLE cellpadding="10"table border="0" align="center"> <tr><td>Post Id</td> <td>Supplier Id</td> <td>Crop Name</td> <td>Crop Image</td> <td>Required Quantity (in kg)</td> <td>Supplier Name</td> <td>Contact</td></tr> <% while (rs.next()) { %> <TR> <TD style="color:blueviolet"><%=rs.getInt("pid")%></TD> <TD style="color:blueviolet"><%=rs.getInt("s_id")%></TD> <TD style="color:blueviolet"><%=rs.getString("cropname")%></TD> <TD style="color:blueviolet"><img src="upload/<%=rs.getString("file")%>" width="70" height="70"></TD> <TD style="color:blueviolet"><%=rs.getInt("requiredquantity")%></TD> <TD style="color:blueviolet"><%=rs.getString("suppliername")%></TD> <TD style="color:blueviolet"><%=rs.getString("phone")%></TD> <TD><button type="submit" class="btn btn-primary" onclick="window.location='sell_crop.jsp?s_id=<%=rs.getInt("s_id")%>&cropname=<%=r s.getString("cropname")%>&suppliername=<%=rs.getString("suppliername")%>&requant ity=<%=rs.getInt("requiredquantity")%>&pid=<%=rs.getInt("pid")%>'">Sell Crop</button></TD> </TD>
  • 63. 63 </TR> <% } %> <% // close all the connections. rs.close(); statement.close(); connection.close(); } catch (Exception ex) { %> <% out.println("Unable to connect to database."); } </div> </div> </div> </div> <!-- Header Area --> <!-- /post add--> <!-- Bootstrap core JavaScript --> <!-- Placed at the end of the document so the pages load faster --> <script src="js/jquery.js"></script> <script src="js/jquery-scrolltofixed-min.js"></script> <script src="js/jquery.vegas.js"></script> <script src="js/jquery.mixitup.min.js"></script> <script src="js/jquery.validate.min.js"></script> <script src="js/script.js"></script> <script src="js/bootstrap.js"></script> <!-- Slideshow Background --> <script> $.vegas('slideshow', { delay:5000, backgrounds:[ { src:'./img/portrait-sm.jpg', fade:2000 }, { src:'./img/bw2.jpg', fade:2000 },
  • 64. 64 { src:'./img/nature.jpg', fade:2000 }, { src:'./img/portrait.jpg', fade:2000 }, { src:'./img/portrait4.jpg', fade:2000 }, { src:'./img/portrait6.jpg', fade:2000 }, { src:'./img/portrait7.jpg', fade:2000 }, { src:'./img/forest1.jpg', fade:2000 } ]})('overlay', { src:'./img/overlay.png' });</script> <!-- /Slideshow Background --> <!-- Mixitup : Grid --> <script> $(function(){ $('#Grid').mixitup(); }); </script> <!-- /Mixitup : Grid --> <!-- Custom JavaScript for Smooth Scrolling - Put in a custom JavaScript file to clean this up --> <script> $(function() { $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^//,'') == this.pathname.replace(/^//,'') || location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 1000); return false; } } });
  • 65. 65 }); </script> <!-- Navbar --> <script type="text/javascript"> $(document).ready(function() { $('#nav').scrollToFixed(); }); </script> <!-- /Navbar--> </body></html> sell_crop.jsp <% Random rand = new Random(); int n = rand.nextInt(900) + 100; %> <script> function alphaOnly(event) { var key = event.keyCode; return ((key >= 65 && key <= 90) || key == 8); }; </script> <% float p=0; String id=(String)session.getAttribute("Sid"); String s_id=request.getParameter("s_id"); String cropname=request.getParameter("cropname"); String suppliername=request.getParameter("suppliername"); Float requantity=Float.parseFloat(request.getParameter("requantity")); String pid=request.getParameter("pid"); //out.println(s_id); %> <% try {
  • 66. 66 /* Create string of connection url within specified format with machine name, port number and database name. Here machine name id localhost and database name is student. */ String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service"; // declare a connection by using Connection interface Connection connection = null; /* declare object of Statement interface that is used for executing sql statements. */ Statement statement = null;// declare a resultset that uses as a table for output data from tha table. ResultSet rs = null; // Load JBBC driver "com.mysql.jdbc.Driver" Class.forName("com.mysql.jdbc.Driver").newInstance(); /* Create a connection by using getConnection() method that takes parameters of string type connection url, user name and password to connect to database.*/ connection = DriverManager.getConnection(connectionURL, "root", "")/* createStatement() is used for create statement object that is used for sending sql statements to the specified database. */ statement = connection.createStatement(); // sql query to retrieve values from the secified table. String QueryString = "SELECT * FROM crop_price WHERE cropname='"+cropname+"'"; rs = statement.executeQuery(QueryString); if(rs.next()){ Float price=Float.parseFloat(rs.getString("price")); //out.println(requantity); //out.println(price); p=p+(price*requantity); } %> <!-- sell_crop form starts --> <form action="sellsave.jsp" id="sellcrop" class="form-horizontal">
  • 67. 67 <fieldset> <div class="form-group"> <label class="col-sm-4 control-label" for="sell_id" style="color:white">SELL ID</label> <div class="col-sm-8"> <input type="text" placeholder="sell_id" class="form-control" name="sell_id" id="sell_id" value="<%=n%>" readonly=""> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="id" style="color:white">Farmer ID</label> <div class="col-sm-8"> <input type="text" placeholder="id" class="form-control" name="id" id="id" value="<%=id%>" readonly=""> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="s_id" style="color:white">SUPPLIER ID</label> <div class="col-sm-8"> <input type="number" placeholder="s_id" class="form-control" name="s_id" id="s_id" maxlength="10" value="<%=s_id%>" readonly=""> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="suppliername" style="color:white">SUPPLIER NAME</label> <div class="col-sm-8"> <input type="text" placeholder="suppliername" class="form-control" name="suppliername" id="suppliername" value="<%=suppliername%>" readonly="">
  • 68. 68 </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="cropname" style="color:white">CROP NAME</label> <div class="col-sm-8"> <input type="text" placeholder="cropname" class="form-control" name="cropname" id="cropname" value="<%=cropname%>" readonly=""> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="quantity" style="color:white">QUANTITY</label> <div class="col-sm-8"> <input type="number" class="form-control" name="quantity" id="quantity" maxlength="10" value="<%=requantity%>" readonly=""> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="rupees" style="color:white">RUPEES</label> <div class="col-sm-8"> <input type="number" placeholder="rupees" class="form-control" name="rupees" id="rupees" value="<%=p%>" readonly=""> </div> </div> <div class="col-sm-offset-4 col-sm-8"> <input type="hidden" name="status" value="sold"/> <input type="hidden" name="pid" value="<%=pid%>"/> <button type="submit" class="btn btn- success">Sell</button> <button type="reset" class="btn btn-primary">Cancel</button>
  • 69. 69 </div> </fieldset> </form> <!-- sell_crop form ends --> </div> </div> </div> </div> sell_save.jsp <% String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service"; Connection con = null; Connection con1 = null; Connection con2 = null; Connection con3 = null; Connection con4 = null; PreparedStatement pstatement = null; PreparedStatement pstatement1 = null; PreparedStatement pstatement2 = null; PreparedStatement pstatement3 = null; PreparedStatement pstatement4 = null; String sell_id,id,s_id,suppliername,cropname,quantity,rupees,pid; sell_id=request.getParameter("sell_id"); id=request.getParameter("id"); s_id=request.getParameter("s_id"); suppliername=request.getParameter("suppliername"); cropname=request.getParameter("cropname"); quantity=request.getParameter("quantity"); rupees=request.getParameter("rupees"); String status=request.getParameter("status"); pid=request.getParameter("pid");
  • 70. 70 try { Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection(connectionURL, "root", ""); con1 = DriverManager.getConnection(connectionURL, "root", ""); con2 = DriverManager.getConnection(connectionURL, "root", ""); con3 = DriverManager.getConnection(connectionURL, "root", ""); con4 = DriverManager.getConnection(connectionURL, "root", ""); String queryString ="INSERT INTO sell_crop(sell_id,id,s_id,suppliername,cropname,quantity,rupees) VALUES (? ,? ,? , ?, ? , ?, ?)"; /* createStatement() is used for create statement object that is used for sending sql statements to the specified database. */ pstatement = con.prepareStatement(queryString); pstatement.setString(1, sell_id); pstatement.setString(2, id); pstatement.setString(3, s_id); pstatement.setString(4, suppliername); pstatement.setString(5, cropname); pstatement.setString(6, quantity); pstatement.setString(7, rupees); int i= pstatement.executeUpdate(); if(i>0) { String queryString1 ="UPDATE post_addvertisement SET id=? where s_id=?"; out.println(queryString1); pstatement1 = con.prepareStatement(queryString1); pstatement1.setString(1, id); pstatement1.setString(2, s_id); int j= pstatement1.executeUpdate(); if (j>0) { String queryString2 ="UPDATE supplier SET id=? where s_id=?";
  • 71. 71 pstatement2 = con.prepareStatement(queryString2); pstatement2.setString(1, id); pstatement2.setString(2, s_id); int k= pstatement2.executeUpdate(); if (k>0) { String queryString3 ="UPDATE farmer SET s_id=? where id=?"; pstatement3 = con.prepareStatement(queryString3); pstatement3.setString(1, s_id); pstatement3.setString(2, id); int l= pstatement3.executeUpdate(); if ( ){ String queryString4 ="UPDATE post_addvertisement SET status=? where pid=?"; out.println(queryString4); pstatement4 = con.prepareStatement(queryString4); pstatement4.setString(1, status); pstatement4.setString(2, pid); pstatement4.executeUpdate(); } } } } //out.println("successfully saved"); response.sendRedirect("crpaddetails.jsp?msg=Successfully sold"); } catch(Exception e) { out.println(e.getMessage()); } %> sellcrpdtls.jsp <%
  • 72. 72 String id=(String)session.getAttribute("Sid");%> <% try { /* Create string of connection url within specified format with machine name, port number and database name. Here machine name id localhost and database name is student. */String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service"; // declare a connection by using Connection interface Connection connection = null; /* declare object of Statement interface that is used for executing sql statements. */ Statement statement = null; // declare a resultset that uses as a table for output data from tha table. ResultSet rs = null; // Load JBBC driver "com.mysql.jdbc.Driver" Class.forName("com.mysql.jdbc.Driver").newInstance(); /* Create a connection by using getConnection() method that takes parameters of string type connection url, user name and password to connect to database.*/ connection = DriverManager.getConnection(connectionURL, "root", ""); /* createStatement() is used for create statement object that is used for sending sql statements to the specified database. */ statement = connection.createStatement(); // sql query to retrieve values from the secified table. String QueryString = "SELECT DISTINCT post_addvertisement.cropname,sell_crop.suppliername,supplier.id,sell_crop.sell_id,sell_cr op.s_id,sell_crop.quantity,sell_crop.status,post_addvertisement.file FROM post_addvertisement join sell_crop on post_addvertisement.s_id=sell_crop.s_id join supplier on post_addvertisement.id=supplier.id where supplier.id='"+id+"' GROUP by sell_crop.sell_id ";//out.println(QueryString); rs = statement.executeQuery(QueryString); %> <style> table, td, th {
  • 73. 73 border: 0px solid black; }table { border-collapse: separate; width: 100%; }th { text-align: left; } </style> <TABLE cellpadding="10"table border="0" align="center"> <tr><td>Sell Id</td> <td>Crop Name</td> <td>Crop Image</td> <td>Supplier Id</td> <td>Quantity (in kg)</td> <td>Supplier Name</td> <td>Status</td> <% while(rs.next()) {%> <TR> <TD style="color:blueviolet"><%=rs.getInt("sell_id")%></TD> <TD style="color:blueviolet"><%=rs.getString("cropname")%></TD> <TD style="color:blueviolet"><img src="upload/<%=rs.getString("file")%>" width="70" height="70"></TD> <TD style="color:blueviolet"><%=rs.getString("s_id")%></TD> <TD style="color:blueviolet"><%=rs.getInt("quantity")%></TD> <TD style="color:blueviolet"><%=rs.getString("suppliername")%></TD> <TD style="color:blueviolet"><%=rs.getString("status")%></TD> </TR> <% } %> <% // close all the connections. rs.close(); statement.close();
  • 74. 74 connection.close(); } catch (Exception ex) { %> <% out.println("Unable to connect to database."); } %> </div> </div> </div> </div> Admin: admin.jsp <!-- admin form starts --> <form action="login.jsp" id="admin-form" class="form-horizontal"> <fieldset> <div class="form-group"> <label class="col-sm-4 control-label" for="id" style="color:white">ID</label> <div class="col-sm-8"> <input type="text" placeholder="Id" class="form-control" name="id" id="name"> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="password" style="color:white">PASSWORD</label> <div class="col-sm-8"> <input type="password" placeholder="********" class="form-control" name="password" id="password"> </div> </div>
  • 75. 75 <div class="col-sm-offset-4 col-sm-8"> <button type="submit" class="btn btn- success">Login</button></div> </fieldset> </form> <!-- admin form ends --> adminmenu.jsp <li><a href="vcmplt.jsp"><i class="service-icon fa fa-eye"></i>&nbsp;View Complaint </a></li> <li><a href="farmtip.jsp"><i class="service-icon fa fa-comments- o"></i>&nbsp;Farming Tips</a></li> <li><a href="logout.jsp"><i class="service-icon fa fa-sign- out"></i>&nbsp;Logout</a></li> </ul></div> <img src="img/adminicon.jpg" align="top"> <table> <tr><td></td></tr> <tr><td></td></tr> <tr><td></td></tr> <tr><td></td></tr> </table> <h2 style="color:white"><em> <% String id=(String)session.getAttribute("Sid"); if(id==null) id=""; out.print("Hello "+id); %> </em> </h2> vcmplt.jsp <li><a href="vcmplt.jsp"><i class="service-icon fa fa-eye"></i>&nbsp;View Complaint </a></li> <li><a href="farmtip.jsp"><i class="service-icon fa fa-comments- o"></i>&nbsp;Farming Tips</a></li>
  • 76. 76 <li><a href="logout.jsp"><i class="service-icon fa fa-sign- out"></i>&nbsp;Logout</a></li> </ul></div> <img src="img/adminicon.jpg" align="top"> <table> <tr><td></td></tr> <tr><td></td></tr> <tr><td></td></tr> <tr><td></td></tr> </table> <h2 style="color:white"><em> <% String id=(String)session.getAttribute("Sid"); if(id==null) id=""; out.print("Hello "+id); %> </em> </h2> vcmpltstatus.jsp <% String id=(String)session.getAttribute("Sid"); String crop=(String)session.getAttribute("crop"); //out.println(id); try { /* Create string of connection url within specified format with machine name, port number and database name. Here machine name id localhost and database name is student. */ String connectionURL = "jdbc:mysql://localhost:3306/farming assistance web service"; // declare a connection by using Connection interface
  • 77. 77 Connection connection = null; /* declare object of Statement interface that is used for executing sql statements. */ Statement statement = null; // declare a resultset that uses as a table for output data from tha table. ResultSet rs = null; // Load JBBC driver "com.mysql.jdbc.Driver" Class.forName("com.mysql.jdbc.Driver").newInstance(); /* Create a connection by using getConnection() method that takes parameters of string type connection url, user name and password to connect to database.*/ connection = DriverManager.getConnection(connectionURL, "root", ""); /* createStatement() is used for create statement object that is used for sending sql statements to the specified database. */ statement = connection.createStatement(); // sql query to retrieve values from the secified table. String QueryString = "SELECT * FROM complaint_page WHERE id="+id+""; rs = statement.executeQuery(QueryString); %> <style> table, td, th { border: 0px solid black; } table { border-collapse: collapse; width: 100%; } th { text-align: left; }</style> <TABLE cellpadding="10"table border="0" align="center"> <tr><td>Complaint Id</td> <td>Id</td> <td>Complaint</td>
  • 78. 78 <td>Status</td><% while (rs.next()) { %> <TR><TD style="color:blueviolet"><%=rs.getInt(1)%></TD> <TD style="color:blueviolet"><%=rs.getInt(2)%></TD> <TD style="color:blueviolet"><%=rs.getString(3)%></TD> <TD style="color:blueviolet"><%=rs.getString(4)%></TD> </TD> </TR> <% } %> <% // close all the connections. rs.close(); statement.close(); connection.close(); } catch (Exception ex) { %> <% out.println("Unable to connect to database."); } %> childclose.jsp <body onload="child_close()"> <script type="text/javascript"> var popupWindow=null; function child_close() { popupWindow =window.close(); } </script> farmtip.jsp <% if ((session.getAttribute("Sid") == null) || (session.getAttribute("Sid") == "")) {
  • 79. 79 %> You are not logged in<br/> <a href="admin.jsp">Please Login</a> <%} else { %> Welcome <%=session.getAttribute("Sid")%> <% } %><!-- admin form starts --> <form action="tipsave.jsp" id="admin-form" class="form-horizontal"> <fieldset> <div class="form-group"> <label class="col-sm-4 control-label" for="id" style="color:white">TIP ID</label> <div class="col-sm-8"> <input type="text" placeholder="Id" class="form- control" name="tipid" value="<%=n%>" readonly=""> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="id" style="color:white">FARMER ID</label> <div class="col-sm-8"> <input type="number" oninput="javascript: if(this.value.length>this.maxLength) this.value=this.value.slice(0,this.maxLength);" placeholder=" Enter Farmer id" class="form-control" name="id" maxlength="10" required=""> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="tips" style="color:white">TIPS</label> <div class="col-sm-8">
  • 80. 80 <textarea placeholder="" class="form-control" name="tips" size="4" required=""></textarea> </div> </div> <div class="col-sm-offset-4 col-sm-8"> <button type="submit" class="btn btn- success">Submit</button> </div> </fieldset> </form>
  • 81. 81 REFERENCES [1]Introduction to Android: http://developer.android.com/guide/index.html [2] Android API: [3] http://developer.android.com/reference/packages.htmlJava 6 API: [4]http://docs.oracle.com/javase/6/docs/api/Android Fundamentals: http://developer.android.com/guide/components/fundamentals.html [5] The Java Tutorials: http://docs.oracle.com/javase/tutorial/ [6] Android User Interfaces: [7] http://developer.android.com/guide/topics/ui/index.htmlLayout: [8] http://developer.android.com/guide/topics/ui/declaring-layout.htmlCommon Tasks: [9] http://developer.android.com/guide/appendix/faq/commontasks.htmlGoogle Maps: [10]http://code.google.com/android/add-ons/google-apis/maps-overview.htmlIconography: [11]http://developer.android.com/guide/practices/ui_guidelines/icon_design.htmlSample Source Code: [12]http://developer.android.com/resources/samples/get.htmlAndroid Training: http://developer.android.com/training/index.html [13] Android Developer's Blog:http://android-developers.blogspot.com/ [14] Developer FAQ: [15] http://developer.android.com/resources/faq/Developer Forums: [16] http://developer.android.com/resources/community-groups.htmlAndroid Developer's Group: [17] http://groups.google.com/group/android-developers?lnk=XDA-Developers Forums: http://forum.xda-developers.com/ [18] http://nevonprojects.com/farming-assistant-web-service/ [19]http://projectideas.co.in/farming-assistance-web-service-project-ideas/