2
0
Fork 0

Make table on homepage responsive

master
Skylar Ittner vor 6 Jahren
Ursprung f6b4c1c4ce
Commit 050e13cbe8

@ -22,53 +22,55 @@ include __DIR__ . "/../bits/navbar.php";
</div>
<table id="questions" class="table table-hover mt-4">
<thead>
<tr>
<th data-priority="0"></th>
<th data-priority="1"><i class="far fa-fw fa-question-circle d-none d-md-inline"></i> Question</th>
<th data-priority="2"><i class="fas fa-fw fa-link d-none d-md-inline"></i> Code</th>
<th data-priority="2"><i class="fas fa-fw fa-list d-none d-md-inline"></i> Answers</th>
<th data-priority="1"><i class="fas fa-fw fa-reply-all d-none d-md-inline"></i> Responses</th>
</tr>
</thead>
<tbody>
<?php
$table = $database->select("questions", ['qid', 'qtext', 'qcode']);
foreach ($table as $row) {
$answers = $database->count("answers", ['qid' => $row['qid']]);
$responses = $database->count("responses", ['qid' => $row['qid']]);
?>
<div class="table-responsive">
<table id="questions" class="table table-hover mt-4">
<thead>
<tr>
<td>
<a class="btn btn-sm btn-info" href="<?php echo "./q/" . $row['qcode']; ?>">
<i class="fas fa-chart-bar"></i> Results
</a>
</td>
<td>
<?php echo $row['qtext']; ?>
</td>
<td>
<?php echo $row['qcode']; ?>
</td>
<td>
<?php echo $answers; ?>
</td>
<td>
<?php echo $responses; ?>
</td>
<th data-priority="0"></th>
<th data-priority="1"><i class="far fa-fw fa-question-circle d-none d-md-inline"></i> Question</th>
<th data-priority="2"><i class="fas fa-fw fa-link d-none d-md-inline"></i> Code</th>
<th data-priority="2"><i class="fas fa-fw fa-list d-none d-md-inline"></i> Answers</th>
<th data-priority="1"><i class="fas fa-fw fa-reply-all d-none d-md-inline"></i> Responses</th>
</tr>
</thead>
<tbody>
<?php
}
?>
</tbody>
<tfoot>
<tr>
<th data-priority="0"></th>
<th data-priority="1"><i class="far fa-fw fa-question-circle d-none d-md-inline"></i> Question</th>
<th data-priority="2"><i class="fas fa-fw fa-link d-none d-md-inline"></i> Code</th>
<th data-priority="2"><i class="fas fa-fw fa-list d-none d-md-inline"></i> Answers</th>
<th data-priority="1"><i class="fas fa-fw fa-reply-all d-none d-md-inline"></i> Responses</th>
</tfoot>
</table>
$table = $database->select("questions", ['qid', 'qtext', 'qcode']);
foreach ($table as $row) {
$answers = $database->count("answers", ['qid' => $row['qid']]);
$responses = $database->count("responses", ['qid' => $row['qid']]);
?>
<tr>
<td>
<a class="btn btn-sm btn-info" href="<?php echo "./q/" . $row['qcode']; ?>">
<i class="fas fa-chart-bar"></i> Results
</a>
</td>
<td>
<?php echo $row['qtext']; ?>
</td>
<td>
<?php echo $row['qcode']; ?>
</td>
<td>
<?php echo $answers; ?>
</td>
<td>
<?php echo $responses; ?>
</td>
</tr>
<?php
}
?>
</tbody>
<tfoot>
<tr>
<th data-priority="0"></th>
<th data-priority="1"><i class="far fa-fw fa-question-circle d-none d-md-inline"></i> Question</th>
<th data-priority="2"><i class="fas fa-fw fa-link d-none d-md-inline"></i> Code</th>
<th data-priority="2"><i class="fas fa-fw fa-list d-none d-md-inline"></i> Answers</th>
<th data-priority="1"><i class="fas fa-fw fa-reply-all d-none d-md-inline"></i> Responses</th>
</tfoot>
</table>
</div>
</div>
Laden…
Abbrechen
Speichern