<!doctype html>
<html lang="en">

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);

require_once __DIR__ . '/../config/database.php';
require_once __DIR__ . '/../lib/auth.php';

if (session_status() === PHP_SESSION_NONE) {
    session_start();
}

requireLogin();

$pageTitle = 'Pesticide';
$siteName  = 'Crop Monitor';
$userId    = getCurrentUserId();

include __DIR__ . '/../layouts/header.php';
include __DIR__ . '/../layouts/navbar.php';
?>
    
	
        
        
    <div class="col-md-6 form-group">

        <div class="row">
            
            <div class="col-md-4 form-group">
                <label class="form-top">Product Concentration</label>
                <input class="form-control" type="number" name="concentration" id="concentration" placeholder="concentration">
            </div>
    
            <div class="col-md-2 form-group">
                <label class="form-top">Unit of Rate</label>
                <div class="input-group">
                    <select class="form-control" id="concentration_unit" name="concentration_unit">
                        <option value="1">kg/ha</option>
                        <option value="2">l/ha</option>
                        <option value="3">dl/ha</option>
                        <option value="4">dag/ha</option>
                        <option value="5">cl/ha</option>
                        <option value="6">g/ha</option>
                        <option value="7">ml/ha</option>
                        <option value="8">%</option>
                    </select>
                </div>
            </div>

            <div class="col-md-4 form-group">
                <label class="form-top">Water amount</label>
                <input type="number" name="water" id="water" class="form-control" placeholder="water amount" value="400">
            </div>
            
            <div class="col-md-2 form-group">
                <label class="form-top">Rate</label>
                <select class="form-control" id="water_unit" name="quantity_unit">
                    <option value="1">l/ha</option>
                </select>
            </div>
        </div>
        
        <div class="row">
            <div class="col-md-10 form-group">
                <label class="form-top">Terrain</label>
                <input type="number" name="terrain_size" id="terrain_size" class="form-control" placeholder="terrain size">
            </div>
            
            <div class="col-md-2 form-group">
                <label class="form-top">Area</label>
                <select class="form-control" id="terrain_unit" name="terrain_unit">
                    <option value="1">ha</option>
                    <option value="2">a</option>
                    <option value="3">m2</option>
                </select>
            </div>
        </div>
    
        <div class="row">
            <div class="col-md-12">
                <p class="text-center" id="text">You can also calculate how much of plant protector you need per each sprayer</p>
            </div>
        </div>
        
        <div class="row">
            <div class="col-md-10 form-group">
                <label class="form-top">Sprayer / Applicator</label>
                <input type="number" name="sprayer" id="sprayer" class="form-control" placeholder="sprayer capacity">
            </div>
            
            <div class="col-md-2 form-group">
                <label class="form-top">Rate</label>
                <select class="form-control" id="sprayer_unit" name="sprayer_unit">
                    <option value="1">l</option>
                </select>
            </div>
        </div>
        
        <div class="row">
            <div class="col-md-12">
            <input type="button" class="btn btn-success" role="button" id="calc_button" onclick="javascript:getQuantity()" value="Calculate">
            </div>
        </div>
    
    </div>
    
    <div class="col-md-6 form-group">
        
        <div class="row">
            <div class="col-md-12">
                <h5 id="result-sprayer-text"></h4>
                <h4 id="result-sprayer"></h3>
                <h5 id="result-text"></h4>
                <h4 id="result"></h3>
            </div>
        </div>
        
    </div>
</div>

<!-- Custom Theme JavaScript -->
<script src="/client-assets/js/pesticide.js"></script>

					</div>

				</div>

			</main>
			
<?php include __DIR__ . '/../layouts/footer.php'; ?>
</div>
</div>