Commit 71705442391d9f5f9a6f634bede4e1d332b00229
1 parent
86d7705f
Exists in
master
and in
7 other branches
Substituição da função loadquery por uma nova existente em classesphp/funcoes_gerais.php
Showing
7 changed files
with
45 additions
and
85 deletions
Show diff stats
classesphp/classe_analise.php
| @@ -960,10 +960,7 @@ $locaplic - Localização do I3geo. | @@ -960,10 +960,7 @@ $locaplic - Localização do I3geo. | ||
| 960 | $nomeshp = $this->diretorio."/".$nomefinal; | 960 | $nomeshp = $this->diretorio."/".$nomefinal; |
| 961 | //pega os shapes selecionados | 961 | //pega os shapes selecionados |
| 962 | $itemspt = pegaItens($layerPt); | 962 | $itemspt = pegaItens($layerPt); |
| 963 | - $existesel = "nao"; | ||
| 964 | - if (file_exists($this->qyfile)) | ||
| 965 | - {$this->mapa->loadquery($this->qyfile);} | ||
| 966 | - if ($layerPt->getNumresults() > 0){$existesel = "sim";} | 963 | + $existesel = carregaquery($this->arquivo,&$this->layer,&$this->mapa); |
| 967 | if ($existesel == "nao") | 964 | if ($existesel == "nao") |
| 968 | { | 965 | { |
| 969 | if($layerPt->getProjection() == "" ) | 966 | if($layerPt->getProjection() == "" ) |
| @@ -1111,9 +1108,8 @@ function distanciaptpt($temaorigem,$temadestino,$temaoverlay,$locaplic,$itemorig | @@ -1111,9 +1108,8 @@ function distanciaptpt($temaorigem,$temadestino,$temaoverlay,$locaplic,$itemorig | ||
| 1111 | //define o nome do novo shapefile que será criado | 1108 | //define o nome do novo shapefile que será criado |
| 1112 | $nomefinal = nomeRandomico(); | 1109 | $nomefinal = nomeRandomico(); |
| 1113 | $nomeshp = $this->diretorio."/".$nomefinal; | 1110 | $nomeshp = $this->diretorio."/".$nomefinal; |
| 1114 | - if (file_exists($this->qyfile)) | ||
| 1115 | - {$this->mapa->loadquery($this->qyfile);} | ||
| 1116 | - else | 1111 | + $existesel = carregaquery($this->arquivo,&$this->layer,&$this->mapa); |
| 1112 | + if ($existesel == "nao") | ||
| 1117 | {return "errox";} | 1113 | {return "errox";} |
| 1118 | $layerorigem = $this->mapa->getlayerbyname($temaorigem); | 1114 | $layerorigem = $this->mapa->getlayerbyname($temaorigem); |
| 1119 | $layerdestino = $this->mapa->getlayerbyname($temadestino); | 1115 | $layerdestino = $this->mapa->getlayerbyname($temadestino); |
| @@ -1237,8 +1233,7 @@ nome do layer criado com o buffer. | @@ -1237,8 +1233,7 @@ nome do layer criado com o buffer. | ||
| 1237 | $nomebuffer = nomeRandomico(); | 1233 | $nomebuffer = nomeRandomico(); |
| 1238 | $nomeshp = $this->diretorio."/".$nomebuffer; | 1234 | $nomeshp = $this->diretorio."/".$nomebuffer; |
| 1239 | //pega os shapes selecionados | 1235 | //pega os shapes selecionados |
| 1240 | - if (file_exists($this->qyfile)) | ||
| 1241 | - {$this->mapa->loadquery($this->qyfile);} | 1236 | + carregaquery($this->arquivo,&$this->layer,&$this->mapa); |
| 1242 | $sopen = $this->layer->open(); | 1237 | $sopen = $this->layer->open(); |
| 1243 | if($sopen == MS_FAILURE){return "erro";} | 1238 | if($sopen == MS_FAILURE){return "erro";} |
| 1244 | $items = pegaItens($this->layer); | 1239 | $items = pegaItens($this->layer); |
| @@ -1349,8 +1344,7 @@ $locaplic - Localização do I3geo. | @@ -1349,8 +1344,7 @@ $locaplic - Localização do I3geo. | ||
| 1349 | $nomeCentroides = nomeRandomico(); | 1344 | $nomeCentroides = nomeRandomico(); |
| 1350 | $nomeshp = $this->diretorio."/".$nomeCentroides; | 1345 | $nomeshp = $this->diretorio."/".$nomeCentroides; |
| 1351 | //pega os shapes selecionados | 1346 | //pega os shapes selecionados |
| 1352 | - if (file_exists($this->qyfile)) | ||
| 1353 | - {$this->mapa->loadquery($this->qyfile);} | 1347 | + carregaquery($this->arquivo,&$this->layer,&$this->mapa); |
| 1354 | $sopen = $this->layer->open(); | 1348 | $sopen = $this->layer->open(); |
| 1355 | if($sopen == MS_FAILURE){return "erro";} | 1349 | if($sopen == MS_FAILURE){return "erro";} |
| 1356 | $items = pegaItens($this->layer); | 1350 | $items = pegaItens($this->layer); |
| @@ -1923,8 +1917,7 @@ Salva o mapa acrescentando um novo layer com o resultado. | @@ -1923,8 +1917,7 @@ Salva o mapa acrescentando um novo layer com o resultado. | ||
| 1923 | else | 1917 | else |
| 1924 | include_once "../pacotes/phpxbase/api_conversion.php"; | 1918 | include_once "../pacotes/phpxbase/api_conversion.php"; |
| 1925 | //define o nome do novo shapefile que será criado | 1919 | //define o nome do novo shapefile que será criado |
| 1926 | - if (file_exists($this->qyfile)) | ||
| 1927 | - {$this->mapa->loadquery($this->qyfile);} | 1920 | + carregaquery($this->arquivo,&$this->layer,&$this->mapa); |
| 1928 | $sopen = $this->layer->open(); | 1921 | $sopen = $this->layer->open(); |
| 1929 | if($sopen == MS_FAILURE){return "erro";} | 1922 | if($sopen == MS_FAILURE){return "erro";} |
| 1930 | $res_count = $this->layer->getNumresults(); | 1923 | $res_count = $this->layer->getNumresults(); |
| @@ -2043,8 +2036,7 @@ $locaplic - Localização do I3geo | @@ -2043,8 +2036,7 @@ $locaplic - Localização do I3geo | ||
| 2043 | else | 2036 | else |
| 2044 | include_once "../pacotes/phpxbase/api_conversion.php"; | 2037 | include_once "../pacotes/phpxbase/api_conversion.php"; |
| 2045 | //define o nome do novo shapefile que será criado | 2038 | //define o nome do novo shapefile que será criado |
| 2046 | - if (file_exists($this->qyfile)) | ||
| 2047 | - {$this->mapa->loadquery($this->qyfile);} | 2039 | + carregaquery($this->arquivo,&$this->layer,&$this->mapa); |
| 2048 | $sopen = $this->layer->open(); | 2040 | $sopen = $this->layer->open(); |
| 2049 | if($sopen == MS_FAILURE){return "erro";} | 2041 | if($sopen == MS_FAILURE){return "erro";} |
| 2050 | $res_count = $this->layer->getNumresults(); | 2042 | $res_count = $this->layer->getNumresults(); |
| @@ -2435,10 +2427,7 @@ function gravaCoordenadasPt($tema,$limitepontos="TRUE",$extendelimite) | @@ -2435,10 +2427,7 @@ function gravaCoordenadasPt($tema,$limitepontos="TRUE",$extendelimite) | ||
| 2435 | $nomefinal = nomeRandomico(); | 2427 | $nomefinal = nomeRandomico(); |
| 2436 | $nomearq = $this->diretorio."/".$nomefinal; | 2428 | $nomearq = $this->diretorio."/".$nomefinal; |
| 2437 | $itemspt = pegaItens($layerPt); | 2429 | $itemspt = pegaItens($layerPt); |
| 2438 | - $existesel = "nao"; | ||
| 2439 | - if (file_exists($this->qyfile)) | ||
| 2440 | - {$this->mapa->loadquery($this->qyfile);} | ||
| 2441 | - if ($layerPt->getNumresults() > 0){$existesel = "sim";} | 2430 | + $existesel = carregaquery($this->arquivo,&$this->layer,&$this->mapa); |
| 2442 | if ($existesel == "nao") | 2431 | if ($existesel == "nao") |
| 2443 | { | 2432 | { |
| 2444 | if($layerPt->getProjection() == "" ) | 2433 | if($layerPt->getProjection() == "" ) |
classesphp/classe_atributos.php
| @@ -87,6 +87,11 @@ $ext - (opcional) extensão geográfica que será aplicada ao mapa | @@ -87,6 +87,11 @@ $ext - (opcional) extensão geográfica que será aplicada ao mapa | ||
| 87 | function __construct($map_file,$tema="",$locaplic="",$ext="") | 87 | function __construct($map_file,$tema="",$locaplic="",$ext="") |
| 88 | { | 88 | { |
| 89 | //error_reporting(E_ALL); | 89 | //error_reporting(E_ALL); |
| 90 | + if (!function_exists('ms_newMapObj')) {return false;} | ||
| 91 | + if(file_exists($locaplic."/funcoes_gerais.php")) | ||
| 92 | + include_once($locaplic."/funcoes_gerais.php"); | ||
| 93 | + else | ||
| 94 | + include_once("funcoes_gerais.php"); | ||
| 90 | $this->qyfile = str_replace(".map",".qy",$map_file); | 95 | $this->qyfile = str_replace(".map",".qy",$map_file); |
| 91 | $this->locaplic = $locaplic; | 96 | $this->locaplic = $locaplic; |
| 92 | $this->mapa = ms_newMapObj($map_file); | 97 | $this->mapa = ms_newMapObj($map_file); |
| @@ -239,10 +244,7 @@ $tipo - Tipo de busca brasil|null | @@ -239,10 +244,7 @@ $tipo - Tipo de busca brasil|null | ||
| 239 | $this->layer->setfilter(""); | 244 | $this->layer->setfilter(""); |
| 240 | //le o arquivo de query se existir e checa se existe seleção para o tema | 245 | //le o arquivo de query se existir e checa se existe seleção para o tema |
| 241 | $items = pegaItens($this->layer); | 246 | $items = pegaItens($this->layer); |
| 242 | - $existesel = "nao"; | ||
| 243 | - if (file_exists($this->qyfile)) | ||
| 244 | - {$this->mapa->loadquery($this->qyfile);} | ||
| 245 | - if ($this->layer->getNumresults() > 0){$existesel = "sim";} | 247 | + $existesel = carregaquery($this->arquivo,&$this->layer,&$this->mapa); |
| 246 | if ($existesel == "nao") | 248 | if ($existesel == "nao") |
| 247 | {$this->layer->querybyrect($this->mapa->extent);} | 249 | {$this->layer->querybyrect($this->mapa->extent);} |
| 248 | $sopen = $this->layer->open(); | 250 | $sopen = $this->layer->open(); |
| @@ -306,8 +308,7 @@ $tipolista - Indica se serão mostrados todos os registros ou apenas os seleciona | @@ -306,8 +308,7 @@ $tipolista - Indica se serão mostrados todos os registros ou apenas os seleciona | ||
| 306 | else | 308 | else |
| 307 | {$items[] = $itemtema;} | 309 | {$items[] = $itemtema;} |
| 308 | $resultadoFinal[] = array("itens"=>$items); | 310 | $resultadoFinal[] = array("itens"=>$items); |
| 309 | - if (file_exists($this->qyfile)) | ||
| 310 | - {$this->mapa->loadquery($this->qyfile);} | 311 | + carregaquery($this->arquivo,&$this->layer,&$this->mapa); |
| 311 | $indxlayer = $this->layer->index; | 312 | $indxlayer = $this->layer->index; |
| 312 | $sopen = $this->layer->open(); | 313 | $sopen = $this->layer->open(); |
| 313 | if($sopen == MS_FAILURE){return "erro";} | 314 | if($sopen == MS_FAILURE){return "erro";} |
| @@ -506,10 +507,7 @@ Include: | @@ -506,10 +507,7 @@ Include: | ||
| 506 | $filtro = $this->layer->getfilterstring(); | 507 | $filtro = $this->layer->getfilterstring(); |
| 507 | if ($filtro != ""){$this->layer->setfilter("");} | 508 | if ($filtro != ""){$this->layer->setfilter("");} |
| 508 | //le o arquivo de query se existir e checa se existe seleção para o tema | 509 | //le o arquivo de query se existir e checa se existe seleção para o tema |
| 509 | - $existesel = "nao"; | ||
| 510 | - if (file_exists($this->qyfile)) | ||
| 511 | - {$this->mapa->loadquery($this->qyfile);} | ||
| 512 | - if ($this->layer->getNumresults() > 0){$existesel = "sim";} | 510 | + $existesel = carregaquery($this->arquivo,&$this->layer,&$this->mapa); |
| 513 | if ($existesel == "nao") | 511 | if ($existesel == "nao") |
| 514 | {$this->layer->queryByrect($this->mapa->extent);} | 512 | {$this->layer->queryByrect($this->mapa->extent);} |
| 515 | $sopen = $this->layer->open(); | 513 | $sopen = $this->layer->open(); |
classesphp/classe_mapa.php
| @@ -170,26 +170,11 @@ string - javascript com os parametros | @@ -170,26 +170,11 @@ string - javascript com os parametros | ||
| 170 | //$qy = file_exists($this->qyfile); | 170 | //$qy = file_exists($this->qyfile); |
| 171 | foreach($this->layers as $l) | 171 | foreach($this->layers as $l) |
| 172 | {$l->set("template","none.htm");} | 172 | {$l->set("template","none.htm");} |
| 173 | - | ||
| 174 | - //if ($qy) | ||
| 175 | - //{$this->mapa->loadquery($this->qyfile);} | ||
| 176 | foreach ($this->layers as $oLayer) | 173 | foreach ($this->layers as $oLayer) |
| 177 | { | 174 | { |
| 178 | $sel = "nao"; | 175 | $sel = "nao"; |
| 179 | if(file_exists($dir."/".$oLayer->name.".php")) | 176 | if(file_exists($dir."/".$oLayer->name.".php")) |
| 180 | {$sel = "sim";$existesel = true;} | 177 | {$sel = "sim";$existesel = true;} |
| 181 | - /* | ||
| 182 | - if ($qy) //verifica se existe alguma selecao no tema | ||
| 183 | - { | ||
| 184 | - $sopen = $oLayer->open(); | ||
| 185 | - if($sopen != MS_FAILURE) | ||
| 186 | - { | ||
| 187 | - $res_count = $oLayer->getNumresults(); | ||
| 188 | - $oLayer->close(); | ||
| 189 | - if ($res_count > 0){$sel = "sim";$existesel = true;} | ||
| 190 | - } | ||
| 191 | - } | ||
| 192 | - */ | ||
| 193 | $escondido = $oLayer->getmetadata("escondido"); | 178 | $escondido = $oLayer->getmetadata("escondido"); |
| 194 | if($escondido == "") | 179 | if($escondido == "") |
| 195 | {$escondido = "nao";} | 180 | {$escondido = "nao";} |
| @@ -294,8 +279,10 @@ Include: | @@ -294,8 +279,10 @@ Include: | ||
| 294 | if($qy) | 279 | if($qy) |
| 295 | { | 280 | { |
| 296 | foreach($this->layers as $l) | 281 | foreach($this->layers as $l) |
| 297 | - {$l->set("template","none.htm");} | ||
| 298 | - $this->mapa->loadquery($this->qyfile); | 282 | + { |
| 283 | + $l->set("template","none.htm"); | ||
| 284 | + carregaquery($this->arquivo,&$l,&$this->mapa); | ||
| 285 | + } | ||
| 299 | } | 286 | } |
| 300 | $legenda = $this->mapa->legend; | 287 | $legenda = $this->mapa->legend; |
| 301 | // | 288 | // |
classesphp/classe_temas.php
| @@ -104,6 +104,7 @@ $ext - (opcional) extensão geográfica que será aplicada ao mapa | @@ -104,6 +104,7 @@ $ext - (opcional) extensão geográfica que será aplicada ao mapa | ||
| 104 | { | 104 | { |
| 105 | //error_reporting(E_ALL); | 105 | //error_reporting(E_ALL); |
| 106 | $this->qyfile = str_replace(".map",".qy",$map_file); | 106 | $this->qyfile = str_replace(".map",".qy",$map_file); |
| 107 | + $this->arquivo = $map_file; | ||
| 107 | if(file_exists($locaplic."/funcoes_gerais.php")) | 108 | if(file_exists($locaplic."/funcoes_gerais.php")) |
| 108 | include_once($locaplic."/funcoes_gerais.php"); | 109 | include_once($locaplic."/funcoes_gerais.php"); |
| 109 | else | 110 | else |
| @@ -745,8 +746,7 @@ $nome - nome que será dado a geometria | @@ -745,8 +746,7 @@ $nome - nome que será dado a geometria | ||
| 745 | $ext = $this->mapa->extent; | 746 | $ext = $this->mapa->extent; |
| 746 | $sb = $this->mapa->scalebar; | 747 | $sb = $this->mapa->scalebar; |
| 747 | $sb->set("status",MS_OFF); | 748 | $sb->set("status",MS_OFF); |
| 748 | - if (file_exists($this->qyfile)) | ||
| 749 | - {$this->mapa->loadquery($this->qyfile);} | 749 | + carregaquery($this->arquivo,&$this->layer,&$this->mapa); |
| 750 | $items = pegaItens($this->layer); | 750 | $items = pegaItens($this->layer); |
| 751 | $sopen = $this->layer->open(); | 751 | $sopen = $this->layer->open(); |
| 752 | if($sopen == MS_FAILURE){return "erro";} | 752 | if($sopen == MS_FAILURE){return "erro";} |
| @@ -970,8 +970,7 @@ Calcula a extensão geográfica dos elementos selecionados de um tema e ajusta o m | @@ -970,8 +970,7 @@ Calcula a extensão geográfica dos elementos selecionados de um tema e ajusta o m | ||
| 970 | $extatual = $this->mapa->extent; | 970 | $extatual = $this->mapa->extent; |
| 971 | $prjMapa = ""; | 971 | $prjMapa = ""; |
| 972 | $prjTema = ""; | 972 | $prjTema = ""; |
| 973 | - if (file_exists($this->qyfile)) | ||
| 974 | - {$this->mapa->loadquery($this->qyfile);} | 973 | + carregaquery($this->arquivo,&$this->layer,&$this->mapa); |
| 975 | $sopen = $this->layer->open(); | 974 | $sopen = $this->layer->open(); |
| 976 | if($sopen == MS_FAILURE){return "erro";} | 975 | if($sopen == MS_FAILURE){return "erro";} |
| 977 | $res_count = $this->layer->getNumresults(); | 976 | $res_count = $this->layer->getNumresults(); |
classesphp/funcoes_gerais.php
| @@ -1830,12 +1830,7 @@ function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE) | @@ -1830,12 +1830,7 @@ function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE) | ||
| 1830 | $reg = array(); | 1830 | $reg = array(); |
| 1831 | $novoshpf = ms_newShapefileObj($nomeshp.".shp", -2); | 1831 | $novoshpf = ms_newShapefileObj($nomeshp.".shp", -2); |
| 1832 | //le o arquivo de query se existir e checa se existe seleção para o tema | 1832 | //le o arquivo de query se existir e checa se existe seleção para o tema |
| 1833 | - $existesel = "nao"; | ||
| 1834 | - if (file_exists($map_file."qy")) | ||
| 1835 | - {$map->loadquery($map_file."qy");} | ||
| 1836 | - if ($layer->getNumresults() > 0) | ||
| 1837 | - {$existesel = "sim";} | ||
| 1838 | - | 1833 | + $existesel = carregaquery($map_file,&$layer,&$map); |
| 1839 | if ($existesel == "nao") | 1834 | if ($existesel == "nao") |
| 1840 | {@$layer->queryByrect($map->extent);} | 1835 | {@$layer->queryByrect($map->extent);} |
| 1841 | 1836 | ||
| @@ -2626,5 +2621,20 @@ function removeLinha($texto,$mapfile) | @@ -2626,5 +2621,20 @@ function removeLinha($texto,$mapfile) | ||
| 2626 | {$escreve = fwrite ($abre,$linha);} | 2621 | {$escreve = fwrite ($abre,$linha);} |
| 2627 | $fecha = fclose ($abre); | 2622 | $fecha = fclose ($abre); |
| 2628 | } | 2623 | } |
| 2629 | - | 2624 | +function carregaquery($mapfile,$objlayer,$objmapa) |
| 2625 | +{ | ||
| 2626 | + $qyfile = dirname($mapfile)."/".$objlayer->name.".php"; | ||
| 2627 | + if(file_exists($qyfile)) | ||
| 2628 | + { | ||
| 2629 | + $indxlayer = $objlayer->index; | ||
| 2630 | + $handle = fopen ($qyfile, "r"); | ||
| 2631 | + $conteudo = fread ($handle, filesize ($qyfile)); | ||
| 2632 | + fclose ($handle); | ||
| 2633 | + $shp = unserialize($conteudo); | ||
| 2634 | + foreach ($shp as $indx) | ||
| 2635 | + {$objmapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} | ||
| 2636 | + return "sim"; | ||
| 2637 | + } | ||
| 2638 | + return "nao"; | ||
| 2639 | +} | ||
| 2630 | ?> | 2640 | ?> |
| 2631 | \ No newline at end of file | 2641 | \ No newline at end of file |
classesphp/graficos.php
| @@ -386,21 +386,8 @@ function iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$t | @@ -386,21 +386,8 @@ function iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$t | ||
| 386 | $extatual = $map->extent; | 386 | $extatual = $map->extent; |
| 387 | $extatual->setextent((min($e[0],$e[2])),(min($e[1],$e[3])),(max($e[0],$e[2])),(max($e[1],$e[3]))); | 387 | $extatual->setextent((min($e[0],$e[2])),(min($e[1],$e[3])),(max($e[0],$e[2])),(max($e[1],$e[3]))); |
| 388 | } | 388 | } |
| 389 | - $selecionados = "sim"; | ||
| 390 | - $qyfile = str_replace(".map",".qy",$map_file); | ||
| 391 | - if (file_exists($qyfile)) | ||
| 392 | - {$map->loadquery($qyfile);} | ||
| 393 | - else | ||
| 394 | - {$selecionados = "nao";} | ||
| 395 | $layer = $map->getLayerByName($tema); | 389 | $layer = $map->getLayerByName($tema); |
| 396 | - if ($selecionados == "sim") | ||
| 397 | - { | ||
| 398 | - $layer->open(); | ||
| 399 | - $res_count = $layer->getNumresults(); | ||
| 400 | - $layer->close(); | ||
| 401 | - if ($res_count < 1) | ||
| 402 | - {$selecionados = "nao";} | ||
| 403 | - } | 390 | + $selecionados = carregaquery($map_file,&$layer,&$map); |
| 404 | if ($exclui == ""){$exclui = "nulo";} | 391 | if ($exclui == ""){$exclui = "nulo";} |
| 405 | $valores = pegaValoresM($map,$layer,array($itemclasses,$itemvalores),$exclui,$selecionados); | 392 | $valores = pegaValoresM($map,$layer,array($itemclasses,$itemvalores),$exclui,$selecionados); |
| 406 | $dados = agrupaValores($valores,0,1,$tipo); | 393 | $dados = agrupaValores($valores,0,1,$tipo); |
| @@ -442,21 +429,8 @@ function dadosLinhaDoTempo($map_file,$tema,$ext="") | @@ -442,21 +429,8 @@ function dadosLinhaDoTempo($map_file,$tema,$ext="") | ||
| 442 | $extatual = $map->extent; | 429 | $extatual = $map->extent; |
| 443 | $extatual->setextent((min($e[0],$e[2])),(min($e[1],$e[3])),(max($e[0],$e[2])),(max($e[1],$e[3]))); | 430 | $extatual->setextent((min($e[0],$e[2])),(min($e[1],$e[3])),(max($e[0],$e[2])),(max($e[1],$e[3]))); |
| 444 | } | 431 | } |
| 445 | - $selecionados = "sim"; | ||
| 446 | - $qyfile = str_replace(".map",".qy",$map_file); | ||
| 447 | - if (file_exists($qyfile)) | ||
| 448 | - {$map->loadquery($qyfile);} | ||
| 449 | - else | ||
| 450 | - {$selecionados = "nao";} | ||
| 451 | $layer = $map->getLayerByName($tema); | 432 | $layer = $map->getLayerByName($tema); |
| 452 | - if ($selecionados == "sim") | ||
| 453 | - { | ||
| 454 | - $layer->open(); | ||
| 455 | - $res_count = $layer->getNumresults(); | ||
| 456 | - $layer->close(); | ||
| 457 | - if ($res_count < 1) | ||
| 458 | - {$selecionados = "nao";} | ||
| 459 | - } | 433 | + $selecionados = carregaquery($map_file,&$layer,&$map); |
| 460 | if ($exclui == ""){$exclui = "nulo";} | 434 | if ($exclui == ""){$exclui = "nulo";} |
| 461 | //define os itens para pegar os dados | 435 | //define os itens para pegar os dados |
| 462 | $itens = array(); | 436 | $itens = array(); |
ferramentas/tabela/relatorio.php
| @@ -42,8 +42,11 @@ if($ext && $ext != ""){ | @@ -42,8 +42,11 @@ if($ext && $ext != ""){ | ||
| 42 | $layer = $mapa->getlayerbyname($temarel); | 42 | $layer = $mapa->getlayerbyname($temarel); |
| 43 | $layer->set("template","none.html"); | 43 | $layer->set("template","none.html"); |
| 44 | $existesel = "nao"; | 44 | $existesel = "nao"; |
| 45 | +/* | ||
| 45 | if (file_exists($map_file."qy")) | 46 | if (file_exists($map_file."qy")) |
| 46 | {$mapa->loadquery($map_file."qy");} | 47 | {$mapa->loadquery($map_file."qy");} |
| 48 | +*/ | ||
| 49 | +carregaquery($map_file,&$layer,&$mapa); | ||
| 47 | if ($layer->getNumresults() > 0){$existesel = "sim";} | 50 | if ($layer->getNumresults() > 0){$existesel = "sim";} |
| 48 | if ($existesel == "nao") | 51 | if ($existesel == "nao") |
| 49 | {$layer->querybyrect($mapa->extent);} | 52 | {$layer->querybyrect($mapa->extent);} |