source: inc/analytics-table-1.php@ 0791611

Last change on this file since 0791611 was 0791611, checked in by sstalevska <sara.stalevska@…>, 21 months ago

Push the entire project.

  • Property mode set to 100644
File size: 786 bytes
Line 
1<h2 class="mt-5"><?= $quarterTitle ?> Quarter</h2>
2<table class="table">
3 <thead>
4 <tr>
5 <th>Category Name</th>
6 <th width="1">Star&nbsp;rating</th>
7 </tr>
8 </thead>
9 <tbody>
10 <?php
11 /**
12 * Fetch all ratings by category for this quarter and display them in the table.
13 */
14 $i = 0;
15 $sql = 'SELECT category_name, ' . $quarterId . ' FROM avg_rating_by_category_by_trimesters ORDER BY ' . $quarterId . ' DESC';
16 foreach ($conn->query($sql) as $row) {
17 $i++;
18 ?>
19 <tr>
20 <td><?= $row['category_name'] ?></td>
21 <td class="text-end"><?= number_format($row[$quarterId], 2) ?></td>
22 </tr>
23 <?php } ?>
24 </tbody>
25</table>
Note: See TracBrowser for help on using the repository browser.