This repository has been archived by the owner on Oct 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathlog.php
62 lines (60 loc) · 1.6 KB
/
log.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
<?php
session_start();
/*
File: log.php
Fungsi: File untuk melihat aktivitas aplikasi.
Auth: ShowCheap
*/
require 'sistem/config.php';
cek_user();
sambung();
get_kepala();
$log=new db();
if(isset($_GET['reset']) && isset($_SESSION['level'])){
$log->sql("TRUNCATE log");
catat($_SESSION['nama'],"Menghapus Log/Aktivitas");
}
$lihat=mysql_real_escape_string($_GET['item']);
$tambah=$lihat+50;
if($lihat==''){
$lihat='100';
}
$log->sql("SELECT * FROM log ORDER BY id ASC LIMIT 0, $lihat");
?>
<script type='text/javascript'>
function reset(){
var tanya = confirm('Yakin Reset Semua Aktivitas??');
if(tanya){
window.location='?reset';
}
}
</script>
<style>
#rec:hover{
background-color: silver;
}
</style>
<h2>Log / Aktivitas</h2>
<table cellpadding='2' cellspacing='0' width='100%' class="table table-striped table-hover">
<thead>
<tr style='font-weight: bold; '>
<td width='150' ">User</td>
<td ">Tindakan / Aktivitas</td>
<td width='150' ">Waktu</td>
</tr>
</thead>
<?php
while($log->hasil()){
echo "<tr id='rec'>";
echo "<td>".$log->hasil['user']."</td>";
echo "<td>".$log->hasil['aksi']."</td>";
echo "<td>".$log->hasil['tgl']."</td>";
echo "</tr>";
}
echo "<tr><td colspan='3' style=\"padding: 3px\"><button class='btn btn-success' onclick='window.location=\"log.php?item=".$tambah."#bawah\"'>Lihat Lebih Banyak</button>";
echo admin(" <button onclick='reset()' class='btn btn-danger'>Kosongkan Log Aktivitas</button></td></tr>");
echo "</table>";
echo "<hr>";
echo "<div id='bawah'></div>";
get_kaki();
?>