-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard.php
490 lines (390 loc) · 15.8 KB
/
dashboard.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
<?php
include_once('connect.php');
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="SELECT * FROM main ORDER BY 'id'";
if ($result=mysqli_query($connection,$sql))
{
// Return the number of rows in result set
$rowcount=mysqli_num_rows($result);
// Free result set
}
?>
<?php
include_once('connect.php');
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="SELECT * FROM pageview ORDER BY 'userip'";
if ($result=mysqli_query($connection,$sql))
{
// Return the number of rows in result set
$ip=mysqli_num_rows($result);
// Free result set
}
?>
<?php
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="SELECT * FROM catagory ORDER BY 'name'";
if ($result=mysqli_query($connection,$sql))
{
// Return the number of rows in result set
$cat=mysqli_num_rows($result);
// Free result set
}
?>
<?php
include_once('connect.php');
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="SELECT * FROM comments ORDER BY 'comments'";
if ($result=mysqli_query($connection,$sql))
{
// Return the number of rows in result set
$comment=mysqli_num_rows($result);
// Free result set
}
?>
<?php
session_start();
// Check if the user is logged in, if not then redirect him to login page
if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
header("location: login.php");
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="apple-touch-icon" sizes="76x76" href="../assets/img/apple-icon.png">
<link rel="icon" type="image/png" href="../assets/img/favicon.png">
<title>
Tiny CMS dashboard
</title>
<!-- Fonts and icons -->
<link href="https://fonts.googleapis.com/css?family=Poppins:200,300,400,600,700,800" rel="stylesheet" />
<link href="https://use.fontawesome.com/releases/v5.0.6/css/all.css" rel="stylesheet">
<!-- Nucleo Icons -->
<link href="/assets/css/nucleo-icons.css" rel="stylesheet" />
<!-- CSS Files -->
<link href="/assets/css/black-dashboard.css?v=1.0.0" rel="stylesheet" />
<link rel="stylesheet" href="cs.css" type="text/css" >
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" integrity="sha384-gfdkjb5BdAXd+lj+gudLWI+BXq4IuLW5IT+brZEZsLFm++aCMlF1V92rMkPaX4PP" crossorigin="anonymous">
</head>
<body class="">
<div class="wrapper">
<div class="sidebar">
<!--
Tip 1: You can change the color of the sidebar using: data-color="blue | green | orange | red"
-->
<div class="sidebar-wrapper">
<div class="logo">
<a href="javascript:void(0)" class="simple-text logo-mini">
TC
</a>
<a href="javascript:void(0)" class="simple-text logo-normal">
Tiny CMS
</a>
</div>
<ul class="nav">
<li class="active ">
<a href="dashboard.php">
<i class="tim-icons icon-chart-pie-36"></i>
<p>Dashboard</p>
</a>
</li>
<li>
<a href="addpost.php">
<i class="tim-icons icon-atom"></i>
<p>Add post</p>
</a>
</li>
<li>
<a href="AddCategory.php">
<i class="tim-icons icon-pin"></i>
<p>Add category</p>
</a>
</li>
<li>
<a href="Comments.php">
<i class="fas fa-comments"></i>
<p>Manage comments</p>
</a>
</li>
<li>
<a href="reset-password.php">
<i class="fas fa-users"></i>
<p>Reset password</p>
</a>
</li>
</ul>
</div>
</div>
<div class="main-panel">
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-absolute navbar-transparent">
<div class="container-fluid">
<div class="navbar-wrapper">
<div class="navbar-toggle d-inline">
<button type="button" class="navbar-toggler">
<span class="navbar-toggler-bar bar1"></span>
<span class="navbar-toggler-bar bar2"></span>
<span class="navbar-toggler-bar bar3"></span>
</button>
</div>
<a class="navbar-brand" href="javascript:void(0)">Dashboard</a>
</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navigation" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-bar navbar-kebab"></span>
<span class="navbar-toggler-bar navbar-kebab"></span>
<span class="navbar-toggler-bar navbar-kebab"></span>
</button>
<div class="collapse navbar-collapse" id="navigation">
<ul class="navbar-nav ml-auto">
<li class="dropdown nav-item">
<a href="#" class="dropdown-toggle nav-link" data-toggle="dropdown">
<div class="photo">
<img src="../assets/img/anime3.png" alt="Profile Photo">
</div>
<b class="caret d-none d-lg-block d-xl-block"></b>
<p class="d-lg-none">
Log out
</p>
</a>
<ul class="dropdown-menu dropdown-navbar">
<li class="dropdown-divider"></li>
<li class="nav-link">
<a href="logout.php" class="nav-item dropdown-item">Log out</a>
</li>
</ul>
</li>
<li class="separator d-lg-none"></li>
</ul>
</div>
</div>
</nav>
<div class="modal modal-search fade" id="searchModal" tabindex="-1" role="dialog" aria-labelledby="searchModal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<input type="text" class="form-control" id="inlineFormInputGroup" placeholder="SEARCH">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<i class="tim-icons icon-simple-remove"></i>
</button>
</div>
</div>
</div>
</div>
<!-- End Navbar -->
<div class="content">
<div class="row">
<div class="container">
<div class="card-deck">
<div class="card text-white bg-secondary mb-3">
<div class="card-body">
<span class="d" style="font-size: 90px; color: white;">
<i class="fas fa-pen-square"></i>
<div class="btn btn-primary btn-md" style = text-align: center; padding-top: 23px; padding-right: 25px; padding-bottom: 23px; padding-left: 25px;><a href="Managecategory.php">View category</a></div>
</span>
</div>
</div>
<div class="card text-white bg-secondary mb-3">
<div class="card-body">
<span class="d" style="font-size: 90px; color: white;">
<i class="fab fa-telegram-plane"></i> <div class="btn btn-primary btn-md" style= text-align: center; padding-top: 23px; padding-right: 25px; padding-bottom: 23px; padding-left: 25px;><a href="ViewPost.php">View post</a></div>
</span>
</div>
</div>
<div class="card text-white bg-secondary mb-3">
<div class="card-body">
<span class="d" style="font-size: 30px; color: white; text-align: center;">
<h3 class="card-title"><i class="fab fa-telegram-plane"><?php echo $rowcount." "; ?>Post</i></h3>
<h3 class="card-title" ><i class="fas fa-pen-square"><?php echo $cat." " ?>Category</i></h3>
<h3 class="card-title"><i class="fas fa-comment-alt"><?php echo $comment." "; ?>Comments</i></h3>
</span>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="container">
<p class="pt-lg-3 pt-lg-2"></p>
<p class="pt-lg-3 pt-lg-2"></p>
<div class="card-deck">
<div class="card text bg-secondary mb-3">
<div class="card-body">
<h3 class="card-title"> <?php echo $ip." "; ?>Totel view in index page</h3>
<div class="btn btn-primary btn-md style= text-align: center; padding-top: 23px; padding-right: 25px; padding-bottom: 23px; padding-left: 25px;"><a href="ip.php">Users ip</a></div>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container-fluid">
<ul class="nav">
<li class="nav-item">
<a href="about.php" class="nav-link">
About Us
</a>
</li>
</ul>
<div class="copyright">
©
<script>
document.write(new Date().getFullYear())
</script> made with <i class="tim-icons icon-heart-2"></i> by
<a href="javascript:void(0)" target="_blank">Tiny CMS</a> for a better web.
</div>
</div>
</footer>
</div>
</div>
<div class="fixed-plugin">
<div class="dropdown show-dropdown">
<a href="#" data-toggle="dropdown">
<i class="fa fa-cog fa-2x"> </i>
</a>
<ul class="dropdown-menu">
<li class="header-title"> Sidebar Background</li>
<li class="adjustments-line">
<a href="javascript:void(0)" class="switch-trigger background-color">
<div class="badge-colors text-center">
<span class="badge filter badge-primary active" data-color="primary"></span>
<span class="badge filter badge-info" data-color="blue"></span>
<span class="badge filter badge-success" data-color="green"></span>
</div>
<div class="clearfix"></div>
</a>
</li>
<li class="adjustments-line text-center color-change">
<span class="color-label">LIGHT MODE</span>
<span class="badge light-badge mr-2"></span>
<span class="badge dark-badge ml-2"></span>
<span class="color-label">DARK MODE</span>
</li>
</ul>
</div>
</div>
<!-- Core JS Files -->
<script src="/assets/js/core/jquery.min.js"></script>
<script src="/assets/js/core/popper.min.js"></script>
<script src="/assets/js/core/bootstrap.min.js"></script>
<script src="/assets/js/plugins/perfect-scrollbar.jquery.min.js"></script>
<!-- Google Maps Plugin -->
<!-- Place this tag in your head or just before your close body tag. -->
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_HERE"></script>
<!-- Chart JS -->
<script src="/assets/js/plugins/chartjs.min.js"></script>
<!-- Notifications Plugin -->
<script src="/assets/js/plugins/bootstrap-notify.js"></script>
<!-- Control Center for Black Dashboard: parallax effects, scripts for the example pages etc -->
<script>
$(document).ready(function() {
$().ready(function() {
$sidebar = $('.sidebar');
$navbar = $('.navbar');
$main_panel = $('.main-panel');
$full_page = $('.full-page');
$sidebar_responsive = $('body > .navbar-collapse');
sidebar_mini_active = true;
white_color = false;
window_width = $(window).width();
fixed_plugin_open = $('.sidebar .sidebar-wrapper .nav li.active a p').html();
$('.fixed-plugin a').click(function(event) {
if ($(this).hasClass('switch-trigger')) {
if (event.stopPropagation) {
event.stopPropagation();
} else if (window.event) {
window.event.cancelBubble = true;
}
}
});
$('.fixed-plugin .background-color span').click(function() {
$(this).siblings().removeClass('active');
$(this).addClass('active');
var new_color = $(this).data('color');
if ($sidebar.length != 0) {
$sidebar.attr('data', new_color);
}
if ($main_panel.length != 0) {
$main_panel.attr('data', new_color);
}
if ($full_page.length != 0) {
$full_page.attr('filter-color', new_color);
}
if ($sidebar_responsive.length != 0) {
$sidebar_responsive.attr('data', new_color);
}
});
$('.switch-sidebar-mini input').on("switchChange.bootstrapSwitch", function() {
var $btn = $(this);
if (sidebar_mini_active == true) {
$('body').removeClass('sidebar-mini');
sidebar_mini_active = false;
blackDashboard.showSidebarMessage('Sidebar mini deactivated...');
} else {
$('body').addClass('sidebar-mini');
sidebar_mini_active = true;
blackDashboard.showSidebarMessage('Sidebar mini activated...');
}
// we simulate the window Resize so the charts will get updated in realtime.
var simulateWindowResize = setInterval(function() {
window.dispatchEvent(new Event('resize'));
}, 180);
// we stop the simulation of Window Resize after the animations are completed
setTimeout(function() {
clearInterval(simulateWindowResize);
}, 1000);
});
$('.switch-change-color input').on("switchChange.bootstrapSwitch", function() {
var $btn = $(this);
if (white_color == true) {
$('body').addClass('change-background');
setTimeout(function() {
$('body').removeClass('change-background');
$('body').removeClass('white-content');
}, 900);
white_color = false;
} else {
$('body').addClass('change-background');
setTimeout(function() {
$('body').removeClass('change-background');
$('body').addClass('white-content');
}, 900);
white_color = true;
}
});
$('.light-badge').click(function() {
$('body').addClass('white-content');
});
$('.dark-badge').click(function() {
$('body').removeClass('white-content');
});
});
});
</script>
<script>
$(document).ready(function() {
// Javascript method's body can be found in assets/js/demos.js
demo.initDashboardPageCharts();
}
</script>
</body>
</html>