Commit 576967a18d875ff4018b1a825fe160aa7972a615
1 parent
493be660
Exists in
master
and in
7 other branches
Correção na acentuação e listagem dos temas
Showing
1 changed file
with
37 additions
and
8 deletions
Show diff stats
mobile/adicionatema.php
@@ -39,6 +39,9 @@ include("../classesphp/classe_menutemas.php"); | @@ -39,6 +39,9 @@ include("../classesphp/classe_menutemas.php"); | ||
39 | include("../ms_configura.php"); | 39 | include("../ms_configura.php"); |
40 | ?> | 40 | ?> |
41 | <html> | 41 | <html> |
42 | +<head> | ||
43 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | ||
44 | +</head> | ||
42 | <style> | 45 | <style> |
43 | body | 46 | body |
44 | { | 47 | { |
@@ -87,8 +90,9 @@ if ($tipo == "listatemas") | @@ -87,8 +90,9 @@ if ($tipo == "listatemas") | ||
87 | echo "<h1>Escolha o tema:</h1>"; | 90 | echo "<h1>Escolha o tema:</h1>"; |
88 | foreach($r as $l) | 91 | foreach($r as $l) |
89 | { | 92 | { |
90 | - echo "<input type='radio' onclick='adicionatema(\"".$l["tid"]."\")' />".$l["nome"]."<br>"; | 93 | + echo "<input type='radio' onclick='adicionatema(\"".$l["tid"]."\")' />".converte($l["nome"])."<br>"; |
91 | } | 94 | } |
95 | + echo "<br>"; | ||
92 | } | 96 | } |
93 | if($tipo == "adicionatema") | 97 | if($tipo == "adicionatema") |
94 | { | 98 | { |
@@ -104,25 +108,50 @@ if ($tipo == "adicionar") | @@ -104,25 +108,50 @@ if ($tipo == "adicionar") | ||
104 | echo "<h1>Escolha o sub-grupo:</h1>"; | 108 | echo "<h1>Escolha o sub-grupo:</h1>"; |
105 | $m = new Menutemas("","",$locsistemas,$locaplic,$menutemas,$urli3geo,$editores); | 109 | $m = new Menutemas("","",$locsistemas,$locaplic,$menutemas,$urli3geo,$editores); |
106 | $menus = $m->pegaListaDeMenus(); | 110 | $menus = $m->pegaListaDeMenus(); |
111 | + | ||
107 | foreach ($menus as $menu) | 112 | foreach ($menus as $menu) |
108 | { | 113 | { |
109 | if($menu["publicado"] != "NAO") | 114 | if($menu["publicado"] != "NAO") |
110 | { | 115 | { |
111 | - $r = $m->pegaListaDeGrupos($menu["idmenu"],"","sim"); | 116 | + $r = $m->pegaListaDeGrupos($menu["idmenu"],"nao","sim"); |
117 | + error_reporting(0); | ||
118 | + //echo "<pre>";var_dump($r);exit; | ||
112 | for($rid=0;$rid<count($r);$rid++) | 119 | for($rid=0;$rid<count($r);$rid++) |
113 | { | 120 | { |
114 | - $g = $r[$rid]; | ||
115 | - echo $g["nome"]."<br>"; | ||
116 | - $sub = $g["subgrupos"]; | ||
117 | - for($sid=0;$sid<count($sub);$sid++) | 121 | + if($r[$rid]) |
118 | { | 122 | { |
119 | - $s = $sub[$sid]; | ||
120 | - echo "<input type='radio' onclick='listatemas(\"".$rid."\",\"".$sid."\",\"".$menu["idmenu"]."\")' /><span style='color:gray;font-size:12pt;'>".$s["nome"]."</span><br>"; | 123 | + $g = $r[$rid]; |
124 | + $idgrupo = $rid; | ||
125 | + if($g["id_n1"]) | ||
126 | + {$idgrupo = $g["id_n1"];} | ||
127 | + if($g["subgrupos"]) | ||
128 | + { | ||
129 | + echo converte($g["nome"])."<br>"; | ||
130 | + $sub = $g["subgrupos"]; | ||
131 | + if(count($sub) > 0) | ||
132 | + { | ||
133 | + for($sid=0;$sid<count($sub);$sid++) | ||
134 | + { | ||
135 | + $s = $sub[$sid]; | ||
136 | + $idsubgrupo = $sub; | ||
137 | + if($s["id_n2"]) | ||
138 | + {$idsubgrupo = $s["id_n2"];} | ||
139 | + if($s["nome"] != "") | ||
140 | + echo " <input type='radio' onclick='listatemas(\"".$idgrupo."\",\"".$idsubgrupo."\",\"".$menu["idmenu"]."\")' /><span style='color:gray;font-size:12pt;'>".converte($s["nome"])."</span><br>"; | ||
141 | + } | ||
142 | + } | ||
143 | + } | ||
121 | } | 144 | } |
122 | } | 145 | } |
123 | } | 146 | } |
124 | } | 147 | } |
148 | + echo "<br>"; | ||
125 | } | 149 | } |
150 | +function converte($texto){ | ||
151 | + $texto = mb_convert_encoding($texto,"ISO-8859-1",mb_detect_encoding($texto)); | ||
152 | + return $texto; | ||
153 | +} | ||
154 | + | ||
126 | ?> | 155 | ?> |
127 | <input type='button' value='retorna' style='cursor:pointer;' onclick='retorno()' /><br> | 156 | <input type='button' value='retorna' style='cursor:pointer;' onclick='retorno()' /><br> |
128 | </body> | 157 | </body> |