<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Main Page</title>
    <link rel="stylesheet" href="../css/subacc.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">

</head>
<body>
    <div class="container">
        <div class="wrapper">
            <div class="title"><span>Choose Subaccount</span></div>
    
            <span id="user-email" data-email="<?php echo htmlspecialchars($user_info['email']); ?>"></span>
            <span id="profile_id" data-profile-id="<?php echo htmlspecialchars($user_info['profile_id']); ?>"></span>
    
            <div id="objects-container">
                <!-- Subaccounts will be listed here dynamically -->
            </div>
    
            <!-- Move buttons outside of the objects container -->
            <div id="button-container">
                <button id="create-object-btn" class="create-btn">Create Subaccount</button>
                <div class="logout-link"><a href="../php/logout.php">Logout</a></div>
            </div>
    
            <!-- Popup dialog for creating objects -->
            <div id="popup-dialog" class="popup-dialog">
                <div id="popup-content" class="popup-content">
                    <p>Name the subaccount!</p>
                    <input type="text" id="object-name-input" placeholder="Subaccount Name">
                    <div class="button-container">
                        <button id="confirm-btn" class="popup-confirm">Confirm</button>
                        <button id="cancel-btn" class="popup-cancel">Cancel</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    

    <!-- Link to external JS file -->
    <script src="../javascript/subaccount.js"></script>
</body>
</html>
