Repository navigation
Expand file tree
/
Copy pathtail.php
More file actions
100 lines (91 loc) · 1.87 KB
/
Copy pathtail.php
File metadata and controls
100 lines (91 loc) · 1.87 KB
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
<?php
require_once('config.php');
$link = mysqli_connect(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB) or die("Error " . mysqli_error($link));
$sql = 'select * from commands';
if(!$result = $link->query($sql)){
die('There was an error running the query [' . $db->error . ']');
}else{
print "
<!DOCTYPE html>
<html>
<head>
<title>Tail</title>
<style>
ol{
counter-reset: li; /* Initiate a counter */
list-style: none; /* Remove default numbering */
*list-style: decimal; /* Keep using default numbering for IE6/7 */
font: 15px 'trebuchet MS', 'lucida sans';
padding: 0;
margin-bottom: 4em;
text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
ol ol{
margin: 0 0 0 2em; /* Add some left margin for inner lists */
}
.rectangle-list a{
position: relative;
display: block;
padding: .4em .4em .4em .8em;
*padding: .4em;
margin: .5em 0 .5em 2.5em;
background: #ddd;
color: #444;
text-decoration: none;
transition: all .3s ease-out;
}
.rectangle-list a:hover{
background: #eee;
}
.rectangle-list a:before{
content: counter(li);
counter-increment: li;
position: absolute;
left: -2.5em;
top: 50%;
margin-top: -1em;
background: #fa8072;
height: 2em;
width: 2em;
line-height: 2em;
text-align: center;
font-weight: bold;
}
.rectangle-list a:after{
position: absolute;
content: '';
border: .5em solid transparent;
left: -1em;
top: 50%;
margin-top: -.5em;
transition: all .3s ease-out;
}
.rectangle-list a:hover:after{
left: -.5em;
border-left-color: #fa8072;
}
</style>
</head>
<body>";
print "<ol class='rectangle-list'>";
while($row = $result->fetch_assoc()){
print "<li>";
print "<a href='outputs/".$row['dir']."' target='_blank'>";
//div command
print "<div>";
print $row['command'];
print "</div>";
//div state
print "<div>";
print $row['state'];
print "</div>";
print "</a>";
print "</li>";
}
print "</ol>";
print "
</body>
</html>
";
}
?>