|
@@ -30,7 +30,8 @@
|
|
|
ORDER BY race_date, venue, race;", $conn->quote(date("Y-m-d")));
|
|
ORDER BY race_date, venue, race;", $conn->quote(date("Y-m-d")));
|
|
|
$stmt = $conn->query($query);
|
|
$stmt = $conn->query($query);
|
|
|
// $r = $stmt->fetch(PDO::FETCH_ASSOC);
|
|
// $r = $stmt->fetch(PDO::FETCH_ASSOC);
|
|
|
- ?>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ $table_head = <<<TABLEHEAD
|
|
|
<table class="table table-striped table-bordered">
|
|
<table class="table table-striped table-bordered">
|
|
|
<thead>
|
|
<thead>
|
|
|
<tr>
|
|
<tr>
|
|
@@ -42,7 +43,22 @@
|
|
|
</tr>
|
|
</tr>
|
|
|
</thead>
|
|
</thead>
|
|
|
<tbody>
|
|
<tbody>
|
|
|
- <?php while($row = $stmt->fetch(PDO::FETCH_ASSOC)) : ?>
|
|
|
|
|
|
|
+TABLEHEAD;
|
|
|
|
|
+ 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'];
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
<tr>
|
|
<tr>
|
|
|
<td><?php echo htmlspecialchars($row['id']); ?></td>
|
|
<td><?php echo htmlspecialchars($row['id']); ?></td>
|
|
|
<td><?php echo htmlspecialchars($row['venue']); ?></td>
|
|
<td><?php echo htmlspecialchars($row['venue']); ?></td>
|
|
@@ -51,9 +67,13 @@
|
|
|
<td><?php echo htmlspecialchars($row['horse']); ?></td>
|
|
<td><?php echo htmlspecialchars($row['horse']); ?></td>
|
|
|
</tr>
|
|
</tr>
|
|
|
<?php endwhile; ?>
|
|
<?php endwhile; ?>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ $table_foot = <<<TABLEFOOT
|
|
|
</tbody>
|
|
</tbody>
|
|
|
</table>
|
|
</table>
|
|
|
- <?php
|
|
|
|
|
|
|
+TABLEFOOT;
|
|
|
|
|
+ echo $table_foot;
|
|
|
|
|
+
|
|
|
}catch (PDOException $e){
|
|
}catch (PDOException $e){
|
|
|
// report error message
|
|
// report error message
|
|
|
echo $e->getMessage();
|
|
echo $e->getMessage();
|