-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
141 lines (127 loc) · 4.24 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php
/*
* Minimati - Lightweight and Open-Source Blogging CMS
* Written by Kidus Bewket (https://kidus.ca)
* Released under the MIT License
*/
session_start();
require_once 'Minimati.php';
if (!isset($_SESSION['minimati_admin'])) redir("login.php");
$recent_articles = fetch_articles(0, 10, null);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootswatch@4.5.2/dist/flatly/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css">
<link rel="stylesheet" href="assets/css/style.css">
<link rel="icon" href="assets/img/icon.png">
<title>Minimati - Dashboard</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<div class="container">
<a class="navbar-brand" href="."><img src="assets/img/icon.png" width="30" height="30" class="d-inline-block align-top"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href=".">Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link" href="create.php">Publish New Article</a>
</li>
<li class="nav-item">
<a class="nav-link" href="edit.php">Edit Articles</a>
</li>
<li class="nav-item">
<a class="nav-link" href="settings.php">Settings</a>
</li>
<li class="nav-item">
<a class="nav-link" href="login.php?logout=1">Logout</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container py-4">
<!-- Stats -->
<div class="row">
<div class="col-lg-6 py-3">
<div class="card bg-info text-white">
<div class="card-body m-3">
<i class="fa fa-file-alt stats-icon p-3"></i>
<h3 class="py-3"><?php echo article_count(); ?> Articles Published</h3>
<div class="text-right">
<a href="create.php" class="btn btn-lg btn-outline-light">Publish New →</a>
</div>
</div>
</div>
</div>
<div class="col-lg-6 py-3">
<div class="card bg-warning text-white">
<div class="card-body m-3">
<i class="fa fa-pencil-alt stats-icon p-3"></i>
<h3 class="py-3"><?php echo edit_count(); ?> Total Edits</h3>
<div class="text-right">
<a href="edit.php" class="btn btn-lg btn-outline-light">Edit Articles →</a>
</div>
</div>
</div>
</div>
</div>
<!-- Latest Articles -->
<div class="row">
<div class="col-lg-12 py-4 mx-auto">
<div class="card shadow">
<div class="card-header text-white bg-primary">
<h3>Recently Published</h3>
</div>
<div class="card-body">
<table class="table articles">
<thead class="thead-dark">
<tr>
<th scope="col">Date/Time</th>
<th scope="col">Title</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
<?php
foreach($recent_articles as $ar) {
$date = $ar->get_date();
echo <<<_END
<tr>
<td>$date</td>
<td><span>$ar->title</span></td>
<td><a href="edit.php?ID=$ar->ID" class="btn btn-sm btn-outline-primary">Edit</a></td>
</tr>
_END;
}
?>
</tbody>
</table><br>
<a href="edit.php">View All Articles →</a>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<span class="text-muted">
<a href="https://github.com/kiduswb/minimati">Minimati</a> -
Open-source built with <i class="fa fa-heart text-danger"></i>
</span>
</div>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>