<?php
	include "../db_connection/db_connection.php";
	include "../config/config.php";
	$i_val=$_GET['ival'];
	$id_val=$_GET['id_val'];
?>
<?php 
	$name_array="";
	if($i_val==1)
	{
		$SLCT_emp = "SELECT * FROM emp_det WHERE emp_det_id='$id_val'";				
		$QURY_emp = mysqli_query($connect,$SLCT_emp);
		$FTCH_emp = mysqli_fetch_object($QURY_emp);	
			
		$SLCT_des = "SELECT * FROM master_dept WHERE master_dept_id='$FTCH_emp->master_dept_id'";				
		$QURY_des = mysqli_query($connect,$SLCT_des);
		$FTCH_des = mysqli_fetch_object($QURY_des);
				
		echo $FTCH_des->master_dept_name.'split_1'. $FTCH_emp->email_id;
		
		
	}
	else if($i_val==2)
	{
		//$pa_mail_id = '';
		$SLCT_cli = "SELECT * FROM party_det WHERE party_det_id='$id_val'";	
		//echo $SLCT_cli;			
		$QURY_cli = mysqli_query($connect,$SLCT_cli);
		$FTCH_cli = mysqli_fetch_object($QURY_cli);
		
		if($FTCH_cli->email_id_1!='')
		{
			$pa_mail_id = $FTCH_cli->email_id_1;
		}
		else if($FTCH_cli->email_id_2!='')
		{
			$pa_mail_id = $FTCH_cli->email_id_2;
		}
		else if($FTCH_cli->email_id_3!='')
		{
			$pa_mail_id = $FTCH_cli->email_id_3;
		}
		echo $pa_mail_id;
	}
?>          
               