-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
96 lines (71 loc) · 1.78 KB
/
index.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
require_once "./database.php";
$sql = "SELECT * FROM post";
$result = mysqli_query($connection, $sql);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
$data[] = $row;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php
require_once('./common/common-header.php');
?>
</head>
<body>
<!-- Navigation -->
<?php
require_once('./common/header.php');
?>
<!-- Page Content -->
<div class="container">
<div class="row">
<!-- Post Content Column -->
<div class="col-lg-8">
<!-- Title -->
<h1 class="mt-4">Recently added posts</h1>
<?php
foreach ($data as $records) {
?>
<div class="posts shadow py-3 px-3">
<!-- Author -->
<p class="lead">
by
<a href="#">Start Bootstrap</a>
</p>
<hr>
<!-- Date/Time -->
<p><?php echo $records['created_at']; ?></p>
<hr>
<!-- Preview Image -->
<img class="img-fluid rounded" src="<?php echo "./Admin/images/" . $records['image'] ?>" alt="">
<hr>
<h2><?php echo $records['title']; ?></h2>
<!-- Post Description -->
<p><?php echo $records['description'] ?></p>
<a type="button" class="btn btn-primary" href="./readmore.php?id=<?php echo $records['id']; ?>"> READ MORE </a>
</div>
<?php
}
?>
</div>
<!-- Sidebar Widgets Column -->
<?php
require_once('./common/sidebar.php');
?>
</div>
<!-- /.row -->
</div>
<!-- /.container -->
<!-- Footer -->
<?php
require_once('common/footer.php')
?>
<?php
require_once('./common/common-footer.php');
?>
</body>
</html>