<?php 
 include("dbConfig.php");
 
  $lang = $_POST["lang"];
 include("../languege_filee_hr.php");

 $company_id_sel = $_POST["company_id_sel"];
 if($lang=="ar"){ $notfound="لا يوجد";}else{ $notfound="not found";}
 ?>

  <option value=""> <?php echo $select.$space.$dept; ?></option>
 <?php
$sql = "SELECT * FROM dept_tb where company_id!='0' AND company_id='".$company_id_sel."'";
 $result = $conn->query($sql);
  if ($result->num_rows > 0) {?>
      // output data of each row
     <?php  while($row = $result->fetch_assoc()) { 
     
     if($lang=='ar'){$dept_name=$row["dept_name"];}else{$dept_name=$row["dept_name_en"];}
     ?>
          <option value="<?php echo $row["dept_id"];?>"><?php echo $dept_name;?></option>
     <?php }
  } else {?>
  <option value=""><?php echo $notfound;?></option>
    <?php  }?>