<?php
	$dir = $_SERVER['DOCUMENT_ROOT']."/".substr(substr($_SERVER['REQUEST_URI'], 1), 0, strpos(substr($_SERVER['REQUEST_URI'], 1), '/'))."/phone_gap";
	require_once($dir."/classes/Familia.class.php");
	require_once($dir."/classes/Dados.class.php");
	
	class FamiliaDAO {
		
		public function lkpFamilia(){
			$dados = new Dados();
			
			$sql = "select CODFAMILIA, DESCRICAO from FAMILIAS order by 2 ";
			$array = $dados->SelectSQL($sql);
			foreach ($array as $row){
				$novaFamilia = new Familia();
				$novaFamilia->setCodfamilia($row["CODFAMILIA"]);
				$novaFamilia->setDescricao($row["DESCRICAO"]);
				$familias[] = $novaFamilia;
			}
			return $familias;
		}
		
	}
	
?>