Gazelle/sections/questions/ajax_get_answers.php

36 lines
675 B
PHP
Raw Normal View History

2013-10-14 08:00:53 +00:00
<?
2013-10-18 08:00:55 +00:00
$ID = (int)$_GET['id'];
2013-10-14 08:00:53 +00:00
if (empty($ID)) {
die();
}
2013-10-18 08:00:55 +00:00
$Text = new TEXT(true);
$UserID = (int)$_GET['userid'];
2013-10-14 08:00:53 +00:00
$UserIDSQL = "";
if (!empty($UserID)) {
$UserIDSQL = " AND UserID != '$UserID' ";
}
2013-10-22 08:01:07 +00:00
G::$DB->query("
SELECT UserID, Answer, Date
FROM staff_answers
WHERE QuestionID = '$ID'
$UserIDSQL
ORDER BY DATE DESC");
2013-10-14 08:00:53 +00:00
2013-10-20 08:00:53 +00:00
$Answers = G::$DB->to_array(false, MYSQLI_ASSOC);
2013-10-22 08:01:07 +00:00
foreach($Answers as $Answer) {
?>
2013-10-18 08:00:55 +00:00
<div class="box box2">
<div class="head">
<span>
Answer by <?=Users::format_username($Answer['UserID'])?> - <?=time_diff($Answer['Date'])?>
</span>
</div>
<div class="pad">
2013-10-22 08:01:07 +00:00
<?= $Text->full_format($Answer['Answer'])?>
2013-10-14 08:00:53 +00:00
</div>
2013-10-18 08:00:55 +00:00
</div>
2013-10-22 08:01:07 +00:00
<?
}
?>