<?PHP
function print_brudne($drt,$ii) {
  if(is_string($drt)) {
    echo $drt . "\n";
  } else {
    if($ii < $GLOBALS["ILENAGL"]) {
      if(isset($GLOBALS["npdb"])) {
        echo $GLOBALS["npdb"]->Int8($GLOBALS["attryby"][$drt]) . '#' . $GLOBALS["npdb"]->Int32($drt) . "#" . $GLOBALS["npdb"]->GetRecord($drt) . "\n";
      }
    } else {
      echo $GLOBALS["tpdb"]->Int8($GLOBALS["attryby"][$drt]) . '#' . $GLOBALS["tpdb"]->Int32($drt) . "#" . $GLOBALS["tpdb"]->GetRecord($drt) . "\n";
    }
  }
}

function fprint_brudne($fp,$drt,$ii) {
  if(is_string($drt)) {
    fputs($fp,"" . $drt . "\n");
  } else {
    if($ii < $GLOBALS["ILENAGL"]) {
      if(isset($GLOBALS["npdb"])) {
        fputs($fp, "" . $GLOBALS["npdb"]->Int8($GLOBALS["attryby"][$drt]) . "#" . $GLOBALS["npdb"]->Int32($drt) . "#" . $GLOBALS["npdb"]->GetRecord($drt) . "\n");
      }
    } else {
      fputs($fp, "" . $GLOBALS["tpdb"]->Int8($GLOBALS["attryby"][$drt]) . "#" . $GLOBALS["tpdb"]->Int32($drt) . "#" . $GLOBALS["tpdb"]->GetRecord($drt) . "\n");
    }
  }
}
?>
