<?php
	require ('../../conn.php');
	
	$elegido1 = $_POST['elegido1'];
	
	$query1 = "select distinct a.pkyItemCategory as cod, a.fldName as categoria
	from
	invItemCategory a, invItemClassification b
	where
	a.pkyItemCategory = b.codSubFamily and
	b.codFamily = '$elegido1' and
	a.sysEnabled = 1 and a.sysAuthorized = 1 
	order by categoria";
	$resultado1 = $mysqli->query($query1);
	
	$html= "<option value='0'>Todos</option>";
	
	while($row = $resultado1->fetch_assoc())
	{
		$html.= "<option value='".$row['cod']."'>".$row['cod'].' - '.$row['categoria']."</option>";
	}
	
	echo $html;
?>		