<?php
include "connect.php";

if(isset($_POST['employeefileno'])){
   $employeefileno = $_POST['employeefileno'];
   $companyid = $_POST['companyid'];

   $query = "select count(*) as cntUser from employees where employeefileno='".$employeefileno."' and companyid='".$companyid."'";

   $result = mysqli_query($db,$query);
   
   if(mysqli_num_rows($result)){
      $row = mysqli_fetch_array($result);

      $count = $row['cntUser'];
    
      if($count == 0){
          //$response = "<input type=\"button\" name=\"save\" class=\"btn btn-primary\" value=\"Add User\" id=\"butsaveNU\">";
         $response = "OK";
      } else {
         //$response = "<span style='color: red;'>User already exists!</span>";
         $response = "KO";
      }
   
   }

   echo $response;
   die;
}