-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathstatus.php
62 lines (56 loc) · 1.58 KB
/
status.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
require_once "header.php";
class Row {
public function __construct($conn) {
$this->sql = $conn;
}
public function getRow($tablename) {
$this->commed = mysqli_fetch_assoc(mysqli_query($this->sql,"select * from `TABLES` where `TABLE_NAME`='$tablename'"));
$this->num = $this->commed['TABLE_ROWS'];
//所有数据
echo $this->num;
}
}
class status {
var $conn;
var $seconds;
function __construct($conn) {
$this->sql = $conn;
}
function getRuntime() {
$this->Starttime = strtotime("2020-02-01"); //开始时间
$this->Nowtime = strtotime(date("Y-m-d"));
$this->diff = $this->Nowtime - $this->Starttime;
$this->Runtime = abs(round($this->diff / 86400));
echo $this->Runtime;
}
}
// 服务是否在运行 | 已发送 | 未发送 | 发送时间段 | 累计运行时间段
$status = new status($conn);
$row = new Row($conns);
?>
<div class="mdui-toolbar mdui-color-theme">
<a class="mdui-typo-title">Status</a>
</div>
<br />
<div class="mdui-container doc-container" style='max-width:85%'>
<div class="mdui-typo">
<div class="mdui-table-fluid">
<table class="mdui-table">
<tbody>
<tr>
<td>运行天数</td>
<td><?php $status->getRuntime();?>天</td>
</tr>
<tr>
<td>已发送</td>
<td><?php $row->getRow("sent");?>封</td>
</tr>
<tr>
<td>待发送</td>
<td><?php $row->getRow("waiting");?>封</td>
</tr>
</tbody>
</table>
</div>
<?php require_once "footer.php"; ?>