|
|
@@ -44,19 +44,31 @@
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
TABLEHEAD;
|
|
|
+ $table_foot = <<<TABLEFOOT
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+TABLEFOOT;
|
|
|
echo( $table_head );
|
|
|
$new_venue = '';
|
|
|
$new_day = '';
|
|
|
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) : ?>
|
|
|
<?php
|
|
|
- if ( $new_day != '' && $new_day != $row['race_date'] ) {
|
|
|
- echo $table_foot;
|
|
|
- echo '<h4>' . htmlspecialchars($row['race_date']) . '</h4>';
|
|
|
- echo $table_head;
|
|
|
- } else if ( $new_venue != '' && $new_venue != $row['venue'] ) {
|
|
|
- echo $table_foot;
|
|
|
- echo $table_head;
|
|
|
- $new_venue = $row['venue'];
|
|
|
+ if ( $new_day != '' ) {
|
|
|
+ if ($new_day != $row['race_date']) {
|
|
|
+ echo $table_foot;
|
|
|
+ echo '<h4>' . htmlspecialchars($row['race_date']) . '</h4>';
|
|
|
+ echo $table_head;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $new_day = $row['race_date'];
|
|
|
+ }
|
|
|
+ if ( $new_venue != '' ) {
|
|
|
+ if ($new_venue != $row['venue'] ) {
|
|
|
+ echo $table_foot;
|
|
|
+ echo $table_head;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $new_venue = $row['venue'];
|
|
|
}
|
|
|
?>
|
|
|
<tr>
|
|
|
@@ -68,10 +80,6 @@ TABLEHEAD;
|
|
|
</tr>
|
|
|
<?php endwhile; ?>
|
|
|
<?php
|
|
|
- $table_foot = <<<TABLEFOOT
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
-TABLEFOOT;
|
|
|
echo $table_foot;
|
|
|
|
|
|
}catch (PDOException $e){
|