Commit b86633e5550757ebde9a253b9a8b5a2e5ed2a682
1 parent
eed23d4f
Exists in
master
and in
7 other branches
correção na busca por perfis cadastrados
Showing
1 changed file
with
24 additions
and
8 deletions
Show diff stats
admin/php/classe_arvore.php
| ... | ... | @@ -81,7 +81,9 @@ class Arvore |
| 81 | 81 | $resultado = array(); |
| 82 | 82 | foreach($regs as $reg) |
| 83 | 83 | { |
| 84 | - if ($this->verificaOcorrencia($perfil,explode(",",$reg["perfil_menu"]))) | |
| 84 | + $a = $reg["perfil_menu"]; | |
| 85 | + $a = str_replace(" ",",",$a); | |
| 86 | + if ($this->verificaOcorrencia($perfil,explode(",",$a))) | |
| 85 | 87 | { |
| 86 | 88 | $status = "fechado"; |
| 87 | 89 | if(strtolower($reg["aberto"]) == "sim") |
| ... | ... | @@ -106,17 +108,23 @@ class Arvore |
| 106 | 108 | $grupos = $this->pegaGruposMenu($menu["idmenu"]); |
| 107 | 109 | foreach($grupos["grupos"] as $grupo) |
| 108 | 110 | { |
| 109 | - if($this->verificaOcorrencia($perfil,explode(",",$grupo["n1_perfil"]))) | |
| 111 | + $a = $grupo["n1_perfil"]; | |
| 112 | + $a = str_replace(" ",",",$a); | |
| 113 | + if($this->verificaOcorrencia($perfil,explode(",",$a))) | |
| 110 | 114 | { |
| 111 | 115 | $sgrupos = $this->pegaSubgruposGrupo($menu["idmenu"],$grupo["id_n1"]); |
| 112 | 116 | foreach($sgrupos["subgrupos"] as $sgrupo) |
| 113 | 117 | { |
| 114 | - if($this->verificaOcorrencia($perfil,explode(",",$sgrupo["n2_perfil"]))) | |
| 118 | + $a = $sgrupo["n2_perfil"]; | |
| 119 | + $a = str_replace(" ",",",$a); | |
| 120 | + if($this->verificaOcorrencia($perfil,explode(",",$a))) | |
| 115 | 121 | { |
| 116 | 122 | $temas = $this->pegaTemasSubGrupo($sgrupo["id_n2"]); |
| 117 | 123 | foreach ($temas as $tema) |
| 118 | 124 | { |
| 119 | - if($this->verificaOcorrencia($perfil,explode(",",$tema["n3_perfil"]))) | |
| 125 | + $a = $tema["n3_perfil"]; | |
| 126 | + $a = str_replace(" ",",",$a); | |
| 127 | + if($this->verificaOcorrencia($perfil,explode(",",$a))) | |
| 120 | 128 | { |
| 121 | 129 | $t = $this->pegaTema($tema["id_tema"]); |
| 122 | 130 | $t = $t[0]; |
| ... | ... | @@ -200,7 +208,9 @@ class Arvore |
| 200 | 208 | {$grupos[] = array();} |
| 201 | 209 | foreach($dados["grupos"] as $grupo) |
| 202 | 210 | { |
| 203 | - if($this->verificaOcorrencia($perfil,explode(",",$grupo["n1_perfil"]))) | |
| 211 | + $a = $grupo["n1_perfil"]; | |
| 212 | + $a = str_replace(" ",",",$a); | |
| 213 | + if($this->verificaOcorrencia($perfil,explode(",",$a))) | |
| 204 | 214 | { |
| 205 | 215 | $temas = array(); |
| 206 | 216 | $raizgrupo = $this->pegaTemasRaizGrupo($id_menu,$grupo["id_n1"]); |
| ... | ... | @@ -220,7 +230,9 @@ class Arvore |
| 220 | 230 | |
| 221 | 231 | foreach($dadossubgrupos["subgrupos"] as $sgrupo) |
| 222 | 232 | { |
| 223 | - if($this->verificaOcorrencia($perfil,explode(",",$sgrupo["n2_perfil"]))) | |
| 233 | + $a = $sgrupo["n2_perfil"]; | |
| 234 | + $a = str_replace(" ",",",$a); | |
| 235 | + if($this->verificaOcorrencia($perfil,explode(",",$a))) | |
| 224 | 236 | { |
| 225 | 237 | //verifica se existem temas que podem receber download |
| 226 | 238 | $down = "nao"; |
| ... | ... | @@ -265,7 +277,9 @@ class Arvore |
| 265 | 277 | $subgrupos = array(); |
| 266 | 278 | foreach($dados["subgrupos"] as $sgrupo) |
| 267 | 279 | { |
| 268 | - if ($this->verificaOcorrencia($perfil,explode(",",$sgrupo["n2_perfil"]))) | |
| 280 | + $a = $sgrupo["n2_perfil"]; | |
| 281 | + $a = str_replace(" ",",",$a); | |
| 282 | + if ($this->verificaOcorrencia($perfil,explode(",",$a))) | |
| 269 | 283 | { |
| 270 | 284 | $listaT = $this->pegaTemasSubGrupo($sgrupo["id_n2"]); |
| 271 | 285 | $down = "nao"; |
| ... | ... | @@ -293,7 +307,9 @@ class Arvore |
| 293 | 307 | $temas = array(); |
| 294 | 308 | foreach($dados as $tema) |
| 295 | 309 | { |
| 296 | - if($this->verificaOcorrencia($perfil,explode(",",$tema["n3_perfil"]))) | |
| 310 | + $a = $tema["n3_perfil"]; | |
| 311 | + $a = str_replace(" ",",",$a); | |
| 312 | + if($this->verificaOcorrencia($perfil,explode(",",$a))) | |
| 297 | 313 | {$temas[] = $this->formataTema($tema["id_tema"],$tema["publicado"]);} |
| 298 | 314 | } |
| 299 | 315 | return $temas; | ... | ... |