<?php
/**
 * Name: Nxz官网系统
 * URI: https://www.nxzlm.com/
 * Description: 逆行者官网系统源码，简单好用带后台
 * Version: 1.0.0
 * Author: 逆行者联盟
 */
require_once '../includes/common.php';
check_admin_login();

// 统计数据
$projects_count = $pdo->query("SELECT COUNT(*) FROM nxz_projects")->fetchColumn();
$services_count = $pdo->query("SELECT COUNT(*) FROM nxz_services")->fetchColumn();
$visits_count = get_config('site_visits') ?: 0;
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>控制台</title>
    <link rel="stylesheet" href="../assets/layui/css/layui.css">
    <style>
        body { background-color: #f2f2f2; padding: 15px; }
        .card-panel { padding: 20px; background: #fff; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.05); margin-bottom: 15px; }
        .card-panel h3 { font-size: 16px; color: #666; margin-bottom: 10px; }
        .card-panel .num { font-size: 30px; color: #333; }
        .welcome-title { font-size: 24px; margin-bottom: 20px; color: #333; font-weight: 300; }
    </style>
</head>
<body>

<h2 class="welcome-title">欢迎使用 <?php echo $nxz_copyright['Name']; ?></h2>

<div class="layui-row layui-col-space15">
    <div class="layui-col-md4">
        <div class="card-panel">
            <h3>总访问量</h3>
            <div class="num"><?php echo $visits_count; ?></div>
        </div>
    </div>
    <div class="layui-col-md4">
        <div class="card-panel">
            <h3>项目总数</h3>
            <div class="num"><?php echo $projects_count; ?></div>
        </div>
    </div>
    <div class="layui-col-md4">
        <div class="card-panel">
            <h3>服务总数</h3>
            <div class="num"><?php echo $services_count; ?></div>
        </div>
    </div>
</div>

<div class="layui-card" style="margin-top: 20px;">
    <div class="layui-card-header">系统信息</div>
    <div class="layui-card-body">
        <table class="layui-table">
            <colgroup>
                <col width="150">
                <col>
            </colgroup>
            <tbody>
                <tr>
                    <td>系统名称</td>
                    <td><?php echo $nxz_copyright['Name']; ?></td>
                </tr>
                <tr>
                    <td>系统版本</td>
                    <td><?php echo $nxz_copyright['Version']; ?></td>
                </tr>
                <tr>
                    <td>开发作者</td>
                    <td><?php echo $nxz_copyright['Author']; ?></td>
                </tr>
                <tr>
                    <td>官方网站</td>
                    <td><a href="<?php echo $nxz_copyright['URI']; ?>" target="_blank"><?php echo $nxz_copyright['URI']; ?></a></td>
                </tr>
                <tr>
                    <td>温馨提示</td>
                    <td><?php echo $nxz_copyright['Ps']; ?></td>
                </tr>
                <tr>
                    <td>PHP版本</td>
                    <td><?php echo PHP_VERSION; ?></td>
                </tr>
                <tr>
                    <td>服务器环境</td>
                    <td><?php echo $_SERVER['SERVER_SOFTWARE']; ?></td>
                </tr>
            </tbody>
        </table>
    </div>
</div>

</body>
</html>