<?php

include "x12_validator.inc.php";
$vx12 = new x12valid_837_4010();
$d = dir("x12files/");
while (false !== ($entry = $d->read())) {
    if (is_file("x12files/" . $entry)) {
        $x12_content = file_get_contents("x12files/" . $entry);
        $vx12->setX12($x12_content);
        if ($vx12->valid4010A()) {
            echo $entry . " : PASSED!<br>";
        } else {
            echo $entry . " : " . $vx12->getReason() . "<br>";
        }
        ob_flush();
    }
}
Example #2
0
<?php

include "x12_parser.inc.php";
include "x12_validator.inc.php";
include "../XMLParser/XMLParser.inc.php";
$x12 = new x12parse_4010();
$vx12 = new x12valid_837_4010();
$data = file_get_contents('x12files/MC174.TXT');
$x12->setX12($data);
$vx12->setX12($data);
// Get the account information for this plugin
$xml = file_get_contents("ansix12_4010.dicc.xml");
$pluginXML = new XMLParser($xml);
$pluginXML->Parse();
echo "<pre>";
$x12->setDicc($pluginXML);
echo "</pre>";
echo "Document Type: " . $x12->docType() . "<br>";
echo "Document Control Number: " . $x12->docControlNumber() . "<br>";
echo "<br>";
echo "Document Interchange Information <br>";
echo "--------------------------------------------------------------------------------------------------<br>";
echo "<pre>";
print_r($x12->docISA());
echo "</pre>";
echo "<br>";
echo "<br>";
echo "Functional Group Information <br>";
echo "--------------------------------------------------------------------------------------------------<br>";
echo "<pre>";
print_r($x12->docGS());