Skip to content
Magak Emmanuel edited this page Jun 16, 2017 · 2 revisions

FarmBase Web Application

Submitted to the Department of Statistics and Computer Science Moi University

in Partial Fulfillment of the Requirements for the Degree of Bachelor of Science in Computer Science by

COM/10/15 EMMANUEL MAGAK COM/1007/15 EMMANUEL HAMARA COM/24/15 DENNIS SERONEY COM/1000/15 NAFTALI WAHOME COM/27/15 GIBSON SILALI

Date ______________________

Declaration We declare that this report is our original work and has not been presented for a degree award in any other university. No part of this work may be reproduced without prior written permission of the authors and/or Moi University.

Reg. No1 Name1 Signature………… Date……… Reg. No2 Name2 Signature………… Date………… Reg. No3 Name3 Signature………. Date………… Reg. No3 Name4 Signature……. Date………….

4.2 Approval page

Supervisor’s Declaration This project has been submitted for review with my approval as the University Supervisor.

Signature…………………………………………Date ……………………………

Name:. …………………………………………………………………………………….

DEPARTMENT OF STATISTICS AND COMPUTER SCIENCE

MOI UNIVERSITY

CONTENTS

  1. Introduction and Background……………………………………………… 7 1.1 Statement of Problem Area 1.2 Background 1.3 Brief Project Description 1.4 Purpose/Objectives/justification of Project

  2. Literature Review…………………………………….. 8 2.1 Previous and Current Work, Methods and Procedures

  3. System Functional Specification……………………. 13 3.1 Functions Performed 3.2 User Interface Design 3.3 System Data Base/File Structure Preview 3.4 External and Internal Limitations and Restrictions 3.5 User Interface Specification 3.6.1 User Screens/Dialog 3.6.2 Report Formats/Sample Data 3.6.3 On­line Help Material 3.6.4 Error Conditions and System Messages 3.6.6 Control Functions

  4. System Performance Requirements…………………… 34 4.1 Efficiency 4.2 Reliability 4.2.1 Description of Reliability Measures 4.2.2 Error/Failure Detection and Recovery 4.2.3 Allowable/Acceptable Error/Failure Rate 4.3 Security 4.3.1 Hardware Security 4.3.2 Software Security 4.3.3 Data Security 4.3.4 Execution Security 4.4 Maintainability 4.5 Modifiability 4.6 Portability

  5. System Design Overview………………………………… 38

5.1 System Data Flow Diagrams 5.2 System Architecture and Structure 5.3 System Data Dictionary 5.4 Description of System Operation 5.5 Equipment Configuration 5.6 Implementation Languages 5.7 Required Support Software

  1. System Data Structure Specifications……………………. 42

6.1 User Input Specification 6.1.1 Identification of Input Data 6.1.2 Source of Input Data 6.1.3 Input Medium and/or Device 6.1.4 Data Format/Syntax 6.2 User Output Specification 6.2.1 Identification of Output Data 6.2.2 Output Medium and/or Device 6.2.3 Output Format/Syntax 6.2.4 Output Interpretation 6.3 System Data Base/File Structure Specification 6.3.1 Identification of Data Base/Files 6.3.2 Systems Accessing the Data Base 6.3.3 Logical File Structure 6.3.4 Physical File Structure 6.3.5 Data Base Management Subsystems Used

  1. Module Design specifications………..…………………… 49

7.1 Modules 7.1.1 Module Functional specification 7.1.1.1 Functions Performed 7.1.1.2 Module Interface Specifications (input/output arguments/global variables/files) 7.1.1.3 Module Limitations and Restrictions 7.1.2 Module operational Specification 7.1.2.1 Locally Declared Data Specifications (variable dictionary) 7.1.2.2 Algorithm Specification (flowchart, pseudo-code, decision table, etc.) 7.1.2.3 Description of Module Operation

  1. System Verification……………………………………….. 61

8.1 Items/Functions to be tested 8.2 Description of Test Cases 8.3 Justification of Test Cases 8.4 Test Run Procedures and Results 8.5 Discussion of Test Results

  1. Conclusions………………………………………….…… 66

9.1 Summary 9.2 Problems Encountered and Solved 9.3 Suggestions for Better Approaches Problem /Future Extensions to Project

  1. Bibliography………………………………………….… 67
  2. Appendices ………………………………………….….. 68
  3. Program Listings……………………………………….. 73
  4. User Manual……………………………………………. 89

Declaration This is to certify that the work being presented in the project entitled FARMBASE submitted by undersigned students of Third Year B. Sc. in COMPUTER SCIENCE in partial fulfillment for the award of degree in Bachelor of Science (Computer Science) is a record of our own work carried out by us under guidance and supervision of Mr. Biomdo of the Department of Statistics and Computer Science and that this work has not been submitted anywhere else for the award of any other degree. APPROVAL This project was done and presented by us before the panel concerned on the 1st June 2017 at Moi University with our approval and that of our supervisor Mr. Biomdo.

Name of student: ____________________________________________ : ____________________________________________ : ____________________________________________ : ____________________________________________ : ____________________________________________

Registration Number: ____________________________ Sign: …………… : ____________________________ Sign: …………… : ____________________________ Sign: …………… : ____________________________ Sign: …………… : ____________________________ Sign: ……………

Name Supervisor: Mr. Biomdo Signature: ____________________ DEDICATION All the work done in coming up with this system is dedicated to the group members for being a part of the whole process. ACKNOWLEDGEMENT The satisfaction that accompanies that the successful completion of any task would be incomplete without the mention of people whose ceaseless cooperation made it possible, whose constant guidance and encouragement crown all efforts with success. We are very grateful to our project supervisor Mr. Biomdo for the guidance, inspiration and constructive suggestions that helped us in the preparation of this project.

CLARIFICATION OF TERMS Throughout the documentation the words Farmer, Seller and Buyer will be used to describe the generic user of the application, whereas the words Admin, Administrator will describe the application user with administrative priviledges, the words consultant or agricultural extension officer will describe the user of application whose job is to give the generic users advice on matters pertaining to farming through the application.

  1. INTRODUCTION AND BACKGROUND 1.1 Statement of Problem Area In our current society the farming sector has always endured tough times with improving technology and the ever infringing middlemen. The agricultural extension officer has always had to travel to the customer’s locality to give agricultural advice. The consumers too have always been affected by the middlemen since they usually don’t have an easier way to buy products directly from the farmers. 1.2 Background FARMBASE was created because; There has been a problem with access of information by farmers, farmers tend to plant their crops and keep their livestock without any advice from the agricultural extension officers and thus brings about low yields. The application solves this by allowing a farmer to send questions to the Agricultural extension officer asking for advice.

1.3 Brief Project description Our project aims at benefiting the farmer and the consumer. The farmer can ask for agricultural advice from the agricultural officer and can also post his products for consumers and middlemen to buy and know their availability. The consumer, farmer and the agricultural extension officer create accounts in our online application.

1.4 Objectives of Project The objectives of this project are;

  1. Help farmers advertise their products.
  2. Help farmers get help on nurturing their products from Agricultural officers.
  3. Consumers get products they need easily.
  4. Business men can buy goods from farmers in bulk.
  5. LITERATURE REVIEW 2.1 Previous and Current Work, Methods and Procedures In the past, the communication channels between the farmers, agricultural extension officers and the consumers has always been a hard task to accomplish. This has often given way to the rise of many middlemen whose aim is usually to “help” the three bodies in providing for their needs while enriching themselves. This has led to the falling economy in the country since its structure is based on the survival for the fittest. Farmers too have always had problems in reaching out to the Agricultural extension officers to help them with advising on the growth patterns and fertilizer usage on the different types of soil in a locality. This involved too many procedures thus bringing a setback in delivering goods and services to the consumers and increase in prices in the process. It’s not every day that one can order farm products from his/her phone or their computers and also not every day does a farmer get to be answered when he or she has a question and is logged on. Most researchers have conducted researches involving the introduction of technology in the farming sector. It’s about time we brought farming at per with technology and in so doing we'll be improving the business of farming and as an economy too. According to the Food and Agriculture Organization of the United Nations, the world population will reach 9.1 billion by 2050, and to feed that number of people, global food production will need to grow by 70%. For Kenya, which is projected to be home to about 55 million people by then, farm productivity must accelerate at a faster rate than the global average to avoid continued mass hunger. This can be achieved by educating farmers to grow crops that are suitable for their environment and use suitable manure. This can be easily done using our online application through Agricultural extension officers. In an attempt to build any software system that follows the required standards by the client, it’s necessary to follow certain software development rules. Thus software development process models which we used in our project will be discussed here. All models follow the basic foundation as follows: Planning: This is the initial evaluation of the software to be developed or in most cases; it is an attempt to upgrade an existing system. Requirement Analysis and Specification: In this stage, the problem the new system is identified; its operational capabilities are defined and the resources needed for the system and maintenance goals are set. Functional Specification or Prototyping: The computational aspect, relation and attributes of the software system are identified. Also, the operations that will transform these objects along with the constraints of the system behaviors are considered at this point. Architectural Design and Configuration Specification: The interconnection between all the component and modules of the system are defined in such a way that they meet the detailed design. Detailed Component Design Specification: This is the stage in which the modules of the defined component are transformed from required inputs into provided outputs. Component Implementation and Debugging: codifies the preceding specifications into Operational source code implementations and validates their basic operation. Software Integration and Testing: This is the stage where integrity of the software system configuration is tested and verified for consistency and completeness. All developed modules, interfaces and resources are verified against their specification. Documentation Revision and System Delivery: At this stage, the technical know-how of the developed soft-ware system is documented as user’s guides. Deployment and Installation: Installation of the software system into local computing environment, operating systems configuration and diagnostic test cases to ensure the workability of the system is done at this stage. Training and Use: Providing training support for the users of the software system is as important as the development of the software system itself, since the user of the system needs to have a good under-standing of the system itself. Software Maintenance: Maintaining the system in the environment in which it is created for is also an important aspect that must be taken into consideration. For us we used the iterative software development process. This model is developed in response to the shortcoming of waterfall model. It does not start with full specification requirement of a project, rather specify and implement some part of the software one at a time in other to review it at every step along the line to identify any further requirement. These processes have to be done again and again to produce a new requirement 8 version for the software and as shown in the figure below, the process starts with the initial planning, and then moves further to the real planning stage before the requirement stage. Iterative development divides the deliverables into different stages. Within each stage, functionality is implemented using the cross-discipline work, which actually starts with the identification of the model to execution.

