Bladeren bron

Add table 'Featured on Torn'

Foppe Hemminga 6 jaren geleden
bovenliggende
commit
1d00cfa182
1 gewijzigde bestanden met toevoegingen van 30 en 0 verwijderingen
  1. 30 0
      index.php

+ 30 - 0
index.php

@@ -43,7 +43,37 @@
 		print_r($r);
 		print "</pre>";
 */
+        $query = sprintf("SELECT * FROM race_program  
+            WHERE race_date >= %s AND torn = TRUE;", $conn->quote($date->format('Y-m-d')));
+        $stmt2 = $conn->query( $query );
         ?>
+        <table class="table table-striped table-bordered">
+            <caption>Races featured on Torn</caption>
+            <thead>
+                <tr>
+                    <th>venue</th>
+                    <th>state</th>
+                    <th>date</th>
+                    <th>race</th>
+                    <th>start</th>
+                    <th>utc></th>
+                </tr>
+            </thead>
+            <tbody>
+            <?php
+            while ( $row = $stmt2->fetch( PDO::FETCH_ASSOC ) ) : ?>
+                <tr>
+                    <!-- <td><?php // echo htmlspecialchars($row['id']); ?></td> -->
+                    <td><?php echo htmlspecialchars($row['venue']); ?></td>
+                    <td><?php echo htmlspecialchars($row['state']); ?></td>
+                    <td><?php echo htmlspecialchars($row['race_date']); ?></td>
+                    <td><?php echo htmlspecialchars($row['race']); ?></td>
+                    <td><?php echo htmlspecialchars(substr($row['start_time'], 0, -3)); ?></td>
+                    <td><?php $t = strtotime($row['utctime']); echo gmdate('H:i', $t); ?></td>
+                </tr>
+			<?php endwhile; ?>
+            </tbody>
+        \</table>
 <table class="table table-striped table-bordered">
     <?php
     $table_head = <<<TABLEHEAD