<?php
declare(strict_types=1);
require_once("PaperRecord.php");

if (isOnline() or Config::isTesting()) {
  [$eventmain, , $full, $toc] = getInputValues($_GET);
  error_reporting(E_ALL & ~E_USER_NOTICE);
} else {
  [$eventmain, , $full, $toc] = getInputValuesShell($argv);
}

$eventRecord = getEventRecord($eventmain);
if (!$eventRecord->isJournal() and $full == "" and time() > strtotime($eventRecord->getEventDateStartISO()) + 3600*24*90) {
  $full = "noabs";
}

$fd = fopen("php://output", "w");
$eventRecord->getFormatter()->printHTML($full, $toc, $fd);
fclose($fd);

?>