Iterations models follows the phases listed below: Inception: In this phase, the scope of the project, requirements for functional and nonfunctional parts included. Elaboration: Complete detailed assessment of the project which includes risk assessment Construction: This phase is the most important and delicate part of the project because at this stage, the architectural part with the already written code from the analysis, designs, implementation and testing are incrementally inscribed into the project. Transition: The last phase of the project is the point where the system is facilitated with the operation environment each of the aforementioned phases can be illustrated in single or multi-face iterations. These iterations are mainly time-bound instead focused on features. The role of the experts is clearly allocated and distributed, that is architects and analysts assess and write out the iteration leaving the work-product backlogs to developers and testers.

  1. System Functional Specification 3.1 Functions performed Use case diagram to reflect systems functional specification Search item for listing Creates account Generic user

    -- View item listing -- Provide farming advice -- View product information -- Post product for sale Buyer Extension office -- Manage posts Seller Generic User Account creation – User will have the privilege to create an account with the site, by submitting valid credentials which will be stored in the database. Search item for listing – User (authenticated and non-authenticated) will have the privilege of searching products in the websites database for a listing. User (buyer) View item listing – User (Buyer) will be provided with a listing of products for sale View product information – User will be provided with a full profile on an item of interest including how to get it. User (extension officer) The system will provide up to date/modern farm related advice to all registered users (farmers/sellers).

User (seller) The system will provide a portal for users (seller) to post advertisements for products they want to sell The System will allow post creators to edit and delete them at their own convenience

3.2 user interface design This section presents the graphical user interface of the Farmbase Web application that will have the form of a light weight web application, where functionalities are grouped visually and logically into thematic units, according to the types of entities they are associated with, i.e. Posting an advertisement, messaging services. Special consideration was given to the application’s ergonomics, with the main concept being to provide visual grouping data group elements, with minimal effort required in user actions. As a result, each of this elements (farm-categories { feeds, supplement’s and Seeds, Livestock, Poultry and Seeds, Farm Machinery and Tools } ) is manifested in the as a separate container web control, having its own contents and selected via an appropriate tab menu at the top of the main section of the index page. Only one tab can be selected by a user at any one time. Where appropriate, each tab’s contents are further divided into sections, according to a particular logical and functional grouping. The design foresees the development of the web application using the following HTML Templates: HTML5; CSS3 with CSS resets; Liquid presentation Use of web standards ( i.e. for tables too ); Semantic HTML The design provides for a responsive site that will work on both desktop and mobile tablet devices. The sections that follow contain mock views of a selection of the most important aspects of the GUI, along with textual descriptions of their purpose and contents.

3.2.1. FarmBase Login This section describes the “login” page which will be common for the Resource Management Web applications (that constitute the FarmBase interfaces). The main component is the login form, where user needs to provide the credentials in order to be authorized to use the web application. The login page will also contain links (Forgot Password {an alternative link in-case a user forgot his/her password}, Register Account {In-case one wanted to register a new account}, Consultant Log In {When a user want to log in as an Agricultural officer}).

Purpose: To provide the user with a portal for signing in Into FarmBase application. The page contains the following elements: A login area Alternative sign-in option links area

Navigation & User Interaction: To login the user is requires to enter valid
Credentials. The successful login will advance the user to the FarmBase index applications page.

3.2.2 FarmBase Index Page

Purpose: To provide the user with navigational container with listing of latest updated product notification.

Navigation & User Interaction: User can navigate through categories of products posted and updated by the user (farmer). User can view a detailed information of a selected product by clicking the view more button.

3.2.3 FarmBase Blog Page

Purpose: To provide the user with navigational container With listing of latest blogged product item.

Navigation & User Interaction: User can navigate through categories of products posted and updated by the user (Agricultural extension officer). A listing is provided for each category selected. Each read more button which takes the user to a blog view page where the blogging information for the item selected is displayed.

3.2.4 FarmBase Blog-view Page

Purpose: To provide user with a detailed and blog Information of selected product. To provide a section for commenting on the product. To provide a string of comments on commented of the selected product. To provide a list of blogged products that the current user may like based algorithm.

Navigation & User Interaction: Authenticated user can comment on the add comment input area provided and click the comment button to update comment. Authenticated users can also message the product post creator by clicking on the message button on the product post creator information panel. See figure 3.2.2

3.2.5 FarmBase Register Account Page

Purpose: To provide the user with a portal for signing-up in Into FarmBase application. The page contains the following elements: A Register area Alternative log-in option link area

Navigation & User Interaction: To Register the user is requires to enter valid
Credentials. The successful register will advance the user to the FarmBase index applications page.

3.2.6 FarmBase about App Page Purpose: To provide the user about the application’s background information. To provide the user a section for contacting the application administrator. Navigation & User Interaction: Any user can use the contact admin section, where the user enters the name, email and message content of the message.

3.2.7 FarmBase Search product listing Page

Purpose: To provide the user with an option to search for a product. Navigation & User Interaction: User is required to enter keywords associated with the related item of interest and hit search button.

3.2.8 FarmBase Post Product Page

Purpose: To provide authenticated user an option to post farm produce Navigation & User Interaction: The user is required to enter valid, required credentials

3.2.9 FarmBase Edit Profile Page

Purpose: To provide authenticated user an option to edit their profile Navigation & User Interaction: The user is required to enter valid credentials

3.3 System Data Base/File Structure Preview Database: Farmbase Tables:

  1. Comment post Columns: Comment (VAR CHAR (100)) Email (VAR CHAR (100)) Id (PRIMARY KEY) Liked (BOOLEAN) Post Id (INT) Timer (TIME STAMP)

  2. Farmer Post Columns: Category (VAR CHAR (100)) Description (VAR CHAR (500)) Email (VAR CHAR (100)) Id (PRIMARY KEY) Location (VAR CHAR (100)) Phone number (VAR CHAR (100)) Photo(VAR CHAR (100), UNIQUE) Timer (TIME STAMP) Title (VAR CHAR (100)) User Picture (VAR CHAR (100))

  3. Message Favorite Columns: Email (VAR CHAR (100)) Favorite (BOOLEAN) Id (PRIMARY KEY) Post Id (INT)

  4. Admin Columns: Email (VAR CHAR (100)) Id (PRIMARY KEY) Password (VAR CHAR (100))

  5. Consultant Columns:

  6. Email (VAR CHAR (100), UNIQUE)

  7. Id (PRIMARY KEY)

  8. Name (VAR CHAR (100))

  9. Password (VAR CHAR (100))

  10. Phone Number (VAR CHAR (100))

  11. Photo(VAR CHAR (100))

  12. Farmer Columns: Email (VAR CHAR (100), UNIQUE) Id (PRIMARY KEY) Name (VAR CHAR (100)) Password (VAR CHAR (100)) Phone Number (VAR CHAR (100)) Photo (VAR CHAR (100))

  13. Message Post Columns: Category (VAR CHAR (100)) Description (VAR CHAR (500)) Email (VAR CHAR (100)) Id (PRIMARY KEY) Phone Number (VAR CHAR (100)) Photo (VAR CHAR (100), UNIQUE KEY) Timer (TIME STAMP) Title (VAR CHAR (100)) User Picture (VAR CHAR (100))

  14. Post Favorite Columns: Email (VAR CHAR (100)) Favorite (BOOLEAN) Id (PRIMARY KEY) Post Id (INT)

  15. Sent Messages Columns: Id (PRIMARY KEY) Message (LONG TEXT) Name (VAR CHAR (100)) Phone Number (VAR CHAR (100)) Post ID (INT) Receiver Email (VAR CHAR (100)) Sender Email (VAR CHAR (100)) Status (VAR CHAR (10)) Timer (TIME STAMP)

  16. Sent Messages Consultant Columns: Category (VAR CHAR (100)) Id (PRIMARY KEY) Message (VAR CHAR (500)) Name (VAR CHAR (100)) Phone (VAR CHAR (100)) Post Id (INT) Receiver Email (VAR CHAR (100)) Sender Email (VAR CHAR (100)) Status (VAR CHAR (10)) Timer (TIME STAMP)

