forked from pplulee/appleid_auto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccount.php
54 lines (52 loc) · 2.45 KB
/
account.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
<?php
include("header.php");
$currentuser = new user($_SESSION['user_id']);
?>
<title>账号管理</title>
<div class="container" style="padding-top:70px;">
<div class="col-md-12 center-block" style="float: none;">
<div class="table-responsive">
<a href='account_edit.php?action=add' class='btn btn-secondary'>添加账号</a>
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>账号</th>
<th>密码</th>
<th>备注</th>
<th>前端备注</th>
<th>状态</th>
<th>上次检查</th>
<th>检查间隔</th>
<th>操作</th>
</tr>
<script>
var clipboard = new ClipboardJS('.btn');
function alert_success() {
Swal.fire({
icon: 'success',
title: '提示',
text: '复制成功',
timer: 1000,
timerProgressBar: true
});
}
</script>
</thead>
<?php
global $conn;
$stmt = $conn->prepare("SELECT * FROM account WHERE owner = :userid;");
$stmt->execute(['userid' => $currentuser->user_id]);
if ($stmt->rowCount() > 0) {
while ($row = $stmt->fetch()) {
$share_link = "{$Sys_config['apiurl']}/share.php?link={$row['share_link']}";
echo "<tr><td>{$row['id']}</td><td>{$row['username']}</td><td>{$row['password']}</td><td>{$row['remark']}</td><td>{$row['frontend_remark']}</td><td>{$row['message']}</td><td>{$row['last_check']}</td><td>{$row['check_interval']}</td><td> <button id='share_link' class='btn btn-success' data-clipboard-text='$share_link' onclick='alert_success()'>复制链接</button> <a href='account_edit.php?action=edit&id={$row['id']}' class='btn btn-secondary'>编辑</a> <a href='account_edit.php?action=delete&id={$row['id']}' class='btn btn-danger'>删除</a></td></tr>";
}
} else {
echo "<tr><td colspan='9'>暂无账号</td></tr>";
}
?>
</table>
</div>
</div>
</div>