<?php
//Include database configuration file
include('../Server/connection.php');

if(!empty($_POST["deptId"])){
	
	
    //Get all state data
    $query = $conn->query("SELECT * FROM designation WHERE dept_id = ".$_POST['deptId']."  and staffcate_id=3 ORDER BY des_name");
    
    //Count total number of rows
    $rowCount = $query->num_rows;
    
    //Display states list
    if($rowCount > 0){
        //echo '<option value="">Chagua Kata</option>';
        while($row = $query->fetch_assoc()){ 
            echo '<option value="'.$row['des_id'].'">'.$row['des_name'].'</option>';
        }
    }else{
        echo '<option value="">No Designation </option>';
    }
	

			
}


?>