<?php
	require ('../../conn.php');
	
	$afelegido2 = $_POST['afelegido2'];
	
	$query = "select distinct a.pkyFixedAssetCategory as cod, a.fldName as categoria
	from
	fasFixedAssetCategory a, fasFixedAssetClassification b
	where
	a.pkyFixedAssetCategory = b.codGroup and
	b.codSubFamily = '$afelegido2' and
	a.sysEnabled = 1 and a.sysAuthorized = 1
	order by categoria";
	$resultado2=$mysqli->query($query);

	$html= "<option value='0'>Todos</option>";
	
	while($row = $resultado2->fetch_assoc())
	{
		$html.= "<option value='".$row['cod']."'>".$row['cod'].' - '.$row['categoria']."</option>";
	}
	echo $html;
?>