<?php
include('connection.php');
$department_name1=$_GET['dept_name1'];
mysqli_query($GLOBALS["___mysqli_ston"], "set NAMES utf8");
$res1="SELECT * FROM `emp_welfare` where dept_sub_category = '$department_name1'";
$result1=mysqli_query($GLOBALS["___mysqli_ston"], $res1) OR DIE ("Query Failed :" . mysqli_error($GLOBALS["___mysqli_ston"]));
if(mysqli_num_rows($result1)>0) 
	 					{
while($rw2=mysqli_fetch_assoc($result1))
{
		$depart_id=$rw2['sub_dept_id'];
	mysqli_query($GLOBALS["___mysqli_ston"], "set NAMES utf8");
	$res11="SELECT * FROM `dept_category` where dept_id='$depart_id'";

$result11=mysqli_query($GLOBALS["___mysqli_ston"], $res11) OR DIE ("Query Failed :" . mysqli_error($GLOBALS["___mysqli_ston"]));
//echo '<option value="">--select--</option>';
	   													
	while($rw22=mysqli_fetch_assoc($result11))
	{
	
						$depart_name=$rw22['dept_name'];
						$srno = $rw22['srno'];
						echo '<option value="'.$srno.'">'.$depart_name.'</option>';
	}
}
}

else{
	
echo 1;	
	
	}


?>