<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<style>
  body{

    background-image:url('image/7.jpg');
    background-size: cover;

  }


.show {
  display: block;
}
.tree{
  text-shadow: 2px 2px 5px black,
               2px 2px 10px black,
               2px 2px 15px black,
               2px 2px 20px black;

} 
.header{
  text-align: center;
  color: white;

}
.ms-auto li{
  padding: 10px;
  color: white;
}
nav
{
  background-color: chocolate;
  color: white;
  height: 55px;
}
#two{
 margin: auto;
  width: 70%;
  height: 360px;
  border: 3px solid green;
  padding: 10px;
   margin-top: 50px;
   line-height: 1.5;
   text-align: center;
   background-color: #ffffffbf;
   border-radius: 20px;
}

</style>

</head>
<body>
<nav class="navbar navbar-expand-lg ">
  
    
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" >
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarNavDropdown">
      <h1 style="margin-left: 600px">Tree Doc</h1>
      <ul class="navbar-nav ms-auto" style="padding: 5px; color:white;">
        <li class="nav-item">
          <a class="nav-link active" style="color: white" aria-current="page" href="#">Home</a>
        </li>
        
        <li class="nav-item dropdown">
          <a  style="color: white" class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-bs-toggle="dropdown" aria-expanded="false">
            Types Of Trees
          </a>
          <ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
            <li><a class="dropdown-item" href="Tree1">Teak Tree</a></li>
            <li><a class="dropdown-item" href="Tree2">Coconut Tree</a></li>
            <li><a class="dropdown-item" href="Tree3">papaya Tree</a></li>
            <li><a class="dropdown-item" href="Tree4">Sandel Wood Tree</a></li>
            <li><a class="dropdown-item" href="Tree5">Tree Cut Down</a></li>
          </ul>
        </li>
      </ul>
    </div>
  </div>
</nav>
<div class="col-lg-12 col-md-12 col-12">
  

  <!-- <p style="color:white;text-align: center;margin-left: 500px;">Health Percentage<input type=text  id="demo" size="5"></p>
 -->

<div id="two">
<form  action="Home"  method=post>

 <b >Health Percentage</b><input type=text name="percentage" id="demo" size="3">

   <div class="row">
      <div class="col-lg-8 col-md-8 col-6 text-center center-block d-block mx-auto">
        <p><b>Tree Name</b></p>
      </div>
      <div class="col-lg-4 col-md-4 col-4">
        <input type="text" name=treename class="" required>
      </div>
    </div>

     <!-- <div class="row">
      <div class="col-lg-8 col-md-8 col-6 text-center center-block d-block mx-auto">
        <p><b>Tree Health</b></p>
      </div>
      <div class="col-lg-4 col-md-4 col-4">
        <input type="text" class="" id="demo">
      </div>
    </div> -->


    <div class="row">
      <div class="col-lg-8 col-md-8 col-6 text-center center-block d-block mx-auto">
        <p><b>Nutrients</b></p>
      </div>
      <div class="col-lg-4 col-md-4 col-4">
        <input type="text" class="" name="nutrients" onKeyUp="myFunction(this)" id="demo1" required>
      </div>
    </div>

    <div class="row">
      <div class="col-lg-8 col-md-8 col-6 text-center center-block d-block mx-auto">
        <p><b>Sunlight</b></p>
      </div>
      <div class="col-lg-4 col-md-4 col-4">
        <input type="text" class="" name="sunlight" onKeyUp="myFunction(this)" id="demo2" required>
      </div>
    </div>

    <div class="row">
      <div class="col-lg-8 col-md-8 col-6 text-center center-block d-block mx-auto">
        <p><b>Water</b></p>
      </div>
      <div class="col-lg-4 col-md-4 col-4">
        <input type="text" class="" name="water" onKeyUp="myFunction(this)" id="demo3" required>
      </div>
    </div>

    <div class="row">
      <div class="col-lg-8 col-md-8 col-6 text-center center-block d-block mx-auto">
        <p><b>Air</b></p>
      </div>
      <div class="col-lg-4 col-md-4 col-4">
        <input type="text" class="" name="air" onKeyUp="myFunction(this)" id="demo4" required>
      </div>
    </div>

    <div class="row">
      <div class="col-lg-8 col-md-8 col-6 text-center center-block d-block mx-auto">
        <p><b>Temprature</b></p>
      </div>
      <div class="col-lg-4 col-md-4 col-4">
        <input type="text" class="" name="temprature" onKeyUp="myFunction(this)" id="demo5" required>
      </div>
    </div>

    <div class="row">
      <div class="col-lg-8 col-md-8 col-6 text-center center-block d-block mx-auto">
        <p><b>Space</b></p>
      </div>
      <div class="col-lg-4 col-md-4 col-4">
        <input type="text" class="" name="space" onKeyUp="myFunction(this)" id="demo6" required>
      </div>
    </div>

    <div class="row">
      <div class="col-lg-8 col-md-8 col-6 text-center center-block d-block mx-auto">
        <p><b>Humidity</b></p>
      </div>
      <div class="col-lg-4 col-md-4 col-4">
        <input type="text" class="" name="humidity" onKeyUp="myFunction(this)" id="demo7" required>
      </div>
    </div>

   <input type="submit" class="btn btn-success" name="submit" onclick="return treestatus()" value="Submit">
</form>
</div>




<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js" integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>

<script>
function myFunction(element) {
  var a =  parseInt(document.getElementById("demo1").value);
  var b =  parseInt(document.getElementById("demo2").value);
  var c =  parseInt(document.getElementById("demo3").value);
  var d =  parseInt(document.getElementById("demo4").value);
  var e =  parseInt(document.getElementById("demo5").value);
  var f =  parseInt(document.getElementById("demo6").value);
  var g =  parseInt(document.getElementById("demo7").value);

  var x = (a + b + c + d + e + f + g) / 7 ;
  document.getElementById("demo").value = x;
};
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script type="text/javascript">
  function treestatus(){
    var status = $.trim($("#demo").val());
    if (status<=20) {
      alert("Tree Is Cut Down");
    }else if(status>=50){
      alert('Tree is Healthy');
    }else if(status>=21&&status<=49){
      alert('Tree Is Unhealthy');
    }
  }
</script>
</body>
</html>
