<?php
/**
 * 芋头CMS
 * ============================================================================
 * 版权所有 2016-2028 沅陵县乌托邦网络服务有限公司，并保留所有权利。
 * 网站地址: http://www.yutoucms.cn
 * ----------------------------------------------------------------------------
 * 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷.
 * ============================================================================
 * Author: 芋头 <mxgsf@qq.com>
 * Date: 2026-5-20
 */


require_once dirname(__DIR__) . '/core/lib/session.php';
cmsStartSession();
require_once dirname(__FILE__) . '/../core/db/db.php';

if (!isset($_SESSION['member_id']) || empty($_SESSION['member_id'])) {
    header('Location: /member/login.php');
    exit;
}
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>积分记录 - 会员中心</title>
    <link rel="stylesheet" href="/public/css/site.css">
    <style>
    .page-container { max-width: 900px; margin: 0 auto; background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
    .page-title { font-size: 20px; color: #0d3b66; margin-bottom: 30px; padding-bottom: 15px; border-bottom: 2px solid #00d2d3; }
    .points-summary { display: flex; gap: 30px; margin-bottom: 30px; padding: 20px; background: linear-gradient(135deg, #0d3b66 0%, #1a5f8a 100%); border-radius: 10px; color: #fff; }
    .points-item { text-align: center; }
    .points-value { font-size: 28px; font-weight: bold; }
    .points-label { font-size: 13px; opacity: 0.8; margin-top: 5px; }
    .empty-state { text-align: center; padding: 60px 0; color: #999; }
    .back-link { display: block; text-align: center; margin-top: 20px; color: #00d2d3; text-decoration: none; }
    </style>
</head>
<body>
    <header class="site-header">
        <div class="container">
            <div class="header-inner">
                <div class="logo"><h1>企业CMS</h1></div>
                <nav class="header-nav">
                    <a href="/">首页</a>
                    <a href="/member/">会员中心</a>
                </nav>
            </div>
        </div>
    </header>

    <section style="padding: 40px 0;">
        <div class="container">
            <div class="page-container">
                <h2 class="page-title">🎫 积分记录</h2>
                
                <div class="points-summary">
                    <div class="points-item">
                        <div class="points-value"><?php echo $member['points'] ?? 0; ?></div>
                        <div class="points-label">当前积分</div>
                    </div>
                    <div class="points-item">
                        <div class="points-value">¥<?php echo number_format($member['balance'] ?? 0, 2); ?></div>
                        <div class="points-label">账户余额</div>
                    </div>
                </div>
                
                <div class="empty-state">
                    <p>暂无积分记录</p>
                    <p style="font-size:13px;">积分明细将显示在这里</p>
                </div>
                
                <a href="/member/" class="back-link">← 返回会员中心</a>
            </div>
        </div>
    </section>

    <footer class="site-footer">
        <div class="container">
            <div class="footer-bottom">
                <p>© <?php echo date('Y'); ?> 企业CMS 版权所有</p>
            </div>
        </div>
    </footer>
</body>
</html>
