$contents = get_contents();
foreach ($contents as $content): ?>
<?php
$accepts_by_id = get_accept_by_id($content["accept_id"])
?>
<div class="content">
<div style="grid-row: 1/2; grid-column: 1/2" class="head_content">
<span>Заголовок: <?php echo $content["head"]; ?></span>
</div>
<div style="grid-row: 2/3; grid-column: 1/2" class="text_content">
<span><?php echo $content["text"]; ?></span>
</div>
<div style="grid-row: 3/4; grid-column: 1/2; display: flex;justify-content: space-between;">
<div class="user_content">
<span>Пользователь <?php echo $content["user"]; ?></span>
</div>
<div class="time_content">
<span>Время <?php echo $content["time"]; ?></span>
</div>
</div>
<div class="accept">Проверена: <?php echo $accepts_by_id; ?></div>
</div>
<?php endforeach ?>
function get_accept_by_id($id)
{
global $db;
$accepts_by_id = $db->query("SELECT * FROM accepted WHERE id = $id");
foreach ($accepts_by_id as $accept) {
return $accept;
}
return $accepts_by_id;
}