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

if (session_status() !== PHP_SESSION_ACTIVE) {
    require_once dirname(__DIR__) . '/core/lib/session.php';
    cmsStartSession();
}

if (!defined('ROOT_PATH')) {
    define('ROOT_PATH', dirname(__FILE__) . '/../');
}

require_once ROOT_PATH . 'core/db/db.php';
require_once ROOT_PATH . 'core/lib/common.php';

if (!isset($_SESSION['member_id']) || empty($_SESSION['member_id'])) {
    header('Location: /member/login.php?redirect=' . urlencode('/member/index.php?page=myorder'));
    exit;
}

$query = $_GET;
$query['page'] = 'myorder';
$target = '/member/index.php';
if (!empty($query)) {
    $target .= '?' . http_build_query($query);
}

header('Location: ' . $target);
exit;
