You are here

function pBarcode39::pBarcode39 in Visitors 7

Same name and namespace in other branches
  1. 7.2 pChart/class/pBarcode39.class.php \pBarcode39::pBarcode39()

File

pChart/class/pBarcode39.class.php, line 27

Class

pBarcode39

Code

function pBarcode39($BasePath = "", $EnableMOD43 = FALSE) {
  $this->MOD43 = $EnableMOD43;
  $this->Codes = "";
  $this->Reverse = "";
  $FileHandle = @fopen($BasePath . "data/39.db", "r");
  if (!$FileHandle) {
    die("Cannot find barcode database (" . $BasePath . "data/39.db).");
  }
  while (!feof($FileHandle)) {
    $Buffer = fgets($FileHandle, 4096);
    $Buffer = str_replace(chr(10), "", $Buffer);
    $Buffer = str_replace(chr(13), "", $Buffer);
    $Values = preg_split("/;/", $Buffer);
    $this->Codes[$Values[0]] = $Values[1];
  }
  fclose($FileHandle);
}