示例#1
0
function Main()
{
    $cod = $_POST["c"];
    $des = urldecode($_POST["d"]);
    header('Content-Type: text/html; charset=iso-8859-1');
    try {
        $p = new Permissao();
        if ($cod != "") {
            $p->setCodigo($cod);
        }
        if ($des != "") {
            $p->setDescricao($des);
        }
        if ($cod == "") {
            if ($p->AdicionaPermissao()) {
                echo "GRAVADO";
            }
        } else {
            if ($p->AtualizaPermissao()) {
                echo "GRAVADO";
            }
        }
    } catch (Exception $ex) {
        echo $ex->getMessage();
    }
}
示例#2
0
function fntDeletaPermissaoSistema()
{
    $codgrupo = base64_decode($_POST['r']);
    $u = new Permissao();
    $u->setCodigo($codgrupo);
    if ($u->DeletaPermissao()) {
        echo "SUCESSO";
    } else {
        echo "ERRO";
    }
}