<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Lizenz Einlösen</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css">
    <script src="https://code.jquery.com/jquery-3.6.3.js"></script>
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons+Sharp" rel="stylesheet">
    <link rel="stylesheet" href="choices.min.css" />
    <style>
        body {
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            background-color: #f4f4f4;
        }

        .container {
            background-color: #6a4c9c;
            color: white;
            border-radius: 8px;
            padding: 30px;
            width: 100%;
            max-width: 500px;
            box-sizing: border-box;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        h1 {
            text-align: center;
            margin-bottom: 20px;
            color: #ffffff;
        }

        label {
            display: block;
            margin-bottom: 8px;
            font-size: 14px;
            color: #ffffff;
        }

        input[type="text"], textarea {
            width: 100%;
            padding: 12px;
            margin-bottom: 20px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 16px;
            background-color: #f4f4f4;
            color: #333;
            box-sizing: border-box;
        }

        textarea {
            resize: vertical;
        }

        button {
            width: 100%;
            padding: 12px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            cursor: pointer;
        }

        button:hover {
            background-color: #45a049;
        }

        .success, .error {
            text-align: center;
            margin-top: 20px;
        }

        .error {
            color: red;
        }

        .success {
            color: green;
        }
    </style>
</head>
<body>

<div class="container">
    <h1>Lizenzkey einlösen</h1>
    <form action="" method="post">
        <label for="license_key">Lizenzkey:</label>
        <input type="text" name="license_key" id="license_key" required><br><br>
        
        <label for="server_name">Servername:</label>
        <input type="text" name="server_name" id="server_name" required><br><br>
        
        <label for="framework">Framework:</label>
        <input type="text" name="framework" id="framework" required><br><br>

        <label for="ip">IP-Adresse:</label>
        <input type="text" name="ip" id="ip" required><br><br>
        
        <button type="submit">Lizenz einlösen</button>
    </form>

    <!-- Success or error message -->
    <div class="success" style="display: <?php echo $showSuccess ? 'block' : 'none'; ?>;">
        Lizenz erfolgreich eingelöst!
    </div>
    <div class="error" style="display: <?php echo isset($license) && !$license ? 'block' : 'none'; ?>;">
        Ungültiger oder bereits eingelöster Lizenzkey.
    </div>
</div>
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<script src="choices.min.js"></script>
<script src="./index.js"></script>
<script>
    if (<?php echo $showSuccess ? 'true' : 'false'; ?>) {
        showSuccessBox();
    }
    setTimeout(closeSuccessBox, 5000);
</script>

</body>
</html>
