-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnews-manager.php
65 lines (60 loc) · 1.91 KB
/
news-manager.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
session_start();
require_once("inc/config.inc.php");
require_once("inc/functions.inc.php");
//Überprüfe, dass der User eingeloggt ist
//Der Aufruf von check_user() muss in alle internen Seiten eingebaut sein
$user = check_user();
?>
<html lang="de">
<?php
include "templates/head.html";
?>
<body>
<?php
include "templates/menu.php";
?>
</div>
<div class="app-container">
<?php include "templates/app-header.php"; ?>
<div class="app-content">
<div class="content-wrapper">
<div class="container">
<div class="row">
<div class="col">
<div class="page-description">
<h1>News Manager</h1>
</div>
</div>
</div>
<div class="row">
<?php
$stmt = $pdo->query("SELECT * FROM news");
while ($row = $stmt->fetch()) {
$text = substr($row["text"], 0, 120);
echo '
<div class="col-xl-4">
<div class="card">
<img src="' . $row["banner"] . '" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">' . $row["titel"] . '</h5>
<p class="card-text">' . $text . '</p>
<a href="#" class="btn btn-primary">Show News</a>
<a href="#" class="btn btn-danger">Remove News</a>
</div>
</div>
</div>';
}
?>
</div>
</div>
<?php include "templates/footer.html"; ?>
</div>
</div>
</div>
</div>
<?php
include "templates/javascript.html";
?>
</body>
</html>