</head> <body> <?php include __DIR__ . '/../views/header.php'; ?> <div class="container"> <div class="row"> <!-- Button trigger modal --> <div style="padding-top:150px;"> <?php $id = get_id(); ?> <?php $coments = Coments::findAll(); ?> <?php $newses = News::findAll(); ?> <?php foreach ($newses as $key) { ?> <?php if ($id == $key->id || $_POST['id'] == $key->id) { ?> <h2><?php echo $key->title; ?> </h2> <p><?php
<?php require_once __DIR__ . '/../function.php'; require_once __DIR__ . '/../autoload.php'; if (empty($_POST['text_news'])) { echo 'Не заполнен текст!'; exit; } $id_news = $_POST['id']; $text = $_POST['text_news']; $avtor = getUser(); $coments = new Coments(); $coments->insert($text, $avtor, $id_news); header('location: /../views/logon.php');