<?php
	$dir = $_SERVER['DOCUMENT_ROOT']."/".substr(substr($_SERVER['REQUEST_URI'], 1), 0, strpos(substr($_SERVER['REQUEST_URI'], 1), '/'))."/phone_gap";
	require_once($dir."/classes/Segmento.class.php");
	require_once($dir."/classes/Dados.class.php");
	
	class SegmentoDAO {
		
		public function lkpSegmento(){
			$dados = new Dados();
			
			$sql = "select CODSEGMENTO, DESCRICAO from SEGMENTOS order by 2 ";
			$array = $dados->SelectSQL($sql);		
			foreach ($array as $row){
				$novoSegmento = new Segmento();
				$novoSegmento->setCodSegmento($row["CODSEGMENTO"]);
				$novoSegmento->setDescricao($row["DESCRICAO"]);
				$segmentos[] = $novoSegmento;
			}
			
			return $segmentos;
		}
	}
	
?>