PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Pablo Veinberg   PHP Validar CPF e CNPJ   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Index
Class: PHP Validar CPF e CNPJ
Validate Brazil fiscal numbers
Author: By
Last change:
Date: 9 years ago
Size: 4,140 bytes
 

Contents

Class file image Download
<!DOCTYPE html>

<html>
    <head>
        <title>Validação de Chaves Fiscais</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
        <link href="./css/style.css" rel="stylesheet"/>
    </head>
    <body>
        <div id="content">

            <h2>Validação de Chaves Fiscais</h2>
            <div>
                <ol>
                    <li><a href="cpf.php">Testar validação CPF</a>
                    <li><a href="cnpj.php">Testar validação CNPJ</a>
                </ol>
            </div>

            <div>
                <h3>Documentação</h3>
                <h4>Introdução</h4>
                <p>
                    Em nossas aplicações, muitas vezes é necessário validar chaves fiscais de pessoas físicas ou jurídicas
                    (<a href="http://pt.wikipedia.org/wiki/Cadastro_de_Pessoas_F%C3%ADsicas" target="_blank">CPF</a>
                    / <a href="http://pt.wikipedia.org/wiki/CNPJ" target="_blank">CNPJ</a>). Além de verificar se a chave em questão é
                    válida ou não, precisamos saber qual o motivo
                    pelo qual essa chave não é válida. A classe <span class="nomeClasse">ValidarChaveFiscal</span> oferece
                    validação dos dígitos verificadores através de um <i>boolean</i>. No caso falso também pode retornar
                    os motivos do resultado negativo.
                </p>
                <h4>Classe ValidarChaveFiscal</h4>

                <table class="api" border="1">
                    <tbody>
                        <tr>
                            <th colspan="2" class="titulo">Constantes</th>
                        </tr>
                    <th>Nome</th>
                    <th>Valor</th>
                    <?php
                   
require_once './classes/ValidarChaveFiscal.php';
                    require_once
'./includes/funcs.php';
                   
$class = new ReflectionClass('ValidarChaveFiscal');

                   
$constantes = $class->getConstants();

                    foreach (
$constantes as $nome => $valor):
                       
?>
<tr>
                            <td><?= $nome ?></td>
                            <td><?= $valor ?></td>
                        </tr>
                    <?php endforeach; ?>
</tbody>
                </table>

                <table class="api" border="1">
                    <tbody>
                        <tr>
                            <th colspan="2" class="titulo">Propriedades</th>
                        </tr>
                    <th>Nome</th>
                    <th>Descrição</th>
                    <?php
                    $propriedades
= $class->getProperties();

                    foreach (
$propriedades as $propriedade):
                       
?>
<tr>
                            <td><?= $propriedade->getName(); ?></td>
                            <td><?= clean_comments($propriedade->getDocComment()); ?></td>
                        </tr>
                    <?php endforeach; ?>


                    </tbody>
                </table>


                <table class="api" border="1">
                    <tbody>
                        <tr>
                            <th colspan="3" class="titulo">Métodos</th>
                        </tr>
                    <th>Nome</th>
                    <th>Descrição</th>
                    <?php
                    $metodos
= $class->getMethods();

                    foreach (
$metodos as $metodo):
                       
?>
<tr>
                            <td><i><?= metodo_acesso($metodo); ?></i>&nbsp;<?= $metodo->getName(); ?></td>
                          
                            <td><?= clean_comments($metodo->getDocComment()); ?></td>
                        </tr>
                    <?php endforeach; ?>

                    </tbody>
                </table>
            </div>

        </div>

    </body>
</html>