-
Notifications
You must be signed in to change notification settings - Fork 0
/
vwusuariosgrupo.php
72 lines (61 loc) · 1.68 KB
/
vwusuariosgrupo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
//--utf8_encode --
session_start();
include_once 'inc/comuns.inc.php';
include_once 'cls/grupo.class.php';
include_once 'cls/permissao.class.php';
include_once 'cls/usuario.class.php';
include_once 'cls/components/botao.class.php';
function Main()
{
try
{
$u = unserialize($_SESSION["usu"]);
$mensagem = $_GET["m"];
$tpl = file_get_contents("tpl/usuariosgrupos.html");
$tpl = str_replace("<!--telatopo-->", Comuns::GeraTopoPagina($u), $tpl);
$tpl = str_replace("<!--Mensagem-->", (isset($mensagem) && $mensagem != "") ? base64_decode($mensagem) : "", $tpl);
$botoes = Botao::BotaoSalvar("fntGravaUsuariosGrupo();", "@lng[Salvar as alterações]");
$tpl = str_replace("<!--itens-toolbar-->", $botoes, $tpl);
$grupos = new Grupo();
$rs = $grupos->ListaRecordSet();
if ($rs != 0)
{
if (mysql_num_rows($rs) > 0)
{
$opts .= '<option value="">@lng[Selecione]</option>';
while ($linha = mysql_fetch_array($rs))
{
$opts .= '<option value="' . $linha["Codigo"] . '">' . $linha["Descricao"] . '</option>';
}
}
else
{
$opts = '<option value="-1">@lng[Nenhum grupo cadastrado]</option>';
}
}
else
{
$opts = '<option value="-1">@lng[Erro ao carregar]</option>';
}
$tpl = str_replace("##OptsGrupos##", $opts, $tpl);
$tpl = str_replace("##OptsTU##", "", $tpl);
$tpl = str_replace("##OptsUDG##", "", $tpl);
echo( Comuns::Idioma($tpl) );
}
catch (Exception $ex)
{
$msg = base64_encode($ex->getMessage());
header("Location:vwerro.php?m=" . $msg);
}
}
if (Comuns::EstaLogado())
{
Main();
}
else
{
$msg = base64_encode("@lng[Você deve estar logado para acessar esta tela]");
header("Location:index.php?m=" . $msg);
}
?>