-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
80 lines (68 loc) · 1.95 KB
/
Copy pathindex.php
File metadata and controls
80 lines (68 loc) · 1.95 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
session_start();
// include classes and objects
use src\classes\Auth;
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);
$list_user = $user->all();
$list_note = $note->all();
$page_title = "KGB Team - official website!";
include "includes/header.php";
if(!$is_auth) {
header('Location: login.php');
}
?>
<?php if (isset($_GET['m'])): ?>
<div class="alert-box success">
welcome <strong><?php echo $_GET['m']; ?></strong> on KGB Team official website!
</div>
<?php endif ?>
<section class="body-container">
<div class="kgb_members">
<div class="kgb_members_header">
<h2>Our actual member</h2>
</div>
<?php
while ($res = $list_user->fetch(PDO::FETCH_ASSOC)) :
extract($res);
?>
<div class="user">
<div class="user-data">
<img src="<?php echo $profile_pic; ?>" alt="username - profile pic" class="avatar">
<div class="user-data_names">
<p class="fullname"><?php echo $fullname; ?></p>
<p class="username">@<?php echo $username; ?></p>
</div>
</div>
<div class="link">
<a href="diary.php?id=<?php echo $id; ?>">his diary</a>
</div>
</div>
<span class="baruser"></span>
<?php endwhile ?>
</div>
<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>
<?php include "includes/footer.php"; ?>