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

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

  <!--option value=""> <?php echo $select.$space.$the_employee; ?></option-->
   <option value="all_employees"> <?php echo $all_employees; ?></option>
 <?php
$sql2 = "SELECT * FROM hr_employ_tbl where employ_stat='active_employ' AND company_id!='0'AND deleted='0'AND dept_id='".$dept_idd."'";
 $result2 = $conn->query($sql2);
  if ($result2->num_rows > 0) { ?>
 <?php  while($row2 = $result2->fetch_assoc()) { 
    if($lang=='ar'){$employ_name=$row2["employ_name_ar"];}else{$employ_name=$row2["employ_name_en"];}
 
$sql_j = "SELECT * FROM job_tb where job_id='".$row2["job_id"]."' ";
 $result_j = $conn->query($sql_j);
  if ($result_j->num_rows > 0) {
  while($row_j = $result_j->fetch_assoc()) {  
 if($lang=='ar'){$job_name=$row_j["job_name"];}else{$job_name_en=$row2["job_name_en"];} 
  ?>

<option value="<?php echo $row2["employ_id"];?>"><?php echo $employ_name;?>-<?php echo $job_name;?></option>
     <?php }
  } else {?>
  <option value=""><?php echo $notfound;?></option>
    <?php  } }}?>