<?php
function paperForm( $Conf, $title="", $abstract="", $authorInfo="", $collaborators="", $topics=array() ){
?>
<table border="0" width="100%" bgcolor="<?php echo $Conf->bgOne ?>">
<tr>
  <td valign="top"><P><STRONG>Title</STRONG></P></td>
  <td valign="top"> <input type="text" name="title" size="75"
	value="<?php echo stripslashes($title)?>"
	MAXLENGTH=200></td>
</tr>

<tr>
<td valign="top"><P><STRONG>Abstract</STRONG></P> <P>Maximum 200 words.</P> </td>
<td valign="top"><textarea rows="30" name="abstract" cols="75"><?php echo stripslashes($abstract)?></textarea> </td>
</tr>

<tr>
  <td valign="top"><P><STRONG>Author Information</STRONG></P>
      <P>List all authors and their affiliation in order of appearance.
Please list one author per line.</P></td>
  <td valign="top"> <textarea rows=10 name="authorInfo" cols=75><?php echo stripslashes($authorInfo)?></textarea></td>
</tr>

<tr>
  <td valign="top"><P><STRONG>Collaborators and Other Affiliations for <EM>ALL</EM>
Authors of the Paper</STRONG></P>
<P>List all persons in alphabetical order (including their current
affiliations) who are currently, or who have been collaborators or
co-authors in the past.  This includes your advisor, students,
and collaborators.  Please list one person per line.  This is
used to avoid conflicts of interest when papers are assigned.</P>
</td>
  <td valign="top"> <textarea rows=20 name="collaborators" cols=75><?php echo stripslashes($collaborators)?></textarea></td>
</tr>
<TR><TD BGCOLOR='White' COLSPAN=2></TD></TR>
<?php 
$query="SELECT TopicArea.topicAreaId, TopicArea.topicName FROM TopicArea ";
$result = $Conf->q($query);
if ( DB::isError($result) ) {
  $Conf->errorMsg("Error in query " . $result->getMessage());
} else if ($result->numRows() > 0) {
?>
 <tr>
    <td valign="top" width="16%" height="19"><P><STRONG>Topics</STRONG></P> <P>Please mark
              all topics that apply to your submission.  This will
              be used to help match reviewers to your
              paper.  Select at least one.</P></td>
    <td valign="top" width="84%" height="19">
<?php 
  while ($row = $result->fetchRow()) {
    $id = $row[0];
    $topic = $row[1];
    if (IsSet($topics[$id])) {
      $checked = " CHECKED ";
    } else {
      $checked ="";
    }
    print "<INPUT type=checkbox name=topics[] value=$id $checked> $topic <br>";
  }
?>
</td>
</tr>
<?php 
	      }
?>



</table>
<?php
}
?>

