<?php require_once('Connections/JCH_Sql.php'); ?>
<?php
$maxRows_Comments = 2;
$pageNum_Comments = 0;
if (isset($_GET['pageNum_Comments'])) {
  $pageNum_Comments = $_GET['pageNum_Comments'];
}
$startRow_Comments = $pageNum_Comments * $maxRows_Comments;

mysql_select_db($database_JCH_Sql, $JCH_Sql);
$query_Comments = "SELECT * FROM Guestbook WHERE YesNo = 1 ORDER BY Id DESC";
$query_limit_Comments = sprintf("%s LIMIT %d, %d", $query_Comments, $startRow_Comments, $maxRows_Comments);
$Comments = mysql_query($query_limit_Comments, $JCH_Sql) or die(mysql_error());
$row_Comments = mysql_fetch_assoc($Comments);

if (isset($_GET['totalRows_Comments'])) {
  $totalRows_Comments = $_GET['totalRows_Comments'];
} else {
  $all_Comments = mysql_query($query_Comments);
  $totalRows_Comments = mysql_num_rows($all_Comments);
}
$totalPages_Comments = ceil($totalRows_Comments/$maxRows_Comments)-1;
?>
<html>
<head>
<title>J C H O N L I N E | Home</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="Images/style.css" rel="stylesheet" type="text/css">

<style type="text/css">

</style><script type="text/javascript" src="ajaxtabs/ajaxtabs.js">
</script>
</head>
<body>
<td width="" valign="top"><table width="98%" border="0" align="center" cellpadding="4" cellspacing="0" bgcolor="#FFFFFF">
  <?php do { ?>
  <tr>
    <td width="100%" bgcolor="#F8F8F8" class="default"><span class="Header1">Band Name : <a href="ArtistePage.php?BandName=<?php echo $row_Comments['bandURL']; ?>"><?php echo $row_Comments['band']; ?></a></span></td>
  </tr>
  <tr>
    <td bgcolor="#F8F8F8" class="default"><div align="justify"><b>Comments : </b><br>
            <?php echo $row_Comments['comment']; ?></div></td>
  </tr>
  <tr>
    <td bgcolor="#F8F8F8" class="default"><div align="right">Commented by : <?php echo $row_Comments['name']; ?> <span class="text"><br>
      &lt; <?php echo $row_Comments['email']; ?>&gt;</span> <br>
      <span class="text"><?php echo $row_Comments['datetime']; ?></span></div></td>
  </tr>
  <tr>
    <td class="default">&nbsp;</td>
  </tr>
  <?php } while ($row_Comments = mysql_fetch_assoc($Comments)); ?>
</table>

</body>
</html>