<?php
  require_once("classes/include.all.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>CSS Star Rating System fully functional using AJAX</title>
    <link type="text/css" href="styles/rating.css" rel="stylesheet" media="all" />
    <script type="text/javascript" src="scripts/prototype.js"></script>
    <script type="text/javascript" src="scripts/rating.js"></script>
  </head>
  <body>
    <h4>Race Rating System:</h4>    
    <?php
      $ratingData = Rating::OutputParentRating('1');
      
      if (Error::HasErrors())
      {
        echo Error::ShowErrorMessages();
        Error::ClearErrors();
      }
      else
      {
        echo $ratingData;
      }
    ?>
    <?php
      $ratingData = Rating::OutputRating('1','1');
      
      if (Error::HasErrors())
      {
        echo Error::ShowErrorMessages();
        Error::ClearErrors();
      }
      else
      {
        echo $ratingData;
      }
    ?>
    <?php
      $ratingData = Rating::OutputRating('1','2');
      
      if (Error::HasErrors())
      {
        echo Error::ShowErrorMessages();
        Error::ClearErrors();
      }
      else
      {
        echo $ratingData;
      }
    ?>
    <?php
      $ratingData = Rating::OutputRating('1','3');
      
      if (Error::HasErrors())
      {
        echo Error::ShowErrorMessages();
        Error::ClearErrors();
      }
      else
      {
        echo $ratingData;
      }
    ?>
  </body>
</html>
<?php
  Database::DeInitialize();
?>