better-staridc-MNBT
1<?php
2/**
3 * 用户端 - 我的主机列表
4 */
5if (!defined('IN_CRONLITE')) {
6 exit;
7}
8$page_title = $page_title ?? '我的主机';
9$hosts = $hosts ?? [];
10ob_start();
11?>
12<div class="zj-section">
13 <h1>我的主机</h1>
14 <p>查看已开通的主机,点击进入详情可执行状态/流量查询与操作</p>
15</div>
16
17<?php if (empty($hosts)): ?>
18 <div class="layui-card">
19 <div class="layui-card-body" style="text-align:center;padding:40px;color:#999;">
20 暂无主机,<a href="<?= zjmf_url('reserve/shop') ?>">去选购商品</a>
21 </div>
22 </div>
23<?php else: ?>
24 <div class="layui-card">
25 <div class="layui-card-body" style="padding:0;">
26 <table class="zj-table">
27 <thead>
28 <tr>
29 <th>主机</th>
30 <th>供应商</th>
31 <th>状态</th>
32 <th>用户名</th>
33 <th>周期</th>
34 <th>到期时间</th>
35 <th>操作</th>
36 </tr>
37 </thead>
38 <tbody>
39 <?php foreach ($hosts as $host): ?>
40 <tr>
41 <td>
42 <b><?= htmlspecialchars($host['name']) ?></b>
43 <div class="zj-muted">ID <?= (int)$host['id'] ?>
44 / 上游 <?= (int)$host['up_host_id'] ?></div>
45 </td>
46 <td><?= htmlspecialchars($host['supplier_name'] ?: '-') ?></td>
47 <td>
48 <span class="zj-status zj-status-<?= htmlspecialchars($host['status']) ?>">
49 <?= htmlspecialchars(zjmf_host_status_label($host['status'])) ?>
50 </span>
51 </td>
52 <td class="zj-mono"><?= htmlspecialchars(($host['username'] ?: '-')) ?></td>
53 <td><?= htmlspecialchars($host['cycle'] ?: '-') ?></td>
54 <td><?= htmlspecialchars($host['renew_date'] ?: '-') ?></td>
55 <td>
56 <a class="layui-btn layui-btn-xs" href="<?= zjmf_url('reserve/hosts/' . (int)$host['id']) ?>">详情</a>
57 </td>
58 </tr>
59 <?php endforeach; ?>
60 </tbody>
61 </table>
62 </div>
63 </div>
64<?php endif; ?>
65
66<?php
67$content = ob_get_clean();
68include __DIR__ . '/layout.php';