<?
include('../Code/confHeader.inc');
$Me -> goIfInvalid("../index.php");
$Me -> goIfNotChair('../index.php');
$Conf -> connect();
?>

<html>

<? $Conf->header("The Chairs View of Paper #$paperId") ?>

<body>
<?
if (!IsSet($paperId) || $paperId == 0) {
  $Conf->errorMsg("No paper was selected for finalization?" );
} else {
  $query = "SELECT Paper.title, Paper.abstract, Paper.authorInformation"
    . " FROM Paper WHERE Paper.paperId=$paperId ";
  $result = $Conf->qe($query);
  if ( DB::isError($result) ) {
    $Conf->errorMsg("That's odd - paper #$paperId isn't suitable for finalizing. "
		    . $result->getMessage());
  } else {
    $row = $result->fetchRow();
    $i = 0;
    $title = $Conf->safeHtml($row[$i++]);
    $abstract = $Conf->safeHtml($row[$i++]);
    $authorInfo = $Conf->safeHtml($row[$i++]);
?>

<table border=1 bgcolor="<?echo $Conf->bgOne?>" >
   <tr> <h3> <b> Paper # <? echo $paperId ?>
	<a href="CheckPaper.php?paperId=<?echo $paperId?>">
   		(Download) </a> </b> <h3> <tr>
   <tr> <td> Title: </td> <td> <? echo $title ?> </td> </tr>
   <tr> <td> Author Information: </td> <td> <? echo $authorInfo ?> </td> </tr>
   <tr> <td> Abstract: </td> <td> <? echo $abstract ?> </td> </tr>
<td> Indicated Topics </td>
<td>
<?
   $query="SELECT topicName from TopicArea, PaperTopic "
   . "WHERE PaperTopic.paperId=$paperId "
   . "AND PaperTopic.topicId=TopicArea.topicAreaId ";
    $result = $Conf->qe($query);
    if ( ! DB::isError($result) ) {
      print "<ul>";
      while ($row=$result->fetchRow()) {
	print "<li>" . $row[0] . "</li>\n";
      }
      print "</ul>";
    }
?>
</td>

</table>
<?
   }
}
?>

<? $Conf->footer() ?>

</body>
</html>
