-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdiary.php
47 lines (38 loc) · 978 Bytes
/
diary.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
// starting sessions
session_start();
// include classes and objects
use src\config\Database;
use src\objects\Note;
use src\objects\User;
require_once 'vendor/autoload.php';
// get database connection
$database = new Database();
$db = $database->getConnection();
$user = new User($db);
$note = new Note($db);
$page_title = "User personal page - KGB Team";
include "includes/header.php";
if (!$is_auth) {
header('Location: login.php');
}
$list_note = $note->getOneById($_GET['id']);
?>
<section>
<div class="recent_post">
<h2 class="label_post">Recent post from membersssss</h2>
<?php
while ($res = $list_note->fetch(PDO::FETCH_ASSOC)) :
extract($res);
?>
<div class="notes">
<div class="label_title">
<h2 class="label_h2"><?php echo $title; ?></h2>
</div>
<div class="content">
<p><?php echo $body; ?></p>
</div>
</div>
<?php endwhile ?>
</div>
</section>