Skip to content

Commit

Permalink
Removido método "listamun" com parâmetro duplicado;
Browse files Browse the repository at this point in the history
portabilis#169;
i-educar/i-educar#29; #Portal do SPB
  • Loading branch information
carolinesalib committed Jan 19, 2016
1 parent 1bf4840 commit 74b335c
Showing 1 changed file with 1 addition and 69 deletions.
70 changes: 1 addition & 69 deletions ieducar/intranet/include/pessoa/clsLogradouro.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,75 +228,7 @@ function lista( $str_idtlog=false, $str_nome=false, $int_idnum=false, $str_geom=
return $resultado;
}
return false;
}
/**
* Exibe uma lista baseada nos parametros de filtragem passados incluindo id municipio
*
* @return Array
*/
function listamun( $str_idtlog=false, $str_nome=false, $int_idmun=false, $int_idmun=false, $str_geom=false, $str_ident_oficial=false, $int_limite_ini=0, $int_limite_qtd=20, $str_orderBy = false )
{
// verificacoes de filtros a serem usados
$whereAnd = "WHERE ";
if( is_string( $str_idtlog ) )
{
$where .= "{$whereAnd}idtlog LIKE '%$str_idtlog%'";
$whereAnd = " AND ";
}
if( is_string( $str_nome ) )
{
$where .= "{$whereAnd}nome LIKE '%$str_nome%'";
$whereAnd = " AND ";
}
if( is_numeric( $int_idmun ) )
{
$where .= "{$whereAnd}idmun = '$int_idmun'";
$whereAnd = " AND ";
}
if( is_string( $str_geom ) )
{
$where .= "{$whereAnd}geom LIKE '%$str_geom%'";
$whereAnd = " AND ";
}

if( is_string( $str_ident_oficial ) )
{
$where .= "{$whereAnd}ident_oficial LIKE '%$str_ident_oficial%'";
$whereAnd = " AND ";
}

if($str_orderBy)
{
$orderBy = "ORDER BY $str_orderBy";
}

$limit = "";
if( is_numeric( $int_limite_ini ) && is_numeric( $int_limite_qtd ) )
{
$limit = " LIMIT $int_limite_ini,$int_limite_qtd";
}

$db = new clsBanco();
$db->Consulta( "SELECT COUNT(0) AS total FROM {$this->schema}.{$this->tabela} $where" );
$db->ProximoRegistro();
$total = $db->Campo( "total" );

$db->Consulta( "SELECT idlog, idtlog, nome, idmun, geom, ident_oficial FROM {$this->schema}.{$this->tabela} $where $orderBy $limit" );
$resultado = array();
while ( $db->ProximoRegistro() )
{
$tupla = $db->Tupla();
$tupla["idtlog"] = new clsTipoLogradouro( $tupla["idtlog"] );

$tupla["total"] = $total;
$resultado[] = $tupla;
}
if( count( $resultado ) )
{
return $resultado;
}
return false;
}
}
/**
* Retorna um array com os detalhes do objeto
*
Expand Down

0 comments on commit 74b335c

Please sign in to comment.