<?php require_once '../../masterpage/webservice_master.php'; 
	
	header("Access-Control-Allow-Origin: *");
	$operative_ID = $_POST['operative_ID'];
	$surveyType_ID = $_POST['surveyType_ID'];
	
if($operative_ID && $surveyType_ID){
	$cond = "surveyType_ID =".$surveyType_ID." AND  operative_ID =".$operative_ID."  AND isActive = 1 AND isDelete = 0";
	$rows = $obj->fetchRowall('lfs_asign_survey_operative',$cond);
	//echo "<pre>";print_r($rows);exit;
	$row = array();
	$y=0;
	if($rows){
		foreach ($rows as $rowvalue) {
			$conds = "project_ID='".$rowvalue['project_ID']."' AND isActive = 1 AND isDelete = 0 ";
			$row1 = $obj->fetchRowall('lfs_projects',$conds);
			if($row1){
				$row[$y]['project_ID']=$row1[0]['project_ID'];
				$row[$y]['project_name']=$row1[0]['p_Name'];
				$y++;
			}
		}
	}
}
if($row){
	echo json_encode($row);
}else{
	echo json_encode(0);
}

?>
