<?php
$PageSecurity = 11;
 include('includes/function_lib.php');
 include('includes/session.inc');
  $sql1=DB_query("Select * from hr_job_criteria where  CompanyId='".$_SESSION['ACGCompanyId']."' and branch='".$_REQUEST['branch']."'",$db);
  if(DB_num_rows($sql1)>0){
  while($res1=DB_fetch_assoc($sql1)){
      $res[]=$res1['designation'];
  }
  // $data.='<option value="0">All</option>';
  }
  if(!empty($res))
  {
      $str=implode(',',$res);
  }
 // echo "Select * from desigmaster where  CompanyId='".$_SESSION['ACGCompanyId']."' and id not in (".$str.") ";
  if(DB_num_rows($sql1)>0){
 $sql=DB_query("Select * from desigmaster where  CompanyId='".$_SESSION['ACGCompanyId']."' and id not in (".$str.") ",$db);
  }
  else
  {
      $sql=DB_query("Select * from desigmaster where  CompanyId='".$_SESSION['ACGCompanyId']."'",$db);
      $data.='<option value="0">All</option>';
  }
 
 while($row=DB_fetch_array($sql))
 {
    
    $data.='<option value="'.$row['id'].'**'.$row['mst_departmentid'].'">'.$row['designame'].'</option>';
 }
 echo $data;
 ?>