<input type="radio" name="vote" value="anti" id="anti" /><img class="antilabel" src="images/thumbs_down.png" /> </label> <label class="neutrallabel"> <input type="radio" name="vote" value="neutral" id="neutral" checked="checked" />?</label> <input type="submit" name="commentButton" value="Submit" /> <input type="hidden" name="form" value="comment" /> <input type="hidden" name="bill" value="<?php echo $bill["bill_id"]; ?> " /> </form> </div> <div class="pro"><h3>Yea</h3> <?php $comments = $dao->getComments($bill["bill_id"], "pro"); foreach ($comments as $comment) { ?> <span><?php echo $comment["username"]; ?> says:</span> <?php echo $comment["comment"] . "<br />"; echo "DATE:" . $comment["date"] . "<br />"; ?> <?php } ?> </div>
<div class="comments"> <h2>Comments</h2> <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/Dao.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/User.php"; $dao = new Dao(); $usr = new User(); $comments = $dao->getComments($post_id); foreach ($comments as $comment) { $user = $dao->getUserById($comment["user_id"]); echo "<div class='regular p2 bg-light-gray m2 rounded'>"; echo htmlspecialchars($comment["content"]); echo "</div>"; echo "<div class='bold'>"; echo htmlspecialchars($usr->user_name($user)); echo "</div>"; } ?> </div>