<!-- <div class="pagination">
  <a href="#">&laquo;</a>
    <a href="#">1</a>
  <a class="active" href="#">2</a>
  <a href="#">3</a>
  <a href="#">4</a>
  <a href="#">5</a>
  <a href="#">6</a>
  <a href="#">&raquo;</a>
</div> -->
<h1 class="grey-text center">All Questions</h1>
<?php
     require_once 'db.connect.php';
     require_once '/../../helpers/func/helper.php';
     require_once '/../../helpers/classes/Question.php';
     require_once '/../../helpers/classes/Answer.php';

    $question = new Question($conn);
    $allQuestions = json_decode($question->getAllQuestions());
    
    $answer = new Answer($conn);

    for ($c = 0; $c < count($allQuestions); $c++){
        $allAnswer = json_decode($answer->getAllByQuestionId( $allQuestions[$c]->id));
?>        
 

<li class="collection-item">
    <div class="col s3">
        <!-- <div class="col s6">
            <span>999999</span>
            <span>Votes</span>
        </div> -->
        <div class="col s6">
            <span><?php print count($allAnswer) ?></span>
            <span>Answers</span>
        </div>
    </div>
 
    <div class="col s9">
        <a href="question.php?id=<?php print $allQuestions[$c]->id ?>&title=<?php print replace_dashes($allQuestions[$c]->topic, true) ?>">
            <span class="title__name"><?php print $allQuestions[$c]->topic ?></span>
        </a>
        <div class="valign-wrapper">
            <small class="right-align"><?php print $allQuestions[$c]->date ?></small>
        </div>
    </div>
</li>

<?php
    }
?>