3.5.1 User Interface Specification 3.5.1 User Screens/Dialog Index Page (/)

  1. Header ( Application name, Home, Blog, About Application, if logged-in->(notifications, post-product advert, profile, login/logout) Canvas ( Picture, Search input area) Horizontal Tab menu ( Product categories ({Feeds, Supplements and Seeds},{Farm Machinery and Tools}, {Livestock, Poultry and Fish}, Farm produce) Tab content (3 columns filling each height and width of the content section of the screen (i.e. between tab menu and the footer)). Each column contains a panel with the following details:- Product category Product name Time posted Product price Vendor’s name Vendor’s location Panel footer (Vender’s number, view Product icon) Blog page (/blog)

Aside section (left of the screen)-> ( Product categories ({Feeds, Supplements and Seeds},{Farm Machinery and Tools}, {Livestock, Poultry and Fish}, Farm produce 8 columns with a view of blogged product

About (/about)

Canvas ( information on the application ) Contact us section ( Input to send a message to site admin) See all messages (/messages)

Messages arranged from most recent received

Post Farm Produce Advertisement (/post)

Farm produce post form( Name of product, description of product, price of product , category of product, location of product)

Edit User Profile (/Profile)

User edit profile form ( Name , email, phone, picture)

Favorites (/favorites)

Buttons ( favorites from blog, favorites from posts ) Listing corresponding to each button toggle

3.5.2 Report Formats/Sample Data

  1. Tables
  2. Itemized list

3.5.3 On­line Help Material (if applicable) farmbase.appslab.com/help 3.5.4 Error Conditions and System Messages All error messages will be outputted on a panel color red in order to catch the users attention.

Error conditions and system messages

	Condition 				Error

Entering a bad email address Invalid email address Entering wrong password Invalid credentials Posting empty data Value required

System messages Condition Message Post saved on database Post success User creates a new account Registration success New message Messages icon counter increments Deleting a post Deletion confirmation and success

3.5.4 Control Functions Un-authenticated user can view item listing, farm and communicate with the system users through messaging module User (seller) can: - Post, edit, delete and hide own posts. User (seller) can: - Edit own profile Extension officer cannot create an account. System admins create accounts for them. Extension officer can create, edit and delete post (advice). System admin can: - create, edit, delete, hide farmers(seller) post. System admin can :- create accounts for users.

4 SYSTEM PERFORMANCE REQUIREMENTS 4.1 Efficiency On a Pentium 4 dual core processor computer with 1 Giga Byte of RAM: The application’s heaviest page takes 14.9 seconds to load 5.3 Mega Bytes of data, and make 29 HTTP requests to the server on a good 3G network. DOM content is loaded in 2.6 seconds On a core i5 dual core processor computer with 4 Giga Bytes of RAM and two virtual cores: The application’s heaviest page takes 6.2 seconds to load 5.3 Mega Bytes of data and make 29 HTTP requests to the server on a good 3G network. DOM content is loaded in 0.8 seconds Using this data we found out that our application is slightly below Google’s performance metrics for web applications https://developers.google.com/web/fundamentals/performance/rail. This difference is mostly caused by the delicate balance between optimization of user uploaded images and keeping their quality. Compared to other similar applications such as https://www.mfarm.co.ke the application falls slightly below. On a Pentium 4 dual core processor with 1 Giga Byte of RAM The M-Farm application takes an average of about 4 seconds to load 5 Mega Bytes of data 4.2 Reliability The web application is reliable, that is it can be online for a long time without needing maintenance. However the site’s maintenance needs to be done manually, when this occurs user will be notified in advance just in case the site needs to be down for a period of time. Accuracy and Precision The web application is accurate in terms of associating users with their posts or availing to user’s data on the selected posts. The software is precise such that it serves the user with exactly what they are looking for in terms of search queries and page navigation. Consistency The web application has consistency in the user interface, feedback messages and also error handling. This consistency ensures users develop quick familiarity with the application so as to solve their problems more efficiently. Reproducibility The web application is consistent hence actions will almost always have the same result over and over again and exceptions are handled in the same way throughout the application that is by showing error messages on the user interface.

Acceptable Failure Rate The acceptable failure rate is about 30%. This is due to the fact that there’s limited hardware resources for hosting the web application and our lack of asynchronous running of tasks which might lead to failure of the system given a high enough traffic to our servers

4.3 Security Hardware security The hardware security is ensured by the hosting company. The user however will have to secure their own hardware while using the software. Software security The biggest threat to this application system is attacks against its software component. The software is protected against:

  1. Cross Site Request Forgery (CSRF) attacks by embedding a CSRF token along each HTTP request, therefore making it harder for attackers to perform successful attacks.
  2. SQL injection by using the version 5.9.* of PHP which protects the application against such an attack.

Data Security The data we collect from users will not be disclosed to third parties unless the law of the country compels us to do so. The users passwords are hashed which makes their accounts more secure. Execution Security Users have to be authenticated and verified before using the software system

4.4 Maintainability The system is maintainable because it is modularized and the module interfaces are well defined. The source code has a consistent coding style that would be easy to read and in turn debug or update. 4.5 Modifiability The system’s code base can be easily modified without breaking any of the core functionalities this because of the use of object oriented programming techniques. The user interface styling is modular therefore components can be swapped without much overhead. 4.6 Portability The system can run on any operating system since it is a web based application. It can run on most modern browsers. Older browsers are supported through fall back code.

SYSTEM DESIGN OVERVIEW The system has been designed to be easy to use hence the most important functions can generally be categorized into read function, create functions, delete functions and delete functions. 5.1 System Data Flow Diagrams post data diagram

5.2 System Architecture and Structure The software system is designed around simplicity. The system core functions are to read, update, delete and create records. The system also has a front end that serves to present organized data to users such as the farmer, consultants and the administrator. The structure of the application system is such that it include: Authentication subsystem Messaging subsystem Post listing subsystem Post favorite subsystem Administrator panel subsystem

5.3 System Data Dictionary ATTRIBUTE NAME REQUIRED ATTRIBUTE TYPE ADDITIONAL DESCRIPTION Name YES String/VAR CHAR User name Email YES VAR CHAR User email Phone YES VAR CHAR User phone number Location YES VAR CHAR/String User location Post title YES String/VAR CHAR Describes product Post description YES String/Long Text Describes product Post image NO Media Post image Post ID YES Integer/Look up Relates post with other entities Read status YES Boolean Marks a message/notification as read Message YES String/VAR CHAR/Long text Makes up the body of a notification message Password YES VAR CHAR User password Product Category YES String Used to categorize user posts Time stamp YES Time stamp Used to record time Favorite NO Boolean Used to mark a post as favorite

5.4 Description of System Operation (high level) The application run on a browser platform. The browser is the interface between the application and the operating system. The application enables one to place an advertisement online. To be able to associate the advertisements with users an authentication subsystem is in place to make sure that a user has the right permissions to advertisement posts. The application includes a database. This database stores entities such as user posts, user details, consultant details, user messages and notification. The application has a post listing module which is used to gather relevant posts and display them to the user. The administrator oversees most of the activities in the system operation.

5.5 Equipment Configuration (diagram and description) 5.6 Implementation Languages

  1. PHP, it is a server side language that is supported by most web hosting companies it is also easy to learn and implement.
  2. MySQL, it allows combination, extraction, manipulation and organization of data in the voters’ database. It is platform independent and therefore can be implemented and used across several such as Windows, Linux server and is compatible with various hardware mainframes. It is fast in performance, stable and provides business value at a low cost since it is open source.
  3. SQL, it is a database querying language that has been used to record, read, update and delete records from the database.
  4. J Query, it is a JavaScript library that makes DOM manipulation easier and convenient. It aim at reducing the code written to perform common tasks. This reduced our front end development time considerably.
  5. HTML, this is currently the core of the web world, it is a language used to makeup web page. It is the glue that holds everything together. Although HTML was used for the implementation of the software, it is highly compatible with extensible HTML (XHTML) which is designed to be a replacement of HTML made to handle data and is also portable between different browsers and platforms with little or no alterations in code
  6. CSS3, the user interface for the software has been styled using CSS. CSS3 is used because it is supported by most browsers.

5.7 Required Support Software.

  1. Apache, it is a server software without which the back-end of the software system will not work.

  2. Browsers, it is the platform upon which the web application will run.

  3. SYSTEM DATA STRUCTURE SPECIFICATION 6.1 User Input Specification 6.1.1 Identification of input data User Input includes the following data types: Personal Details Advertisement Post details User location details User contact details 6.1.2 Source of Input data Sources of input data include: Administrator Client input Google location data 6.1.3 Input Medium Input medium for the application will be personal computers’ and mobile devices’ keyboards, mice and screens. Input medium for Google location data will be Google location API. 6.1.4 Data format Different data types will have different formats Personal Details Email: emails have to match against a regular expression for email to be valid. Name: name will be a string and it will be required for account creation Phone Number: phone number has to be an integer to be valid Location Details Location: location will be a string and will use Google maps API format will be in JSON Advertisement Post details User ID: this is an integer foreign key that associates a user with the advertisement they have posted Title: it is a requirement for creation of the advertisement it has to be a string Description: it is a requirement for creation of the advertisement it has to be a string Image: it might be either png or jpeg format Authentication Details Password: they are required for authentication they might be either integer or string format; dependent on user preference. AJAX requests data AJAX requests will use JSON to pass data to the back-end PHP code.

6.2 User output specification 6.2.1 Identification of output data Output data will include: database query results Personal Details Advertisement Post details User location details User contact details 6.2.2 Output devices Output devices include: personal computer and mobile devices screens and monitors 6.2.3 Output format Output will include: Data tables Collection of images 6.2.4 Output interpretation Data tables will show the administrative user all posts on the site made by the generic user Data tables will show the generic user all post they have created and allow for them to delete, edit or hide their posts

6.3 System Data Base/File Structure Specification 6.3.1 Identification of Data Base/Files The database contains 10 tables as shown below.

TABLE

FUNCTION comment_posts It stores the comments associated with blog posts farmer_posts It stores the user advertisement posts message_fav It associates the blog posts with the user favorite mark message_posts It stores user notification messages and associates the message with the sender, recipient and the advertisement post product_fav It associates the product posts with the user favorite mark sent_messages It stores and associates user notification messages with the sender and recipient sent_messages_cons

tbl_admin It stores application administrator details tbl_consultants It stores consultant details tbl_farmers It stores the general user’s details

6.3.2 (Sub) systems accessing the Data Base (creating, updating, deleting and reading frequency) The subsystem accessing the database include: Authentication Subsystem This subsystem creates records and reads the database it however does not update nor delete records from the database. The frequency of the subsystem’s interaction is at most twice per session. User Account Configuration Subsystem This subsystem reads and updates the database the frequency of access is user dependent therefore hard to measure Post Display Subsystem This subsystem only reads from the database. The frequency of access for this will depend on number of users currently logged on to the application. Administrator Panel Subsystem This subsystem can read, write, update and delete from the database. The frequency of access to database is very high considering it takes data from other subsystem. Favorite subsystem It can read, create and update the records in database. Frequency of access is dependent on the users’ preferences and it is high. 6.3.3 Logical File Structure (record formats, file organization, access methods, rationale) The database is organized as shown below: TABLE RELATIONSHIP TABLES RELATED comment_posts One to Many farmer_posts message_fav Many to Many tbl_farmers, message_posts message_posts One to Many tbl_consultants product_fav Many to Many farmer_posts, tbl_farmers sent_messages One to Many tbl_farmers sent_messages_cons One to Many tbl_consultants tbl_consultants One to Many message_posts tbl_farmers One to Many farmer_posts,sent_messages

Record formats include: VAR CHAR – variable characters INT – integers BOOLEAN – true or false value LONGTEXT -for long posts TIME STAMP -for recording unique time

The application logic is modularized into classes while the user interface has been categorized under views for easier debugging and readability.

6.3.4 Physical File Structure The database is stored in remote server provided by a web hosting service provider. The application logic is under the sub-domain Farmbase in the domain venturezhub.com. 6.3.5 Data Base Management Subsystems Used (internal or external) The application uses MySql as its database management system, it also has a separate database configuration PHP file for handling database authentication. Database queries are employed as needed throughout the application. The phpmyadmin application is the GUI for our database management system.

7.1 post product module

7.1.1 Module functional specification Functioned performed This module displays farm products posted by seller to the interested consumer. It also displays information or comments posted by Agricultural Extension Officer about advices on the good farm produce. Module interface specification The input/output and arguments used are:

  1. Name of product- in this text field you insert the name of the product you want to post as a string
  2. Description of the product-the seller describes the produce he/she wants to post.
  3. Category of the product-the seller choses in which category does the farm produce fall in this can be i. Feeds Supplements and seeds. ii. Farm Machinery and tools. iii. Livestock Poultry And Fish iv. Farm Produce
  4. Location-in the text field you indicate the geographical place that you are in so as the buyers can know. Product image-the seller uploads the image so as it can appear at the home page for it to be viewed.

Module limitation.

  1. User is limited to the type of image he/she should approach. The image should be a png, jpeg format 7.1.2 Module Operation Specification. Locally Declared Data Specification The local data variables that have been declared in here is the category section and they include.

Algorithm Specification

Description of module operation. Use case1: Seller /Agricultural Extension Officer post data to be viewed. Main flow (seller/ Agricultural Extension Officer) i. The user starts the web application ii. User input data and hits submit button. iii. System sends data to Admin panel to be filtered. iv. Admin verifies post v. System sends verified post to the notification vi. stop vii. Alternative 3a:

  1. System notifies user post is rejected and redirects user to main flow 2 7.2 Messaging. 7.2.1 Module Functional Specification Function performed This module notifies the seller that there is an unread message for him in form of a notification The module displays the information in form of a text. Module Interface Specification The input/output and arguments used are:
  2. Full names: In here you provide your full names as you want them to appear on the recipient end.
  3. Email address: you provide your email address in case of further contact with the seller
  4. Phone no: the buyer inputs his phone number in case the seller wants to call him personally in regards to the product Message: the buyer inputs his information which is to be sent to the buyer about the product that has been posted. Module limitation.
  1. User is limited to the person who he/she is sending the message to.

7.22 Module Operation Specification Locally Declared Data Specification The locally declared variable is the messaging query where user inputs the message in form of text.
Algorithm Specification

Description of module operation. Use Case2: Consumer sends message to the seller who posted the produce ad. Main flow: (seller/buyer)

  1. User starts the web application.
  2. User writes the message on the text area.
  3. User hits the send button
  4. System sends the message to the desired person
  5. Stop

7.3 Search 7.3.1 Module Function Specification Function performed This module allows user to have easy time since the buyer can search the product by using the first name from the glyphicon search

Module Interface Specification The input/output and arguments used are: Glyphicon _search-the user is able to input his/her name product and can easily access the product since the system produce a variety of product which have the same letter as used in search button. Module limitation

  1. The search button only accommodates the products in the web application.
  2. The farm product can be so many hence finding the algorithm to suit all product can be difficult to implement 7.3.2. Module operation specification Locally declared data specification. The locally declared data is the search query where user searches for products from the the search button

Algorithm specification

Description of module operation. Case 3: Buyer searching for products on the web page. Main Flow (buyer)

  1. Buyer starts the application
  2. Buyer inputs name on the search button
  3. Buyers search is filtered by the system
  4. Buyers search is displayed
  5. Stop
  6. Alternative 3a:
  7. System displays nothing on the search button
  8. System redirects buyer to main flow

7.4 Register 7.4.1 Module Function Specification Function Performed The user is able to create an account so as he can access the services of the web application like posting, receiving notification etc. Module Interface Specification The input/output and arguments used are:

  1. Full names (var-char)-user inputs his/her full names that would appear in his account.
  2. Email(var-char)-user inputs his/her email in the correct format
  3. Phone number(int)-user input his/her phone number so as to be contacted whenever he/she post product on the application
  4. Password (var-char) - user inputs his/her secret password that he will use whenever he is accessing his account.
  5. Confirm password(var-char)-user repeats the password for security measures Limitation
  6. One must fill all fields before signing up.
  7. Agree to terms –user must check the check box before sign up.

7.4.2Module operation specification Locally declared data specification.

  1. Full names
  2. Email
  3. Phone number
  4. Password
  5. Confirm password

Algorithm Specification

Description of module operation. Case 4: user registry on the web page. Main flow (buyer, seller and agricultural extension officer)

  1. User starts the web application.
  2. User registers to the application.
  3. Users credentials are filtered by the system for security
  4. User is directed to his home page.
  5. Stop Alternative 3a:
  6. Users credentials are rejected and redacted 7.5 login 7.5.1 Module Function Specification Function Performed Allows user to have access into his own account so as to view the current products in the market, post his/her products and also receive notification. Module Interface Specification The input/output and arguments used are:
  7. Email (var-char)-user inputs his/her email in the correct format in the text field provided.
  8. Password (var-char)-user inputs his/her password that he used during registering so as to be redirected to his own home page. Limitation
  9. User can’t login with any other details he? She is limited to email and password

7.5.2 Module operation specification Locally declared data specification.

  1. Email
  2. password

Algorithm Specification

Case 5: user login Main flow (buyer, seller, agricultural extension officer)

  1. User launches the web application
  2. User inputs his login credentials
  3. System filters the credentials entered by the user
  4. User is directed to his home page
  5. stop

Alternative 3a:

  1. System rejects credentials and redirects to step 2.

7.6 logout Module Function Specification Function performed User is able to leave his own web page without leaving the page online and hence somebody else accessing the page. Module Interface Specification The input/output and arguments used are: On the users navigation bar there is a dropdown where when clicked user just signs out with a lot of ease. Limitation

  1. Once signed out you can’t access the page until you login again with the correct credentials.

7.6.2 Module Operation Specification Locally declared data specification There is no local declared variable

Algorithm specification

Case 7: user log out Main flow (buyer, seller and agricultural extension officer)

  1. Users launches the web application
  2. User clicks on the dropdown menu to on navbar to access the logout button
  3. User clicks the logout button
  4. System directs user to a default home page
  5. Stop

7.7 Favorite 7.7.1 Module Function Specification Function performed This module helps user to favorite am post ad that has been posted by the seller. It helps the seller to know how many people really have interested in their products. Module Interface Specification Input/output and arguments used are Favorite button –user is able to click the favorite button on the post to indicate he likes the button. The like button then changes its color. Module limitation

  1. The user can only favorite the post ad only once on a product. 7.7.2 Module operation specification Locally declared data specification The local declared variable is the favorite query

Algorithm specification

Case 7: user favorite Main flow (user)

  1. User launches the application
  2. User clicks on the favorite button
  3. System changes the color of the favorite button
  4. Seller is able to see his product has been favorite
  5. stop
  6. System Verification

8.1 Items/functions to be tested

  1. Post product module

  2. Messaging module

  3. Search module

  4. Register module

  5. Login module

  6. Logout module

  7. Favorite module 8.2 description of test cases For the modules in 8.1 above; we used different test case to verify that the modules were working correctly. Some of the test cases are:

  8. Functionality test case This test case was to ensures that our web application interfaces with the modules in 8.1 works correctly with the rest of the systems and the users

  9. User interface test case This test case verified that the graphical user interface (GUI) looks good and works correctly to the advantage of the user with no any hideous.

  10. Performance test case This test case validates the response time of each module and the overall effectiveness of the application to user that is after executing a task how long does it take for the system to respond

  11. Integration test cases This type of test was meant to evaluate how the modules above in 8.1 interact with each other. Its core function was to ensure that interface between the different modules are working properly.

  12. Security test case This test case was to ensure that our web application restricts actions and permissions where necessary. Authentication and encryption was our main focus in this test case. 8.3 justification of test cases

  13. Functionality test case-The reason why we used this test case is because it is efficient in in showing the errors that would occur in the interface of web application.

  14. User interface test case- the reason why we chose this test case was to ensure that our graphical user interface looks good and friendly to the user using the web application that they did not have any headache while using the system

  15. Performance test case-this was to verify that each module responded quickly to any task given. Since we have many modules we had to each and every module to ensure that user wasn’t stuck at one module for long before execution

  16. Integration test case-since each module has to work with another module we had to ensure that their interface worked correctly so as not be unambiguous to the user.

  17. Security test case-since security is very vital in any web application we had to ensure that our system is secured by using this kind of test since it enables us to focus more on authentication and encryption since they are the pillars to any web application system.

8.4 Test run procedures and result Test type Name of module objective result

Post produce module This module displays farm products posted by seller to the interested consumer Enhance easy communication between the buyer and the seller

Messaging module This module notifies the seller that there is unread message for him inform of a notification Helps the seller to know how his/her products are faring on the web application

Search module This module displays all products available when searched Makes it easy for buyer to look for products as quick as possible

Register module

User is able to create his personal account in the web application

User can access services of the web application like posting products, buying products and receiving notification

Login module

Allows user to have access into own account

User is able to view the current product in the market, post his/her products and receive notification

Logout module

User is able to leave the page without any difficulty

User is able to be redirected to the index page

Favorite module User is able to favorite a product that has been posted The favorite button changes the color when favorite.

8.5 discussion of test results

  1. Functionality test case-in this test case we tested our web application interface modules (post produce, messaging, search, login, logout, favorite and register) 10 times and out of these eight were successful hence deemed our project efficient.
  2. User interface test case-In these test case we tested the graphical user interface of each module sixteen times and out of these fourteen times were successful hence our web application was good.
  3. Performance test case-This test was to ensure that our web application responded as quickly as possible to request given. We tested each module eight times and the response time was first.
  4. Integration test case-this module was to ensure the different modules interface are interacting in a very responsive manner together. i.e. the login, logout and register do not jumble up we tested the integration fifteen times and it was all successful.
  5. Security test case-this test case was to ensure that our web application was free from attacks. We tested the authentication and encryption at least twenty five times in each modules and out of that twenty four was successful.

9 SUMMARY, RECOMMENDATIONS AND CONCLUSION. Introduction This chapter gives a summary and conclusion of the whole research project. It gives recommendation on achieving the ultimate efficient performance monitoring system and proposes areas for further improvements that future researchers may undertake.

9.1 Summary The main objective of the case study was to develop a web application system for monitoring farmers and agricultural extension officer that will replace the old method that was largely paper based which can get lost or wrongly filed making it so hard to monitor the local farmer. The online portal can also accommodate a larger number of people at ease than the paper work system. The portal will provide an interactive platform and instant results report. The specific objectives were to review the local farmer monitoring system with a view of specifying requirements. This survey employed an experimental research design methodology which was used to obtain the distribution of respondents. To undertake the primary data collection, a questionnaire was designed as a tool to guide in gathering data which was delivered electronically through mail to the local farmers selected in the country. The research had an excellent response rate of 88.7% as only four out of 25 delivered questionnaire was not returned. The background details of the research were that, the respondents were mostly farmers and agricultural extension officer. System Constraints 9.2 Incompatibility between software Online portal for monitoring the local farmer to the agricultural extension officer’ performance was developed as a web, application system it has limited the users of the system. This means that users who had no laptops or android phones were not able to access and enjoy its functionalities and this reduced the reach of the system to specific users. Time This refers to the actual time required to produce the desirable system. Which in this case would be the working prototype. Naturally, the amount of time required to produce the system will be directly related to the amount of requirements that are part of the scope. 9.3 Conclusion The study concludes that, with the development of a Portal to monitor the local farmer to the agricultural ’extension officer in Kenya to, better the agricultural produce will be greatly achieved as the parent can view, print and comments on the students’ academic results While there has been a rampant poor agricultural product country wide, adoption of technology to cap this problem will help in adopting the automated way of monitoring the local farmer produce in Kenya. This suggest that the development of future solutions should only occur with a thorough understanding of the local farmer and the agricultural ’extension officer ability to use automated platforms to achieve better results, an expanded research project related to this topic should be considered. Recommendation

The application to be integrated with a mobile application system which will vastly increase its benefit to farmers. The application to have more interactive features that will help the farmer benefit financially: offer credit functions to farmer. The application to be on separate domains The website to form cooperates that will increase the digital market portal the website application provides.

  1. BIBLIOGRAPHY

  2. Archer, P. Personalized Access to Cultural Heritage Space. Project, 2009)

  3. Bersoff, E. H. (1984).

  4. Goa, J. San Jose state University, 2002

  5. Larman, C. & Basili. V (Dr). History of Iterative and Incremental Model 1980

  6. M. Ridley, Requirement analysis and specification, 2006

  7. P. Graham, B. Nelson, and B. Hutchings, 2001

  8. Spriestersbach, A. Resource development and Management, 2011

  9. APPENDICES

  10. Appendix I: Budget Activity Cost (Kshs) Flash disk and laptop 60,000 Printing and typing 1,500 Photocopying 3,000 Modem and bundles 2,500 Binding 200 Anti virus 2,000 Stationary (notebook & pens) 500

Miscellaneous expenses 500 GRAND TOTAL Ksh. 70,200

  1. appendix ii: work plan WORK DONE
    SEP 2016 OCT 2016 NOV 2016 DEC 2016 JAN 2017 APRIL 2017 MAY 2017 JUNE 2017 Identification of research topic and supervisor

Proposal preparation

Proposal presentation

Correction of the proposal

Data collection

Data Analysis

System Defense

Report Submission

  1. Appendix III: Questionnaire Student section.
  2. Who are you? Farmer/seller of farm items Consumer Consultant
  3. Are you a computer literate? Yes No
  4. Have you heard of Farmbase Portal for monitoring farmers and their products system? Yes No
  5. In your own opinion, how do you recommend the efficiency of Online Portal for monitoring farmers’ products over the paper based-system? Excellent Very good Good Fair
  6. According to you, do you think Online Portal for monitoring farmers’ products will improve famers’ production results? Yes No Reason …………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………
  7. How do you likely recommend the development of the system? Very likely Likely Not likely 12 PROGRAM LISTINGS

Results page view

is_logged_in()) // { // $farmer_home->redirect('index.php'); // } if($farmer_home->is_logged_in()){ $stmt = $farmer_home->runQuery("SELECT * FROM tbl_farmers WHERE email=:email_id"); $stmt->execute(array(":email_id"=>$_SESSION['farmerSession'])); $row = $stmt->fetch(PDO::FETCH_ASSOC); if ($row['hidden']==1) { $farmer_home->logout(); $farmer_home->redirect('farmer_signin'); } if ($row['photo']=="") { $pic = ""; } } $farmer_home_post = new Database(); if($farmer_home_post->dbConnection()) { include_once 'class.post.php'; $paginate = new paginate(); } $admin_home = new CONSULTANT(); if($admin_home->is_logged_in()){ $stmt = $admin_home->runQuery("SELECT * FROM tbl_consultants WHERE email=:email_id"); $stmt->execute(array(":email_id"=>$_SESSION['consultantSession'])); $row = $stmt->fetch(PDO::FETCH_ASSOC); if ($row['photo']=="") { $pic = ""; } } ?>
	 <script async src="site.js"></script>

	 <link rel="manifest" href="manifest.json" />

	<title>Farmer | Home</title>

</head>
<body>
<section>
	<nav class="navbar navbar-default navbar-fixed-top">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="index">Farmers</a>
    </div>

    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav">
        <li class="active"><a href="index">Home</a></li>
        <li><a href="blog">Blog</a></li>
        <!-- <li><a href="#">Tenders</a></li> -->
        <li><a href="about">About Farmbase</a></li>
      </ul>
      	
      <ul class="nav navbar-nav navbar-right">

        
       <?php

if($farmer_home->is_logged_in()) { ?>

  •  Post Produce Ad
  •           	<?php
    				if(isset($pic)){
    					echo $pic;
    				} else { ?>									
    
    				<img class="img-circle " src="farmer_images/<?php echo $row['photo']; ?>"  style=" padding:0px;"  height=50px />
    			<?php
    			}?>
    		  <span class=""></span>&nbsp; <?php echo $row['name']; ?>&nbsp;<span class="caret"></span></a>
              <ul class="dropdown-menu">
            
                <li><a href="farmer_profile"><span class="glyphicon glyphicon-user"></span>&nbsp;Edit Profile</a></li>
                <li><a href="message_favs"><span class="glyphicon glyphicon-star"></span>&nbsp;Favourites</a></li>
                <li><a href="logout"><span class="glyphicon glyphicon-log-out"></span>&nbsp;Sign Out</a></li>
              </ul>
            </li><?php } ?>
         <?php if(!$farmer_home->is_logged_in() AND !$admin_home->is_logged_in() )  {
    ?>
    
            	<li><a href="farmer_signin" title="login">Login</a></li>           <?php }
     ?>
    
    is_logged_in() ) { ?>
    <li id="header_inbox" class="dropdown">
               <!-- messages in inbox here -->         
    
  •  Post Message
  •           	<?php
    				if(isset($pic)){
    					echo $pic;
    				} else { ?>									
    
    				<img class="img-circle " src="consultants/consult_images/<?php echo $row['photo']; ?>"  style=" padding:0px;"  height=50px />
    			<?php
    			}?>
    		  <span class=""></span>&nbsp; <?php echo $row['email']; ?>&nbsp;<span class="caret"></span></a>
              <ul class="dropdown-menu">
                
                <li><a href="consultants/consultant_profile"><span class="glyphicon glyphicon-user"></span>&nbsp;Edit Profile</a></li>
                <li><a href="consultants/logout"><span class="glyphicon glyphicon-log-out"></span>&nbsp;Sign Out</a></li>
              </ul>
            </li><?php } ?>
    
          </ul>
        </div><!--/.nav-collapse -->
    
      </div>
    </nav>
    <div class="clearfix"></div>
     <div class="col-lg-2 col-lg-offset-5">
    	<br style="margin: 20px;">
    </div>
    
    </section>
    <header>
    	  <section class="page1_header">
    		<div class="container">
    		  <div class="row">
    		 <div class="col-md-7 col-sm-7" id="info1">
    			<b> <h2>Farmers <br> Extension officers <br> The Market</h2>
    			 <p> FarmBase <small>reaching out to all farmers</small> </p></b>
    		</div>
    		<div class="col-md-5 col-sm-5" id="tab-panels">
    			<div class="col-md-6 col-sm-6 col-xs-6" id="we">
    			<b>  <a href="blog" class="banner "><div class="maxheight">
    				<i class="fa fa-globe"><br></i><p>Farm Blog</p></div>
    			  </a></b>
    			</div>
    			<div class="col-md-6 col-sm-6 col-xs-6" id="wa">
    			<b>  <a href="farmer_signup" class="banner "><div class="maxheight">
    				<i class="fa fa-gears"><br></i><p>Register</p></div>
    			  </a></b>
    			</div>
    			<div class="col-md-6 col-sm-6 col-xs-6" id="wa">
    			 <b> <a href="index" class="banner "><div class="maxheight1">
    				<i class="fa fa-lightbulb-o"><br></i><p>Farmer Products</p></div>
    			  </a></b>
    			</div>
    			<div class="col-md-6 col-sm-6 col-xs-6" id="we">
    			  <b> <a href="about" class="banner "><div class="maxheight1">
    				<i class="fa fa-briefcase"><br></i><p>About Us</p></div>
    			  </a></b>
    			</div>
    		</div>
    			
    		  </div>
    		</div>
    	  </section>
    	
     
    <div class="clearfix"></div>
    
               		<form action="" method="post">
    					<div class="__form-button">
                         	<button name="btn-search" class=" btn btn-success" type="submit"><i class="fa fa-search"></i></button>
    					</div>
    					<div class="__form-input1">
                        	 <input type="text" class="form-control" name="search" placeholder="Search Products " id="country_id" onkeyup="autocomplet()"  /> 
    					</div>
              		</form>          
    </div>
    	</div>
    
      <section>
      <div class="container" id="panel_post">
                  <ul  class="nav  nav-tabs " id="myTab">
                     <li  class="active"><a href="#feeds" data-toggle="tab">Feeds, Suppliments and Seeds</a></li>
                    <li><a href="#tools" data-toggle="tab">Farm Machinery and Tools</a></li>
                    <li><a href="#livestock" data-toggle="tab">Livestock, Poultry and Fish</a></li>
                    <li><a href="#farm" data-toggle="tab">Farm Produce</a></li>
                  </ul>
                  <!-- Tab panes -->
                  <div class="tab-content  clearfix col-md-12  ">
                    <div class="tab-pane fade in active" id="feeds">
      			  	 
      					
      	                   <?php 
      	                    $query = "SELECT * FROM farmer_posts WHERE cartegory = 'Feeds, Suppliments and Seeds' AND (hidden ='' OR hidden = 0) ORDER BY timer DESC";       
      	                    $records_per_page=12;
      	                    $newquery = $paginate->paging($query,$records_per_page);
      	                    $paginate->dataview($newquery);
      	                    ?>
      	                 <div class=" col-md-10 col-xs-12 col-md-offset-1">
      	                 	<ul class="pagination">
      	                    <?php
      	                    $paginate->paginglink($query,$records_per_page);        
      	                    ?>
      	                    </ul>
      	                 </div>
      	                   
      				
      					  
                    </div>
                    <div class="tab-pane fade in" id="tools">
      						
      					
      	                   <?php 
      	                    $query = "SELECT * FROM farmer_posts WHERE cartegory = 'Farm Machinery and Tools' AND (hidden ='' OR hidden = 0) ORDER BY timer DESC";       
      	                    $records_per_page=12;
      	                    $newquery = $paginate->paging($query,$records_per_page);
      	                    $paginate->dataview($newquery);
      	                    ?>
      	                 <div class=" col-md-10 col-xs-12 col-md-offset-1">
      	                 	<ul class="pagination">
      	                    <?php
      	                    $paginate->paginglink($query,$records_per_page);        
      	                    ?>
      	                    </ul>
      	                 </div>
      	                  
      					
                    </div>
                    <div class="tab-pane fade " id="livestock">
      					
      	                   <?php 
      	                    $query = "SELECT * FROM farmer_posts WHERE cartegory = 'Livestock, Poultry and Fish' AND (hidden ='' OR hidden = 0) ORDER BY timer DESC";       
      	                    $records_per_page=12;
      	                    $newquery = $paginate->paging($query,$records_per_page);
      	                    $paginate->dataview($newquery);
      	                    ?>
      	                 <div class=" col-md-10 col-xs-12 col-md-offset-1">
      	                 	<ul class="pagination">
      	                    <?php
      	                    $paginate->paginglink($query,$records_per_page);        
      	                    ?>
      	                    </ul>
      	                 </div>
      	                  
      				
                    </div>
                    <div class="tab-pane fade " id="farm">
      					
      	                   <?php 
      	                    $query = "SELECT * FROM farmer_posts WHERE cartegory = 'Farm Produce' AND (hidden ='' OR hidden = 0) ORDER BY timer DESC";       
      	                    $records_per_page=12;
      	                    $newquery = $paginate->paging($query,$records_per_page);
      	                    $paginate->dataview($newquery);
      	                    ?>
      	                 <div class=" col-md-10 col-xs-12 col-md-offset-1">
      	                 	<ul class="pagination">
      	                    <?php
      	                    $paginate->paginglink($query,$records_per_page);        
      	                    ?>
      	                    </ul>
      	                 </div>
      	                   
      
                    </div>
                    
                  </div>
              
          </div>
      </section>
      <div class="clearfix"></div>
      <section>
      		<div class="container" id="register">
      		  <div class="row">
      			<div class="col-lg-3 col-md-3 col-sm-3">
      			  <div class="single-footer-widget">
      				<div class="section-heading">
      				<h2 class="reg">Product Posts</h2>
      				<div class="line"></div>
      			  </div>           
      			  <p>These are farm produce posts which are made by farmers. In you are a farmer or is intersted in farm products, you can proceed to create an account with us in order to access more services in FarmBase. Farmers can be messaged directly regarding their posts.<br>
      
      			 <a href="farmer_signup">Create an account here.</a></p>
      			  </div>
      			</div>
      			<div class="col-lg-3 col-md-3 col-sm-3">
      			  <div class="single-footer-widget">
      				<div class="section-heading">
      				<h2 class="reg"><a href="farmer_signup" style="color: #4CAF50!important;"> How to Register</a></h2>
      				<div class="line"></div>
      			  </div>
      			  <ul class="footer-service">
      				<li><span class="fa fa-check"></span>Enter your Personal Details</li>
      				<li><span class="fa fa-check"></span>Enter default password</li>
      				<li><span class="fa fa-check"></span>Read the Terms and Conditions</li>
      				<li><span class="fa fa-check"></span>Accept to the terms of condition</li>
      				<li><span class="fa fa-check"></span>Enjoy our services</li>
      			  </ul>
      			  </div>
      			</div>
      			<div class="col-lg-3 col-md-3 col-sm-3">
      			  <div class="single-footer-widget">
      				<div class="section-heading">
      				<h2 class="reg">Tags</h2>
      				<div class="line"></div>
      			  </div>
      				<ul class="tag-nav">
      				  <li><a href="index">Posts</a></li>
      				  <li><a href="farmer_signin">Login</a></li>
      				  <li><a href="blog">The Blog</a></li>
      				  <li><a href="about">About Us</a></li>
      				  <li><a href="farmer_signup" >Register </a></li>
      				  <li><a href="farmer_post">Create Posts</a></li>
      				 
      				</ul>
      			  </div>
      			</div>
      			<div class="col-lg-3 col-md-3 col-sm-3">
      			  <div class="single-footer-widget">
      				<div class="section-heading">
      				<h2 class="reg">Contact Info</h2>
      				<div class="line"></div>
      			  </div>
      			  <p>For more information about us you can get in touch with us.</p>
      			  <address class="contact-info">
      				<p><span class="fa fa-home"></span>P.O Box, 
      				30784-00100, Nairobi</p>
      				<p><span class="fa fa-phone"></span>+254728700535,+254716590576</p>
      				<p><span class="fa fa-envelope"></span>info@farmbase.co.ke</p>
      			  </address>
      			  </div>
      			</div>
      		 </div>
      		</div>
      	</section>	
      <div class="clearfix"></div>
      <?php 
      
      //footer
      include 'footer.php';
      
      ?>
      </body>
       <script type="text/javascript" src="js/jquery2.js"></script>
      <script type="text/javascript" src="js/notifications.js"> </script>
      	<script type="text/javascript" src="js/bootstrap.min.js"></script>
      	<!-- <script type="text/javascript" src="js/main.js"></script> -->
      	<script type="text/javascript" src="js/jquery.validate.min.js" ></script>
      	<script type="text/javascript" src="js/validation.min.js"></script>
      	<script type="text/javascript" src="js/register.js"></script>
      	 <script type="text/javascript" src="js/script.js"></script>
      

      Notification module

      	                   <?php 
      	                    $query = "SELECT * FROM farmer_posts WHERE cartegory = 'Feeds, Suppliments and Seeds' AND (hidden ='' OR hidden = 0) ORDER BY timer DESC";       
      	                    $records_per_page=12;
      	                    $newquery = $paginate->paging($query,$records_per_page);
      	                    $paginate->dataview($newquery);
      	                    ?>
      	                 <div class=" col-md-10 col-xs-12 col-md-offset-1">
      	                 	<ul class="pagination">
      	                    <?php
      	                    $paginate->paginglink($query,$records_per_page);        
      	                    ?>
      	                    </ul>
      	                 </div>
                    </div>
                    <div class="tab-pane fade in" id="tools">
      	                 <?php 
      	                    $query = "SELECT * FROM farmer_posts WHERE cartegory = 'Farm Machinery and Tools' AND (hidden ='' OR hidden = 0) ORDER BY timer DESC";       
      	                    $records_per_page=12;
      	                    $newquery = $paginate->paging($query,$records_per_page);
      	                    $paginate->dataview($newquery);
      	                    ?>
      	                 <div class=" col-md-10 col-xs-12 col-md-offset-1">
      	                 	<ul class="pagination">
      	                    <?php
      	                    $paginate->paginglink($query,$records_per_page);        
      	                    ?>
      	                    </ul>
      	                 </div>
                    </div>
                    <div class="tab-pane fade " id="livestock">
      
      	                   <?php 
      	                    $query = "SELECT * FROM farmer_posts WHERE cartegory = 'Livestock, Poultry and Fish' AND (hidden ='' OR hidden = 0) ORDER BY timer DESC";       
      	                    $records_per_page=12;
      	                    $newquery = $paginate->paging($query,$records_per_page);
      	                    $paginate->dataview($newquery);
      	                    ?>
      	                 <div class=" col-md-10 col-xs-12 col-md-offset-1">
      	                 	<ul class="pagination">
      	                    <?php
      	                    $paginate->paginglink($query,$records_per_page);        
      	                    ?>
      	                    </ul>
      	                 </div>
      
                    </div>
                    <div class="tab-pane fade " id="farm">
      
      	                   <?php 
      	                    $query = "SELECT * FROM farmer_posts WHERE cartegory = 'Farm Produce' AND (hidden ='' OR hidden = 0) ORDER BY timer DESC";       
      	                    $records_per_page=12;
      	                    $newquery = $paginate->paging($query,$records_per_page);
      	                    $paginate->dataview($newquery);
      	                    ?>
      	                 <div class=" col-md-10 col-xs-12 col-md-offset-1">
      	                 	<ul class="pagination">
      	                    <?php
      	                    $paginate->paginglink($query,$records_per_page);         ?>
      	                    </ul>             </div>
                    </div>
                  </div>  </div>
      </section>
      

      Register Module

      Product Posts

      These are farm produce posts which are made by farmers. In you are a farmer or is intersted in farm products, you can proceed to create an account with us in order to access more services in FarmBase. Farmers can be messaged directly regarding their posts.

      			 <a href="farmer_signup">Create an account here.</a></p>
      			  </div>
      			</div>
      			<div class="col-lg-3 col-md-3 col-sm-3">
      			  <div class="single-footer-widget">
      				<div class="section-heading">
      				<h2 class="reg"><a href="farmer_signup" style="color: #4CAF50!important;"> How to Register</a></h2>
      				<div class="line"></div>
      			  </div>
      			  <ul class="footer-service">
      				<li><span class="fa fa-check"></span>Enter your Personal Details</li>
      				<li><span class="fa fa-check"></span>Enter default password</li>
      				<li><span class="fa fa-check"></span>Read the Terms and Conditions</li>
      				<li><span class="fa fa-check"></span>Accept to the terms of condition</li>
      				<li><span class="fa fa-check"></span>Enjoy our services</li>
      			  </ul>
      			  </div>
      			</div>
      			<div class="col-lg-3 col-md-3 col-sm-3">
      			  <div class="single-footer-widget">
      				<div class="section-heading">
      				<h2 class="reg">Tags</h2>
      				<div class="line"></div>
      			  </div>
      				<ul class="tag-nav">
      				  <li><a href="index">Posts</a></li>
      				  <li><a href="farmer_signin">Login</a></li>
      				  <li><a href="blog">The Blog</a></li>
      				  <li><a href="about">About Us</a></li>
      				  <li><a href="farmer_signup" >Register </a></li>
      				  <li><a href="farmer_post">Create Posts</a></li>
      
      				</ul>
      			  </div>
      			</div>
      			<div class="col-lg-3 col-md-3 col-sm-3">
      			  <div class="single-footer-widget">
      				<div class="section-heading">
      				<h2 class="reg">Contact Info</h2>
      				<div class="line"></div>
      			  </div>
      			  <p>For more information about us you can get in touch with us.</p>
      			  <address class="contact-info">
      				<p><span class="fa fa-home"></span>P.O Box, 
      				30784-00100, Nairobi</p>
      				<p><span class="fa fa-phone"></span>+254728700535,+254716590576</p>
      				<p><span class="fa fa-envelope"></span>info@farmbase.co.ke</p>
      			  </address>
      			  </div>
      			</div>
      		 </div>
      		</div>
      	</section>	
      

      Search module

      = $min_length){ // if query length is more or equal minimum length then $query = htmlspecialchars($query); // changes characters used in html to their equivalents, for example: < to > $raw_results = $farmer_search->runQuery( "SELECT * FROM farmer_posts WHERE (`title` LIKE '%$query%') OR (`price` LIKE '%$query%') OR (`description` LIKE '%$query%') OR(`cartegory` LIKE '%$query%') OR(`phone` LIKE '%$query%') OR(`email` LIKE '%$query%') OR(`location` LIKE '%$query%') LIMIT $position, $item_per_page") ; $raw_results->bindValue(1, "%$query%", PDO::PARAM_STR); $raw_results->execute(); ?>
      Showing results related to ;

      "'.$query.'"

      ';?> rowCount() > 0){ // if one or more rows are returned do following
              while($results=$raw_results->fetch(PDO::FETCH_ASSOC)){
                
              // $results = mysql_fetch_array($raw_results) puts data from database into array, while it's valid it does the loop
                echo'<div class="panel panel-default">
      
      '.str_replace($query, ''.$query.'', $results['cartegory']).'
      Price:'.str_replace($query, ''.$query.'', $results['price']).'
      Location: '.str_replace($query, ''.$query.'', $results['location']).'
      Read More...

      '.str_replace($query, ''.$query.'', $results['email']).' | '.str_replace($query, ''.$query.'', $results['phone']).'

      ';

      } } else{ // if there is no matching rows do following echo 'No results Found for the search term "'.$query.'"

      possible suggestions

      • Try being specific
      • Be as precice as possible
      • Try searching for products category
      • No such products exists in our site currently
      '; }
      }
      else{ // if query length is less than minimum
          echo '<p>Minimum search term length is '.$min_length.' characters,please try again.</p>';
      }
      

      ?>

      Login Module

             <?php
      

      if($farmer_home->is_logged_in()) { ?>

    •  Post Produce Ad
    •           	<?php
      				if(isset($pic)){
      					echo $pic;
      				} else { ?>									
      
      				<img class="img-circle " src="farmer_images/<?php echo $row['photo']; ?>"  style=" padding:0px;"  height=50px />
      			<?php
      			}?>
      		  <span class=""></span>&nbsp; <?php echo $row['name']; ?>&nbsp;<span class="caret"></span></a>
                <ul class="dropdown-menu">
      
                  <li><a href="farmer_profile"><span class="glyphicon glyphicon-user"></span>&nbsp;Edit Profile</a></li>
                  <li><a href="message_favs"><span class="glyphicon glyphicon-star"></span>&nbsp;Favourites</a></li>
                  <li><a href="logout"><span class="glyphicon glyphicon-log-out"></span>&nbsp;Sign Out</a></li>
                </ul>
              </li><?php } ?>
           <?php if(!$farmer_home->is_logged_in() AND !$admin_home->is_logged_in() )  {
      ?>
      
              	<li><a href="farmer_signin" title="login">Login</a></li>           <?php }
       ?>
      
      is_logged_in() ) { ?>
      <li id="header_inbox" class="dropdown">
                 <!-- messages in inbox here -->         
      
    •  Post Message
    •           	<?php
      				if(isset($pic)){
      					echo $pic;
      				} else { ?>									
      
      				<img class="img-circle " src="consultants/consult_images/<?php echo $row['photo']; ?>"  style=" padding:0px;"  height=50px />
      			<?php
      			}?>
      		  <span class=""></span>&nbsp; <?php echo $row['email']; ?>&nbsp;<span class="caret"></span></a>
                <ul class="dropdown-menu">
      
                  <li><a href="consultants/consultant_profile"><span class="glyphicon glyphicon-user"></span>&nbsp;Edit Profile</a></li>
                  <li><a href="consultants/logout"><span class="glyphicon glyphicon-log-out"></span>&nbsp;Sign Out</a></li>
                </ul>
              </li><?php } ?>
      
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </nav>
      

      Logout Module

      is_logged_in()) { $farmer->redirect('index'); } if($farmer->is_logged_in()!="") { $farmer->logout(); if(isset($_SESSION['redirect_url'])){ $redirect_url = (isset($_SESSION['redirect_url'])) ? $_SESSION['redirect_url'] : '/'; unset($_SESSION['redirect_url']); header("Location: $redirect_url", true, 303); } else { $farmer->redirect('index'); } } ?>

      Messaging Module

      is_logged_in()){ $stmt = $farmer_home->runQuery("SELECT * FROM tbl_farmers WHERE email=:email_id"); $stmt->execute(array(":email_id"=>$_SESSION['farmerSession'])); $row = $stmt->fetch(PDO::FETCH_ASSOC); } $admin_home = new CONSULTANT(); if($admin_home->is_logged_in()){ $stmt = $admin_home->runQuery("SELECT * FROM tbl_consultants WHERE email=:email_id"); $stmt->execute(array(":email_id"=>$_SESSION['consultantSession'])); $row = $stmt->fetch(PDO::FETCH_ASSOC); } $name = $row['name']; $stmt = $farmer_home->runQuery("SELECT * FROM sent_messages WHERE receiverEmail=:email_id AND status = 'unread' ORDER BY ID DESC LIMIT 0,10"); $stmt->execute(array(":email_id"=> $name)); ?>
                               <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                             Notifications <i class="fa fa-envelope-o"></i>
                                  <span class="badge bg-theme"><?php echo $stmt->rowCount(); ?></span>
                              </a>
                              <ul class="dropdown-menu extended inbox" >
      
                      <?php  if ($stmt->rowCount() > 0) {
                               while($note = $stmt->fetch(PDO::FETCH_ASSOC)) {?>
                                  <li>
                                  <a href="farmer_inbox_view.php?message=<?php echo $note['ID']; ?>">
                          <?php
                              $stmt1 = $admin_home->runQuery("SELECT * FROM tbl_consultants WHERE name=:email_id AND photo!=''");
                              $stmt1->execute(array(":email_id"=>$note['name']));
                              if ($stmt1->rowCount() > 0) {
                                  $rower = $stmt1->fetch(PDO::FETCH_ASSOC);?>
                                  <span class="photo"><img class=" img-circle" alt="avatar" src="consultants/consult_images/<?php echo $rower['photo']; ?>" height="30px"></span>
                         <?php     } else {
                              $stmt1 = $admin_home->runQuery("SELECT * FROM tbl_farmers WHERE name=:email_id AND photo!=''");
                              $stmt1->execute(array(":email_id"=>$note['name']));
                              if ($stmt1->rowCount() > 0) {
                                  $rower = $stmt1->fetch(PDO::FETCH_ASSOC);?>
                                  <span class="photo"><img class=" img-circle" alt="avatar" src="farmer_images/<?php echo $rower['photo']; ?>" height="30px"></span>
                        <?php } else { ?>
                                  <span class="photo"><img class=" img-circle" alt="avatar" src="img/user.png" height="30px"></span>
                        <?php }
                          } ?>
                                      <span class="subject">
                                      <span class="from"><?php echo $note['name']; ?></span>
                                      <span class="time"><?php 
                                                date_default_timezone_set('Africa/Nairobi'); 
                                              $timed = $note['timer'];
      
                                             $timestamp = strtotime($timed);  
      
                                             $strTime = array("second", "minute", "hour", "day", "month", "year");
                                             $length = array("60","60","24","30","12","10");
      
                                             $currentTime = time();
                                             if($currentTime >= $timestamp) {
                                                  $diff     = time()- $timestamp;
                                                  for($i = 0; $diff >= $length[$i] && $i < count($length)-1; $i++) {
                                                  $diff = $diff / $length[$i];
                                                  }
                                                  $diff = round($diff);
                                                  echo $diff . " " . $strTime[$i] . "(s) ago ";
                                             } ?></span>
                                      </span>
                                      <span class="message">
                                          <?php
                                              $position = 100;
                                              $messo = $note['message'];
                                              $poster = substr($messo,0,$position);
                                              echo $poster;
                                              echo "..."; 
                                           ?>
                                      </span>
                                  </a>
                                  </li>
                      <?php } ?>
                                  <li>
                                      <a href="farmer_inbox">See all messages</a>
                                  </li>
      
                      <?php } else {?>
                                  <li>
                                     <span>No new Messages ...</span>
                                  </li>
                                  <li>
                                      <a href="farmer_inbox">See all messages</a>
                                  </li>
                      <?php } ?>
                              </ul>
      

      Favorite Module

      is_logged_in()) // { // $farmer_home->redirect('index.php'); // } if($farmer_home->is_logged_in()){ $stmt = $farmer_home->runQuery("SELECT * FROM tbl_farmers WHERE email=:email_id"); $stmt->execute(array(":email_id"=>$_SESSION['farmerSession'])); $row = $stmt->fetch(PDO::FETCH_ASSOC); } $admin_home = new CONSULTANT(); if($admin_home->is_logged_in()){ $stmt = $admin_home->runQuery("SELECT * FROM tbl_consultants WHERE email=:email_id"); $stmt->execute(array(":email_id"=>$_SESSION['consultantSession'])); $row = $stmt->fetch(PDO::FETCH_ASSOC); } //if (isset($_POST['btn-fav'])) { $fav_mess = trim($_POST['id']); $email = $row['email'] ; $favourite = 1; $fav_no = 0; $stmt = $farmer_home->runQuery("SELECT * FROM message_fav WHERE postID=:email_id AND email='$row[email]'"); $stmt->execute(array(":email_id"=>$fav_mess)); $list = $stmt->fetch(PDO::FETCH_ASSOC); if($stmt->rowCount()==0){ $farmer_home->message_fav($fav_mess,$email,$favourite); echo "fav"; } else { if ($list['favourite']==1) { $farmer_home->message_favno($fav_mess,$email,$fav_no); echo "dis"; } else { $farmer_home->message_favno($fav_mess,$email,$favourite); echo "fav"; } } //} ?>
      1. USER MANUAL
      2. Log on to www.farmbase.appslab.co.ke
      3. Register for an account
      4. Follow the various prompts to post, delete and update your posts.