Beispiel #1
0
        Query("delete from usuario where usua_codigo = '" . $codigo . "'");
        Disconnect();
        //*
        echo "<script type=\"text/javascript\">\n\t\t\t\t\talert(\"Se ha borrado exitosamente\");\n\t\t\t\t\twindow.location.href=\"../index.php\"\n\t\t\t\t</script>";
        //*/
    } catch (Exception $e) {
        echo "Message: " . $e->getMessage();
    }
}
if (isset($_POST['ingresar'])) {
    try {
        Connect();
        $usuario = $_POST["usuario"];
        $clave = $_POST["clave"];
        if (IsEmpty("select usua_codigo from usuario where usua_nombre='" . $usuario . "' and usua_clave='" . $clave . "'") == false) {
            $rol = Value("select rol_permiso from usuario,rol,rous where fk_usua=usua_codigo and fk_rol=rol_codigo and usua_nombre='" . $usuario . "'", "ROL_PERMISO");
            if ($rol == false) {
                echo "<script type=\"text/javascript\">\n\t\t\t\t\talert(\"Agregue un rol al usuario\");\n\t\t\t\t\twindow.location.href=\"../index.php\"\n\t\t\t\t</script>";
                //*/
            }
            session_start();
            $_SESSION['usuario'] = $usuario;
            $_SESSION['rol'] = $rol;
        }
        Disconnect();
        echo "<script type=\"text/javascript\">\n\t\t\t\t\twindow.location.href=\"../index.php\"\n\t\t\t\t</script>";
        //*/
    } catch (Exception $e) {
        echo "Message: " . $e->getMessage();
    }
}
// Sample:
// Flatten all form fields in a document.
// Note that this sample is intended to show that it is possible to flatten
// individual fields. PDFNet provides a utility function PDFDoc.FlattenAnnotations()
// that will automatically flatten all fields.
//----------------------------------------------------------------------------------
$doc = new PDFDoc($output_path . "forms_test1.pdf");
$doc->InitSecurityHandler();
// Traverse all pages
if (true) {
    $doc->FlattenAnnotations();
} else {
    for ($pitr = $doc->GetPageIterator(); $pitr->HasNext(); $pitr->Next()) {
        $page = $pitr->Current();
        $annots = $page->GetAnnots();
        if ($annots) {
            // Look for all widget annotations (in reverse order)
            for ($i = $annots->Size() - 1; $i >= 0; --$i) {
                if (!strcmp(annots . GetAt(i) . Get("Subtype") . Value() . GetName(), "Widget")) {
                    $field($annots->GetAt(i));
                    $field->Flatten($page);
                    // Another way of making a read only field is by modifying
                    // field's e_read_only flag:
                    //    field.SetFlag(Field::e_read_only, true);
                }
            }
        }
    }
}
$doc->Save($output_path . "forms_test1_flattened.pdf", 0);
echo nl2br("Done.\n");