You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
1.6 KiB
80 lines
1.6 KiB
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* @author Robert Strutts
|
|
* @copyright (c) 2026, Robert Strutts
|
|
* @license MIT
|
|
*/
|
|
|
|
function end_of_the_line(): void
|
|
{
|
|
echo "</div>" . PHP_EOL . "</body>" . PHP_EOL . "</html>";
|
|
}
|
|
?>
|
|
|
|
<?= $Auth ?>
|
|
|
|
<div class="container">
|
|
<h1>🎯<?= $html->getTitle(); ?></h1>
|
|
<form method="GET">
|
|
<input name="search" placeholder="Search">
|
|
<button>Search</button>
|
|
</form>
|
|
|
|
<h2>All Goals</h2>
|
|
|
|
<?php foreach($Goals as $g): ?>
|
|
<div class="goal-item">
|
|
<a href="?g=<?= $g['uuid'] ?>"><b><?= $local->outputHTML::get($g['title']) ?></b></a>
|
|
|
|
<?php
|
|
$Tags = $Model->GetTags($g);
|
|
if ($Tags !== true && $Tags !== false) {
|
|
foreach($Tags as $t): ?>
|
|
<span class="tag" onclick="filterTag('<?= $t['name'] ?>')"><?= $t['name'] ?></span>
|
|
<?php endforeach;
|
|
}
|
|
?>
|
|
|
|
</div>
|
|
<?php endforeach; ?>
|
|
|
|
<?php
|
|
if ($Uid['MyUUID'] === false) { end_of_the_line(); } else {
|
|
$goal = $Model->GetGoal($Uid);
|
|
if ($goal === false) { end_of_the_line(); } else {
|
|
//<h3>GOAL ID = $myuuid
|
|
?>
|
|
|
|
<hr>
|
|
<h2><?= $local->outputHTML::get($goal['title']) ?></h2>
|
|
<p><?= $Bb->parse(nl2br($local->outputHTML::get($goal['description']))) ?></p>
|
|
|
|
<?php
|
|
$stmt = $Model->GetVotes($goal);
|
|
foreach($stmt as $a): ?>
|
|
|
|
<div class="advice-box">
|
|
<p><?= $Bb->parse($local->outputHTML::get($a['content'])) ?></p>
|
|
|
|
<div class="vote">👍 <span><?= $a['votes'] ?></span></div>
|
|
|
|
<h4>Comments</h4>
|
|
|
|
<div id="comments-<?= $a['id'] ?>">
|
|
<?php
|
|
$comments = $Model->GetComments($a);
|
|
foreach($comments as $c): ?>
|
|
<div class="comment"><?= $Bb->parse($local->outputHTML::get($c['content'])) ?></div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</div>
|
|
|
|
<?php } } ?>
|