<HTML><HEAD><TITLE>Classifieds</TITLE></HEAD>
<BODY BGCOLOR=cornsilk>
<?
include("common.inc");
if ($cat=="") $cat=1;
include("head.inc");
?>
<TABLE BORDER=0 WIDTH=80% CELLSPACING=10>
<TR><TD VALIGN=TOP BGCOLOR=<?=$navcolor?>>
<?
include("navtable.inc");
?>
<A HREF=add.php?cat=<?= $cat ?>>Place an ad here</A>
</TD><TD WIDTH=80% VALIGN=TOP>
<?
include("show.inc");
if ($start=="") $start=0;
$qsiz=$pagesiz+1;
$now=strftime($db_datefmt);
$result=query($sql_showquery);
$rowct=0;
if ($can_use_limit==0) {  // we have to skip to the offset manually
  for ($i=1;$i<=$start;$i++) 
     fetch_array($result);
  }
while ($rows=fetch_array($result)) {
  $rowct++;
  if ($rowct==$qsiz) break;
  showad($rows);
}
if ($start==0 && $rowct==0) {
  echo "<H1>No ads at present</H1>";
  echo "<P><A HREF=add.php?cat=$cat>You can place the first ad</A>";
  }
else {
?>
<TABLE BORDER=0 WIDTH=80%>
<TR><TD WIDTH=10% ALIGN=LEFT VALIGN=TOP>
<? 
if ($start!=0) {
$offset=$start-$pagesiz;
echo "<A HREF=show.php?start=$offset&cat=$cat>&lt;&lt;&lt;</A>";
}
else {
echo "&lt;&lt;&lt;";
}
?>
</TD><TD WIDTH=80%>&nbsp;</TD><TD WIDTH=10% ALIGN=RIGHT VALIGN=TOP>
<?
if ($rowct==$qsiz) {
$offset=$start+$pagesiz;
echo "<A HREF=show.php?start=$offset&cat=$cat>&gt;&gt;&gt;</A>";
}
else {
echo "&gt;&gt;&gt;";
}
?>
</TD></TR></TABLE>
<? 
echo "<BR><A HREF=add.php?cat=$cat>Place a new ad in this category</A>";
} // end else ?>
</TD></TR></TABLE>

</BODY></HTML>