<html>
<body>
<h2 align="center"><?php echo $FormParams['heading'].$myrow['reportname'].' - '.RPT_BTN_DB; ?></h2>
<form name="DBPageSetup" method="post" action="ReportCreator.php?action=step5">
	<input name="ReportID" type="hidden" value="<?php echo $ReportID; ?>">
	<input name="Type" type="hidden" value="<?php echo $Type; ?>">
	<input name="ReportName" type="hidden" value="<?php echo $myrow['reportname']; ?>">
  <table align="center" width="550"  border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><input name="todo" type="submit" id="todo" value="<?php echo RPT_BTN_BACK; ?>"></td>
      <td><div align="center"><input name="todo" type="submit" id="todo" value="<?php echo RPT_BTN_UPDATE; ?>"></div></td>
      <td><div align="right"><input name="todo" type="submit" id="todo" value="<?php echo RPT_BTN_CONT; ?>"></div></td>
    </tr>
  </table>
  <table align="center" border="2" cellspacing="1" cellpadding="1">
    <tr>
      <td>&nbsp;</td>
      <td><div align="center"><?php echo RPT_TBLNAME; ?></div></td>
      <td><?php echo RPT_LINKEQ; ?></td>
    </tr>
    <tr>
      <td><?php echo RPT_PRIMARY; ?></td>
      <td><select name="Table1"><OPTION Value=""><?php echo RPT_SELECT; ?>
	  	<?php echo CreateTableList($ReportID,1); ?></select></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><?php echo RPT_SECOND; ?></td>
      <td><select name="Table2"><OPTION Value=""><?php echo RPT_SELECT; ?>
	  	<?php if ($myrow['table1']) echo CreateTableList($ReportID,2); ?></select></td>
      <td><input name="Table2Criteria" type="text" value="<?php echo $myrow['table2criteria']; ?>" size="76" maxlength="75"><td>
    </tr>
    <tr>
      <td><?php echo RPT_THIRD; ?></td>
      <td><select name="Table3"><OPTION Value=""><?php echo RPT_SELECT; ?>
	  	<?php if ($myrow['table2']) echo CreateTableList($ReportID,3); ?></select></td>
      <td><input name="Table3Criteria" type="text" value="<?php echo $myrow['table3criteria']; ?>" size="76" maxlength="75"><td>
    </tr>
    <tr>
      <td><?php echo RPT_FOURTH; ?></td>
      <td><select name="Table4"><OPTION Value=""><?php echo RPT_SELECT; ?>
	  	<?php if ($myrow['table3']) echo CreateTableList($ReportID,4); ?></select></td>
      <td><input name="Table4Criteria" type="text" value="<?php echo $myrow['table4criteria']; ?>" size="76" maxlength="75"><td>
    </tr>
    <tr>
      <td><?php echo RPT_FIFTH; ?></td>
      <td><select name="Table5"><OPTION Value=""><?php echo RPT_SELECT; ?>
	  	<?php if ($myrow['table4']) echo CreateTableList($ReportID,5); ?></select></td>
      <td><input name="Table5Criteria" type="text" value="<?php echo $myrow['table5criteria']; ?>" size="76" maxlength="75"><td>
    </tr>
    <tr>
      <td><?php echo RPT_SIXTH; ?></td>
      <td><select name="Table6"><OPTION Value=""><?php echo RPT_SELECT; ?>
	  	<?php if ($myrow['table5']) echo CreateTableList($ReportID,6); ?></select></td>
      <td><input name="Table6Criteria" type="text" value="<?php echo $myrow['table6criteria']; ?>" size="76" maxlength="75"><td>
    </tr>
  </table>
</form>
</body>
</html>
