<?php
	require ('../../conn.php');
	
	$elegido2 = $_POST['elegido2'];
	
	$query = "select distinct a.pkyItemCategory as cod, a.fldName as categoria
	from
	invItemCategory a, invItemClassification b
	where
	a.pkyItemCategory = b.codGroup and
	b.codSubFamily = '$elegido2' 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;
?>