-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.php
94 lines (89 loc) · 2.73 KB
/
admin.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
<?php
session_start();
if($_SESSION['status']!="login"){header("location:login.php");}
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Ripan Fauzi | Administrator</title>
<link rel="shortcut icon" href="images/favicon.ico">
<meta charset="utf-8" />
<meta name="description" content="Ripan Fauzi Official Website">
<meta name="author" content="Ripan Fauzi">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="assets/css/main.css" />
<noscript><link rel="stylesheet" href="assets/css/noscript.css" /></noscript>
</head>
<body class="is-preload">
<!-- Wrapper -->
<div id="wrapper">
<!-- Header -->
<header id="header">
<div class="logo">
<span class="icon fa-smile"></span>
</div>
<div class="content">
<div class="inner">
<h1>Ripan Fauzi</h1>
<p>Welcome to Administrator <?= $_SESSION['username'];?></p>
</div>
</div>
<nav>
<ul>
<li><a href="#cek">Check</a></li>
</ul>
</nav>
</header>
<div id="main">
<!-- Intro -->
<article id="cek">
<h2 class="major">Welcome <?= $_SESSION['username'];?></h2>
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>Message</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php
include "conn.php";
$query = mysqli_query($mysqli, "SELECT * FROM komentar order by id desc");
while($hasil = mysqli_fetch_array($query)){?>
<tr>
<td><?= $hasil['komentar'];?></td>
<?php
if($hasil['status']=="show"){ ?>
<td><a href="<?php echo "proc.php?id=".$hasil['id']."&&status=hide";?>" class="button primary">Hide it</a></td>
<?php }else{ ?>
<td><a href="<?php echo "proc.php?id=".$hasil['id']."&&status=show";?>" class="button">Show it</a></td>
<?php } ?>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr>
<td>Total Message</td>
<td><?php echo mysqli_num_rows($query)?></td>
</tr>
</tfoot>
</table>
</div>
</article>
</div>
<!-- Footer -->
<footer id="footer">
<p class="copyright">© 2020. <a href="logout.php">Click Here To Logout</a>.</p>
</footer>
</div>
<!-- BG -->
<div id="bg"></div>
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/browser.min.js"></script>
<script src="assets/js/breakpoints.min.js"></script>
<script src="assets/js/util.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>