37 lines
No EOL
963 B
PHP
37 lines
No EOL
963 B
PHP
<?php
|
|
|
|
include 'config.php';
|
|
|
|
$id = $_GET["id"];
|
|
|
|
if ($id === null) {
|
|
exit();
|
|
}
|
|
|
|
$query = "
|
|
SELECT * FROM data
|
|
WHERE id = {$id};
|
|
";
|
|
|
|
$qresp = pg_query($db, $query);
|
|
$arr = pg_fetch_array($qresp);
|
|
|
|
echo("<link rel=\"stylesheet\" href=\"indiv.css\">");
|
|
|
|
if (pg_num_rows($qresp) === 0 || $arr["ispublic"] === "f" || $arr["isrespondedto"] === "f") {
|
|
echo("<h1 class=\"title\">no such question exists<h1>");
|
|
} else {
|
|
echo("<h1 class=\"title\">individual question</h1>");
|
|
|
|
echo("<a class=\"goback\" href=\"index.php\">(go back?)</a>");
|
|
echo("<div class=\"question\">");
|
|
if ($arr["iscwed"] === "t") {
|
|
echo("<details><summary>cw: " . $arr["cw"] . "</summary><span class=\"cwfiller\"></span>");
|
|
}
|
|
echo($arr["text"]);
|
|
echo("<div class=\"time\">" . $arr["time"] . "</div>");
|
|
echo("<div class=\"response\">" . $arr["responsetext"] . "");
|
|
echo("<div class=\"time\">" . $arr["responsetime"] . "</div></div></div>");
|
|
}
|
|
|
|
?>
|