<?php
   include('session.php');
   include('connect.php');
   include('logging.php');

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

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

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

    $valueid = mysqli_real_escape_string($db,$_GET['valueid']);

    $sqlDeleteCompanyValue = "
    DELETE FROM
    valuesbycompany
    WHERE valueid = $valueid;";

      if(mysqli_query($db, $sqlDeleteCompanyValue)) {

      $positionUpdate = "User deleted Company Value ";

      logEvent($db,"Company Value Deleted",$positionUpdate,$last_id);
      
      header("location: companysettings.php");

      } else {
         echo "Error: " . mysqli_error($db);
    }

    } else {
    echo "Value not selected!!!";
   }
 
}

?>