Make table on homepage responsive
This commit is contained in:
parent
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>
|
Loading…
x
Reference in New Issue
Block a user