<?php
   include('session.php');
   include('header1.php');
   include('ietpartial.php');

// start role specific 
$user_role = $_SESSION['role'];

if ($_SERVER["REQUEST_METHOD"] == "GET") {

  $companyid = $_GET['companyID'];

  if(isset($_GET['updated'])) {

    $updated = $_GET['updated'];

  }

  $sqlGetCompany = "SELECT * FROM companyfile WHERE companyid = $companyid";

  $resultCompany = mysqli_query($db,$sqlGetCompany);

  $countCompany = mysqli_num_rows($resultCompany);

  echo "<main role=\"main\" class=\"col-md-9 ml-sm-auto col-lg-10 px-4\">";

  echo "<div class=\"d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom\">";

  if ($countCompany !== 0) { 

  	while ($rowcompany = mysqli_fetch_array($resultCompany)) {

    	echo "<h1 class=\"h2\">" . $rowcompany['companyName'] . "</h1>";
      echo "<a href=\"companysettings.php\" class=\"btn btn-sm btn-outline-secondary\" role=\"button\">Back to Company Settings</a>";
    
    	echo "</div>";

    	echo "<form method = \"POST\" action=\"addCompanyValue1.php\">";

    	echo "<input type = \"hidden\" value = \"" . $rowcompany['companyid'] . "\" name = \"company_id\">";

          echo "<p>Value Type*
                <select name=\"value_type\" id=\"valuetypes\" required class=\"form-control\">
                  <option disabled selected value> -- Select Type -- </option>
                  <option value=\"PRGF\">PRGF</option>


                </select>
              </p>";

              echo "<p>Value*
              <input type=\"numeric\" name=\"value\" required class=\"form-control\"> 
            </p>";

          echo "<p>Effective Start Date*
                <input type=\"date\" name=\"effective_start_date\" required class=\"form-control\"> 
              </p>";

              echo "<p>Effective End Date*
                <input type=\"date\" name=\"effective_end_date\" required value = \"2999-12-31\" class=\"form-control\"> 
              </p>";

    }

    echo "<input type=\"submit\"> </form>";

   }

} 


include('footer1.php');
?>